summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy4
-rw-r--r--.gitattributes25
-rw-r--r--.github/pull_request_template.md7
-rw-r--r--Auxiliary/vim/syntax/cmake.vim13
-rw-r--r--CMakeLists.txt103
-rw-r--r--CONTRIBUTING.rst9
-rw-r--r--CTestCustom.cmake.in10
-rw-r--r--CompileFlags.cmake12
-rw-r--r--Copyright.txt1
-rw-r--r--Help/command/cmake_host_system_information.rst41
-rw-r--r--Help/command/configure_file.rst14
-rw-r--r--Help/command/execute_process.rst9
-rw-r--r--Help/command/file.rst20
-rw-r--r--Help/command/if.rst2
-rw-r--r--Help/command/include_guard.rst46
-rw-r--r--Help/command/string.rst9
-rw-r--r--Help/dev/maint.rst74
-rw-r--r--Help/dev/review.rst77
-rw-r--r--Help/dev/source.rst63
-rw-r--r--Help/manual/cmake-buildsystem.7.rst2
-rw-r--r--Help/manual/cmake-commands.7.rst1
-rw-r--r--Help/manual/cmake-modules.7.rst1
-rw-r--r--Help/manual/cmake-policies.7.rst9
-rw-r--r--Help/manual/cmake-properties.7.rst6
-rw-r--r--Help/manual/cmake-qt.7.rst31
-rw-r--r--Help/manual/cmake-server.7.rst57
-rw-r--r--Help/manual/cmake-variables.7.rst5
-rw-r--r--Help/manual/cmake.1.rst30
-rw-r--r--Help/manual/ctest.1.rst33
-rw-r--r--Help/module/CPackFreeBSD.rst1
-rw-r--r--Help/policy/CMP0070.rst25
-rw-r--r--Help/policy/CMP0071.rst34
-rw-r--r--Help/prop_dir/LABELS.rst13
-rw-r--r--Help/prop_dir/TEST_INCLUDE_FILE.rst4
-rw-r--r--Help/prop_dir/TEST_INCLUDE_FILES.rst7
-rw-r--r--Help/prop_test/FIXTURES_CLEANUP.rst3
-rw-r--r--Help/prop_test/FIXTURES_REQUIRED.rst6
-rw-r--r--Help/prop_test/FIXTURES_SETUP.rst5
-rw-r--r--Help/prop_tgt/AUTOMOC.rst17
-rw-r--r--Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst28
-rw-r--r--Help/prop_tgt/AUTOUIC.rst3
-rw-r--r--Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst3
-rw-r--r--Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst14
-rw-r--r--Help/release/3.9.rst17
-rw-r--r--Help/release/dev/0-sample-topic.rst7
-rw-r--r--Help/release/dev/FindCurses-wide.rst5
-rw-r--r--Help/release/dev/GoogleTest.rst11
-rw-r--r--Help/release/dev/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst6
-rw-r--r--Help/release/dev/autogen-configs.rst8
-rw-r--r--Help/release/dev/autogen-generated-files.rst8
-rw-r--r--Help/release/dev/autogen-macro-names.rst12
-rw-r--r--Help/release/dev/cmake-command-mode-shasum.rst5
-rw-r--r--Help/release/dev/cmake_host_system_information-extend.rst6
-rw-r--r--Help/release/dev/cpack-freebsd-pkg.rst5
-rw-r--r--Help/release/dev/cpackifw-package-file-extension.rst6
-rw-r--r--Help/release/dev/cpackifw-repositories-directories.rst8
-rw-r--r--Help/release/dev/cuda-compiler-launcher.rst8
-rw-r--r--Help/release/dev/deb-on-windows.rst7
-rw-r--r--Help/release/dev/drop-HP-UX.rst8
-rw-r--r--Help/release/dev/execute_process-pipeline-results.rst6
-rw-r--r--Help/release/dev/file-generate-relative-paths.rst7
-rw-r--r--Help/release/dev/iar.rst4
-rw-r--r--Help/release/dev/include-guard.rst8
-rw-r--r--Help/release/dev/indented_cmakedefine.rst7
-rw-r--r--Help/release/dev/labels_for_subprojects.rst14
-rw-r--r--Help/release/dev/require-c++11.rst5
-rw-r--r--Help/release/dev/string_prepend.rst4
-rw-r--r--Help/release/dev/test_include_files.rst7
-rw-r--r--Help/release/index.rst2
-rw-r--r--Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst19
-rw-r--r--Help/variable/CMAKE_DIRECTORY_LABELS.rst6
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst8
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst1
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst2
-rw-r--r--Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst10
-rw-r--r--Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst5
-rw-r--r--Modules/AutogenInfo.cmake.in3
-rw-r--r--Modules/CMakeASMCompiler.cmake.in3
-rw-r--r--Modules/CMakeCCompiler.cmake.in1
-rw-r--r--Modules/CMakeCSharpInformation.cmake2
-rw-r--r--Modules/CMakeCUDAInformation.cmake4
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in1
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in12
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake69
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake7
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake10
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake5
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake7
-rw-r--r--Modules/CMakeFortranCompiler.cmake.in1
-rw-r--r--Modules/CMakePlatformId.h.in10
-rw-r--r--Modules/CMakePushCheckState.cmake2
-rwxr-xr-xModules/CPack.STGZ_Header.sh.in2
-rw-r--r--Modules/CPack.cmake3
-rw-r--r--Modules/CPackComponent.cmake10
-rw-r--r--Modules/CPackDeb.cmake21
-rw-r--r--Modules/CPackFreeBSD.cmake246
-rw-r--r--Modules/CPackIFW.cmake19
-rw-r--r--Modules/CPackRPM.cmake12
-rw-r--r--Modules/CheckCCompilerFlag.cmake50
-rw-r--r--Modules/CheckCSourceCompiles.cmake84
-rw-r--r--Modules/CheckCSourceRuns.cmake83
-rw-r--r--Modules/CheckCXXCompilerFlag.cmake49
-rw-r--r--Modules/CheckCXXSourceCompiles.cmake83
-rw-r--r--Modules/CheckCXXSourceRuns.cmake83
-rw-r--r--Modules/CheckCXXSymbolExists.cmake2
-rw-r--r--Modules/CheckFortranCompilerFlag.cmake51
-rw-r--r--Modules/CheckFortranSourceCompiles.cmake94
-rw-r--r--Modules/CheckSymbolExists.cmake6
-rw-r--r--Modules/CheckTypeSize.c.in6
-rw-r--r--Modules/Compiler/Clang-C.cmake30
-rw-r--r--Modules/Compiler/Clang-CXX.cmake60
-rw-r--r--Modules/Compiler/Clang-FindBinUtils.cmake8
-rw-r--r--Modules/Compiler/GNU-Fortran.cmake2
-rw-r--r--Modules/Compiler/IAR-ASM.cmake17
-rw-r--r--Modules/Compiler/IAR-C.cmake42
-rw-r--r--Modules/Compiler/IAR-CXX.cmake52
-rw-r--r--Modules/Compiler/IAR-DetermineCompiler.cmake18
-rw-r--r--Modules/Compiler/IAR-FindBinUtils.cmake54
-rw-r--r--Modules/Compiler/IAR.cmake87
-rw-r--r--Modules/Compiler/MSVC-CXX.cmake20
-rw-r--r--Modules/DartConfiguration.tcl.in3
-rw-r--r--Modules/ExternalProject.cmake1195
-rw-r--r--Modules/FindBoost.cmake30
-rw-r--r--Modules/FindCUDA.cmake30
-rw-r--r--Modules/FindCUDA/run_nvcc.cmake2
-rw-r--r--Modules/FindCUDA/select_compute_arch.cmake12
-rw-r--r--Modules/FindCurses.cmake112
-rw-r--r--Modules/FindCygwin.cmake23
-rw-r--r--Modules/FindGTest.cmake2
-rw-r--r--Modules/FindGettext.cmake8
-rw-r--r--Modules/FindHDF5.cmake167
-rw-r--r--Modules/FindHTMLHelp.cmake28
-rw-r--r--Modules/FindICU.cmake92
-rw-r--r--Modules/FindIce.cmake332
-rw-r--r--Modules/FindLibXml2.cmake53
-rw-r--r--Modules/FindMFC.cmake11
-rw-r--r--Modules/FindMatlab.cmake4
-rw-r--r--Modules/FindPkgConfig.cmake7
-rw-r--r--Modules/FindProtobuf.cmake20
-rw-r--r--Modules/FindQt4.cmake14
-rw-r--r--Modules/FindXCTest.cmake4
-rw-r--r--Modules/FindwxWidgets.cmake38
-rw-r--r--Modules/GoogleTest.cmake216
-rw-r--r--Modules/GoogleTestAddTests.cmake100
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake42
-rw-r--r--Modules/MacOSXBundleInfo.plist.in4
-rw-r--r--Modules/Platform/GHS-MULTI-Initialize.cmake2
-rw-r--r--Modules/Platform/GNUtoMS_lib.bat.in7
-rw-r--r--Modules/Platform/Generic-SDCC-C.cmake2
-rwxr-xr-xModules/SquishRunTestCase.bat22
-rw-r--r--Modules/UseSWIG.cmake11
-rw-r--r--README.rst4
-rw-r--r--Source/CMakeLists.txt60
-rw-r--r--Source/CMakeVersion.cmake4
-rw-r--r--Source/CPack/IFW/cmCPackIFWCommon.cxx4
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx83
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.h6
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx2
-rw-r--r--Source/CPack/WiX/cmWIXPatchParser.cxx2
-rw-r--r--Source/CPack/WiX/cmWIXRichTextFormatWriter.h2
-rw-r--r--Source/CPack/cmCPack7zGenerator.h2
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.h2
-rw-r--r--Source/CPack/cmCPackBundleGenerator.h4
-rw-r--r--Source/CPack/cmCPackComponentGroup.h6
-rw-r--r--Source/CPack/cmCPackCygwinBinaryGenerator.h2
-rw-r--r--Source/CPack/cmCPackCygwinSourceGenerator.h2
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx327
-rw-r--r--Source/CPack/cmCPackDebGenerator.h2
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx5
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.h6
-rw-r--r--Source/CPack/cmCPackFreeBSDGenerator.cxx359
-rw-r--r--Source/CPack/cmCPackFreeBSDGenerator.h37
-rw-r--r--Source/CPack/cmCPackGenerator.cxx23
-rw-r--r--Source/CPack/cmCPackGenerator.h4
-rw-r--r--Source/CPack/cmCPackGeneratorFactory.cxx24
-rw-r--r--Source/CPack/cmCPackLog.cxx9
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackNSISGenerator.h2
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.h4
-rw-r--r--Source/CPack/cmCPackPKGGenerator.h4
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.h4
-rw-r--r--Source/CPack/cmCPackProductBuildGenerator.h4
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackRPMGenerator.h2
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.h2
-rw-r--r--Source/CPack/cmCPackTGZGenerator.h2
-rw-r--r--Source/CPack/cmCPackTXZGenerator.h2
-rw-r--r--Source/CPack/cmCPackTarBZip2Generator.h2
-rw-r--r--Source/CPack/cmCPackTarCompressGenerator.h2
-rw-r--r--Source/CPack/cmCPackZIPGenerator.h2
-rw-r--r--Source/CPack/cpack.cxx13
-rw-r--r--Source/CTest/cmCTestBZR.cxx13
-rw-r--r--Source/CTest/cmCTestBZR.h2
-rw-r--r--Source/CTest/cmCTestBatchTestHandler.h2
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx24
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.h2
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx24
-rw-r--r--Source/CTest/cmCTestBuildCommand.h2
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx23
-rw-r--r--Source/CTest/cmCTestBuildHandler.h2
-rw-r--r--Source/CTest/cmCTestCVS.cxx7
-rw-r--r--Source/CTest/cmCTestCVS.h2
-rw-r--r--Source/CTest/cmCTestCommand.h4
-rw-r--r--Source/CTest/cmCTestConfigureCommand.cxx23
-rw-r--r--Source/CTest/cmCTestConfigureCommand.h2
-rw-r--r--Source/CTest/cmCTestConfigureHandler.cxx1
-rw-r--r--Source/CTest/cmCTestConfigureHandler.h2
-rw-r--r--Source/CTest/cmCTestCoverageCommand.cxx2
-rw-r--r--Source/CTest/cmCTestCoverageCommand.h2
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx10
-rw-r--r--Source/CTest/cmCTestCoverageHandler.h2
-rw-r--r--Source/CTest/cmCTestCurl.cxx15
-rw-r--r--Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h2
-rw-r--r--Source/CTest/cmCTestGIT.cxx52
-rw-r--r--Source/CTest/cmCTestGIT.h2
-rw-r--r--Source/CTest/cmCTestGenericHandler.cxx5
-rw-r--r--Source/CTest/cmCTestGlobalVC.h2
-rw-r--r--Source/CTest/cmCTestHG.cxx10
-rw-r--r--Source/CTest/cmCTestHG.h2
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx4
-rw-r--r--Source/CTest/cmCTestHandlerCommand.h2
-rw-r--r--Source/CTest/cmCTestLaunch.cxx20
-rw-r--r--Source/CTest/cmCTestMemCheckCommand.cxx2
-rw-r--r--Source/CTest/cmCTestMemCheckCommand.h2
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx23
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.h2
-rw-r--r--Source/CTest/cmCTestP4.cxx14
-rw-r--r--Source/CTest/cmCTestP4.h2
-rw-r--r--Source/CTest/cmCTestReadCustomFilesCommand.h2
-rw-r--r--Source/CTest/cmCTestRunScriptCommand.h2
-rw-r--r--Source/CTest/cmCTestRunTest.cxx12
-rw-r--r--Source/CTest/cmCTestSVN.cxx2
-rw-r--r--Source/CTest/cmCTestSVN.h2
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx18
-rw-r--r--Source/CTest/cmCTestScriptHandler.h2
-rw-r--r--Source/CTest/cmCTestSleepCommand.h2
-rw-r--r--Source/CTest/cmCTestStartCommand.cxx6
-rw-r--r--Source/CTest/cmCTestStartCommand.h2
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx4
-rw-r--r--Source/CTest/cmCTestSubmitCommand.h2
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx57
-rw-r--r--Source/CTest/cmCTestSubmitHandler.h4
-rw-r--r--Source/CTest/cmCTestTestCommand.cxx8
-rw-r--r--Source/CTest/cmCTestTestCommand.h2
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx233
-rw-r--r--Source/CTest/cmCTestTestHandler.h12
-rw-r--r--Source/CTest/cmCTestUpdateCommand.cxx4
-rw-r--r--Source/CTest/cmCTestUpdateCommand.h2
-rw-r--r--Source/CTest/cmCTestUpdateHandler.cxx2
-rw-r--r--Source/CTest/cmCTestUpdateHandler.h2
-rw-r--r--Source/CTest/cmCTestUploadCommand.cxx2
-rw-r--r--Source/CTest/cmCTestUploadCommand.h2
-rw-r--r--Source/CTest/cmCTestUploadHandler.h2
-rw-r--r--Source/CTest/cmCTestVC.cxx4
-rw-r--r--Source/CTest/cmCTestVC.h10
-rw-r--r--Source/CTest/cmParseCacheCoverage.h2
-rw-r--r--Source/CTest/cmParseCoberturaCoverage.cxx1
-rw-r--r--Source/CTest/cmParseGTMCoverage.h2
-rw-r--r--Source/CTest/cmParseJacocoCoverage.cxx2
-rw-r--r--Source/CTest/cmParseMumpsCoverage.cxx5
-rw-r--r--Source/CTest/cmProcess.cxx10
-rw-r--r--Source/CTest/cmProcess.h1
-rw-r--r--Source/Checks/cm_cxx_attribute_fallthrough.cxx2
-rw-r--r--Source/Checks/cm_cxx_fallthrough.cxx2
-rw-r--r--Source/Checks/cm_cxx_features.cmake3
-rw-r--r--Source/Checks/cm_cxx_gnu_fallthrough.cxx2
-rw-r--r--Source/Checks/cm_cxx_nullptr.cxx14
-rw-r--r--Source/Checks/cm_cxx_unordered_map.cxx7
-rw-r--r--Source/Checks/cm_cxx_unordered_set.cxx7
-rw-r--r--Source/CursesDialog/CMakeLists.txt4
-rw-r--r--Source/CursesDialog/ccmake.cxx28
-rw-r--r--Source/CursesDialog/cmCursesBoolWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.cxx6
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.h2
-rw-r--r--Source/CursesDialog/cmCursesDummyWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesFilePathWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesForm.cxx4
-rw-r--r--Source/CursesDialog/cmCursesForm.h2
-rw-r--r--Source/CursesDialog/cmCursesLabelWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.cxx8
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.h2
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx38
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h4
-rw-r--r--Source/CursesDialog/cmCursesOptionsWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesPathWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesStandardIncludes.h2
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.cxx2
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesWidget.cxx2
-rw-r--r--Source/CursesDialog/cmCursesWidget.h2
-rw-r--r--Source/CursesDialog/form/CMakeLists.txt17
-rw-r--r--Source/LexerParser/cmCommandArgumentLexer.cxx671
-rw-r--r--Source/LexerParser/cmCommandArgumentLexer.h441
-rw-r--r--Source/LexerParser/cmCommandArgumentLexer.in.l11
-rw-r--r--Source/LexerParser/cmDependsJavaLexer.cxx767
-rw-r--r--Source/LexerParser/cmDependsJavaLexer.h441
-rw-r--r--Source/LexerParser/cmDependsJavaLexer.in.l11
-rw-r--r--Source/LexerParser/cmExprLexer.cxx670
-rw-r--r--Source/LexerParser/cmExprLexer.h441
-rw-r--r--Source/LexerParser/cmExprLexer.in.l11
-rw-r--r--Source/LexerParser/cmFortranLexer.cxx995
-rw-r--r--Source/LexerParser/cmFortranLexer.h441
-rw-r--r--Source/LexerParser/cmFortranLexer.in.l11
-rw-r--r--Source/LexerParser/cmListFileLexer.c693
-rw-r--r--Source/LexerParser/cmListFileLexer.in.l20
-rw-r--r--Source/QtDialog/CMakeSetup.cxx15
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx6
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h2
-rw-r--r--Source/QtDialog/Compilers.h4
-rw-r--r--Source/QtDialog/FirstConfigure.cxx2
-rw-r--r--Source/QtDialog/QCMake.h4
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx4
-rw-r--r--Source/QtDialog/QCMakeWidgets.cxx6
-rw-r--r--Source/QtDialog/QCMakeWidgets.h7
-rw-r--r--Source/bindexplib.h2
-rw-r--r--Source/cmAddCompileOptionsCommand.h2
-rw-r--r--Source/cmAddCustomCommandCommand.cxx2
-rw-r--r--Source/cmAddCustomCommandCommand.h2
-rw-r--r--Source/cmAddCustomTargetCommand.cxx2
-rw-r--r--Source/cmAddCustomTargetCommand.h2
-rw-r--r--Source/cmAddDefinitionsCommand.h2
-rw-r--r--Source/cmAddDependenciesCommand.h2
-rw-r--r--Source/cmAddExecutableCommand.h2
-rw-r--r--Source/cmAddLibraryCommand.h2
-rw-r--r--Source/cmAddSubDirectoryCommand.h2
-rw-r--r--Source/cmAddTestCommand.h2
-rw-r--r--Source/cmAlgorithms.h19
-rw-r--r--Source/cmArchiveWrite.cxx6
-rw-r--r--Source/cmArchiveWrite.h4
-rw-r--r--Source/cmAuxSourceDirectoryCommand.h2
-rw-r--r--Source/cmBreakCommand.h2
-rw-r--r--Source/cmBuildCommand.h2
-rw-r--r--Source/cmBuildNameCommand.h2
-rw-r--r--Source/cmCLocaleEnvironmentScope.h2
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.cxx49
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.h2
-rw-r--r--Source/cmCMakeMinimumRequired.h2
-rw-r--r--Source/cmCMakePolicyCommand.h2
-rw-r--r--Source/cmCPackPropertiesGenerator.h2
-rw-r--r--Source/cmCPluginAPI.cxx22
-rw-r--r--Source/cmCTest.cxx95
-rw-r--r--Source/cmCTest.h16
-rw-r--r--Source/cmCacheManager.cxx10
-rw-r--r--Source/cmCacheManager.h7
-rw-r--r--Source/cmCallVisualStudioMacro.h2
-rw-r--r--Source/cmCommand.h4
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx10
-rw-r--r--Source/cmCommandArgumentParserHelper.h2
-rw-r--r--Source/cmCommandArgumentsHelper.cxx28
-rw-r--r--Source/cmCommandArgumentsHelper.h12
-rw-r--r--Source/cmCommands.cxx34
-rw-r--r--Source/cmCommonTargetGenerator.cxx37
-rw-r--r--Source/cmCommonTargetGenerator.h4
-rw-r--r--Source/cmComputeLinkDepends.cxx6
-rw-r--r--Source/cmComputeLinkDepends.h2
-rw-r--r--Source/cmComputeLinkInformation.cxx20
-rw-r--r--Source/cmComputeLinkInformation.h4
-rw-r--r--Source/cmComputeTargetDepends.cxx6
-rw-r--r--Source/cmConditionEvaluator.cxx11
-rw-r--r--Source/cmConfigure.cmake.h.in12
-rw-r--r--Source/cmConfigureFileCommand.h2
-rw-r--r--Source/cmConnection.cxx158
-rw-r--r--Source/cmConnection.h118
-rw-r--r--Source/cmContinueCommand.h2
-rw-r--r--Source/cmCoreTryCompile.cxx3
-rw-r--r--Source/cmCreateTestSourceList.h2
-rw-r--r--Source/cmCryptoHash.cxx2
-rw-r--r--Source/cmCryptoHash.h2
-rw-r--r--Source/cmCurl.h4
-rw-r--r--Source/cmCustomCommand.cxx6
-rw-r--r--Source/cmCustomCommandGenerator.cxx48
-rw-r--r--Source/cmCustomCommandGenerator.h3
-rw-r--r--Source/cmDefinePropertyCommand.h2
-rw-r--r--Source/cmDefinitions.cxx3
-rw-r--r--Source/cmDefinitions.h4
-rw-r--r--Source/cmDepends.cxx12
-rw-r--r--Source/cmDepends.h4
-rw-r--r--Source/cmDependsC.cxx12
-rw-r--r--Source/cmDependsC.h2
-rw-r--r--Source/cmDependsFortran.cxx2
-rw-r--r--Source/cmDependsFortran.h2
-rw-r--r--Source/cmDependsJava.h2
-rw-r--r--Source/cmDependsJavaParserHelper.cxx18
-rw-r--r--Source/cmDisallowedCommand.h2
-rw-r--r--Source/cmDocumentation.cxx14
-rw-r--r--Source/cmDocumentation.h4
-rw-r--r--Source/cmDynamicLoader.cxx4
-rw-r--r--Source/cmDynamicLoader.h2
-rw-r--r--Source/cmELF.cxx20
-rw-r--r--Source/cmELF.h2
-rw-r--r--Source/cmEnableLanguageCommand.h2
-rw-r--r--Source/cmEnableTestingCommand.h2
-rw-r--r--Source/cmExecProgramCommand.cxx8
-rw-r--r--Source/cmExecProgramCommand.h5
-rw-r--r--Source/cmExecuteProcessCommand.cxx61
-rw-r--r--Source/cmExecuteProcessCommand.h2
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.cxx4
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.h2
-rw-r--r--Source/cmExportBuildFileGenerator.cxx6
-rw-r--r--Source/cmExportBuildFileGenerator.h2
-rw-r--r--Source/cmExportCommand.cxx8
-rw-r--r--Source/cmExportCommand.h2
-rw-r--r--Source/cmExportInstallAndroidMKGenerator.h2
-rw-r--r--Source/cmExportInstallFileGenerator.cxx2
-rw-r--r--Source/cmExportInstallFileGenerator.h2
-rw-r--r--Source/cmExportLibraryDependenciesCommand.cxx2
-rw-r--r--Source/cmExportLibraryDependenciesCommand.h2
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx4
-rw-r--r--Source/cmExportTryCompileFileGenerator.h2
-rw-r--r--Source/cmExprParserHelper.cxx4
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx35
-rw-r--r--Source/cmExtraCodeBlocksGenerator.h2
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx5
-rw-r--r--Source/cmExtraCodeLiteGenerator.h2
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx15
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h4
-rw-r--r--Source/cmExtraKateGenerator.cxx6
-rw-r--r--Source/cmExtraKateGenerator.h2
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx15
-rw-r--r--Source/cmExtraSublimeTextGenerator.h2
-rw-r--r--Source/cmFLTKWrapUICommand.cxx4
-rw-r--r--Source/cmFLTKWrapUICommand.h2
-rw-r--r--Source/cmFileCommand.cxx105
-rw-r--r--Source/cmFileCommand.h2
-rw-r--r--Source/cmFileLock.h2
-rw-r--r--Source/cmFileLockPool.h2
-rw-r--r--Source/cmFileLockResult.cxx19
-rw-r--r--Source/cmFileMonitor.cxx4
-rw-r--r--Source/cmFileMonitor.h2
-rw-r--r--Source/cmFileTimeComparison.cxx5
-rw-r--r--Source/cmFindBase.cxx3
-rw-r--r--Source/cmFindCommon.cxx4
-rw-r--r--Source/cmFindCommon.h2
-rw-r--r--Source/cmFindFileCommand.h2
-rw-r--r--Source/cmFindLibraryCommand.h2
-rw-r--r--Source/cmFindPackageCommand.cxx4
-rw-r--r--Source/cmFindPackageCommand.h2
-rw-r--r--Source/cmFindPathCommand.h2
-rw-r--r--Source/cmFindProgramCommand.h2
-rw-r--r--Source/cmForEachCommand.h2
-rw-r--r--Source/cmFortranParser.h2
-rw-r--r--Source/cmFortranParserImpl.cxx7
-rw-r--r--Source/cmFunctionCommand.h2
-rw-r--r--Source/cmGeneratedFileStream.h2
-rw-r--r--Source/cmGeneratorExpression.h14
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h4
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.cxx89
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.h13
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx2
-rw-r--r--Source/cmGeneratorExpressionEvaluator.h2
-rw-r--r--Source/cmGeneratorExpressionNode.cxx20
-rw-r--r--Source/cmGeneratorTarget.cxx177
-rw-r--r--Source/cmGeneratorTarget.h11
-rw-r--r--Source/cmGetCMakePropertyCommand.cxx2
-rw-r--r--Source/cmGetCMakePropertyCommand.h2
-rw-r--r--Source/cmGetDirectoryPropertyCommand.cxx2
-rw-r--r--Source/cmGetDirectoryPropertyCommand.h2
-rw-r--r--Source/cmGetFilenameComponentCommand.h2
-rw-r--r--Source/cmGetPropertyCommand.cxx8
-rw-r--r--Source/cmGetPropertyCommand.h2
-rw-r--r--Source/cmGetSourceFilePropertyCommand.cxx2
-rw-r--r--Source/cmGetSourceFilePropertyCommand.h2
-rw-r--r--Source/cmGetTargetPropertyCommand.cxx2
-rw-r--r--Source/cmGetTargetPropertyCommand.h2
-rw-r--r--Source/cmGetTestPropertyCommand.cxx2
-rw-r--r--Source/cmGetTestPropertyCommand.h2
-rw-r--r--Source/cmGhsMultiGpj.h2
-rw-r--r--Source/cmGlobalCommonGenerator.h2
-rw-r--r--Source/cmGlobalGenerator.cxx151
-rw-r--r--Source/cmGlobalGenerator.h39
-rw-r--r--Source/cmGlobalGeneratorFactory.h4
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx6
-rw-r--r--Source/cmGlobalGhsMultiGenerator.h2
-rw-r--r--Source/cmGlobalKdevelopGenerator.cxx25
-rw-r--r--Source/cmGlobalKdevelopGenerator.h2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx22
-rw-r--r--Source/cmGlobalNinjaGenerator.h4
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx31
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h2
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx18
-rw-r--r--Source/cmGlobalVisualStudio11Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio12Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx7
-rw-r--r--Source/cmGlobalVisualStudio14Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio15Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx6
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx12
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h2
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.h2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx59
-rw-r--r--Source/cmGlobalXCodeGenerator.h2
-rw-r--r--Source/cmGraphVizWriter.cxx21
-rw-r--r--Source/cmHexFileConverter.cxx13
-rw-r--r--Source/cmHexFileConverter.h2
-rw-r--r--Source/cmIDEOptions.h2
-rw-r--r--Source/cmIfCommand.h2
-rw-r--r--Source/cmIncludeCommand.cxx2
-rw-r--r--Source/cmIncludeCommand.h2
-rw-r--r--Source/cmIncludeDirectoryCommand.h2
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.h2
-rw-r--r--Source/cmIncludeGuardCommand.cxx108
-rw-r--r--Source/cmIncludeGuardCommand.h37
-rw-r--r--Source/cmIncludeRegularExpressionCommand.h2
-rw-r--r--Source/cmInstallCommand.cxx55
-rw-r--r--Source/cmInstallCommand.h2
-rw-r--r--Source/cmInstallCommandArguments.cxx24
-rw-r--r--Source/cmInstallDirectoryGenerator.cxx4
-rw-r--r--Source/cmInstallDirectoryGenerator.h2
-rw-r--r--Source/cmInstallExportAndroidMKGenerator.cxx8
-rw-r--r--Source/cmInstallExportGenerator.cxx10
-rw-r--r--Source/cmInstallExportGenerator.h2
-rw-r--r--Source/cmInstallFilesCommand.h2
-rw-r--r--Source/cmInstallFilesGenerator.cxx6
-rw-r--r--Source/cmInstallFilesGenerator.h2
-rw-r--r--Source/cmInstallGenerator.cxx4
-rw-r--r--Source/cmInstallGenerator.h8
-rw-r--r--Source/cmInstallProgramsCommand.h2
-rw-r--r--Source/cmInstallScriptGenerator.cxx2
-rw-r--r--Source/cmInstallScriptGenerator.h2
-rw-r--r--Source/cmInstallTargetGenerator.cxx10
-rw-r--r--Source/cmInstallTargetGenerator.h2
-rw-r--r--Source/cmInstallTargetsCommand.cxx2
-rw-r--r--Source/cmInstallTargetsCommand.h2
-rw-r--r--Source/cmInstalledFile.cxx3
-rw-r--r--Source/cmLinkDirectoriesCommand.h2
-rw-r--r--Source/cmLinkItem.h6
-rw-r--r--Source/cmLinkLibrariesCommand.h2
-rw-r--r--Source/cmLinkLineComputer.h2
-rw-r--r--Source/cmLinkLineDeviceComputer.h2
-rw-r--r--Source/cmLinkedTree.h4
-rw-r--r--Source/cmListCommand.cxx12
-rw-r--r--Source/cmListCommand.h2
-rw-r--r--Source/cmListFileCache.cxx9
-rw-r--r--Source/cmLoadCacheCommand.h2
-rw-r--r--Source/cmLoadCommandCommand.cxx28
-rw-r--r--Source/cmLoadCommandCommand.h2
-rw-r--r--Source/cmLocalCommonGenerator.h2
-rw-r--r--Source/cmLocalGenerator.cxx128
-rw-r--r--Source/cmLocalGenerator.h15
-rw-r--r--Source/cmLocalGhsMultiGenerator.cxx4
-rw-r--r--Source/cmLocalNinjaGenerator.cxx4
-rw-r--r--Source/cmLocalNinjaGenerator.h4
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx24
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h13
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx4
-rw-r--r--Source/cmLocalVisualStudio10Generator.h2
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx17
-rw-r--r--Source/cmLocalVisualStudio7Generator.h2
-rw-r--r--Source/cmLocalVisualStudioGenerator.h2
-rw-r--r--Source/cmLocalXCodeGenerator.cxx8
-rw-r--r--Source/cmLocale.h4
-rw-r--r--Source/cmMSVC60LinkLineComputer.h2
-rw-r--r--Source/cmMachO.h2
-rw-r--r--Source/cmMacroCommand.h2
-rw-r--r--Source/cmMakeDirectoryCommand.h2
-rw-r--r--Source/cmMakefile.cxx109
-rw-r--r--Source/cmMakefile.h47
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx6
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.h2
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx6
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.h2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx45
-rw-r--r--Source/cmMakefileTargetGenerator.h2
-rw-r--r--Source/cmMakefileUtilityTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileUtilityTargetGenerator.h2
-rw-r--r--Source/cmMarkAsAdvancedCommand.cxx2
-rw-r--r--Source/cmMarkAsAdvancedCommand.h2
-rw-r--r--Source/cmMathCommand.h2
-rw-r--r--Source/cmMessageCommand.h2
-rw-r--r--Source/cmNinjaLinkLineComputer.h2
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx29
-rw-r--r--Source/cmNinjaNormalTargetGenerator.h2
-rw-r--r--Source/cmNinjaTargetGenerator.cxx27
-rw-r--r--Source/cmNinjaTargetGenerator.h2
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.h2
-rw-r--r--Source/cmOSXBundleGenerator.cxx4
-rw-r--r--Source/cmOptionCommand.h2
-rw-r--r--Source/cmOrderDirectories.h4
-rw-r--r--Source/cmOutputConverter.cxx2
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx10
-rw-r--r--Source/cmOutputRequiredFilesCommand.h2
-rw-r--r--Source/cmParseArgumentsCommand.h2
-rw-r--r--Source/cmPipeConnection.cxx79
-rw-r--r--Source/cmPipeConnection.h28
-rw-r--r--Source/cmPolicies.cxx13
-rw-r--r--Source/cmPolicies.h7
-rw-r--r--Source/cmProcessTools.cxx14
-rw-r--r--Source/cmProcessTools.h6
-rw-r--r--Source/cmProjectCommand.h2
-rw-r--r--Source/cmProperty.cxx4
-rw-r--r--Source/cmPropertyMap.cxx3
-rw-r--r--Source/cmQTWrapCPPCommand.cxx2
-rw-r--r--Source/cmQTWrapCPPCommand.h2
-rw-r--r--Source/cmQTWrapUICommand.cxx4
-rw-r--r--Source/cmQTWrapUICommand.h2
-rw-r--r--Source/cmQtAutoGeneratorCommon.cxx12
-rw-r--r--Source/cmQtAutoGeneratorCommon.h4
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx850
-rw-r--r--Source/cmQtAutoGeneratorInitializer.h3
-rw-r--r--Source/cmQtAutoGenerators.cxx188
-rw-r--r--Source/cmQtAutoGenerators.h7
-rw-r--r--Source/cmRemoveCommand.h2
-rw-r--r--Source/cmRemoveDefinitionsCommand.h2
-rw-r--r--Source/cmReturnCommand.h2
-rw-r--r--Source/cmScriptGenerator.cxx4
-rw-r--r--Source/cmScriptGenerator.h2
-rw-r--r--Source/cmSearchPath.cxx10
-rw-r--r--Source/cmSearchPath.h8
-rw-r--r--Source/cmSeparateArgumentsCommand.h2
-rw-r--r--Source/cmServer.cxx251
-rw-r--r--Source/cmServer.h100
-rw-r--r--Source/cmServerConnection.cxx391
-rw-r--r--Source/cmServerConnection.h99
-rw-r--r--Source/cmServerDictionary.h5
-rw-r--r--Source/cmServerProtocol.cxx117
-rw-r--r--Source/cmServerProtocol.h9
-rw-r--r--Source/cmSetCommand.cxx6
-rw-r--r--Source/cmSetCommand.h2
-rw-r--r--Source/cmSetDirectoryPropertiesCommand.h2
-rw-r--r--Source/cmSetPropertyCommand.cxx10
-rw-r--r--Source/cmSetPropertyCommand.h2
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.h2
-rw-r--r--Source/cmSetTargetPropertiesCommand.h2
-rw-r--r--Source/cmSetTestsPropertiesCommand.h2
-rw-r--r--Source/cmSiteNameCommand.cxx4
-rw-r--r--Source/cmSiteNameCommand.h2
-rw-r--r--Source/cmSourceFile.cxx25
-rw-r--r--Source/cmSourceFile.h11
-rw-r--r--Source/cmSourceFileLocation.cxx4
-rw-r--r--Source/cmSourceGroup.cxx6
-rw-r--r--Source/cmSourceGroup.h4
-rw-r--r--Source/cmSourceGroupCommand.cxx4
-rw-r--r--Source/cmSourceGroupCommand.h2
-rw-r--r--Source/cmState.cxx14
-rw-r--r--Source/cmStateSnapshot.cxx2
-rw-r--r--Source/cmStateSnapshot.h2
-rw-r--r--Source/cmStringCommand.cxx31
-rw-r--r--Source/cmStringCommand.h3
-rw-r--r--Source/cmSubdirCommand.h2
-rw-r--r--Source/cmSubdirDependsCommand.h2
-rw-r--r--Source/cmSystemTools.cxx55
-rw-r--r--Source/cmSystemTools.h47
-rw-r--r--Source/cmTarget.cxx186
-rw-r--r--Source/cmTarget.h6
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.h2
-rw-r--r--Source/cmTargetCompileFeaturesCommand.h2
-rw-r--r--Source/cmTargetCompileOptionsCommand.h2
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.h2
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx4
-rw-r--r--Source/cmTargetLinkLibrariesCommand.h2
-rw-r--r--Source/cmTargetPropertyComputer.cxx6
-rw-r--r--Source/cmTargetPropertyComputer.h12
-rw-r--r--Source/cmTargetSourcesCommand.h2
-rw-r--r--Source/cmTestGenerator.cxx4
-rw-r--r--Source/cmTestGenerator.h2
-rw-r--r--Source/cmTimestamp.cxx7
-rw-r--r--Source/cmTryCompileCommand.h2
-rw-r--r--Source/cmTryRunCommand.cxx21
-rw-r--r--Source/cmTryRunCommand.h2
-rw-r--r--Source/cmUnexpectedCommand.h2
-rw-r--r--Source/cmUnsetCommand.cxx2
-rw-r--r--Source/cmUnsetCommand.h2
-rw-r--r--Source/cmUseMangledMesaCommand.h2
-rw-r--r--Source/cmUtilitySourceCommand.cxx4
-rw-r--r--Source/cmUtilitySourceCommand.h2
-rw-r--r--Source/cmVS10CLFlagTable.h3
-rw-r--r--Source/cmVS10CSharpFlagTable.h3
-rw-r--r--Source/cmVS11CLFlagTable.h3
-rw-r--r--Source/cmVS11CSharpFlagTable.h3
-rw-r--r--Source/cmVS12CLFlagTable.h3
-rw-r--r--Source/cmVS12CSharpFlagTable.h3
-rw-r--r--Source/cmVS140CLFlagTable.h3
-rw-r--r--Source/cmVS140CSharpFlagTable.h3
-rw-r--r--Source/cmVS141CLFlagTable.h3
-rw-r--r--Source/cmVS141CSharpFlagTable.h3
-rw-r--r--Source/cmVariableRequiresCommand.h2
-rw-r--r--Source/cmVariableWatch.h11
-rw-r--r--Source/cmVariableWatchCommand.h2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx432
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h20
-rw-r--r--Source/cmVisualStudio10ToolsetOptions.h2
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx2
-rw-r--r--Source/cmVisualStudioGeneratorOptions.h2
-rw-r--r--Source/cmVisualStudioSlnData.h2
-rw-r--r--Source/cmVisualStudioSlnParser.h2
-rw-r--r--Source/cmVisualStudioWCEPlatformParser.h2
-rw-r--r--Source/cmWhileCommand.h2
-rw-r--r--Source/cmWriteFileCommand.h2
-rw-r--r--Source/cmXCodeScheme.cxx61
-rw-r--r--Source/cmXCodeScheme.h17
-rw-r--r--Source/cmXMLParser.cxx14
-rw-r--r--Source/cmXMLWriter.h2
-rw-r--r--Source/cm_auto_ptr.hxx4
-rw-r--r--Source/cm_sys_stat.h5
-rw-r--r--Source/cm_unordered_map.hxx25
-rw-r--r--Source/cm_unordered_set.hxx25
-rw-r--r--Source/cmake.cxx20
-rw-r--r--Source/cmake.h5
-rw-r--r--Source/cmakemain.cxx55
-rw-r--r--Source/cmcmd.cxx121
-rw-r--r--Source/cmcmd.h3
-rw-r--r--Source/ctest.cxx13
-rw-r--r--Source/kwsys/CMakeLists.txt158
-rw-r--r--Source/kwsys/ProcessUNIX.c3
-rw-r--r--Source/kwsys/RegularExpression.cxx5
-rw-r--r--Source/kwsys/SystemTools.cxx18
-rw-r--r--Source/kwsys/SystemTools.hxx.in12
-rw-r--r--Source/kwsys/testSystemTools.cxx26
-rw-r--r--Tests/AliasTarget/CMakeLists.txt7
-rw-r--r--Tests/CMakeLib/run_compile_commands.cxx5
-rw-r--r--Tests/CMakeLib/testUTF8.cxx5
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/.gitattributes2
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/bom.sln-file4
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/err-data.sln-file12
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-global.sln-file18
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-header.sln-file8
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectArgs.sln-file8
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectContents.sln-file12
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectSection.sln-file22
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayParen.sln-file8
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote.sln-file8
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote2.sln-file8
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-topLevel.sln-file8
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-unclosed.sln-file10
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/nobom.sln-file4
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser_data/valid.sln-file1360
-rw-r--r--Tests/CMakeLib/testXMLSafe.cxx4
-rw-r--r--Tests/CMakeLists.txt53
-rw-r--r--Tests/CMakeTests/.gitattributes2
-rw-r--r--Tests/CMakeTests/CMakeHostSystemInformationTest.cmake.in19
-rw-r--r--Tests/CMakeTests/PushCheckStateTest.cmake.in22
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt8
-rw-r--r--Tests/CompileFeatures/default_dialect.cpp23
-rw-r--r--Tests/CompileFeatures/genex_test.cpp12
-rw-r--r--Tests/Complex/CMakeLists.txt9
-rw-r--r--Tests/Complex/Executable/complex.cxx22
-rw-r--r--Tests/Complex/VarTests.cmake2
-rw-r--r--Tests/Complex/cmTestConfigure.h.in4
-rw-r--r--Tests/ComplexOneConfig/CMakeLists.txt9
-rw-r--r--Tests/ComplexOneConfig/Executable/complex.cxx22
-rw-r--r--Tests/ComplexOneConfig/VarTests.cmake2
-rw-r--r--Tests/ComplexOneConfig/cmTestConfigure.h.in4
-rw-r--r--Tests/Cuda/Complex/CMakeLists.txt5
-rw-r--r--Tests/Cuda/ObjectLibrary/CMakeLists.txt6
-rw-r--r--Tests/Cuda/WithC/CMakeLists.txt5
-rw-r--r--Tests/CudaOnly/ExportPTX/CMakeLists.txt5
-rw-r--r--Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt5
-rw-r--r--Tests/CudaOnly/SeparateCompilation/CMakeLists.txt7
-rw-r--r--Tests/CudaOnly/WithDefs/CMakeLists.txt7
-rw-r--r--Tests/FindProtobuf/Test/CMakeLists.txt2
-rw-r--r--Tests/MFC/CMakeLists.txt.in5
-rw-r--r--Tests/MFC/mfc1/.gitattributes6
-rw-r--r--Tests/MFC/mfc1/mfc1.sln42
-rw-r--r--Tests/MFC/mfc1/mfc1.vcproj432
-rw-r--r--Tests/Module/CheckIPOSupported-C/CMakeLists.txt5
-rw-r--r--Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt5
-rw-r--r--Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt5
-rw-r--r--Tests/Module/ExternalData/.gitattributes5
-rw-r--r--Tests/Module/ExternalData/MD5/.gitattributes1
-rw-r--r--Tests/Module/ExternalData/SHA1/.gitattributes1
-rw-r--r--Tests/Module/ExternalData/SHA224/.gitattributes1
-rw-r--r--Tests/Module/ExternalData/SHA256/.gitattributes1
-rw-r--r--Tests/Module/ExternalData/SHA3_256/.gitattributes1
-rw-r--r--Tests/MumpsCoverage/.gitattributes3
-rw-r--r--Tests/MumpsCoverage/ZZCOVTST.cmcov90
-rw-r--r--Tests/Plugin/CMakeLists.txt7
-rw-r--r--Tests/Qt4Targets/CMakeLists.txt10
-rw-r--r--Tests/QtAutoUicInterface/CMakeLists.txt5
-rw-r--r--Tests/QtAutogen/CMakeLists.txt322
-rw-r--r--Tests/QtAutogen/complex/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/mocCMP0071/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt16
-rw-r--r--Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt18
-rw-r--r--Tests/QtAutogen/mocCMP0071/Obj.cpp20
-rw-r--r--Tests/QtAutogen/mocCMP0071/Obj.hpp19
-rw-r--r--Tests/QtAutogen/mocCMP0071/Obj_p.h14
-rw-r--r--Tests/QtAutogen/mocCMP0071/main.cpp7
-rw-r--r--Tests/QtAutogen/mocDepends/CMakeLists.txt106
-rw-r--r--Tests/QtAutogen/mocDepends/simpleLib.hpp.in5
-rw-r--r--Tests/QtAutogen/mocDepends/test1.cpp3
-rw-r--r--Tests/QtAutogen/mocDepends/test2.cpp7
-rw-r--r--Tests/QtAutogen/mocDepends/test3.cpp12
-rw-r--r--Tests/QtAutogen/mocDepends/test3.hpp (renamed from Tests/QtAutogen/mocDepends/test2.hpp)4
-rw-r--r--Tests/QtAutogen/mocInclude/EObjA.cpp43
-rw-r--r--Tests/QtAutogen/mocInclude/EObjA.hpp19
-rw-r--r--Tests/QtAutogen/mocInclude/EObjAExtra.cpp20
-rw-r--r--Tests/QtAutogen/mocInclude/EObjAExtra.hpp18
-rw-r--r--Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp12
-rw-r--r--Tests/QtAutogen/mocInclude/EObjA_p.hpp12
-rw-r--r--Tests/QtAutogen/mocInclude/EObjB.cpp44
-rw-r--r--Tests/QtAutogen/mocInclude/EObjB.hpp19
-rw-r--r--Tests/QtAutogen/mocInclude/EObjB_p.hpp12
-rw-r--r--Tests/QtAutogen/mocInclude/LObjA.cpp39
-rw-r--r--Tests/QtAutogen/mocInclude/LObjA.hpp19
-rw-r--r--Tests/QtAutogen/mocInclude/LObjA_p.h12
-rw-r--r--Tests/QtAutogen/mocInclude/LObjB.cpp40
-rw-r--r--Tests/QtAutogen/mocInclude/LObjB.hpp19
-rw-r--r--Tests/QtAutogen/mocInclude/LObjB_p.h12
-rw-r--r--Tests/QtAutogen/mocInclude/ObjA.cpp24
-rw-r--r--Tests/QtAutogen/mocInclude/ObjA.hpp10
-rw-r--r--Tests/QtAutogen/mocInclude/ObjA_p.h12
-rw-r--r--Tests/QtAutogen/mocInclude/ObjB.cpp23
-rw-r--r--Tests/QtAutogen/mocInclude/ObjB.hpp14
-rw-r--r--Tests/QtAutogen/mocInclude/ObjB_p.h12
-rw-r--r--Tests/QtAutogen/mocInclude/ObjC.cpp26
-rw-r--r--Tests/QtAutogen/mocInclude/ObjC.hpp13
-rw-r--r--Tests/QtAutogen/mocInclude/ObjD.cpp26
-rw-r--r--Tests/QtAutogen/mocInclude/ObjD.hpp13
-rw-r--r--Tests/QtAutogen/mocInclude/SObjA.cpp11
-rw-r--r--Tests/QtAutogen/mocInclude/SObjA.hpp15
-rw-r--r--Tests/QtAutogen/mocInclude/SObjB.cpp.in11
-rw-r--r--Tests/QtAutogen/mocInclude/SObjB.hpp.in15
-rw-r--r--Tests/QtAutogen/mocInclude/SObjC.cpp35
-rw-r--r--Tests/QtAutogen/mocInclude/SObjC.hpp15
-rw-r--r--Tests/QtAutogen/mocInclude/SObjCExtra.cpp31
-rw-r--r--Tests/QtAutogen/mocInclude/SObjCExtra.hpp15
-rw-r--r--Tests/QtAutogen/mocInclude/SObjCExtra.moc.in4
-rw-r--r--Tests/QtAutogen/mocInclude/shared.cmake71
-rw-r--r--Tests/QtAutogen/mocInclude/subA/SubObjA.cpp27
-rw-r--r--Tests/QtAutogen/mocInclude/subA/SubObjA.hpp16
-rw-r--r--Tests/QtAutogen/mocInclude/subB/SubObjB.cpp27
-rw-r--r--Tests/QtAutogen/mocInclude/subB/SubObjB.hpp16
-rw-r--r--Tests/QtAutogen/mocInclude/subC/SubObjC.cpp27
-rw-r--r--Tests/QtAutogen/mocInclude/subC/SubObjC.hpp16
-rw-r--r--Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp20
-rw-r--r--Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp18
-rw-r--r--Tests/QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp12
-rw-r--r--Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp41
-rw-r--r--Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp17
-rw-r--r--Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp15
-rw-r--r--Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt23
-rw-r--r--Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp12
-rw-r--r--Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp12
-rw-r--r--Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp14
-rw-r--r--Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp22
-rw-r--r--Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp14
-rw-r--r--Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp14
-rw-r--r--Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp30
-rw-r--r--Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp14
-rw-r--r--Tests/QtAutogen/mocIncludeRelaxed/main.cpp18
-rw-r--r--Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt16
-rw-r--r--Tests/QtAutogen/mocIncludeStrict/main.cpp18
-rw-r--r--Tests/QtAutogen/mocMacroName/MacroAlias.hpp7
-rw-r--r--Tests/QtAutogen/mocMacroName/MacroName.cpp9
-rw-r--r--Tests/QtAutogen/mocMacroName/MacroName.hpp20
-rw-r--r--Tests/QtAutogen/mocMacroName/main.cpp7
-rw-r--r--Tests/QtAutogen/mocOnlySource/StyleA.cpp5
-rw-r--r--Tests/QtAutogen/mocOnlySource/StyleA.hpp15
-rw-r--r--Tests/QtAutogen/mocOnlySource/StyleB.cpp5
-rw-r--r--Tests/QtAutogen/mocOnlySource/StyleB.hpp16
-rw-r--r--Tests/QtAutogen/mocOnlySource/main.cpp9
-rw-r--r--Tests/QtAutogen/objectLibrary/CMakeLists.txt14
-rw-r--r--Tests/QtAutogen/objectLibrary/a/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/objectLibrary/a/classa.cpp7
-rw-r--r--Tests/QtAutogen/objectLibrary/a/classa.h23
-rw-r--r--Tests/QtAutogen/objectLibrary/b/classb.cpp7
-rw-r--r--Tests/QtAutogen/objectLibrary/b/classb.h23
-rw-r--r--Tests/QtAutogen/objectLibrary/main.cpp13
-rw-r--r--Tests/QtAutogen/skipMoc.cpp6
-rw-r--r--Tests/QtAutogen/skipSource/qItemC.cpp12
-rw-r--r--Tests/QtAutogen/skipSource/qItemD.cpp17
-rw-r--r--Tests/QtAutogen/skipSource/qItemD.hpp13
-rw-r--r--Tests/QtAutogen/uicInclude/PageC2.ui24
-rw-r--r--Tests/QtAutogen/uicInclude/dirB/PageB.ui (renamed from Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui)0
-rw-r--r--Tests/QtAutogen/uicInclude/dirB/PageB2.ui24
-rw-r--r--Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui24
-rw-r--r--Tests/QtAutogen/uicInclude/main.cpp10
-rw-r--r--Tests/QtAutogen/uicInclude/subC/PageCsub.ui24
-rw-r--r--Tests/QtAutogenRerun/CMakeLists.txt239
-rw-r--r--Tests/QtAutogenRerun/defines_test/CMakeLists.txt4
-rw-r--r--Tests/QtAutogenRerun/defines_test/defines_test.cpp38
-rw-r--r--Tests/QtAutogenRerun/dummy.cpp5
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt (renamed from Tests/QtAutogen/mocPlugin/CMakeLists.txt)2
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleA.cpp (renamed from Tests/QtAutogen/mocPlugin/StyleA.cpp)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleA.hpp (renamed from Tests/QtAutogen/mocPlugin/StyleA.hpp)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleA.json (renamed from Tests/QtAutogen/mocPlugin/StyleA.json)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleA_Custom.json (renamed from Tests/QtAutogen/mocPlugin/StyleA_Custom.json)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleB.cpp (renamed from Tests/QtAutogen/mocPlugin/StyleB.cpp)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleB.hpp (renamed from Tests/QtAutogen/mocPlugin/StyleB.hpp)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleC.cpp (renamed from Tests/QtAutogen/mocPlugin/StyleC.cpp)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleC.hpp (renamed from Tests/QtAutogen/mocPlugin/StyleC.hpp)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleCommon.hpp (renamed from Tests/QtAutogen/mocPlugin/StyleCommon.hpp)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleD.cpp (renamed from Tests/QtAutogen/mocPlugin/StyleD.cpp)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleD.hpp (renamed from Tests/QtAutogen/mocPlugin/StyleD.hpp)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleE.cpp (renamed from Tests/QtAutogen/mocPlugin/StyleE.cpp)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleE.hpp (renamed from Tests/QtAutogen/mocPlugin/StyleE.hpp)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json (renamed from Tests/QtAutogen/mocPlugin/jsonIn/StyleB.json)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB_Custom.json (renamed from Tests/QtAutogen/mocPlugin/jsonIn/StyleB_Custom.json)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleC.json (renamed from Tests/QtAutogen/mocPlugin/jsonIn/StyleC.json)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleD.json (renamed from Tests/QtAutogen/mocPlugin/jsonIn/StyleD.json)0
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/main.cpp (renamed from Tests/QtAutogen/mocPlugin/main.cpp)0
-rw-r--r--Tests/QtAutogenRerun/mocRerun/CMakeLists.txt (renamed from Tests/QtAutogen/mocRerun/CMakeLists.txt)4
-rw-r--r--Tests/QtAutogenRerun/mocRerun/input.txt (renamed from Tests/QtAutogen/mocRerun/input.txt)0
-rw-r--r--Tests/QtAutogenRerun/mocRerun/main.cpp.in (renamed from Tests/QtAutogen/mocRerun/main.cpp.in)0
-rw-r--r--Tests/QtAutogenRerun/mocRerun/res1.qrc (renamed from Tests/QtAutogen/mocRerun/res1.qrc)0
-rw-r--r--Tests/QtAutogenRerun/mocRerun/test1a.h.in (renamed from Tests/QtAutogen/mocRerun/test1a.h.in)0
-rw-r--r--Tests/QtAutogenRerun/mocRerun/test1b.h.in (renamed from Tests/QtAutogen/mocRerun/test1b.h.in)0
-rw-r--r--Tests/QtAutogenRerun/rccDepends/CMakeLists.txt (renamed from Tests/QtAutogen/rccDepends/CMakeLists.txt)4
-rw-r--r--Tests/QtAutogenRerun/rccDepends/main.cpp (renamed from Tests/QtAutogen/rccDepends/main.cpp)0
-rw-r--r--Tests/QtAutogenRerun/rccDepends/res/input1.txt.in (renamed from Tests/QtAutogen/rccDepends/res/input1.txt.in)0
-rw-r--r--Tests/QtAutogenRerun/rccDepends/res/input2.txt.in (renamed from Tests/QtAutogen/rccDepends/res/input2.txt.in)0
-rw-r--r--Tests/QtAutogenRerun/rccDepends/res1a.qrc.in (renamed from Tests/QtAutogen/rccDepends/res1a.qrc.in)0
-rw-r--r--Tests/QtAutogenRerun/rccDepends/res1b.qrc.in (renamed from Tests/QtAutogen/rccDepends/res1b.qrc.in)0
-rw-r--r--Tests/QtAutogenRerun/rccDepends/res2a.qrc.in (renamed from Tests/QtAutogen/rccDepends/res2a.qrc.in)0
-rw-r--r--Tests/QtAutogenRerun/rccDepends/res2b.qrc.in (renamed from Tests/QtAutogen/rccDepends/res2b.qrc.in)0
-rw-r--r--Tests/README39
-rw-r--r--Tests/README.rst31
-rw-r--r--Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake2
-rw-r--r--Tests/RunCMake/BuildDepends/C-Exe.cmake2
-rw-r--r--Tests/RunCMake/BuildDepends/Custom-Always.cmake2
-rw-r--r--Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake2
-rw-r--r--Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake2
-rw-r--r--Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake2
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/CMakeLists.txt15
-rw-r--r--Tests/RunCMake/CPack/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/CPack/README.txt5
-rw-r--r--Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake2
-rw-r--r--Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake2
-rw-r--r--Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake2
-rw-r--r--Tests/RunCMake/CSharpCustomCommand/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CSharpCustomCommand/CommandWithOutput-check.cmake21
-rw-r--r--Tests/RunCMake/CSharpCustomCommand/CommandWithOutput.cmake13
-rw-r--r--Tests/RunCMake/CSharpCustomCommand/RunCMakeTest.cmake34
-rw-r--r--Tests/RunCMake/CSharpCustomCommand/dummy.cs0
-rw-r--r--Tests/RunCMake/CSharpCustomCommand/test.cs.in8
-rw-r--r--Tests/RunCMake/CommandLine/E_md5sum-dir-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_md5sum-dir-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_md5sum-mixed-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_md5sum-mixed-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_md5sum-mixed-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_md5sum-no-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_md5sum-no-file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_md5sum-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_md5sum-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha1sum-dir-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha1sum-dir-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha1sum-no-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha1sum-no-file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha1sum-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha1sum-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha224sum-dir-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha224sum-dir-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha224sum-no-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha224sum-no-file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha224sum-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha224sum-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha256sum-dir-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha256sum-dir-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha256sum-no-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha256sum-no-file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha256sum-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha256sum-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha384sum-dir-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha384sum-dir-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha384sum-no-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha384sum-no-file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha384sum-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha384sum-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha512sum-dir-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha512sum-dir-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha512sum-no-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha512sum-no-file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha512sum-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_sha512sum-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake24
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA-launch.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA.cmake4
-rw-r--r--Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake15
-rw-r--r--Tests/RunCMake/CompilerLauncher/main.cu4
-rw-r--r--Tests/RunCMake/ExternalProject/NoOptions-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalProject/SourceEmpty-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalProject/SourceMissing-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Generate/CMP0070-NEW-check.cmake13
-rw-r--r--Tests/RunCMake/File_Generate/CMP0070-NEW.cmake2
-rw-r--r--Tests/RunCMake/File_Generate/CMP0070-OLD-check.cmake13
-rw-r--r--Tests/RunCMake/File_Generate/CMP0070-OLD.cmake3
-rw-r--r--Tests/RunCMake/File_Generate/CMP0070-WARN-check.cmake13
-rw-r--r--Tests/RunCMake/File_Generate/CMP0070-WARN-stderr.txt27
-rw-r--r--Tests/RunCMake/File_Generate/CMP0070-WARN.cmake2
-rw-r--r--Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake2
-rw-r--r--Tests/RunCMake/File_Generate/ReRunCMake.cmake2
-rw-r--r--Tests/RunCMake/File_Generate/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/File_Generate/WriteIfDifferent.cmake2
-rw-r--r--Tests/RunCMake/File_Generate/relative-input-NEW.txt1
-rw-r--r--Tests/RunCMake/Framework/FrameworkLayout.cmake2
-rw-r--r--Tests/RunCMake/GenerateExportHeader/GEH.cmake7
-rw-r--r--Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command-stderr.txt4
-rw-r--r--Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target-stderr.txt4
-rw-r--r--Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable-stderr.txt4
-rw-r--r--Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library-stderr.txt4
-rw-r--r--Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test-stderr.txt4
-rw-r--r--Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install-stderr.txt4
-rw-r--r--Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources-stderr.txt4
-rw-r--r--Tests/RunCMake/GoogleTest/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-test-stdout.txt25
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest.cmake15
-rw-r--r--Tests/RunCMake/GoogleTest/RunCMakeTest.cmake26
-rw-r--r--Tests/RunCMake/GoogleTest/fake_gtest.cpp41
-rw-r--r--Tests/RunCMake/Syntax/.gitattributes4
-rw-r--r--Tests/RunCMake/Syntax/BracketCRLF.cmake16
-rw-r--r--Tests/RunCMake/Syntax/StringCRLF.cmake12
-rw-r--r--Tests/RunCMake/TargetObjects/NoTarget.cmake4
-rw-r--r--Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake31
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake26
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpReferenceProps-check.cmake49
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpReferenceProps.cmake19
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CMakeLists.txt.in5
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in2
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CTestConfigCTestScript-check.cmake36
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CTestConfigCTestScript-stdout.txt7
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariable-check.cmake36
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariable-stdout.txt7
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-check.cmake34
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-result.txt1
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stdout.txt6
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-result.txt1
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-stdout.txt6
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-result.txt1
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-stdout.txt6
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-result.txt1
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-stdout.txt7
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-result.txt1
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-stdout.txt6
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/MyExperimentalFeature/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/MyExperimentalFeature/experimental.c16
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/MyProductionCode/CMakeLists.txt12
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/MyProductionCode/production.c16
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/CMakeLists.txt10
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/thirdparty.c14
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/RunCMakeTest.cmake185
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/test.cmake.in21
-rw-r--r--Tests/RunCMake/execute_process/ExitValues-stdout.txt14
-rw-r--r--Tests/RunCMake/execute_process/ExitValues.cmake120
-rw-r--r--Tests/RunCMake/execute_process/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/exit_code.c30
-rw-r--r--Tests/RunCMake/include_guard/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/include_guard/DirectoryScope.cmake19
-rw-r--r--Tests/RunCMake/include_guard/GlobalScope.cmake11
-rw-r--r--Tests/RunCMake/include_guard/InvalidArgumentsNumber-result.txt1
-rw-r--r--Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt5
-rw-r--r--Tests/RunCMake/include_guard/InvalidArgumentsNumber.cmake1
-rw-r--r--Tests/RunCMake/include_guard/InvalidScope-result.txt1
-rw-r--r--Tests/RunCMake/include_guard/InvalidScope-stderr.txt4
-rw-r--r--Tests/RunCMake/include_guard/InvalidScope.cmake1
-rw-r--r--Tests/RunCMake/include_guard/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/include_guard/Scripts/DirScript.cmake12
-rw-r--r--Tests/RunCMake/include_guard/Scripts/GlobScript.cmake12
-rw-r--r--Tests/RunCMake/include_guard/Scripts/VarScript.cmake12
-rw-r--r--Tests/RunCMake/include_guard/VariableScope.cmake24
-rw-r--r--Tests/RunCMake/include_guard/global_script_dir/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/include_guard/sub_dir_script1/CMakeLists.txt9
-rw-r--r--Tests/RunCMake/include_guard/sub_dir_script1/sub_dir_script3/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/include_guard/sub_dir_script2/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/string/Prepend.cmake58
-rw-r--r--Tests/RunCMake/string/PrependNoArgs-result.txt1
-rw-r--r--Tests/RunCMake/string/PrependNoArgs-stderr.txt4
-rw-r--r--Tests/RunCMake/string/PrependNoArgs.cmake1
-rw-r--r--Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt12
-rw-r--r--Tests/RunCMake/string/RegexMultiMatchClear.cmake20
-rw-r--r--Tests/RunCMake/string/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/test_include_dirs/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/test_include_dirs/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/test_include_dirs/TID-test-stdout.txt17
-rw-r--r--Tests/RunCMake/test_include_dirs/TID.cmake29
-rw-r--r--Tests/RunCMake/test_include_dirs/add-tests.cmake8
-rw-r--r--Tests/RunCMake/test_include_dirs/dummy.cpp4
-rw-r--r--Tests/Server/CMakeLists.txt1
-rw-r--r--Tests/Server/cmakelib.py39
-rw-r--r--Tests/Server/server-test.py26
-rw-r--r--Tests/Server/tc_cache.json24
-rw-r--r--Tests/Server/tc_handshake.json4
-rwxr-xr-xTests/SimpleInstall/scripts/sample_script.bat2
-rwxr-xr-xTests/SimpleInstallS2/scripts/sample_script.bat2
-rw-r--r--Tests/XCTest/CMakeLists.txt2
-rw-r--r--Utilities/Doxygen/CMakeLists.txt2
-rw-r--r--Utilities/IWYU/mapping.imp21
-rw-r--r--Utilities/Release/linux64_release.cmake1
-rw-r--r--Utilities/Release/osx_release.cmake1
-rw-r--r--Utilities/Release/win32_release.cmake1
-rw-r--r--Utilities/Release/win64_release.cmake1
-rw-r--r--Utilities/Scripts/BoostScanDeps.cmake39
-rwxr-xr-xUtilities/Scripts/clang-format.bash2
-rwxr-xr-xUtilities/Scripts/regenerate-lexers.bash33
-rwxr-xr-xUtilities/Scripts/update-jsoncpp.bash33
-rwxr-xr-xUtilities/Scripts/update-libarchive.bash2
-rw-r--r--Utilities/Sphinx/CMakeLists.txt2
-rw-r--r--Utilities/cmbzip2/dlltest.dsp93
-rw-r--r--Utilities/cmbzip2/libbz2.dsp130
-rw-r--r--Utilities/cmjsoncpp/CMakeLists.txt2
-rw-r--r--Utilities/cmjsoncpp/LICENSE8
-rw-r--r--Utilities/cmjsoncpp/include/json/allocator.h102
-rw-r--r--Utilities/cmjsoncpp/include/json/assertions.h41
-rw-r--r--Utilities/cmjsoncpp/include/json/config.h136
-rw-r--r--Utilities/cmjsoncpp/include/json/features.h10
-rw-r--r--Utilities/cmjsoncpp/include/json/forwards.h8
-rw-r--r--Utilities/cmjsoncpp/include/json/json.h2
-rw-r--r--Utilities/cmjsoncpp/include/json/reader.h181
-rw-r--r--Utilities/cmjsoncpp/include/json/value.h723
-rw-r--r--Utilities/cmjsoncpp/include/json/version.h16
-rw-r--r--Utilities/cmjsoncpp/include/json/writer.h205
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_batchallocator.h121
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl360
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl473
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_reader.cpp1434
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_tool.h44
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_value.cpp892
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl138
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_writer.cpp823
-rw-r--r--Utilities/cmlibarchive/CMakeLists.txt409
-rw-r--r--Utilities/cmlibarchive/build/cmake/config.h.in92
-rw-r--r--Utilities/cmlibarchive/build/version2
-rw-r--r--Utilities/cmlibarchive/libarchive/CMakeLists.txt15
-rw-r--r--Utilities/cmlibarchive/libarchive/archive.h4
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_check_magic.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_disk_acl_darwin.c559
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_disk_acl_freebsd.c700
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_disk_acl_linux.c743
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_disk_acl_sunos.c821
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry.32
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry.c31
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry.h2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry_acl.310
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry_paths.312
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry_perms.34
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry_sparse.c4
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_getdate.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_openssl_hmac_private.h2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_pack_dev.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_platform.h26
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_platform_acl.h49
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_platform_xattr.h41
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_random.c3
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read.c3
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_disk.372
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_disk_entry_from_file.c1285
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_disk_private.h9
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_format.36
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_open.34
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_filter_lz4.c6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_cab.c156
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_cpio.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c5
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_lha.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_mtree.c180
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c18
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_warc.c9
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c39
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_string.c3
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_string_sprintf.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_util.c88
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_version_details.c133
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_by_name.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_lz4.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_program.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_data.324
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_disk.3185
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_disk_acl.c654
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c296
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_disk_private.h6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_finish_entry.35
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_format.31
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_by_name.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_filter_by_ext.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c17
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_warc.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/config_freebsd.h351
-rw-r--r--Utilities/cmlibarchive/libarchive/libarchive_changes.31
-rw-r--r--Utilities/cmlibarchive/libarchive/mtree.52
-rw-r--r--Utilities/cmlibarchive/libarchive/xxhash.c12
-rwxr-xr-xbootstrap241
1186 files changed, 25848 insertions, 13850 deletions
diff --git a/.clang-tidy b/.clang-tidy
index a9d121a..0f14f6b 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,5 +1,6 @@
---
Checks: "-*,\
+google-readability-casting,\
misc-*,\
-misc-incorrect-roundings,\
-misc-macro-parentheses,\
@@ -24,7 +25,4 @@ readability-*,\
-readability-simplify-boolean-expr,\
"
HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
-CheckOptions:
- - key: modernize-use-nullptr.NullMacros
- value: 'CM_NULLPTR'
...
diff --git a/.gitattributes b/.gitattributes
index 3829160..fd878ac 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -8,20 +8,19 @@
# Do not perform whitespace checks. Do not format.
[attr]generated whitespace=-tab-in-indent,-indent-with-non-tab -format.clang-format
-bootstrap crlf=input
-configure crlf=input
-*.[1-9] crlf=input
-*.sh crlf=input
-*.sh.in crlf=input
+bootstrap eol=lf
+configure eol=lf
+*.[1-9] eol=lf
+*.sh eol=lf
+*.sh.in eol=lf
-*.bat -crlf
-*.bat.in -crlf
-*.dsp -crlf
-*.dsw -crlf
-*.pfx -crlf
-*.png -crlf
-*.sln -crlf
-*.vcproj -crlf
+*.bat eol=crlf
+*.bat.in eol=crlf
+*.sln eol=crlf
+*.vcproj eol=crlf
+
+*.pfx -text
+*.png -text
*.c our-c-style
*.cc our-c-style
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..d934bf9
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,7 @@
+Thanks for your interest in contributing to CMake! The GitHub repository
+is a mirror provided for convenience, but CMake does not use GitHub pull
+requests for contribution. Please see
+
+ https://gitlab.kitware.com/cmake/cmake/tree/master/CONTRIBUTING.rst
+
+for contribution instructions. GitHub OAuth may be used to sign in.
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim
index a191c18..b06fa42 100644
--- a/Auxiliary/vim/syntax/cmake.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -31,12 +31,11 @@ syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cma
syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeArguments,cmakeTodo
syn case match
-
syn keyword cmakeProperty contained
- \ ABSTRACT ADDITIONAL_MAKE_CLEAN_FILES ADVANCED ALIASED_TARGET ALLOW_DUPLICATE_CUSTOM_TARGETS ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_API ANDROID_API_MIN ANDROID_ARCH ANDROID_ASSETS_DIRECTORIES ANDROID_GUI ANDROID_JAR_DEPENDENCIES ANDROID_JAR_DIRECTORIES ANDROID_JAVA_SOURCE_DIR ANDROID_NATIVE_LIB_DEPENDENCIES ANDROID_NATIVE_LIB_DIRECTORIES ANDROID_PROCESS_MAX ANDROID_PROGUARD ANDROID_PROGUARD_CONFIG_PATH ANDROID_SECURE_PROPS_PATH ANDROID_SKIP_ANT_STEP ANDROID_STL_TYPE ARCHIVE_OUTPUT_DIRECTORY ARCHIVE_OUTPUT_DIRECTORY_DEBUG ARCHIVE_OUTPUT_DIRECTORY_RELEASE ARCHIVE_OUTPUT_NAME ARCHIVE_OUTPUT_NAME_DEBUG ARCHIVE_OUTPUT_NAME_RELEASE ATTACHED_FILES ATTACHED_FILES_ON_FAIL AUTOGEN_TARGETS_FOLDER AUTOGEN_TARGET_DEPENDS AUTOMOC AUTOMOC_MOC_OPTIONS AUTOMOC_TARGETS_FOLDER AUTORCC AUTORCC_OPTIONS AUTOUIC AUTOUIC_OPTIONS BINARY_DIR BUILD_WITH_INSTALL_RPATH BUNDLE BUNDLE_EXTENSION CACHE_VARIABLES CLEAN_NO_CUSTOM CMAKE_CONFIGURE_DEPENDS CMAKE_CXX_KNOWN_FEATURES CMAKE_C_KNOWN_FEATURES COMPATIBLE_INTERFACE_BOOL COMPATIBLE_INTERFACE_NUMBER_MAX COMPATIBLE_INTERFACE_NUMBER_MIN COMPATIBLE_INTERFACE_STRING COMPILE_DEFINITIONS COMPILE_DEFINITIONS_DEBUG COMPILE_DEFINITIONS_RELEASE COMPILE_FEATURES COMPILE_FLAGS COMPILE_OPTIONS COMPILE_PDB_NAME COMPILE_PDB_NAME_DEBUG COMPILE_PDB_NAME_RELEASE COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_DEBUG COMPILE_PDB_OUTPUT_DIRECTORY_RELEASE COST CPACK_DESKTOP_SHORTCUTS CPACK_NEVER_OVERWRITE CPACK_PERMANENT CPACK_STARTUP_SHORTCUTS CPACK_START_MENU_SHORTCUTS CPACK_WIX_ACL CROSSCOMPILING_EMULATOR CXX_EXTENSIONS CXX_STANDARD CXX_STANDARD_REQUIRED C_EXTENSIONS C_STANDARD C_STANDARD_REQUIRED DEBUG_CONFIGURATIONS DEBUG_POSTFIX DEFINE_SYMBOL DEFINITIONS DEPENDS DISABLED_FEATURES ECLIPSE_EXTRA_NATURES ENABLED_FEATURES ENABLED_LANGUAGES ENABLE_EXPORTS ENVIRONMENT EXCLUDE_FROM_ALL EXCLUDE_FROM_DEFAULT_BUILD EXCLUDE_FROM_DEFAULT_BUILD_DEBUG EXCLUDE_FROM_DEFAULT_BUILD_RELEASE EXPORT_NAME EXTERNAL_OBJECT EchoString FAIL_REGULAR_EXPRESSION FIND_LIBRARY_USE_LIB64_PATHS FIND_LIBRARY_USE_OPENBSD_VERSIONING FOLDER FRAMEWORK FRAMEWORK_VERSION Fortran_FORMAT Fortran_MODULE_DIRECTORY GENERATED GENERATOR_FILE_NAME GLOBAL_DEPENDS_DEBUG_MODE GLOBAL_DEPENDS_NO_CYCLES GNUtoMS HAS_CXX HEADER_FILE_ONLY HELPSTRING IMPLICIT_DEPENDS_INCLUDE_TRANSFORM IMPORTED IMPORTED_CONFIGURATIONS IMPORTED_IMPLIB IMPORTED_IMPLIB_DEBUG IMPORTED_IMPLIB_RELEASE IMPORTED_LINK_DEPENDENT_LIBRARIES IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBUG IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE IMPORTED_LINK_INTERFACE_LANGUAGES IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE IMPORTED_LINK_INTERFACE_LIBRARIES IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE IMPORTED_LINK_INTERFACE_MULTIPLICITY IMPORTED_LINK_INTERFACE_MULTIPLICITY_DEBUG IMPORTED_LINK_INTERFACE_MULTIPLICITY_RELEASE IMPORTED_LOCATION IMPORTED_LOCATION_DEBUG IMPORTED_LOCATION_RELEASE IMPORTED_NO_SONAME IMPORTED_NO_SONAME_DEBUG IMPORTED_NO_SONAME_RELEASE IMPORTED_SONAME IMPORTED_SONAME_DEBUG IMPORTED_SONAME_RELEASE IMPORT_PREFIX IMPORT_SUFFIX INCLUDE_DIRECTORIES INCLUDE_REGULAR_EXPRESSION INSTALL_NAME_DIR INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH INTERFACE_AUTOUIC_OPTIONS INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES INTERFACE_COMPILE_OPTIONS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_LINK_LIBRARIES INTERFACE_POSITION_INDEPENDENT_CODE INTERFACE_SOURCES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES INTERPROCEDURAL_OPTIMIZATION INTERPROCEDURAL_OPTIMIZATION_DEBUG INTERPROCEDURAL_OPTIMIZATION_RELEASE IN_TRY_COMPILE JOB_POOLS JOB_POOL_COMPILE JOB_POOL_LINK KEEP_EXTENSION LABELS LANGUAGE LIBRARY_OUTPUT_DIRECTORY LIBRARY_OUTPUT_DIRECTORY_DEBUG LIBRARY_OUTPUT_DIRECTORY_RELEASE LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME_DEBUG LIBRARY_OUTPUT_NAME_RELEASE LINKER_LANGUAGE LINK_DEPENDS LINK_DEPENDS_NO_SHARED LINK_DIRECTORIES LINK_FLAGS LINK_FLAGS_DEBUG LINK_FLAGS_RELEASE LINK_INTERFACE_LIBRARIES LINK_INTERFACE_LIBRARIES_DEBUG LINK_INTERFACE_LIBRARIES_RELEASE LINK_INTERFACE_MULTIPLICITY LINK_INTERFACE_MULTIPLICITY_DEBUG LINK_INTERFACE_MULTIPLICITY_RELEASE LINK_LIBRARIES LINK_SEARCH_END_STATIC LINK_SEARCH_START_STATIC LISTFILE_STACK LOCATION LOCATION_DEBUG LOCATION_RELEASE MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_PACKAGE_LOCATION MACOSX_RPATH MACROS MAP_IMPORTED_CONFIG_DEBUG MAP_IMPORTED_CONFIG_RELEASE MEASUREMENT MODIFIED NAME NO_SONAME NO_SYSTEM_FROM_IMPORTED OBJECT_DEPENDS OBJECT_OUTPUTS OSX_ARCHITECTURES OSX_ARCHITECTURES_DEBUG OSX_ARCHITECTURES_RELEASE OUTPUT_NAME OUTPUT_NAME_DEBUG OUTPUT_NAME_RELEASE PACKAGES_FOUND PACKAGES_NOT_FOUND PARENT_DIRECTORY PASS_REGULAR_EXPRESSION PDB_NAME PDB_NAME_DEBUG PDB_NAME_RELEASE PDB_OUTPUT_DIRECTORY PDB_OUTPUT_DIRECTORY_DEBUG PDB_OUTPUT_DIRECTORY_RELEASE POSITION_INDEPENDENT_CODE POST_INSTALL_SCRIPT PREDEFINED_TARGETS_FOLDER PREFIX PRE_INSTALL_SCRIPT PRIVATE_HEADER PROCESSORS PROJECT_LABEL PUBLIC_HEADER REPORT_UNDEFINED_PROPERTIES REQUIRED_FILES RESOURCE RESOURCE_LOCK RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK RULE_MESSAGES RUNTIME_OUTPUT_DIRECTORY RUNTIME_OUTPUT_DIRECTORY_DEBUG RUNTIME_OUTPUT_DIRECTORY_RELEASE RUNTIME_OUTPUT_NAME RUNTIME_OUTPUT_NAME_DEBUG RUNTIME_OUTPUT_NAME_RELEASE RUN_SERIAL SKIP_BUILD_RPATH SKIP_RETURN_CODE SOURCES SOURCE_DIR SOVERSION STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_DEBUG STATIC_LIBRARY_FLAGS_RELEASE STRINGS SUFFIX SYMBOLIC TARGET_ARCHIVES_MAY_BE_SHARED_LIBS TARGET_MESSAGES TARGET_SUPPORTS_SHARED_LIBS TEST_INCLUDE_FILE TIMEOUT TYPE USE_FOLDERS VALUE VARIABLES VERSION VISIBILITY_INLINES_HIDDEN VS_DEPLOYMENT_CONTENT VS_DEPLOYMENT_LOCATION VS_DESKTOP_EXTENSIONS_VERSION VS_DOTNET_REFERENCES VS_DOTNET_TARGET_FRAMEWORK_VERSION VS_GLOBAL_KEYWORD VS_GLOBAL_PROJECT_TYPES VS_GLOBAL_ROOTNAMESPACE VS_IOT_EXTENSIONS_VERSION VS_IOT_STARTUP_TASK VS_KEYWORD VS_MOBILE_EXTENSIONS_VERSION VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME VS_SCC_PROVIDER VS_SHADER_ENTRYPOINT VS_SHADER_FLAGS VS_SHADER_MODEL VS_SHADER_TYPE VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES VS_XAML_TYPE WILL_FAIL WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS WORKING_DIRECTORY WRAP_EXCLUDE XCODE_EXPLICIT_FILE_TYPE XCODE_LAST_KNOWN_FILE_TYPE XCTEST
+ \ ABSTRACT ADDITIONAL_MAKE_CLEAN_FILES ADVANCED ALIASED_TARGET ALLOW_DUPLICATE_CUSTOM_TARGETS ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_API ANDROID_API_MIN ANDROID_ARCH ANDROID_ASSETS_DIRECTORIES ANDROID_GUI ANDROID_JAR_DEPENDENCIES ANDROID_JAR_DIRECTORIES ANDROID_JAVA_SOURCE_DIR ANDROID_NATIVE_LIB_DEPENDENCIES ANDROID_NATIVE_LIB_DIRECTORIES ANDROID_PROCESS_MAX ANDROID_PROGUARD ANDROID_PROGUARD_CONFIG_PATH ANDROID_SECURE_PROPS_PATH ANDROID_SKIP_ANT_STEP ANDROID_STL_TYPE ARCHIVE_OUTPUT_DIRECTORY ARCHIVE_OUTPUT_DIRECTORY_DEBUG ARCHIVE_OUTPUT_DIRECTORY_RELEASE ARCHIVE_OUTPUT_NAME ARCHIVE_OUTPUT_NAME_DEBUG ARCHIVE_OUTPUT_NAME_RELEASE ATTACHED_FILES ATTACHED_FILES_ON_FAIL AUTOGEN_TARGETS_FOLDER AUTOGEN_TARGET_DEPENDS AUTOMOC AUTOMOC_MOC_OPTIONS AUTOMOC_TARGETS_FOLDER AUTORCC AUTORCC_OPTIONS AUTOUIC AUTOUIC_OPTIONS BINARY_DIR BUILD_WITH_INSTALL_RPATH BUNDLE BUNDLE_EXTENSION CACHE_VARIABLES CLEAN_NO_CUSTOM CMAKE_CONFIGURE_DEPENDS CMAKE_CXX_KNOWN_FEATURES CMAKE_C_KNOWN_FEATURES CMAKE_DIRECTORY_LABELS COMPATIBLE_INTERFACE_BOOL COMPATIBLE_INTERFACE_NUMBER_MAX COMPATIBLE_INTERFACE_NUMBER_MIN COMPATIBLE_INTERFACE_STRING COMPILE_DEFINITIONS COMPILE_DEFINITIONS_DEBUG COMPILE_DEFINITIONS_RELEASE COMPILE_FEATURES COMPILE_FLAGS COMPILE_OPTIONS COMPILE_PDB_NAME COMPILE_PDB_NAME_DEBUG COMPILE_PDB_NAME_RELEASE COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_DEBUG COMPILE_PDB_OUTPUT_DIRECTORY_RELEASE COST CPACK_DESKTOP_SHORTCUTS CPACK_NEVER_OVERWRITE CPACK_PERMANENT CPACK_STARTUP_SHORTCUTS CPACK_START_MENU_SHORTCUTS CPACK_WIX_ACL CROSSCOMPILING_EMULATOR CXX_EXTENSIONS CXX_STANDARD CXX_STANDARD_REQUIRED C_EXTENSIONS C_STANDARD C_STANDARD_REQUIRED DEBUG_CONFIGURATIONS DEBUG_POSTFIX DEFINE_SYMBOL DEFINITIONS DEPENDS DISABLED_FEATURES ECLIPSE_EXTRA_NATURES ENABLED_FEATURES ENABLED_LANGUAGES ENABLE_EXPORTS ENVIRONMENT EXCLUDE_FROM_ALL EXCLUDE_FROM_DEFAULT_BUILD EXCLUDE_FROM_DEFAULT_BUILD_DEBUG EXCLUDE_FROM_DEFAULT_BUILD_RELEASE EXPORT_NAME EXTERNAL_OBJECT EchoString FAIL_REGULAR_EXPRESSION FIND_LIBRARY_USE_LIB64_PATHS FIND_LIBRARY_USE_OPENBSD_VERSIONING FOLDER FRAMEWORK FRAMEWORK_VERSION Fortran_FORMAT Fortran_MODULE_DIRECTORY GENERATED GENERATOR_FILE_NAME GLOBAL_DEPENDS_DEBUG_MODE GLOBAL_DEPENDS_NO_CYCLES GNUtoMS HAS_CXX HEADER_FILE_ONLY HELPSTRING IMPLICIT_DEPENDS_INCLUDE_TRANSFORM IMPORTED IMPORTED_CONFIGURATIONS IMPORTED_IMPLIB IMPORTED_IMPLIB_DEBUG IMPORTED_IMPLIB_RELEASE IMPORTED_LINK_DEPENDENT_LIBRARIES IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBUG IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE IMPORTED_LINK_INTERFACE_LANGUAGES IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE IMPORTED_LINK_INTERFACE_LIBRARIES IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE IMPORTED_LINK_INTERFACE_MULTIPLICITY IMPORTED_LINK_INTERFACE_MULTIPLICITY_DEBUG IMPORTED_LINK_INTERFACE_MULTIPLICITY_RELEASE IMPORTED_LOCATION IMPORTED_LOCATION_DEBUG IMPORTED_LOCATION_RELEASE IMPORTED_NO_SONAME IMPORTED_NO_SONAME_DEBUG IMPORTED_NO_SONAME_RELEASE IMPORTED_SONAME IMPORTED_SONAME_DEBUG IMPORTED_SONAME_RELEASE IMPORT_PREFIX IMPORT_SUFFIX INCLUDE_DIRECTORIES INCLUDE_REGULAR_EXPRESSION INSTALL_NAME_DIR INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH INTERFACE_AUTOUIC_OPTIONS INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES INTERFACE_COMPILE_OPTIONS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_LINK_LIBRARIES INTERFACE_POSITION_INDEPENDENT_CODE INTERFACE_SOURCES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES INTERPROCEDURAL_OPTIMIZATION INTERPROCEDURAL_OPTIMIZATION_DEBUG INTERPROCEDURAL_OPTIMIZATION_RELEASE IN_TRY_COMPILE JOB_POOLS JOB_POOL_COMPILE JOB_POOL_LINK KEEP_EXTENSION LABELS LANGUAGE LIBRARY_OUTPUT_DIRECTORY LIBRARY_OUTPUT_DIRECTORY_DEBUG LIBRARY_OUTPUT_DIRECTORY_RELEASE LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME_DEBUG LIBRARY_OUTPUT_NAME_RELEASE LINKER_LANGUAGE LINK_DEPENDS LINK_DEPENDS_NO_SHARED LINK_DIRECTORIES LINK_FLAGS LINK_FLAGS_DEBUG LINK_FLAGS_RELEASE LINK_INTERFACE_LIBRARIES LINK_INTERFACE_LIBRARIES_DEBUG LINK_INTERFACE_LIBRARIES_RELEASE LINK_INTERFACE_MULTIPLICITY LINK_INTERFACE_MULTIPLICITY_DEBUG LINK_INTERFACE_MULTIPLICITY_RELEASE LINK_LIBRARIES LINK_SEARCH_END_STATIC LINK_SEARCH_START_STATIC LISTFILE_STACK LOCATION LOCATION_DEBUG LOCATION_RELEASE MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_PACKAGE_LOCATION MACOSX_RPATH MACROS MAP_IMPORTED_CONFIG_DEBUG MAP_IMPORTED_CONFIG_RELEASE MEASUREMENT MODIFIED NAME NO_SONAME NO_SYSTEM_FROM_IMPORTED OBJECT_DEPENDS OBJECT_OUTPUTS OSX_ARCHITECTURES OSX_ARCHITECTURES_DEBUG OSX_ARCHITECTURES_RELEASE OUTPUT_NAME OUTPUT_NAME_DEBUG OUTPUT_NAME_RELEASE PACKAGES_FOUND PACKAGES_NOT_FOUND PARENT_DIRECTORY PASS_REGULAR_EXPRESSION PDB_NAME PDB_NAME_DEBUG PDB_NAME_RELEASE PDB_OUTPUT_DIRECTORY PDB_OUTPUT_DIRECTORY_DEBUG PDB_OUTPUT_DIRECTORY_RELEASE POSITION_INDEPENDENT_CODE POST_INSTALL_SCRIPT PREDEFINED_TARGETS_FOLDER PREFIX PRE_INSTALL_SCRIPT PRIVATE_HEADER PROCESSORS PROJECT_LABEL PUBLIC_HEADER REPORT_UNDEFINED_PROPERTIES REQUIRED_FILES RESOURCE RESOURCE_LOCK RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK RULE_MESSAGES RUNTIME_OUTPUT_DIRECTORY RUNTIME_OUTPUT_DIRECTORY_DEBUG RUNTIME_OUTPUT_DIRECTORY_RELEASE RUNTIME_OUTPUT_NAME RUNTIME_OUTPUT_NAME_DEBUG RUNTIME_OUTPUT_NAME_RELEASE RUN_SERIAL SKIP_BUILD_RPATH SKIP_RETURN_CODE SOURCES SOURCE_DIR SOVERSION STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_DEBUG STATIC_LIBRARY_FLAGS_RELEASE STRINGS SUFFIX SYMBOLIC TARGET_ARCHIVES_MAY_BE_SHARED_LIBS TARGET_MESSAGES TARGET_SUPPORTS_SHARED_LIBS TEST_INCLUDE_FILE TIMEOUT TYPE USE_FOLDERS VALUE VARIABLES VERSION VISIBILITY_INLINES_HIDDEN VS_DEPLOYMENT_CONTENT VS_DEPLOYMENT_LOCATION VS_DESKTOP_EXTENSIONS_VERSION VS_DOTNET_REFERENCES VS_DOTNET_TARGET_FRAMEWORK_VERSION VS_GLOBAL_KEYWORD VS_GLOBAL_PROJECT_TYPES VS_GLOBAL_ROOTNAMESPACE VS_IOT_EXTENSIONS_VERSION VS_IOT_STARTUP_TASK VS_KEYWORD VS_MOBILE_EXTENSIONS_VERSION VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME VS_SCC_PROVIDER VS_SHADER_ENTRYPOINT VS_SHADER_FLAGS VS_SHADER_MODEL VS_SHADER_TYPE VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES VS_XAML_TYPE WILL_FAIL WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS WORKING_DIRECTORY WRAP_EXCLUDE XCODE_EXPLICIT_FILE_TYPE XCODE_LAST_KNOWN_FILE_TYPE XCTEST
syn keyword cmakeVariable contained
- \ ANDROID APPLE BORLAND BUILD_SHARED_LIBS CMAKE_ABSOLUTE_DESTINATION_FILES CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS CMAKE_ANDROID_API CMAKE_ANDROID_API_MIN CMAKE_ANDROID_ARCH CMAKE_ANDROID_ARCH_ABI CMAKE_ANDROID_ARM_MODE CMAKE_ANDROID_ARM_NEON CMAKE_ANDROID_ASSETS_DIRECTORIES CMAKE_ANDROID_GUI CMAKE_ANDROID_JAR_DEPENDENCIES CMAKE_ANDROID_JAR_DIRECTORIES CMAKE_ANDROID_JAVA_SOURCE_DIR CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES CMAKE_ANDROID_NDK CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION CMAKE_ANDROID_PROCESS_MAX CMAKE_ANDROID_PROGUARD CMAKE_ANDROID_PROGUARD_CONFIG_PATH CMAKE_ANDROID_SECURE_PROPS_PATH CMAKE_ANDROID_SKIP_ANT_STEP CMAKE_ANDROID_STANDALONE_TOOLCHAIN CMAKE_ANDROID_STL_TYPE CMAKE_APPBUNDLE_PATH CMAKE_AR CMAKE_ARCHIVE_OUTPUT_DIRECTORY CMAKE_ARGC CMAKE_ARGV0 CMAKE_AUTOMOC CMAKE_AUTOMOC_DEPEND_FILTERS CMAKE_AUTOMOC_MOC_OPTIONS CMAKE_AUTOMOC_RELAXED_MODE CMAKE_AUTORCC CMAKE_AUTORCC_OPTIONS CMAKE_AUTOUIC CMAKE_AUTOUIC_OPTIONS CMAKE_AUTOUIC_SEARCH_PATHS CMAKE_BACKWARDS_COMPATIBILITY CMAKE_BINARY_DIR CMAKE_BUILD_RPATH CMAKE_BUILD_TOOL CMAKE_BUILD_TYPE CMAKE_BUILD_WITH_INSTALL_NAME_DIR CMAKE_BUILD_WITH_INSTALL_RPATH CMAKE_CACHEFILE_DIR CMAKE_CACHE_MAJOR_VERSION CMAKE_CACHE_MINOR_VERSION CMAKE_CACHE_PATCH_VERSION CMAKE_CFG_INTDIR CMAKE_CL_64 CMAKE_CODELITE_USE_TARGETS CMAKE_COLOR_MAKEFILE CMAKE_COMMAND CMAKE_COMPILER_2005 CMAKE_COMPILER_IS_GNUCC CMAKE_COMPILER_IS_GNUCXX CMAKE_COMPILER_IS_GNUG77 CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY CMAKE_CONFIGURATION_TYPES CMAKE_CROSSCOMPILING CMAKE_CROSSCOMPILING_EMULATOR CMAKE_CTEST_COMMAND CMAKE_CUDA_EXTENSIONS CMAKE_CUDA_STANDARD CMAKE_CUDA_STANDARD_REQUIRED CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES CMAKE_CURRENT_BINARY_DIR CMAKE_CURRENT_LIST_DIR CMAKE_CURRENT_LIST_FILE CMAKE_CURRENT_LIST_LINE CMAKE_CURRENT_SOURCE_DIR CMAKE_CXX_COMPILE_FEATURES CMAKE_CXX_EXTENSIONS CMAKE_CXX_STANDARD CMAKE_CXX_STANDARD_REQUIRED CMAKE_C_COMPILE_FEATURES CMAKE_C_EXTENSIONS CMAKE_C_STANDARD CMAKE_C_STANDARD_REQUIRED CMAKE_DEBUG_POSTFIX CMAKE_DEBUG_TARGET_PROPERTIES CMAKE_DEPENDS_IN_PROJECT_ONLY CMAKE_DL_LIBS CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT CMAKE_ECLIPSE_MAKE_ARGUMENTS CMAKE_ECLIPSE_VERSION CMAKE_EDIT_COMMAND CMAKE_ENABLE_EXPORTS CMAKE_ERROR_DEPRECATED CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION CMAKE_EXECUTABLE_SUFFIX CMAKE_EXE_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS_INIT CMAKE_EXPORT_COMPILE_COMMANDS CMAKE_EXPORT_NO_PACKAGE_REGISTRY CMAKE_EXTRA_GENERATOR CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES CMAKE_FIND_APPBUNDLE CMAKE_FIND_FRAMEWORK CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX CMAKE_FIND_LIBRARY_PREFIXES CMAKE_FIND_LIBRARY_SUFFIXES CMAKE_FIND_NO_INSTALL_PREFIX CMAKE_FIND_PACKAGE_NAME CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY CMAKE_FIND_PACKAGE_SORT_DIRECTION CMAKE_FIND_PACKAGE_SORT_ORDER CMAKE_FIND_PACKAGE_WARN_NO_MODULE CMAKE_FIND_ROOT_PATH CMAKE_FIND_ROOT_PATH_MODE_INCLUDE CMAKE_FIND_ROOT_PATH_MODE_LIBRARY CMAKE_FIND_ROOT_PATH_MODE_PACKAGE CMAKE_FIND_ROOT_PATH_MODE_PROGRAM CMAKE_FRAMEWORK_PATH CMAKE_Fortran_FORMAT CMAKE_Fortran_MODDIR_DEFAULT CMAKE_Fortran_MODDIR_FLAG CMAKE_Fortran_MODOUT_FLAG CMAKE_Fortran_MODULE_DIRECTORY CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET CMAKE_GNUtoMS CMAKE_HOME_DIRECTORY CMAKE_HOST_APPLE CMAKE_HOST_SOLARIS CMAKE_HOST_SYSTEM CMAKE_HOST_SYSTEM_NAME CMAKE_HOST_SYSTEM_PROCESSOR CMAKE_HOST_SYSTEM_VERSION CMAKE_HOST_UNIX CMAKE_HOST_WIN32 CMAKE_IGNORE_PATH CMAKE_IMPORT_LIBRARY_PREFIX CMAKE_IMPORT_LIBRARY_SUFFIX CMAKE_INCLUDE_CURRENT_DIR CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE CMAKE_INCLUDE_DIRECTORIES_BEFORE CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE CMAKE_INCLUDE_PATH CMAKE_INSTALL_DEFAULT_COMPONENT_NAME CMAKE_INSTALL_MESSAGE CMAKE_INSTALL_NAME_DIR CMAKE_INSTALL_PREFIX CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT CMAKE_INSTALL_RPATH CMAKE_INSTALL_RPATH_USE_LINK_PATH CMAKE_INTERNAL_PLATFORM_ABI CMAKE_INTERPROCEDURAL_OPTIMIZATION CMAKE_IOS_INSTALL_COMBINED CMAKE_JOB_POOL_COMPILE CMAKE_JOB_POOL_LINK CMAKE_LIBRARY_ARCHITECTURE CMAKE_LIBRARY_ARCHITECTURE_REGEX CMAKE_LIBRARY_OUTPUT_DIRECTORY CMAKE_LIBRARY_PATH CMAKE_LIBRARY_PATH_FLAG CMAKE_LINK_DEF_FILE_FLAG CMAKE_LINK_DEPENDS_NO_SHARED CMAKE_LINK_INTERFACE_LIBRARIES CMAKE_LINK_LIBRARY_FILE_FLAG CMAKE_LINK_LIBRARY_FLAG CMAKE_LINK_LIBRARY_SUFFIX CMAKE_LINK_SEARCH_END_STATIC CMAKE_LINK_SEARCH_START_STATIC CMAKE_LINK_WHAT_YOU_USE CMAKE_MACOSX_BUNDLE CMAKE_MACOSX_RPATH CMAKE_MAJOR_VERSION CMAKE_MAKE_PROGRAM CMAKE_MATCH_COUNT CMAKE_MFC_FLAG CMAKE_MINIMUM_REQUIRED_VERSION CMAKE_MINOR_VERSION CMAKE_MODULE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS_INIT CMAKE_MODULE_PATH CMAKE_NINJA_OUTPUT_PATH_PREFIX CMAKE_NOT_USING_CONFIG_FLAGS CMAKE_NO_BUILTIN_CHRPATH CMAKE_NO_SYSTEM_FROM_IMPORTED CMAKE_OBJECT_PATH_MAX CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET CMAKE_OSX_SYSROOT CMAKE_PARENT_LIST_FILE CMAKE_PATCH_VERSION CMAKE_PDB_OUTPUT_DIRECTORY CMAKE_POSITION_INDEPENDENT_CODE CMAKE_PREFIX_PATH CMAKE_PROGRAM_PATH CMAKE_PROJECT_DESCRIPTION CMAKE_PROJECT_NAME CMAKE_RANLIB CMAKE_ROOT CMAKE_RUNTIME_OUTPUT_DIRECTORY CMAKE_SCRIPT_MODE_FILE CMAKE_SHARED_LIBRARY_PREFIX CMAKE_SHARED_LIBRARY_SUFFIX CMAKE_SHARED_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS_INIT CMAKE_SHARED_MODULE_PREFIX CMAKE_SHARED_MODULE_SUFFIX CMAKE_SIZEOF_VOID_P CMAKE_SKIP_BUILD_RPATH CMAKE_SKIP_INSTALL_ALL_DEPENDENCY CMAKE_SKIP_INSTALL_RPATH CMAKE_SKIP_INSTALL_RULES CMAKE_SKIP_RPATH CMAKE_SOURCE_DIR CMAKE_STAGING_PREFIX CMAKE_STATIC_LIBRARY_PREFIX CMAKE_STATIC_LIBRARY_SUFFIX CMAKE_STATIC_LINKER_FLAGS CMAKE_STATIC_LINKER_FLAGS_INIT CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE CMAKE_SYSROOT CMAKE_SYSTEM CMAKE_SYSTEM_APPBUNDLE_PATH CMAKE_SYSTEM_FRAMEWORK_PATH CMAKE_SYSTEM_IGNORE_PATH CMAKE_SYSTEM_INCLUDE_PATH CMAKE_SYSTEM_LIBRARY_PATH CMAKE_SYSTEM_NAME CMAKE_SYSTEM_PREFIX_PATH CMAKE_SYSTEM_PROCESSOR CMAKE_SYSTEM_PROGRAM_PATH CMAKE_SYSTEM_VERSION CMAKE_Swift_LANGUAGE_VERSION CMAKE_TOOLCHAIN_FILE CMAKE_TRY_COMPILE_CONFIGURATION CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_TRY_COMPILE_TARGET_TYPE CMAKE_TWEAK_VERSION CMAKE_USER_MAKE_RULES_OVERRIDE CMAKE_USE_RELATIVE_PATHS CMAKE_VERBOSE_MAKEFILE CMAKE_VERSION CMAKE_VISIBILITY_INLINES_HIDDEN CMAKE_VS_DEVENV_COMMAND CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD CMAKE_VS_INTEL_Fortran_PROJECT_VERSION CMAKE_VS_MSBUILD_COMMAND CMAKE_VS_NsightTegra_VERSION CMAKE_VS_PLATFORM_NAME CMAKE_VS_PLATFORM_TOOLSET CMAKE_VS_PLATFORM_TOOLSET_CUDA CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION CMAKE_WARN_DEPRECATED CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION CMAKE_WIN32_EXECUTABLE CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS CMAKE_XCODE_GENERATE_SCHEME CMAKE_XCODE_PLATFORM_TOOLSET CPACK_ABSOLUTE_DESTINATION_FILES CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION CPACK_INCLUDE_TOPLEVEL_DIRECTORY CPACK_INSTALL_SCRIPT CPACK_PACKAGING_INSTALL_PREFIX CPACK_SET_DESTDIR CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION CTEST_BINARY_DIRECTORY CTEST_BUILD_COMMAND CTEST_BUILD_NAME CTEST_BZR_COMMAND CTEST_BZR_UPDATE_OPTIONS CTEST_CHANGE_ID CTEST_CHECKOUT_COMMAND CTEST_CONFIGURATION_TYPE CTEST_CONFIGURE_COMMAND CTEST_COVERAGE_COMMAND CTEST_COVERAGE_EXTRA_FLAGS CTEST_CURL_OPTIONS CTEST_CUSTOM_COVERAGE_EXCLUDE CTEST_CUSTOM_ERROR_EXCEPTION CTEST_CUSTOM_ERROR_MATCH CTEST_CUSTOM_ERROR_POST_CONTEXT CTEST_CUSTOM_ERROR_PRE_CONTEXT CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE CTEST_CUSTOM_MEMCHECK_IGNORE CTEST_CUSTOM_POST_MEMCHECK CTEST_CUSTOM_POST_TEST CTEST_CUSTOM_PRE_MEMCHECK CTEST_CUSTOM_PRE_TEST CTEST_CUSTOM_TEST_IGNORE CTEST_CUSTOM_WARNING_EXCEPTION CTEST_CUSTOM_WARNING_MATCH CTEST_CVS_CHECKOUT CTEST_CVS_COMMAND CTEST_CVS_UPDATE_OPTIONS CTEST_DROP_LOCATION CTEST_DROP_METHOD CTEST_DROP_SITE CTEST_DROP_SITE_CDASH CTEST_DROP_SITE_PASSWORD CTEST_DROP_SITE_USER CTEST_EXTRA_COVERAGE_GLOB CTEST_GIT_COMMAND CTEST_GIT_INIT_SUBMODULES CTEST_GIT_UPDATE_CUSTOM CTEST_GIT_UPDATE_OPTIONS CTEST_HG_COMMAND CTEST_HG_UPDATE_OPTIONS CTEST_MEMORYCHECK_COMMAND CTEST_MEMORYCHECK_COMMAND_OPTIONS CTEST_MEMORYCHECK_SANITIZER_OPTIONS CTEST_MEMORYCHECK_SUPPRESSIONS_FILE CTEST_MEMORYCHECK_TYPE CTEST_NIGHTLY_START_TIME CTEST_P4_CLIENT CTEST_P4_COMMAND CTEST_P4_OPTIONS CTEST_P4_UPDATE_OPTIONS CTEST_SCP_COMMAND CTEST_SITE CTEST_SOURCE_DIRECTORY CTEST_SVN_COMMAND CTEST_SVN_OPTIONS CTEST_SVN_UPDATE_OPTIONS CTEST_TEST_LOAD CTEST_TEST_TIMEOUT CTEST_TRIGGER_SITE CTEST_UPDATE_COMMAND CTEST_UPDATE_OPTIONS CTEST_UPDATE_VERSION_ONLY CTEST_USE_LAUNCHERS CYGWIN ENV EXECUTABLE_OUTPUT_PATH GHS-MULTI LIBRARY_OUTPUT_PATH MINGW MSVC MSVC10 MSVC11 MSVC12 MSVC14 MSVC60 MSVC70 MSVC71 MSVC80 MSVC90 MSVC_IDE MSVC_VERSION PROJECT_BINARY_DIR PROJECT_DESCRIPTION PROJECT_NAME PROJECT_SOURCE_DIR PROJECT_VERSION PROJECT_VERSION_MAJOR PROJECT_VERSION_MINOR PROJECT_VERSION_PATCH PROJECT_VERSION_TWEAK UNIX WIN32 WINCE WINDOWS_PHONE WINDOWS_STORE XCODE XCODE_VERSION
+ \ ANDROID APPLE BORLAND BUILD_SHARED_LIBS CMAKE_ABSOLUTE_DESTINATION_FILES CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS CMAKE_ANDROID_API CMAKE_ANDROID_API_MIN CMAKE_ANDROID_ARCH CMAKE_ANDROID_ARCH_ABI CMAKE_ANDROID_ARM_MODE CMAKE_ANDROID_ARM_NEON CMAKE_ANDROID_ASSETS_DIRECTORIES CMAKE_ANDROID_GUI CMAKE_ANDROID_JAR_DEPENDENCIES CMAKE_ANDROID_JAR_DIRECTORIES CMAKE_ANDROID_JAVA_SOURCE_DIR CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES CMAKE_ANDROID_NDK CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION CMAKE_ANDROID_PROCESS_MAX CMAKE_ANDROID_PROGUARD CMAKE_ANDROID_PROGUARD_CONFIG_PATH CMAKE_ANDROID_SECURE_PROPS_PATH CMAKE_ANDROID_SKIP_ANT_STEP CMAKE_ANDROID_STANDALONE_TOOLCHAIN CMAKE_ANDROID_STL_TYPE CMAKE_APPBUNDLE_PATH CMAKE_AR CMAKE_ARCHIVE_OUTPUT_DIRECTORY CMAKE_ARGC CMAKE_ARGV0 CMAKE_AUTOMOC CMAKE_AUTOMOC_DEPEND_FILTERS CMAKE_AUTOMOC_MOC_OPTIONS CMAKE_AUTOMOC_RELAXED_MODE CMAKE_AUTORCC CMAKE_AUTORCC_OPTIONS CMAKE_AUTOUIC CMAKE_AUTOUIC_OPTIONS CMAKE_AUTOUIC_SEARCH_PATHS CMAKE_BACKWARDS_COMPATIBILITY CMAKE_BINARY_DIR CMAKE_BUILD_RPATH CMAKE_BUILD_TOOL CMAKE_BUILD_TYPE CMAKE_BUILD_WITH_INSTALL_NAME_DIR CMAKE_BUILD_WITH_INSTALL_RPATH CMAKE_CACHEFILE_DIR CMAKE_CACHE_MAJOR_VERSION CMAKE_CACHE_MINOR_VERSION CMAKE_CACHE_PATCH_VERSION CMAKE_CFG_INTDIR CMAKE_CL_64 CMAKE_CODELITE_USE_TARGETS CMAKE_COLOR_MAKEFILE CMAKE_COMMAND CMAKE_COMPILER_2005 CMAKE_COMPILER_IS_GNUCC CMAKE_COMPILER_IS_GNUCXX CMAKE_COMPILER_IS_GNUG77 CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY CMAKE_CONFIGURATION_TYPES CMAKE_CROSSCOMPILING CMAKE_CROSSCOMPILING_EMULATOR CMAKE_CTEST_COMMAND CMAKE_CUDA_EXTENSIONS CMAKE_CUDA_STANDARD CMAKE_CUDA_STANDARD_REQUIRED CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES CMAKE_CURRENT_BINARY_DIR CMAKE_CURRENT_LIST_DIR CMAKE_CURRENT_LIST_FILE CMAKE_CURRENT_LIST_LINE CMAKE_CURRENT_SOURCE_DIR CMAKE_CXX_COMPILE_FEATURES CMAKE_CXX_EXTENSIONS CMAKE_CXX_STANDARD CMAKE_CXX_STANDARD_REQUIRED CMAKE_C_COMPILE_FEATURES CMAKE_C_EXTENSIONS CMAKE_C_STANDARD CMAKE_C_STANDARD_REQUIRED CMAKE_DEBUG_POSTFIX CMAKE_DEBUG_TARGET_PROPERTIES CMAKE_DEPENDS_IN_PROJECT_ONLY CMAKE_DL_LIBS CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT CMAKE_ECLIPSE_MAKE_ARGUMENTS CMAKE_ECLIPSE_VERSION CMAKE_EDIT_COMMAND CMAKE_ENABLE_EXPORTS CMAKE_ERROR_DEPRECATED CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION CMAKE_EXECUTABLE_SUFFIX CMAKE_EXE_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS_INIT CMAKE_EXPORT_COMPILE_COMMANDS CMAKE_EXPORT_NO_PACKAGE_REGISTRY CMAKE_EXTRA_GENERATOR CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES CMAKE_FIND_APPBUNDLE CMAKE_FIND_FRAMEWORK CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX CMAKE_FIND_LIBRARY_PREFIXES CMAKE_FIND_LIBRARY_SUFFIXES CMAKE_FIND_NO_INSTALL_PREFIX CMAKE_FIND_PACKAGE_NAME CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY CMAKE_FIND_PACKAGE_SORT_DIRECTION CMAKE_FIND_PACKAGE_SORT_ORDER CMAKE_FIND_PACKAGE_WARN_NO_MODULE CMAKE_FIND_ROOT_PATH CMAKE_FIND_ROOT_PATH_MODE_INCLUDE CMAKE_FIND_ROOT_PATH_MODE_LIBRARY CMAKE_FIND_ROOT_PATH_MODE_PACKAGE CMAKE_FIND_ROOT_PATH_MODE_PROGRAM CMAKE_FRAMEWORK_PATH CMAKE_Fortran_FORMAT CMAKE_Fortran_MODDIR_DEFAULT CMAKE_Fortran_MODDIR_FLAG CMAKE_Fortran_MODOUT_FLAG CMAKE_Fortran_MODULE_DIRECTORY CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET CMAKE_GNUtoMS CMAKE_HOME_DIRECTORY CMAKE_HOST_APPLE CMAKE_HOST_SOLARIS CMAKE_HOST_SYSTEM CMAKE_HOST_SYSTEM_NAME CMAKE_HOST_SYSTEM_PROCESSOR CMAKE_HOST_SYSTEM_VERSION CMAKE_HOST_UNIX CMAKE_HOST_WIN32 CMAKE_IGNORE_PATH CMAKE_IMPORT_LIBRARY_PREFIX CMAKE_IMPORT_LIBRARY_SUFFIX CMAKE_INCLUDE_CURRENT_DIR CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE CMAKE_INCLUDE_DIRECTORIES_BEFORE CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE CMAKE_INCLUDE_PATH CMAKE_INSTALL_DEFAULT_COMPONENT_NAME CMAKE_INSTALL_MESSAGE CMAKE_INSTALL_NAME_DIR CMAKE_INSTALL_PREFIX CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT CMAKE_INSTALL_RPATH CMAKE_INSTALL_RPATH_USE_LINK_PATH CMAKE_INTERNAL_PLATFORM_ABI CMAKE_INTERPROCEDURAL_OPTIMIZATION CMAKE_IOS_INSTALL_COMBINED CMAKE_JOB_POOL_COMPILE CMAKE_JOB_POOL_LINK CMAKE_LIBRARY_ARCHITECTURE CMAKE_LIBRARY_ARCHITECTURE_REGEX CMAKE_LIBRARY_OUTPUT_DIRECTORY CMAKE_LIBRARY_PATH CMAKE_LIBRARY_PATH_FLAG CMAKE_LINK_DEF_FILE_FLAG CMAKE_LINK_DEPENDS_NO_SHARED CMAKE_LINK_INTERFACE_LIBRARIES CMAKE_LINK_LIBRARY_FILE_FLAG CMAKE_LINK_LIBRARY_FLAG CMAKE_LINK_LIBRARY_SUFFIX CMAKE_LINK_SEARCH_END_STATIC CMAKE_LINK_SEARCH_START_STATIC CMAKE_LINK_WHAT_YOU_USE CMAKE_MACOSX_BUNDLE CMAKE_MACOSX_RPATH CMAKE_MAJOR_VERSION CMAKE_MAKE_PROGRAM CMAKE_MATCH_COUNT CMAKE_MFC_FLAG CMAKE_MINIMUM_REQUIRED_VERSION CMAKE_MINOR_VERSION CMAKE_MODULE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS_INIT CMAKE_MODULE_PATH CMAKE_NINJA_OUTPUT_PATH_PREFIX CMAKE_NOT_USING_CONFIG_FLAGS CMAKE_NO_BUILTIN_CHRPATH CMAKE_NO_SYSTEM_FROM_IMPORTED CMAKE_OBJECT_PATH_MAX CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET CMAKE_OSX_SYSROOT CMAKE_PARENT_LIST_FILE CMAKE_PATCH_VERSION CMAKE_PDB_OUTPUT_DIRECTORY CMAKE_POSITION_INDEPENDENT_CODE CMAKE_PREFIX_PATH CMAKE_PROGRAM_PATH CMAKE_PROJECT_DESCRIPTION CMAKE_PROJECT_NAME CMAKE_RANLIB CMAKE_ROOT CMAKE_RUNTIME_OUTPUT_DIRECTORY CMAKE_SCRIPT_MODE_FILE CMAKE_SHARED_LIBRARY_PREFIX CMAKE_SHARED_LIBRARY_SUFFIX CMAKE_SHARED_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS_INIT CMAKE_SHARED_MODULE_PREFIX CMAKE_SHARED_MODULE_SUFFIX CMAKE_SIZEOF_VOID_P CMAKE_SKIP_BUILD_RPATH CMAKE_SKIP_INSTALL_ALL_DEPENDENCY CMAKE_SKIP_INSTALL_RPATH CMAKE_SKIP_INSTALL_RULES CMAKE_SKIP_RPATH CMAKE_SOURCE_DIR CMAKE_STAGING_PREFIX CMAKE_STATIC_LIBRARY_PREFIX CMAKE_STATIC_LIBRARY_SUFFIX CMAKE_STATIC_LINKER_FLAGS CMAKE_STATIC_LINKER_FLAGS_INIT CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE CMAKE_SYSROOT CMAKE_SYSTEM CMAKE_SYSTEM_APPBUNDLE_PATH CMAKE_SYSTEM_FRAMEWORK_PATH CMAKE_SYSTEM_IGNORE_PATH CMAKE_SYSTEM_INCLUDE_PATH CMAKE_SYSTEM_LIBRARY_PATH CMAKE_SYSTEM_NAME CMAKE_SYSTEM_PREFIX_PATH CMAKE_SYSTEM_PROCESSOR CMAKE_SYSTEM_PROGRAM_PATH CMAKE_SYSTEM_VERSION CMAKE_Swift_LANGUAGE_VERSION CMAKE_TOOLCHAIN_FILE CMAKE_TRY_COMPILE_CONFIGURATION CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_TRY_COMPILE_TARGET_TYPE CMAKE_TWEAK_VERSION CMAKE_USER_MAKE_RULES_OVERRIDE CMAKE_USE_RELATIVE_PATHS CMAKE_VERBOSE_MAKEFILE CMAKE_VERSION CMAKE_VISIBILITY_INLINES_HIDDEN CMAKE_VS_DEVENV_COMMAND CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD CMAKE_VS_INTEL_Fortran_PROJECT_VERSION CMAKE_VS_MSBUILD_COMMAND CMAKE_VS_NsightTegra_VERSION CMAKE_VS_PLATFORM_NAME CMAKE_VS_PLATFORM_TOOLSET CMAKE_VS_PLATFORM_TOOLSET_CUDA CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION CMAKE_WARN_DEPRECATED CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION CMAKE_WIN32_EXECUTABLE CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS CMAKE_XCODE_GENERATE_SCHEME CMAKE_XCODE_PLATFORM_TOOLSET CPACK_ABSOLUTE_DESTINATION_FILES CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION CPACK_INCLUDE_TOPLEVEL_DIRECTORY CPACK_INSTALL_SCRIPT CPACK_PACKAGING_INSTALL_PREFIX CPACK_SET_DESTDIR CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION CTEST_BINARY_DIRECTORY CTEST_BUILD_COMMAND CTEST_BUILD_NAME CTEST_BZR_COMMAND CTEST_BZR_UPDATE_OPTIONS CTEST_CHANGE_ID CTEST_CHECKOUT_COMMAND CTEST_CONFIGURATION_TYPE CTEST_CONFIGURE_COMMAND CTEST_COVERAGE_COMMAND CTEST_COVERAGE_EXTRA_FLAGS CTEST_CURL_OPTIONS CTEST_CUSTOM_COVERAGE_EXCLUDE CTEST_CUSTOM_ERROR_EXCEPTION CTEST_CUSTOM_ERROR_MATCH CTEST_CUSTOM_ERROR_POST_CONTEXT CTEST_CUSTOM_ERROR_PRE_CONTEXT CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE CTEST_CUSTOM_MEMCHECK_IGNORE CTEST_CUSTOM_POST_MEMCHECK CTEST_CUSTOM_POST_TEST CTEST_CUSTOM_PRE_MEMCHECK CTEST_CUSTOM_PRE_TEST CTEST_CUSTOM_TEST_IGNORE CTEST_CUSTOM_WARNING_EXCEPTION CTEST_CUSTOM_WARNING_MATCH CTEST_CVS_CHECKOUT CTEST_CVS_COMMAND CTEST_CVS_UPDATE_OPTIONS CTEST_DROP_LOCATION CTEST_DROP_METHOD CTEST_DROP_SITE CTEST_DROP_SITE_CDASH CTEST_DROP_SITE_PASSWORD CTEST_DROP_SITE_USER CTEST_EXTRA_COVERAGE_GLOB CTEST_GIT_COMMAND CTEST_GIT_INIT_SUBMODULES CTEST_GIT_UPDATE_CUSTOM CTEST_GIT_UPDATE_OPTIONS CTEST_HG_COMMAND CTEST_HG_UPDATE_OPTIONS CTEST_LABELS_FOR_SUBPROJECTS CTEST_MEMORYCHECK_COMMAND CTEST_MEMORYCHECK_COMMAND_OPTIONS CTEST_MEMORYCHECK_SANITIZER_OPTIONS CTEST_MEMORYCHECK_SUPPRESSIONS_FILE CTEST_MEMORYCHECK_TYPE CTEST_NIGHTLY_START_TIME CTEST_P4_CLIENT CTEST_P4_COMMAND CTEST_P4_OPTIONS CTEST_P4_UPDATE_OPTIONS CTEST_SCP_COMMAND CTEST_SITE CTEST_SOURCE_DIRECTORY CTEST_SVN_COMMAND CTEST_SVN_OPTIONS CTEST_SVN_UPDATE_OPTIONS CTEST_TEST_LOAD CTEST_TEST_TIMEOUT CTEST_TRIGGER_SITE CTEST_UPDATE_COMMAND CTEST_UPDATE_OPTIONS CTEST_UPDATE_VERSION_ONLY CTEST_USE_LAUNCHERS CYGWIN ENV EXECUTABLE_OUTPUT_PATH GHS-MULTI LIBRARY_OUTPUT_PATH MINGW MSVC MSVC10 MSVC11 MSVC12 MSVC14 MSVC60 MSVC70 MSVC71 MSVC80 MSVC90 MSVC_IDE MSVC_VERSION PROJECT_BINARY_DIR PROJECT_DESCRIPTION PROJECT_NAME PROJECT_SOURCE_DIR PROJECT_VERSION PROJECT_VERSION_MAJOR PROJECT_VERSION_MINOR PROJECT_VERSION_PATCH PROJECT_VERSION_TWEAK UNIX WIN32 WINCE WINDOWS_PHONE WINDOWS_STORE XCODE XCODE_VERSION
syn keyword cmakeModule contained
\ ExternalProject
@@ -78,7 +77,7 @@ syn keyword cmakeKWbuild_name contained
\ CMAKE_CXX_COMPILER
syn keyword cmakeKWcmake_host_system_information contained
- \ AVAILABLE_PHYSICAL_MEMORY AVAILABLE_VIRTUAL_MEMORY FQDN HOSTNAME NUMBER_OF_LOGICAL_CORES NUMBER_OF_PHYSICAL_CORES QUERY RESULT TOTAL_PHYSICAL_MEMORY TOTAL_VIRTUAL_MEMORY
+ \ AVAILABLE_PHYSICAL_MEMORY AVAILABLE_VIRTUAL_MEMORY FQDN HOSTNAME NUMBER_OF_LOGICAL_CORES NUMBER_OF_PHYSICAL_CORES QUERY RESULT TOTAL_PHYSICAL_MEMORY TOTAL_VIRTUAL_MEMORY IS_64BIT HAS_FPU HAS_MMX HAS_MMX_PLUS HAS_SSE HAS_SSE2 HAS_SSE_FP HAS_SSE_MMX HAS_AMD_3DNOW HAS_AMD_3DNOW_PLUS HAS_IA64 HAS_SERIAL_NUMBER PROCESSOR_SERIAL_NUMBER PROCESSOR_NAME OS_NAME OS_RELEASE OS_VERSION OS_PLATFORM
syn keyword cmakeKWcmake_minimum_required contained
\ FATAL_ERROR VERSION
@@ -203,6 +202,9 @@ syn keyword cmakeKWinclude_directories contained
syn keyword cmakeKWinclude_external_msproject contained
\ GUID MAP_IMPORTED_CONFIG_ PLATFORM TYPE WIX
+syn keyword cmakeKWinclude_guard contained
+ \ DIRECTORY GLOBAL
+
syn keyword cmakeKWinstall contained
\ ARCHIVE BUNDLE CODE COMPONENT CONFIGURATIONS CVS DESTDIR DESTINATION DIRECTORY DIRECTORY_PERMISSIONS DLL EXCLUDE_FROM_ALL EXPORT EXPORT_ANDROID_MK EXPORT_LINK_INTERFACE_LIBRARIES FILES FILES_MATCHING FILE_PERMISSIONS FRAMEWORK GROUP_EXECUTE GROUP_READ GROUP_WRITE IMPORTED_ INCLUDES INSTALL_PREFIX INTERFACE_INCLUDE_DIRECTORIES LIBRARY MACOSX_BUNDLE MESSAGE_NEVER NAMELINK_ONLY NAMELINK_SKIP NAMESPACE NDK OBJECTS OPTIONAL OWNER_EXECUTE OWNER_READ OWNER_WRITE PATTERN PERMISSIONS POST_INSTALL_SCRIPT PRE_INSTALL_SCRIPT PRIVATE_HEADER PROGRAMS PUBLIC_HEADER REGEX RENAME RESOURCE RUNTIME SCRIPT SETGID SETUID SOVERSION TARGETS TRUE USE_SOURCE_PERMISSIONS VERSION WORLD_EXECUTE WORLD_READ WORLD_WRITE
@@ -327,7 +329,7 @@ syn keyword cmakeGeneratorExpressions contained
syn case ignore
syn keyword cmakeCommand
- \ add_compile_options add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_host_system_information cmake_minimum_required cmake_parse_arguments cmake_policy configure_file continue create_test_sourcelist ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ctest_test ctest_update ctest_upload define_property enable_language enable_testing endfunction endmacro execute_process export file find_file find_library find_package find_path find_program fltk_wrap_ui function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property include include_directories include_external_msproject include_regular_expression install link_directories list load_cache load_command macro mark_as_advanced math message option project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_compile_definitions target_compile_features target_compile_options target_include_directories target_link_libraries target_sources try_compile try_run unset variable_watch
+ \ add_compile_options add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_host_system_information cmake_minimum_required cmake_parse_arguments cmake_policy configure_file continue create_test_sourcelist ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ctest_test ctest_update ctest_upload define_property enable_language enable_testing endfunction endmacro execute_process export file find_file find_library find_package find_path find_program fltk_wrap_ui function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property include include_directories include_external_msproject include_guard include_regular_expression install link_directories list load_cache load_command macro mark_as_advanced math message option project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_compile_definitions target_compile_features target_compile_options target_include_directories target_link_libraries target_sources try_compile try_run unset variable_watch
\ nextgroup=cmakeArguments
syn keyword cmakeCommandConditional
@@ -420,6 +422,7 @@ hi def link cmakeKWif ModeMsg
hi def link cmakeKWinclude ModeMsg
hi def link cmakeKWinclude_directories ModeMsg
hi def link cmakeKWinclude_external_msproject ModeMsg
+hi def link cmakeKWinclude_guard ModeMsg
hi def link cmakeKWinstall ModeMsg
hi def link cmakeKWinstall_files ModeMsg
hi def link cmakeKWinstall_programs ModeMsg
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed924eb..c9e632e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,13 +1,7 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR)
-if(POLICY CMP0025)
- cmake_policy(SET CMP0025 NEW)
-endif()
-if(POLICY CMP0053)
- cmake_policy(SET CMP0053 NEW)
-endif()
+cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(CMake)
# Make sure we can find internal find_package modules only used for
@@ -21,6 +15,14 @@ if(CMAKE_BOOTSTRAP)
endif()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
+ if(CMAKE_SYSTEM_NAME STREQUAL "HP-UX")
+ message(FATAL_ERROR
+ "CMake no longer compiles on HP-UX. See\n"
+ " https://gitlab.kitware.com/cmake/cmake/issues/17137\n"
+ "Use CMake 3.9 or lower instead."
+ )
+ endif()
+
set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
endif()
@@ -72,6 +74,10 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
# check for available C++ features
include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake)
+
+ if(NOT CMake_HAVE_CXX_UNIQUE_PTR)
+ message(FATAL_ERROR "The C++ compiler does not support C++11 (e.g. std::unique_ptr).")
+ endif()
endif()
# set the internal encoding of CMake to UTF-8
@@ -333,11 +339,7 @@ macro (CMAKE_BUILD_UTILITIES)
endif()
if(CMAKE_USE_SYSTEM_LIBRHASH)
- if(NOT CMAKE_VERSION VERSION_LESS 3.0)
- find_package(LibRHash)
- else()
- message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBRHASH requires CMake >= 3.0")
- endif()
+ find_package(LibRHash)
if(NOT LibRHash_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_LIBRHASH is ON but LibRHash is not found!")
@@ -503,11 +505,7 @@ macro (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Build jsoncpp library.
if(CMAKE_USE_SYSTEM_JSONCPP)
- if(NOT CMAKE_VERSION VERSION_LESS 3.0)
- find_package(JsonCpp)
- else()
- message(FATAL_ERROR "CMAKE_USE_SYSTEM_JSONCPP requires CMake >= 3.0")
- endif()
+ find_package(JsonCpp)
if(NOT JsonCpp_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found!")
@@ -521,45 +519,17 @@ macro (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Build libuv library.
- if(NOT DEFINED CMAKE_USE_LIBUV)
- set(CMAKE_USE_LIBUV 1)
- if(APPLE)
- include(CheckCSourceCompiles)
- check_c_source_compiles("
-#include <CoreServices/CoreServices.h>
-#include <AvailabilityMacros.h>
-#ifndef MAC_OS_X_VERSION_10_5
-#error \"MAC_OS_X_VERSION_10_5 is not defined\"
-#endif
-int main(void) { return 0; }
-" HAVE_CoreServices_OS_X_10_5)
- if(NOT HAVE_CoreServices_OS_X_10_5)
- set(CMAKE_USE_LIBUV 0)
- endif()
- elseif(CMAKE_SYSTEM_NAME STREQUAL "HP-UX")
- # Disable until it can be ported.
- set(CMAKE_USE_LIBUV 0)
- endif()
- endif()
- if(CMAKE_USE_LIBUV)
- if(CMAKE_USE_SYSTEM_LIBUV)
- if(NOT CMAKE_VERSION VERSION_LESS 3.0)
- find_package(LibUV 1.0.0)
- else()
- message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBUV requires CMake >= 3.0")
- endif()
- if(NOT LIBUV_FOUND)
- message(FATAL_ERROR
- "CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!")
- endif()
- set(CMAKE_LIBUV_LIBRARIES LibUV::LibUV)
- else()
- set(CMAKE_LIBUV_LIBRARIES cmlibuv)
- add_subdirectory(Utilities/cmlibuv)
- CMAKE_SET_TARGET_FOLDER(cmlibuv "Utilities/3rdParty")
+ if(CMAKE_USE_SYSTEM_LIBUV)
+ find_package(LibUV 1.0.0)
+ if(NOT LIBUV_FOUND)
+ message(FATAL_ERROR
+ "CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!")
endif()
+ set(CMAKE_LIBUV_LIBRARIES LibUV::LibUV)
else()
- set(CMAKE_LIBUV_LIBRARIES)
+ set(CMAKE_LIBUV_LIBRARIES cmlibuv)
+ add_subdirectory(Utilities/cmlibuv)
+ CMAKE_SET_TARGET_FOLDER(cmlibuv "Utilities/3rdParty")
endif()
#---------------------------------------------------------------------
@@ -748,31 +718,6 @@ endif()
# setup some Testing support (a macro defined in this file)
CMAKE_SETUP_TESTING()
-# Check whether to build server mode or not:
-if(NOT CMake_TEST_EXTERNAL_CMAKE)
- if(NOT DEFINED CMake_ENABLE_SERVER_MODE)
- list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_auto_type CMake_HAVE_CXX_AUTO_TYPE)
- list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_range_for CMake_HAVE_CXX_RANGE_FOR)
- if(CMAKE_USE_LIBUV
- AND CMake_HAVE_CXX_AUTO_TYPE
- AND CMake_HAVE_CXX_MAKE_UNIQUE
- AND CMake_HAVE_CXX_RANGE_FOR
- )
- set(CMake_ENABLE_SERVER_MODE 1)
- else()
- set(CMake_ENABLE_SERVER_MODE 0)
- endif()
- endif()
- if(CMake_ENABLE_SERVER_MODE AND NOT CMAKE_USE_LIBUV)
- message(FATAL_ERROR "The server mode requires libuv!")
- endif()
-else()
- set(CMake_ENABLE_SERVER_MODE 0)
-endif()
-if(NOT DEFINED CMake_TEST_SERVER_MODE)
- set(CMake_TEST_SERVER_MODE ${CMake_ENABLE_SERVER_MODE})
-endif()
-
if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(NOT CMake_VERSION_IS_RELEASE)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index e219763..381769d 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -27,9 +27,13 @@ To contribute patches:
#. Run `Utilities/SetupForDevelopment.sh`_ for local configuration.
#. See the `CMake Source Code Guide`_ for coding guidelines.
#. Base all new work on the upstream ``master`` branch.
-#. Create commits making incremental, distinct, logically complete changes.
+ Base work on the upstream ``release`` branch only if it fixes a
+ regression or bug in a feature new to that release.
+#. Create commits making incremental, distinct, logically complete changes
+ with appropriate `commit messages`_.
#. Push a topic branch to a personal repository fork on GitLab.
-#. Create a GitLab Merge Request targeting the upstream ``master`` branch.
+#. Create a GitLab Merge Request targeting the upstream ``master`` branch
+ (even if the change is intended for merge to the ``release`` branch).
The merge request will enter the `CMake Review Process`_ for consideration.
@@ -37,6 +41,7 @@ The merge request will enter the `CMake Review Process`_ for consideration.
.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake
.. _`Utilities/SetupForDevelopment.sh`: Utilities/SetupForDevelopment.sh
.. _`CMake Source Code Guide`: Help/dev/source.rst
+.. _`commit messages`: Help/dev/review.rst#commit-messages
.. _`CMake Review Process`: Help/dev/review.rst
License
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index fa2fbe3..0e4e9fe 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -44,6 +44,8 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"Warning: LINN32: Last line.*is less.*"
"Warning: Olimit was exceeded on function.*"
"Warning: To override Olimit for all functions in file.*"
+ "Warning: Function .* can throw only the exceptions thrown by the function .* it overrides\\."
+ "WarningMessagesDialog\\.cxx"
"warning.*directory name.*CMake-Xcode.*/bin/.*does not exist.*"
"stl_deque.h:1051"
"(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)"
@@ -68,11 +70,11 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*srand.*seed choices are.*poor" # we do not do crypto
"IPA warning: function.*multiply defined in"
- # Ignore clang's summary warning, assuming prior text has matched some
+ # Ignore compiler summary warning, assuming prior text has matched some
# other warning expression:
- "[0-9,]+ warnings? generated."
- # similarly for PGI
- "compilation completed with warnings"
+ "[0-9,]+ warnings? generated." # Clang
+ "compilation completed with warnings" # PGI
+ "[0-9]+ Warning\\(s\\) detected" # SunPro
# scanbuild exceptions
"char_traits.h:.*: warning: Null pointer argument in call to string length function"
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 7a9d4cd..9834b04 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -37,18 +37,6 @@ if(CMAKE_SYSTEM MATCHES "OSF1-V")
endif()
endif()
-if(CMAKE_SYSTEM_NAME MATCHES "HP-UX" AND CMAKE_CXX_COMPILER_ID MATCHES "HP")
- # HP aCC since version 3.80 supports the flag +hpxstd98 to get ANSI C++98
- # template support. It is known that version 6.25 doesn't need that flag.
- # Versions prior to 3.80 will not be able to build CMake. Current assumption:
- # it is needed for every version from 3.80 to 4 to get it working.
- if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4 AND
- NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.80)
- # use new C++ library and improved template support
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA +hpxstd98")
- endif()
-endif()
-
# Workaround for short jump tables on PA-RISC
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc")
if(CMAKE_COMPILER_IS_GNUCC)
diff --git a/Copyright.txt b/Copyright.txt
index daaa1d1..b7af4c5 100644
--- a/Copyright.txt
+++ b/Copyright.txt
@@ -34,6 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The following individuals and institutions are among the Contributors:
* Aaron C. Meadows <cmake@shadowguarddev.com>
+* Adriaan de Groot <groot@kde.org>
* Aleksey Avdeev <solo@altlinux.ru>
* Alexander Neundorf <neundorf@kde.org>
* Alexander Smorkalov <alexander.smorkalov@itseez.com>
diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst
index 9402d57..7199874 100644
--- a/Help/command/cmake_host_system_information.rst
+++ b/Help/command/cmake_host_system_information.rst
@@ -13,13 +13,34 @@ queried. The list of queried values is stored in ``<variable>``.
``<key>`` can be one of the following values:
-::
-
- NUMBER_OF_LOGICAL_CORES = Number of logical cores.
- NUMBER_OF_PHYSICAL_CORES = Number of physical cores.
- HOSTNAME = Hostname.
- FQDN = Fully qualified domain name.
- TOTAL_VIRTUAL_MEMORY = Total virtual memory in megabytes.
- AVAILABLE_VIRTUAL_MEMORY = Available virtual memory in megabytes.
- TOTAL_PHYSICAL_MEMORY = Total physical memory in megabytes.
- AVAILABLE_PHYSICAL_MEMORY = Available physical memory in megabytes.
+============================= ================================================
+Key Description
+============================= ================================================
+``NUMBER_OF_LOGICAL_CORES`` Number of logical cores
+``NUMBER_OF_PHYSICAL_CORES`` Number of physical cores
+``HOSTNAME`` Hostname
+``FQDN`` Fully qualified domain name
+``TOTAL_VIRTUAL_MEMORY`` Total virtual memory in megabytes
+``AVAILABLE_VIRTUAL_MEMORY`` Available virtual memory in megabytes
+``TOTAL_PHYSICAL_MEMORY`` Total physical memory in megabytes
+``AVAILABLE_PHYSICAL_MEMORY`` Available physical memory in megabytes
+``IS_64BIT`` One if processor is 64Bit
+``HAS_FPU`` One if processor has floating point unit
+``HAS_MMX`` One if processor supports MMX instructions
+``HAS_MMX_PLUS`` One if porcessor supports Ext. MMX instructions
+``HAS_SSE`` One if porcessor supports SSE instructions
+``HAS_SSE2`` One if porcessor supports SSE2 instructions
+``HAS_SSE_FP`` One if porcessor supports SSE FP instructions
+``HAS_SSE_MMX`` One if porcessor supports SSE MMX instructions
+``HAS_AMD_3DNOW`` One if porcessor supports 3DNow instructions
+``HAS_AMD_3DNOW_PLUS`` One if porcessor supports 3DNow+ instructions
+``HAS_IA64`` One if IA64 processor emulating x86
+``HAS_SERIAL_NUMBER`` One if processor has serial number
+``PROCESSOR_SERIAL_NUMBER`` Processor serial number
+``PROCESSOR_NAME`` Human readable processor name
+``PROCESSOR_DESCRIPTION`` Human readable full processor description
+``OS_NAME`` See :variable:`CMAKE_HOST_SYSTEM_NAME`
+``OS_RELEASE`` The OS sub-type e.g. on Windows ``Professional``
+``OS_VERSION`` The OS build ID
+``OS_PLATFORM`` See :variable:`CMAKE_HOST_SYSTEM_PROCESSOR`
+============================= ================================================
diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst
index 4304f09..e08c573 100644
--- a/Help/command/configure_file.rst
+++ b/Help/command/configure_file.rst
@@ -30,9 +30,23 @@ a false constant by the :command:`if` command. The "..." content on the
line after the variable name, if any, is processed as above.
Input file lines of the form ``#cmakedefine01 VAR`` will be replaced with
either ``#define VAR 1`` or ``#define VAR 0`` similarly.
+The result lines (with the exception of the ``#undef`` comments) can be
+indented using spaces and/or tabs between the ``#`` character
+and the ``cmakedefine`` or ``cmakedefine01`` words. This whitespace
+indentation will be preserved in the output lines::
+
+ # cmakedefine VAR
+ # cmakedefine01 VAR
+
+will be replaced, if ``VAR`` is defined, with::
+
+ # define VAR
+ # define VAR 1
If the input file is modified the build system will re-run CMake to
re-configure the file and generate the build system again.
+The generated file is modified and its timestamp updated on subsequent
+cmake runs only if its content is changed.
The arguments are:
diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst
index d617243..799493f 100644
--- a/Help/command/execute_process.rst
+++ b/Help/command/execute_process.rst
@@ -10,6 +10,7 @@ Execute one or more child processes.
[WORKING_DIRECTORY <directory>]
[TIMEOUT <seconds>]
[RESULT_VARIABLE <variable>]
+ [RESULTS_VARIABLE <variable>]
[OUTPUT_VARIABLE <variable>]
[ERROR_VARIABLE <variable>]
[INPUT_FILE <file>]
@@ -49,10 +50,16 @@ Options:
specified number of seconds (fractions are allowed).
``RESULT_VARIABLE``
- The variable will be set to contain the result of running the processes.
+ The variable will be set to contain the result of last child process.
This will be an integer return code from the last child or a string
describing an error condition.
+``RESULTS_VARIABLE <variable>``
+ The variable will be set to contain the result of all processes as a
+ :ref:`;-list <CMake Language Lists>`, in order of the given ``COMMAND``
+ arguments. Each entry will be an integer return code from the
+ corresponding child or a string describing an error condition.
+
``OUTPUT_VARIABLE``, ``ERROR_VARIABLE``
The variable named will be set with the contents of the standard output
and standard error pipes, respectively. If the same variable is named
diff --git a/Help/command/file.rst b/Help/command/file.rst
index b2e4eea..edccac5 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -13,8 +13,11 @@ File manipulation command.
Write ``<content>`` into a file called ``<filename>``. If the file does
not exist, it will be created. If the file already exists, ``WRITE``
mode will overwrite it and ``APPEND`` mode will append to the end.
-(If the file is a build input, use the :command:`configure_file` command
-to update the file only when its content changes.)
+Any directories in the path specified by ``<filename>`` that do not
+exist will be created.
+
+If the file is a build input, use the :command:`configure_file` command
+to update the file only when its content changes.
------------------------------------------------------------------------------
@@ -105,9 +108,7 @@ Generate a list of files that match the ``<globbing-expressions>`` and
store it into the ``<variable>``. Globbing expressions are similar to
regular expressions, but much simpler. If ``RELATIVE`` flag is
specified, the results will be returned as relative paths to the given
-path. No specific order of results is defined other than that it is
-deterministic. If order is important then sort the list explicitly
-(e.g. using the :command:`list(SORT)` command).
+path. The results will be ordered lexicographically.
By default ``GLOB`` lists directories - directories are omited in result if
``LIST_DIRECTORIES`` is set to false.
@@ -291,6 +292,8 @@ from the input content to produce the output content. The options are:
``INPUT <input-file>``
Use the content from a given file as input.
+ A relative path is treated with respect to the value of
+ :variable:`CMAKE_CURRENT_SOURCE_DIR`. See policy :policy:`CMP0070`.
``OUTPUT <output-file>``
Specify the output file name to generate. Use generator expressions
@@ -298,11 +301,14 @@ from the input content to produce the output content. The options are:
name. Multiple configurations may generate the same output file only
if the generated content is identical. Otherwise, the ``<output-file>``
must evaluate to an unique name for each configuration.
+ A relative path (after evaluating generator expressions) is treated
+ with respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`.
+ See policy :policy:`CMP0070`.
Exactly one ``CONTENT`` or ``INPUT`` option must be given. A specific
``OUTPUT`` file may be named by at most one invocation of ``file(GENERATE)``.
-Generated files are modified on subsequent cmake runs only if their content
-is changed.
+Generated files are modified and their timestamp updated on subsequent cmake
+runs only if their content is changed.
Note also that ``file(GENERATE)`` does not create the output file until the
generation phase. The output file will not yet have been written when the
diff --git a/Help/command/if.rst b/Help/command/if.rst
index edd343d..f04f233 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -30,7 +30,7 @@ else and endif clause is optional. Long expressions can be used and
there is a traditional order of precedence. Parenthetical expressions
are evaluated first followed by unary tests such as ``EXISTS``,
``COMMAND``, and ``DEFINED``. Then any binary tests such as
-``EQUAL``, ``LESS``, ``LESS_EQUAL, ``GREATER``, ``GREATER_EQUAL``,
+``EQUAL``, ``LESS``, ``LESS_EQUAL``, ``GREATER``, ``GREATER_EQUAL``,
``STREQUAL``, ``STRLESS``, ``STRLESS_EQUAL``, ``STRGREATER``,
``STRGREATER_EQUAL``, ``VERSION_EQUAL``, ``VERSION_LESS``,
``VERSION_LESS_EQUAL``, ``VERSION_GREATER``, ``VERSION_GREATER_EQUAL``,
diff --git a/Help/command/include_guard.rst b/Help/command/include_guard.rst
new file mode 100644
index 0000000..62cce22
--- /dev/null
+++ b/Help/command/include_guard.rst
@@ -0,0 +1,46 @@
+include_guard
+-------------
+
+Provides an include guard for the file currently being processed by CMake.
+
+::
+
+ include_guard([DIRECTORY|GLOBAL])
+
+Sets up an include guard for the current CMake file (see the
+:variable:`CMAKE_CURRENT_LIST_FILE` variable documentation).
+
+CMake will end its processing of the current file at the location of the
+:command:`include_guard` command if the current file has already been
+processed for the applicable scope (see below). This provides functionality
+similar to the include guards commonly used in source headers or to the
+``#pragma once`` directive. If the current file has been processed previously
+for the applicable scope, the effect is as though :command:`return` had been
+called. Do not call this command from inside a function being defined within
+the current file.
+
+An optional argument specifying the scope of the guard may be provided.
+Possible values for the option are:
+
+``DIRECTORY``
+ The include guard applies within the current directory and below. The file
+ will only be included once within this directory scope, but may be included
+ again by other files outside of this directory (i.e. a parent directory or
+ another directory not pulled in by :command:`add_subdirectory` or
+ :command:`include` from the current file or its children).
+
+``GLOBAL``
+ The include guard applies globally to the whole build. The current file
+ will only be included once regardless of the scope.
+
+If no arguments given, ``include_guard`` has the same scope as a variable,
+meaning that the include guard effect is isolated by the most recent
+function scope or current directory if no inner function scopes exist.
+In this case the command behavior is the same as:
+
+.. code-block:: cmake
+
+ if(__CURRENT_FILE_VAR__)
+ return()
+ endif()
+ set(__CURRENT_FILE_VAR__ TRUE)
diff --git a/Help/command/string.rst b/Help/command/string.rst
index 4f0c45c..ba4a412 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -132,6 +132,15 @@ APPEND
Append all the input arguments to the string.
+PREPEND
+"""""""
+
+::
+
+ string(PREPEND <string variable> [<input>...])
+
+Prepend all the input arguments to the string.
+
CONCAT
""""""
diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst
index 78c06df..bdfb3d0 100644
--- a/Help/dev/maint.rst
+++ b/Help/dev/maint.rst
@@ -8,6 +8,80 @@ See documentation on `CMake Development`_ for more information.
.. contents:: Maintainer Processes:
+Review a Merge Request
+======================
+
+The `CMake Review Process`_ requires a maintainer to issue the ``Do: merge``
+command to integrate a merge request. Please check at least the following:
+
+* If the MR source branch is not named well for the change it makes
+ (e.g. it is just ``master`` or the patch changed during review),
+ add a ``Topic-rename: <topic>`` trailing line to the MR description
+ to provide a better topic name.
+
+* If the MR introduces a new feature or a user-facing behavior change,
+ such as a policy, ensure that a ``Help/release/dev/$topic.rst`` file
+ is added with a release note.
+
+* If a commit changes a specific area, such as a module, its commit
+ message should have an ``area:`` prefix on its first line.
+
+* If a commit fixes a tracked issue, its commit message should have
+ a trailing line such as ``Fixes: #00000``.
+
+* Ensure that the MR adds sufficient documentation and test cases.
+
+* Ensure that the MR has been tested sufficiently. Typically it should
+ be staged for nightly testing with ``Do: stage``. Then manually
+ review the `CMake CDash Page`_ to verify that no regressions were
+ introduced. (Learn to tolerate spurious failures due to idiosyncrasies
+ of various nightly builders.)
+
+* Ensure that the MR targets the ``master`` branch. A MR intended for
+ the ``release`` branch should be based on ``release`` but still merged
+ to ``master`` first (via ``Do: merge``). A maintainer may then merge
+ the MR topic to ``release`` manually.
+
+Maintain Current Release
+========================
+
+The ``release`` branch is used to maintain the current release or release
+candidate. The branch is published with no version number but maintained
+using a local branch named ``release-$ver``, where ``$ver`` is the version
+number of the current release in the form ``$major.$minor``. It is always
+merged into ``master`` before publishing.
+
+To merge some ``$topic`` branch into ``release``, first create the local
+branch:
+
+.. code-block:: shell
+
+ git fetch origin
+ git checkout -b release-$ver origin/release
+
+Merge the ``$topic`` branch into the local ``release-$ver`` branch:
+
+.. code-block:: shell
+
+ git merge --no-ff $topic
+
+Merge the ``release-$ver`` branch to ``master``:
+
+.. code-block:: shell
+
+ git checkout master
+ git pull
+ git merge --no-ff release-$ver
+
+Publish both ``master`` and ``release`` simultaneously:
+
+.. code-block:: shell
+
+ git push --atomic origin master release-$ver:release
+
+.. _`CMake Review Process`: review.rst
+.. _`CMake CDash Page`: https://open.cdash.org/index.php?project=CMake
+
Branch a New Release
====================
diff --git a/Help/dev/review.rst b/Help/dev/review.rst
index 9450bf0..be02a1a 100644
--- a/Help/dev/review.rst
+++ b/Help/dev/review.rst
@@ -185,6 +185,83 @@ commands to ``@kwrobot`` using the form ``Do: ...``:
See the corresponding sections for details on permissions and options
for each command.
+Commit Messages
+---------------
+
+Part of the human review is to check that each commit message is appropriate.
+The first line of the message should begin with one or two words indicating the
+area the commit applies to, followed by a colon and then a brief summary.
+Committers should aim to keep this first line short. Any subsequent lines
+should be separated from the first by a blank line and provide relevant, useful
+information.
+
+Area Prefix on Commit Messages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The appropriateness of the initial word describing the area the commit applies
+to is not something the automatic robot review can judge, so it is up to the
+human reviewer to confirm that the area is specified and that it is
+appropriate. Good area words include the module name the commit is primarily
+fixing, the main C++ source file being edited, ``Help`` for generic
+documentation changes or a feature or functionality theme the changes apply to
+(e.g. ``server`` or ``Autogen``). Examples of suitable first lines of a commit
+message include:
+
+* ``Help: Fix example in cmake-buildsystem(7) manual``
+* ``FindBoost: Add support for 1.64``
+* ``Autogen: Extended mocInclude tests``
+* ``cmLocalGenerator: Explain standard flag selection logic in comments``
+
+Referencing Issues in Commit Messages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If the commit fixes a particular reported issue, this information should
+ideally also be part of the commit message. The recommended way to do this is
+to place a line at the end of the message in the form ``Fixes: #xxxxx`` where
+``xxxxx`` is the GitLab issue number and to separate it from the rest of the
+text by a blank line. For example::
+
+ Help: Fix FooBar example robustness issue
+
+ FooBar supports option X, but the example provided
+ would not work if Y was also specified.
+
+ Fixes: #12345
+
+GitLab will automatically create relevant links to the merge request and will
+close the issue when the commit is merged into master. GitLab understands a few
+other synonyms for ``Fixes`` and allows much more flexible forms than the
+above, but committers should aim for this format for consistency. Note that
+such details can alternatively be specified in the merge request description.
+
+Referencing Commits in Commit Messages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The preferred form for references to other commits is
+``commit <commit> (<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>``.
+
+* ``<subject>``:
+ The first line of the commit message.
+
+* ``<date>``:
+ 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.
+
+Alternatively, the full commit ``<hash>`` may be used.
+
+Revising Commit Messages
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Reviewers are encouraged to ask the committer to amend commit messages to
+follow these guidelines, but prefer to focus on the changes themselves as a
+first priority. Maintainers will also make a check of commit messages before
+merging.
+
Topic Testing
=============
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 7e44995..b40a884 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -23,20 +23,18 @@ format only a subset of files, such as those that are locally modified.
C++ Subset Permitted
====================
-CMake supports compiling as C++98 in addition to C++11 and C++14.
-In order to support building on older toolchains some constructs
-need to be handled with care:
+CMake requires compiling as C++11 or above. However, in order to support
+building on older toolchains some constructs need to be handled with care:
-* Use ``CM_AUTO_PTR`` instead of ``std::auto_ptr``.
+* Do not use ``CM_AUTO_PTR`` or ``std::auto_ptr``.
- The ``std::auto_ptr`` template is deprecated in C++11. We want to use it
- so we can build on C++98 compilers but we do not want to turn off compiler
- warnings about deprecated interfaces in general. Use the ``CM_AUTO_PTR``
- macro instead.
+ The ``std::auto_ptr`` template is deprecated in C++11. The ``CM_AUTO_PTR``
+ macro remains leftover from C++98 support until its uses can be ported to
+ ``std::unique_ptr``. Do not add new uses of the macro.
* Use ``CM_EQ_DELETE;`` instead of ``= delete;``.
- Defining functions as *deleted* is not supported in C++98. Using
+ Older C++11 compilers do not support deleting functions. Using
``CM_EQ_DELETE`` will delete the functions if the compiler supports it and
give them no implementation otherwise. Calling such a function will lead
to compiler errors if the compiler supports *deleted* functions and linker
@@ -58,3 +56,50 @@ need to be handled with care:
When assigning the result of ``.size()`` on a container for example,
the result should be assigned to ``size_t`` not to ``std::size_t``,
``unsigned int`` or similar types.
+
+Source Tree Layout
+==================
+
+The CMake source tree is organized as follows.
+
+* ``Auxiliary/``:
+ Shell and editor integration files.
+
+* ``Help/``:
+ Documentation.
+
+ * ``Help/dev/``:
+ Developer documentation.
+
+ * ``Help/release/dev/``:
+ Release note snippets for development since last release.
+
+* ``Licenses/``:
+ License files for third-party libraries in binary distributions.
+
+* ``Modules/``:
+ CMake language modules installed with CMake.
+
+* ``Packaging/``:
+ Files used for packaging CMake itself for distribution.
+
+* ``Source/``:
+ Source code of CMake itself.
+
+* ``Templates/``:
+ Files distributed with CMake as implementation details for generators,
+ packagers, etc.
+
+* ``Tests/``:
+ The test suite. See `Tests/README.rst`_.
+
+* ``Utilities/``:
+ Scripts, third-party source code.
+
+ * ``Utilities/Sphinx/``:
+ Sphinx configuration to build CMake user documentation.
+
+ * ``Utilities/Release/``:
+ Scripts used to package CMake itself for distribution on ``cmake.org``.
+
+.. _`Tests/README.rst`: ../../Tests/README.rst
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index 95f5b87..debaf23 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -266,7 +266,7 @@ The :command:`target_link_libraries` command has ``PRIVATE``,
Because ``archive`` is a ``PUBLIC`` dependency of ``archiveExtras``, the
usage requirements of it are propagated to ``consumer`` too. Because
-``serialization`` is a ``PRIVATE`` dependency of ``archive``, the usage
+``serialization`` is a ``PRIVATE`` dependency of ``archiveExtras``, the usage
requirements of it are not propagated to ``consumer``.
Generally, a dependency should be specified in a use of
diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index 611c989..f8bfb32 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -44,6 +44,7 @@ These commands are always available.
/command/get_property
/command/if
/command/include
+ /command/include_guard
/command/list
/command/macro
/command/mark_as_advanced
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index 4a03b7a..fa6144c 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -60,6 +60,7 @@ All Modules
/module/CPackCygwin
/module/CPackDeb
/module/CPackDMG
+ /module/CPackFreeBSD
/module/CPackIFW
/module/CPackIFWConfigureFile
/module/CPackNSIS
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 7b85817..c81ba59 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -51,6 +51,15 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used
to determine whether to report an error on use of deprecated macros or
functions.
+Policies Introduced by CMake 3.10
+=================================
+
+.. toctree::
+ :maxdepth: 1
+
+ CMP0071: Let AUTOMOC and AUTOUIC process GENERATED files. </policy/CMP0071>
+ CMP0070: Define file(GENERATE) behavior for relative paths. </policy/CMP0070>
+
Policies Introduced by CMake 3.9
================================
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index ec25596..f1378c8 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -74,6 +74,7 @@ Properties on Directories
/prop_dir/INCLUDE_REGULAR_EXPRESSION
/prop_dir/INTERPROCEDURAL_OPTIMIZATION_CONFIG
/prop_dir/INTERPROCEDURAL_OPTIMIZATION
+ /prop_dir/LABELS
/prop_dir/LINK_DIRECTORIES
/prop_dir/LISTFILE_STACK
/prop_dir/MACROS
@@ -83,7 +84,7 @@ Properties on Directories
/prop_dir/RULE_LAUNCH_LINK
/prop_dir/SOURCE_DIR
/prop_dir/SUBDIRECTORIES
- /prop_dir/TEST_INCLUDE_FILE
+ /prop_dir/TEST_INCLUDE_FILES
/prop_dir/VARIABLES
/prop_dir/VS_GLOBAL_SECTION_POST_section
/prop_dir/VS_GLOBAL_SECTION_PRE_section
@@ -122,6 +123,7 @@ Properties on Targets
/prop_tgt/AUTOGEN_BUILD_DIR
/prop_tgt/AUTOGEN_TARGET_DEPENDS
/prop_tgt/AUTOMOC_DEPEND_FILTERS
+ /prop_tgt/AUTOMOC_MACRO_NAMES
/prop_tgt/AUTOMOC_MOC_OPTIONS
/prop_tgt/AUTOMOC
/prop_tgt/AUTOUIC
@@ -291,6 +293,7 @@ Properties on Targets
/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY
/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION
/prop_tgt/VS_DOTNET_REFERENCE_refname
+ /prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname
/prop_tgt/VS_DOTNET_REFERENCES
/prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL
/prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION
@@ -434,6 +437,7 @@ Deprecated Properties on Directories
:maxdepth: 1
/prop_dir/COMPILE_DEFINITIONS_CONFIG
+ /prop_dir/TEST_INCLUDE_FILE
Deprecated Properties on Targets
diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index 00d6e6e..55121df 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -70,7 +70,11 @@ be included by the user in the C++ implementation file with a preprocessor
Included ``moc_*.cpp`` and ``*.moc`` files will be generated in the
``<AUTOGEN_BUILD_DIR>/include`` directory which is
automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
-(This differs from CMake 3.7 and below; see their documentation for details.)
+
+* This differs from CMake 3.7 and below; see their documentation for details.
+
+* For multi configuration generators, the include directory is
+ ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>``.
* See :prop_tgt:`AUTOGEN_BUILD_DIR`.
@@ -91,6 +95,10 @@ following targets by setting the :variable:`CMAKE_AUTOMOC` variable. The
options to pass to ``moc``. The :variable:`CMAKE_AUTOMOC_MOC_OPTIONS`
variable may be populated to pre-set the options for all following targets.
+The appearance of the strings ``Q_OBJECT`` or ``Q_GADGET`` in a source file
+determines if it needs to be ``moc`` processed. To search for additional
+strings, list them in :prop_tgt:`AUTOMOC_MACRO_NAMES`.
+
Additional ``moc`` dependency file names can be extracted from source code
by using :prop_tgt:`AUTOMOC_DEPEND_FILTERS`.
@@ -107,15 +115,26 @@ inspects the C++ files in the target to determine if they require ``uic`` to
be run, and to create rules to execute ``uic`` at the appropriate time.
If a preprocessor ``#include`` directive is found which matches
-``ui_<basename>.h``, and a ``<basename>.ui`` file exists, then ``uic`` will
-be executed to generate the appropriate file. The ``<basename>.ui`` file is
-searched for first in the vicinity of including file and afterwards in the
-optional :prop_tgt:`AUTOUIC_SEARCH_PATHS` of the target.
+``<path>ui_<basename>.h``, and a ``<basename>.ui`` file exists,
+then ``uic`` will be executed to generate the appropriate file.
+The ``<basename>.ui`` file is searched for in the following places
+
+1. ``<source_dir>/<basename>.ui``
+2. ``<source_dir>/<path><basename>.ui``
+3. ``<AUTOUIC_SEARCH_PATHS>/<basename>.ui``
+4. ``<AUTOUIC_SEARCH_PATHS>/<path><basename>.ui``
+
+where ``<source_dir>`` is the directory of the C++ file and
+:prop_tgt:`AUTOUIC_SEARCH_PATHS` is a list of additional search paths.
The generated generated ``ui_*.h`` files are placed in the
``<AUTOGEN_BUILD_DIR>/include`` directory which is
automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
-(This differs from CMake 3.7 and below; see their documentation for details.)
+
+* This differs from CMake 3.7 and below; see their documentation for details.
+
+* For multi configuration generators, the include directory is
+ ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>``.
* See :prop_tgt:`AUTOGEN_BUILD_DIR`.
diff --git a/Help/manual/cmake-server.7.rst b/Help/manual/cmake-server.7.rst
index 9520cc1..c56e5a7 100644
--- a/Help/manual/cmake-server.7.rst
+++ b/Help/manual/cmake-server.7.rst
@@ -254,6 +254,11 @@ versions supported by the cmake server. These are JSON objects with "major" and
as experimental. These will contain the "isExperimental" key set to true. Enabling
these requires a special command line argument when starting the cmake server mode.
+Within a "major" version all "minor" versions are fully backwards compatible.
+New "minor" versions may introduce functionality in such a way that existing
+clients of the same "major" version will continue to work, provided they
+ignore keys in the output that they do not know about.
+
Example::
[== "CMake Server" ==[
@@ -268,8 +273,13 @@ The first request that the client may send to the server is of type "handshake".
This request needs to pass one of the "supportedProtocolVersions" of the "hello"
type response received earlier back to the server in the "protocolVersion" field.
+Giving the "major" version of the requested protocol version will make the server
+use the latest minor version of that protocol. Use this if you do not explicitly
+need to depend on a specific minor version.
-Each protocol version may request additional attributes to be present.
+If the build directory already contains a CMake cache, it is sufficient to set
+the "buildDirectory" attribute. To create a fresh build directory, additional
+attributes are required depending on the protocol version.
Protocol version 1.0 requires the following attributes to be set:
@@ -496,6 +506,9 @@ Each target object can have the following keys:
with the sysroot path.
"fileGroups"
contains the source files making up the target.
+"crossReferences"
+ contains the location of the target in the corresponding CMakeLists.txt
+ file and the locations of the related statements like "target_link_libraries"
FileGroups are used to group sources using similar settings together.
@@ -521,6 +534,16 @@ Each fileGroup object may contain the following keys:
All file paths in the fileGroup are either absolute or relative to the
sourceDirectory of the target.
+CrossReferences object is used to report the location of the target (including
+the entire call stack if the target is defined in a function) and the related
+"target_link_libraries", "target_include_directories", "target_compile_definitions"
+and "target_compile_options" statements.
+
+See the example below for details on the internal format of the "crossReferences" object.
+Line numbers stated in the "backtrace" entries are 1-based. The last entry of a backtrace
+is a special entry with missing "line" and "name" fields that specifies the initial
+CMakeLists.txt file.
+
Example::
[== "CMake Server" ==[
@@ -557,7 +580,34 @@ CMake will reply::
"linkerLanguage": "C",
"name": "cmForm",
"sourceDirectory": "/home/code/src/cmake/Source/CursesDialog/form",
- "type": "STATIC_LIBRARY"
+ "type": "STATIC_LIBRARY",
+ "crossReferences": {
+ "backtrace": [
+ {
+ "line": 7,
+ "name": "add_executable",
+ "path": "C:/full/path/CMakeLists.txt"
+ },
+ {
+ "path": "c:/full/path/CMakeLists.txt"
+ }
+ ],
+ "relatedStatements": [
+ {
+ "backtrace": [
+ {
+ "line": 8,
+ "name": "target_link_libraries",
+ "path": "c:/full/path/CMakeLists.txt"
+ },
+ {
+ "path": "c:/full/path/CMakeLists.txt"
+ }
+ ],
+ "type": "target_link_libraries"
+ }
+ ]
+ }
}
]
},
@@ -616,8 +666,7 @@ and will not survive the build directory getting cleaned out.
Type "cache"
^^^^^^^^^^^^
-The "cache" request can be used once a project is configured and will
-list the cached configuration values.
+The "cache" request will list the cached configuration values.
Example::
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 1a2726d..bef1171 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -32,6 +32,7 @@ Variables that Provide Information
/variable/CMAKE_CURRENT_LIST_FILE
/variable/CMAKE_CURRENT_LIST_LINE
/variable/CMAKE_CURRENT_SOURCE_DIR
+ /variable/CMAKE_DIRECTORY_LABELS
/variable/CMAKE_DL_LIBS
/variable/CMAKE_EDIT_COMMAND
/variable/CMAKE_EXECUTABLE_SUFFIX
@@ -269,6 +270,7 @@ Variables that Control the Build
/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG
/variable/CMAKE_AUTOMOC
/variable/CMAKE_AUTOMOC_DEPEND_FILTERS
+ /variable/CMAKE_AUTOMOC_MACRO_NAMES
/variable/CMAKE_AUTOMOC_MOC_OPTIONS
/variable/CMAKE_AUTORCC
/variable/CMAKE_AUTORCC_OPTIONS
@@ -319,6 +321,7 @@ Variables that Control the Build
/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG
/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG_INIT
/variable/CMAKE_MODULE_LINKER_FLAGS_INIT
+ /variable/CMAKE_MSVCIDE_RUN_PATH
/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX
/variable/CMAKE_NO_BUILTIN_CHRPATH
/variable/CMAKE_NO_SYSTEM_FROM_IMPORTED
@@ -386,6 +389,7 @@ Variables for Languages
/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
@@ -480,6 +484,7 @@ Variables for CTest
/variable/CTEST_GIT_UPDATE_OPTIONS
/variable/CTEST_HG_COMMAND
/variable/CTEST_HG_UPDATE_OPTIONS
+ /variable/CTEST_LABELS_FOR_SUBPROJECTS
/variable/CTEST_MEMORYCHECK_COMMAND
/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS
/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index ba925e8..8aece23 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -262,6 +262,36 @@ Available commands are:
351abe79cd3800b38cdfb25d45015a15 file1.txt
052f86c15bbde68af55c7f7b340ab639 file2.txt
+``sha1sum <file>...``
+ Create SHA1 checksum of files in ``sha1sum`` compatible format::
+
+ 4bb7932a29e6f73c97bb9272f2bdc393122f86e0 file1.txt
+ 1df4c8f318665f9a5f2ed38f55adadb7ef9f559c file2.txt
+
+``sha224sum <file>...``
+ Create SHA224 checksum of files in ``sha224sum`` compatible format::
+
+ b9b9346bc8437bbda630b0b7ddfc5ea9ca157546dbbf4c613192f930 file1.txt
+ 6dfbe55f4d2edc5fe5c9197bca51ceaaf824e48eba0cc453088aee24 file2.txt
+
+``sha256sum <file>...``
+ Create SHA256 checksum of files in ``sha256sum`` compatible format::
+
+ 76713b23615d31680afeb0e9efe94d47d3d4229191198bb46d7485f9cb191acc file1.txt
+ 15b682ead6c12dedb1baf91231e1e89cfc7974b3787c1e2e01b986bffadae0ea file2.txt
+
+``sha384sum <file>...``
+ Create SHA384 checksum of files in ``sha384sum`` compatible format::
+
+ acc049fedc091a22f5f2ce39a43b9057fd93c910e9afd76a6411a28a8f2b8a12c73d7129e292f94fc0329c309df49434 file1.txt
+ 668ddeb108710d271ee21c0f3acbd6a7517e2b78f9181c6a2ff3b8943af92b0195dcb7cce48aa3e17893173c0a39e23d file2.txt
+
+``sha512sum <file>...``
+ Create SHA512 checksum of files in ``sha512sum`` compatible format::
+
+ 2a78d7a6c5328cfb1467c63beac8ff21794213901eaadafd48e7800289afbc08e5fb3e86aa31116c945ee3d7bf2a6194489ec6101051083d1108defc8e1dba89 file1.txt
+ 7a0b54896fe5e70cca6dd643ad6f672614b189bf26f8153061c4d219474b05dad08c4e729af9f4b009f1a1a280cb625454bf587c690f4617c27e3aebdf3b7a2d file2.txt
+
``remove [-f] <file>...``
Remove the file(s). If any of the listed files already do not
exist, the command returns a non-zero exit code, but no message
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index a89c4e9..03466ce 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -250,6 +250,13 @@ Options
label associated with the tests run. If there are no labels on the
tests, nothing extra is printed.
+ ``--no-subproject-summary``
+ Disable timing summary information for subprojects.
+
+ This option tells ctest not to print summary information for each
+ subproject associated with the tests run. If there are no subprojects on the
+ tests, nothing extra is printed.
+
``--build-and-test <path-to-source> <path-to-build>``
Configure, build and run a test.
@@ -758,6 +765,15 @@ Configuration settings include:
* :module:`CTest` module variable: :variable:`CMAKE_COMMAND`
followed by :variable:`PROJECT_SOURCE_DIR`
+``LabelsForSubprojects``
+ Specify a semicolon-separated list of labels that will be treated as
+ subprojects. This mapping will be passed on to CDash when configure, test or
+ build results are submitted.
+
+ * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
+ * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
+
+
.. _`CTest Build Step`:
CTest Build Step
@@ -780,6 +796,14 @@ Configuration settings include:
* :module:`CTest` module variable: ``DEFAULT_CTEST_CONFIGURATION_TYPE``,
initialized by the ``CMAKE_CONFIG_TYPE`` environment variable
+``LabelsForSubprojects``
+ Specify a semicolon-separated list of labels that will be treated as
+ subprojects. This mapping will be passed on to CDash when configure, test or
+ build results are submitted.
+
+ * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
+ * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
+
``MakeCommand``
Command-line to launch the software build process.
It will be executed in the location specified by the
@@ -815,6 +839,15 @@ Arguments to the command may specify some of the step settings.
Configuration settings include:
+``LabelsForSubprojects``
+ Specify a semicolon-separated list of labels that will be treated as
+ subprojects. This mapping will be passed on to CDash when configure, test or
+ build results are submitted.
+
+ * `CTest Script`_ variable: :variable:`CTEST_LABELS_FOR_SUBPROJECTS`
+ * :module:`CTest` module variable: ``CTEST_LABELS_FOR_SUBPROJECTS``
+
+
``TestLoad``
While running tests in parallel (e.g. with ``-j``), try not to start
tests when they may cause the CPU load to pass above a given threshold.
diff --git a/Help/module/CPackFreeBSD.rst b/Help/module/CPackFreeBSD.rst
new file mode 100644
index 0000000..083f0cb
--- /dev/null
+++ b/Help/module/CPackFreeBSD.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/CPackFreeBSD.cmake
diff --git a/Help/policy/CMP0070.rst b/Help/policy/CMP0070.rst
new file mode 100644
index 0000000..0fb3617
--- /dev/null
+++ b/Help/policy/CMP0070.rst
@@ -0,0 +1,25 @@
+CMP0070
+-------
+
+Define :command:`file(GENERATE)` behavior for relative paths.
+
+CMake 3.10 and newer define that relative paths given to ``INPUT`` and
+``OUTPUT`` arguments of ``file(GENERATE)`` are interpreted relative to the
+current source and binary directories, respectively. CMake 3.9 and lower did
+not define any behavior for relative paths but did not diagnose them either
+and accidentally treated them relative to the process working directory.
+Policy ``CMP0070`` provides compatibility with projects that used the old
+undefined behavior.
+
+This policy affects behavior of relative paths given to ``file(GENERATE)``.
+The ``OLD`` behavior for this policy is to treat the paths relative to the
+working directory of CMake. The ``NEW`` behavior for this policy is to
+interpret relative paths with respect to the current source or binary
+directory of the caller.
+
+This policy was introduced in CMake version 3.10. 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.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0071.rst b/Help/policy/CMP0071.rst
new file mode 100644
index 0000000..61f14dc
--- /dev/null
+++ b/Help/policy/CMP0071.rst
@@ -0,0 +1,34 @@
+CMP0071
+-------
+
+Let :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` process
+:prop_sf:`GENERATED` files.
+
+CMake 3.10 and newer process regular *and* :prop_sf:`GENERATED` source files
+in :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`.
+In CMake 3.9 and lower, only regular source files were processed in
+:prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`,
+:prop_sf:`GENERATED` source files were ignored.
+
+This policy affects how :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` process
+source files that are :prop_sf:`GENERATED`.
+
+The ``OLD`` behavior for this policy is to *ignore* :prop_sf:`GENERATED`
+source files in :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`.
+
+The ``NEW`` behavior for this policy is to process :prop_sf:`GENERATED`
+source files in :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` just like regular
+source files.
+
+.. note::
+ To exclude source files from :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`
+ processing, the boolean source file properties
+ :prop_sf:`SKIP_AUTOMOC`, :prop_sf:`SKIP_AUTOUIC` and :prop_sf:`SKIP_AUTOGEN`
+ can be set accordingly.
+
+This policy was introduced in CMake version 3.10. 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.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/prop_dir/LABELS.rst b/Help/prop_dir/LABELS.rst
new file mode 100644
index 0000000..de27d90
--- /dev/null
+++ b/Help/prop_dir/LABELS.rst
@@ -0,0 +1,13 @@
+LABELS
+------
+
+Specify a list of text labels associated with a directory and all of its
+subdirectories. This is equivalent to setting the :prop_tgt:`LABELS` target
+property and the :prop_test:`LABELS` test property on all targets and tests in
+the current directory and subdirectories. Note: Launchers must enabled to
+propagate labels to targets.
+
+The :variable:`CMAKE_DIRECTORY_LABELS` variable can be used to initialize this
+property.
+
+The list is reported in dashboard submissions.
diff --git a/Help/prop_dir/TEST_INCLUDE_FILE.rst b/Help/prop_dir/TEST_INCLUDE_FILE.rst
index e477951..31b2382 100644
--- a/Help/prop_dir/TEST_INCLUDE_FILE.rst
+++ b/Help/prop_dir/TEST_INCLUDE_FILE.rst
@@ -1,7 +1,9 @@
TEST_INCLUDE_FILE
-----------------
+Deprecated. Use :prop_dir:`TEST_INCLUDE_FILES` instead.
+
A cmake file that will be included when ctest is run.
-If you specify TEST_INCLUDE_FILE, that file will be included and
+If you specify ``TEST_INCLUDE_FILE``, that file will be included and
processed when ctest is run on the directory.
diff --git a/Help/prop_dir/TEST_INCLUDE_FILES.rst b/Help/prop_dir/TEST_INCLUDE_FILES.rst
new file mode 100644
index 0000000..c3e4602
--- /dev/null
+++ b/Help/prop_dir/TEST_INCLUDE_FILES.rst
@@ -0,0 +1,7 @@
+TEST_INCLUDE_FILES
+------------------
+
+A list of cmake files that will be included when ctest is run.
+
+If you specify ``TEST_INCLUDE_FILES``, those files will be included and
+processed when ctest is run on the directory.
diff --git a/Help/prop_test/FIXTURES_CLEANUP.rst b/Help/prop_test/FIXTURES_CLEANUP.rst
index f0a4be0..3075b4d 100644
--- a/Help/prop_test/FIXTURES_CLEANUP.rst
+++ b/Help/prop_test/FIXTURES_CLEANUP.rst
@@ -2,7 +2,8 @@ FIXTURES_CLEANUP
----------------
Specifies a list of fixtures for which the test is to be treated as a cleanup
-test.
+test. These fixture names are distinct from test case names and are not
+required to have any similarity to the names of tests associated with them.
Fixture cleanup tests are ordinary tests with all of the usual test
functionality. Setting the ``FIXTURES_CLEANUP`` property for a test has two
diff --git a/Help/prop_test/FIXTURES_REQUIRED.rst b/Help/prop_test/FIXTURES_REQUIRED.rst
index e37dfb5..e3f60c4 100644
--- a/Help/prop_test/FIXTURES_REQUIRED.rst
+++ b/Help/prop_test/FIXTURES_REQUIRED.rst
@@ -2,7 +2,7 @@ FIXTURES_REQUIRED
-----------------
Specifies a list of fixtures the test requires. Fixture names are case
-sensitive.
+sensitive and they are not required to have any similarity to test names.
Fixtures are a way to attach setup and cleanup tasks to a set of tests. If a
test requires a given fixture, then all tests marked as setup tasks for that
@@ -19,7 +19,9 @@ some setup tests fail.
When CTest is asked to execute only a subset of tests (e.g. by the use of
regular expressions or when run with the ``--rerun-failed`` command line
option), it will automatically add any setup or cleanup tests for fixtures
-required by any of the tests that are in the execution set.
+required by any of the tests that are in the execution set. This behavior can
+be overridden with the ``-FS``, ``-FC`` and ``-FA`` command line options to
+:manual:`ctest(1)` if desired.
Since setup and cleanup tasks are also tests, they can have an ordering
specified by the :prop_test:`DEPENDS` test property just like any other tests.
diff --git a/Help/prop_test/FIXTURES_SETUP.rst b/Help/prop_test/FIXTURES_SETUP.rst
index a220215..fdb21cc 100644
--- a/Help/prop_test/FIXTURES_SETUP.rst
+++ b/Help/prop_test/FIXTURES_SETUP.rst
@@ -2,14 +2,15 @@ FIXTURES_SETUP
--------------
Specifies a list of fixtures for which the test is to be treated as a setup
-test.
+test. These fixture names are distinct from test case names and are not
+required to have any similarity to the names of tests associated with them.
Fixture setup tests are ordinary tests with all of the usual test
functionality. Setting the ``FIXTURES_SETUP`` property for a test has two
primary effects:
- CTest will ensure the test executes before any other test which lists the
- fixture(s) in its :prop_test:`FIXTURES_REQUIRED` property.
+ fixture name(s) in its :prop_test:`FIXTURES_REQUIRED` property.
- If CTest is asked to run only a subset of tests (e.g. using regular
expressions or the ``--rerun-failed`` option) and the setup test is not in
diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index 0171d20..61813be68 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -5,8 +5,8 @@ Should the target be processed with automoc (for Qt projects).
AUTOMOC is a boolean specifying whether CMake will handle the Qt ``moc``
preprocessor automatically, i.e. without having to use the
-:module:`QT4_WRAP_CPP() <FindQt4>` or QT5_WRAP_CPP() macro. Currently Qt4 and Qt5 are
-supported.
+:module:`QT4_WRAP_CPP() <FindQt4>` or QT5_WRAP_CPP() macro.
+Currently Qt4 and Qt5 are supported.
When this property is set ``ON``, CMake will scan the header and
source files at build time and invoke moc accordingly.
@@ -20,6 +20,9 @@ source files at build time and invoke moc accordingly.
This allows the compiler to find the included ``moc_<basename>.cpp`` file
regardless of the location the original source.
+ * For multi configuration generators, the include directory is
+ ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>``.
+
* See :prop_tgt:`AUTOGEN_BUILD_DIR`.
* If an ``#include`` statement like ``#include "<basename>.moc"`` is found,
@@ -34,7 +37,7 @@ source files at build time and invoke moc accordingly.
which is compiled as part of the target.
* The custom directories with checksum
- based names help to avoid name collisions for moc files with the same
+ based names help to avoid name collisions for ``moc`` files with the same
``<basename>``.
* See :prop_tgt:`AUTOGEN_BUILD_DIR`.
@@ -53,11 +56,11 @@ source files at build time and invoke moc accordingly.
This property is initialized by the value of the :variable:`CMAKE_AUTOMOC`
variable if it is set when a target is created.
-Additional command line options for moc can be set via the
+Additional command line options for ``moc`` can be set via the
:prop_tgt:`AUTOMOC_MOC_OPTIONS` property.
By enabling the :variable:`CMAKE_AUTOMOC_RELAXED_MODE` variable the
-rules for searching the files which will be processed by moc can be relaxed.
+rules for searching the files which will be processed by ``moc`` can be relaxed.
See the documentation for this variable for more details.
The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the
@@ -66,6 +69,10 @@ automoc targets together in an IDE, e.g. in MSVS.
The global property :prop_gbl:`AUTOGEN_SOURCE_GROUP` can be used to group
files generated by :prop_tgt:`AUTOMOC` together in an IDE, e.g. in MSVS.
+The appearance of the strings ``Q_OBJECT`` or ``Q_GADGET`` in a source file
+determines if it needs to be ``moc`` processed. To search for additional
+strings, list them in :prop_tgt:`AUTOMOC_MACRO_NAMES`.
+
Additional ``moc`` dependency file names can be extracted from source code
by using :prop_tgt:`AUTOMOC_DEPEND_FILTERS`.
diff --git a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
new file mode 100644
index 0000000..0639bc8
--- /dev/null
+++ b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
@@ -0,0 +1,28 @@
+AUTOMOC_MACRO_NAMES
+-------------------
+
+Additional macro names used by :prop_tgt:`AUTOMOC`
+to determine if a C++ file needs to be processed by ``moc``.
+
+This property is only used if the :prop_tgt:`AUTOMOC` property is ``ON``
+for this target.
+
+CMake searches for the strings ``Q_OBJECT`` and ``Q_GADGET`` to
+determine if a file needs to be processed by ``moc``.
+:prop_tgt:`AUTOMOC_MACRO_NAMES` allows to add additional strings to the
+search list. This is useful for cases where the ``Q_OBJECT`` or ``Q_GADGET``
+macro is hidden inside another macro.
+
+By default :prop_tgt:`AUTOMOC_MACRO_NAMES` is initialized from
+:variable:`CMAKE_AUTOMOC_MACRO_NAMES`, which is empty by default.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
+
+Example
+-------
+In this case the the ``Q_OBJECT`` macro is hidden inside an other macro
+called ``CUSTOM_MACRO``. To let CMake know that source files, that contain
+``CUSTOM_MACRO``, need to be ``moc`` processed, we call::
+
+ set_property(TARGET tgt PROPERTY AUTOMOC_MACRO_NAMES "CUSTOM_MACRO")
diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst
index 6493bbc..2fc2167 100644
--- a/Help/prop_tgt/AUTOUIC.rst
+++ b/Help/prop_tgt/AUTOUIC.rst
@@ -17,6 +17,9 @@ optional :prop_tgt:`AUTOUIC_SEARCH_PATHS` of the target.
``<AUTOGEN_BUILD_DIR>/include``,
which is automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
+* For multi configuration generators, the include directory is
+ ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>``.
+
* See :prop_tgt:`AUTOGEN_BUILD_DIR`.
This property is initialized by the value of the :variable:`CMAKE_AUTOUIC`
diff --git a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
index 0fe0b31..28925fc 100644
--- a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
+++ b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
@@ -1,7 +1,8 @@
<LANG>_COMPILER_LAUNCHER
------------------------
-This property is implemented only when ``<LANG>`` is ``C`` or ``CXX``.
+This property is implemented only when ``<LANG>`` is ``C``, ``CXX``,
+or ``CUDA``.
Specify a :ref:`;-list <CMake Language Lists>` containing a command line
for a compiler launching tool. The :ref:`Makefile Generators` and the
diff --git a/Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst b/Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst
new file mode 100644
index 0000000..ab311ea
--- /dev/null
+++ b/Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst
@@ -0,0 +1,14 @@
+VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname>
+-----------------------------------------------
+
+Defines an XML property ``<tagname>`` for a .NET reference
+``<refname>``.
+
+Reference properties can be set for .NET references which are
+defined by the target properties :prop_tgt:`VS_DOTNET_REFERENCES`,
+:prop_tgt:`VS_DOTNET_REFERENCE_<refname>`
+and also for project references to other C# targets which are
+established by :command:`target_link_libraries()`.
+
+This property is only applicable to C# targets and Visual Studio
+generators 2010 and later.
diff --git a/Help/release/3.9.rst b/Help/release/3.9.rst
index ae55105..897e268 100644
--- a/Help/release/3.9.rst
+++ b/Help/release/3.9.rst
@@ -34,8 +34,6 @@ Generators
This is an experimental feature and can be activated by setting the
:variable:`CMAKE_XCODE_GENERATE_SCHEME` variable to a ``TRUE`` value.
-* The :generator:`Xcode` generator now supports Xcode 9.
-
Commands
--------
@@ -310,9 +308,6 @@ Other Changes
in dependent targets may now compile without waiting for their targets'
dependencies to link.
-* On macOS, the default application bundle ``Info.plist`` file now enables
- Hi-DPI support.
-
* On macOS, ``RPATH`` settings such as :prop_tgt:`BUILD_WITH_INSTALL_RPATH`
no longer affect the ``install_name`` field. See policy :policy:`CMP0068`.
@@ -333,3 +328,15 @@ Changes made since CMake 3.9.0 include the following.
CMake 3.9.0 has been removed for the 3.9 series due to regressions
caused by new use of ``<PackageName>_ROOT`` variables. The behavior
may be re-introduced in the future in a more-compatible way.
+
+3.9.2
+-----
+
+* On macOS, the default application bundle ``Info.plist`` file no longer
+ enables Hi-DPI support as it did in 3.9.0 and 3.9.1. The change had
+ to be reverted because it broke iOS applications.
+
+* The Xcode generator no longer adds "outputPaths" to custom script
+ build phases as it did in 3.9.0 and 3.9.1. This was added in an
+ attempt to support Xcode 9's new build system, but broke incremental
+ rebuilds for both the old and new Xcode build systems.
diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst
new file mode 100644
index 0000000..e4cc01e
--- /dev/null
+++ b/Help/release/dev/0-sample-topic.rst
@@ -0,0 +1,7 @@
+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/FindCurses-wide.rst b/Help/release/dev/FindCurses-wide.rst
new file mode 100644
index 0000000..63fb671
--- /dev/null
+++ b/Help/release/dev/FindCurses-wide.rst
@@ -0,0 +1,5 @@
+FindCurses-wide
+---------------
+
+* The :module:`FindCurses` module gained a ``CURSES_NEED_WIDE`` option
+ to request the wide-character variant.
diff --git a/Help/release/dev/GoogleTest.rst b/Help/release/dev/GoogleTest.rst
new file mode 100644
index 0000000..1e4a10e
--- /dev/null
+++ b/Help/release/dev/GoogleTest.rst
@@ -0,0 +1,11 @@
+GoogleTest
+----------
+
+* The :module:`GoogleTest` module gained a new command
+ :command:`gtest_discover_tests` implementing dynamic (build-time) test
+ discovery. Unlike the source parsing approach, dynamic discovery executes
+ the test (in 'list available tests' mode) at build time to discover tests.
+ This is robust against unusual ways of labeling tests, provides much better
+ support for advanced features such as parameterized tests, and does not
+ require re-running CMake to discover added or removed tests within a test
+ executable.
diff --git a/Help/release/dev/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst b/Help/release/dev/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst
new file mode 100644
index 0000000..0e258fd
--- /dev/null
+++ b/Help/release/dev/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst
@@ -0,0 +1,6 @@
+vs-dotnet-custom-reference-tags
+-------------------------------
+
+* The :prop_tgt:`VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname>`
+ target property was added to support custom XML tags for reference
+ assemblies in C# targets.
diff --git a/Help/release/dev/autogen-configs.rst b/Help/release/dev/autogen-configs.rst
new file mode 100644
index 0000000..7613c68
--- /dev/null
+++ b/Help/release/dev/autogen-configs.rst
@@ -0,0 +1,8 @@
+autogen-configs
+---------------
+
+* When using :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` with a
+ multi configuration generator (e.g. :generator:`Xcode`),
+ included ``*.moc``, ``moc_*.cpp`` and ``ui_*.h`` files are generated in
+ ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>`` instead of
+ ``<AUTOGEN_BUILD_DIR>/include``.
diff --git a/Help/release/dev/autogen-generated-files.rst b/Help/release/dev/autogen-generated-files.rst
new file mode 100644
index 0000000..da2fc4e
--- /dev/null
+++ b/Help/release/dev/autogen-generated-files.rst
@@ -0,0 +1,8 @@
+autogen-generated-files
+-----------------------
+
+* When using :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC`,
+ source files that are :prop_sf:`GENERATED` will be processed as well.
+ They were ignored by :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`
+ in earlier releases.
+ See policy :policy:`CMP0071`.
diff --git a/Help/release/dev/autogen-macro-names.rst b/Help/release/dev/autogen-macro-names.rst
new file mode 100644
index 0000000..736dd3a
--- /dev/null
+++ b/Help/release/dev/autogen-macro-names.rst
@@ -0,0 +1,12 @@
+autogen-macro-names
+-------------------
+
+* When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``
+ and ``Q_OBJECT`` in a source file to determine if it needs to be ``moc``
+ processed. The new variable :variable:`CMAKE_AUTOMOC_MACRO_NAMES` allows to
+ register additional strings (macro names) so search for.
+
+* When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``
+ and ``Q_OBJECT`` in a source file to determine if it needs to be ``moc``
+ processed. The new target property :prop_tgt:`AUTOMOC_MACRO_NAMES` allows to
+ register additional strings (macro names) so search for.
diff --git a/Help/release/dev/cmake-command-mode-shasum.rst b/Help/release/dev/cmake-command-mode-shasum.rst
new file mode 100644
index 0000000..681e0c0
--- /dev/null
+++ b/Help/release/dev/cmake-command-mode-shasum.rst
@@ -0,0 +1,5 @@
+cmake-command-mode-shasum
+-------------------------
+
+* Added sha1sum, sha224sum, sha256sum, sha384sum and sha512sum
+ as an equivalent to existing md5sum to cmake command mode.
diff --git a/Help/release/dev/cmake_host_system_information-extend.rst b/Help/release/dev/cmake_host_system_information-extend.rst
new file mode 100644
index 0000000..d1c882d
--- /dev/null
+++ b/Help/release/dev/cmake_host_system_information-extend.rst
@@ -0,0 +1,6 @@
+cmake_host_system_information-extend
+------------------------------------
+
+* The :command:`cmake_host_system_information` command learned more keys
+ to get information about the processor capabilities and the host OS
+ version.
diff --git a/Help/release/dev/cpack-freebsd-pkg.rst b/Help/release/dev/cpack-freebsd-pkg.rst
new file mode 100644
index 0000000..1732581
--- /dev/null
+++ b/Help/release/dev/cpack-freebsd-pkg.rst
@@ -0,0 +1,5 @@
+cpack-freebsd-pkg
+-----------------
+
+* CPack gained a ``FREEBSD`` generator for FreeBSD ``pkg(8)``, configured
+ by the :module:`CPackFreeBSD` module.
diff --git a/Help/release/dev/cpackifw-package-file-extension.rst b/Help/release/dev/cpackifw-package-file-extension.rst
new file mode 100644
index 0000000..e264081
--- /dev/null
+++ b/Help/release/dev/cpackifw-package-file-extension.rst
@@ -0,0 +1,6 @@
+cpackifw-package-file-extension
+-------------------------------
+
+* The :module:`CPackIFW` module gained new
+ :variable:`CPACK_IFW_PACKAGE_FILE_EXTENSION` variable to customize
+ target binary format.
diff --git a/Help/release/dev/cpackifw-repositories-directories.rst b/Help/release/dev/cpackifw-repositories-directories.rst
new file mode 100644
index 0000000..cda74b8
--- /dev/null
+++ b/Help/release/dev/cpackifw-repositories-directories.rst
@@ -0,0 +1,8 @@
+cpackifw-repositories-directories
+---------------------------------
+
+* The :module:`CPackIFW` module gained new
+ :variable:`CPACK_IFW_REPOSITORIES_DIRECTORIES` variable to specify
+ additional repositories dirs that will be used to resolve and
+ repack dependent components. This feature available only
+ since QtIFW 3.1.
diff --git a/Help/release/dev/cuda-compiler-launcher.rst b/Help/release/dev/cuda-compiler-launcher.rst
new file mode 100644
index 0000000..f217780
--- /dev/null
+++ b/Help/release/dev/cuda-compiler-launcher.rst
@@ -0,0 +1,8 @@
+cuda-compiler-launcher
+----------------------
+
+* The :ref:`Makefile Generators` and the :generator:`Ninja` generator learned
+ to add compiler launcher tools like ccache along with the compiler for the
+ ``CUDA`` language (``C`` and ``CXX`` were supported previously). See the
+ :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable and
+ :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property for details.
diff --git a/Help/release/dev/deb-on-windows.rst b/Help/release/dev/deb-on-windows.rst
new file mode 100644
index 0000000..b307720
--- /dev/null
+++ b/Help/release/dev/deb-on-windows.rst
@@ -0,0 +1,7 @@
+deb-on-windows
+--------------
+
+* The CPack ``DEB`` generator, configured by the :module:`CPackDeb` module,
+ was enabled on Windows. While not fully featured (due to the lack of
+ external UNIX tools) this will allow building basic cross-platform Debian
+ packages.
diff --git a/Help/release/dev/drop-HP-UX.rst b/Help/release/dev/drop-HP-UX.rst
new file mode 100644
index 0000000..199fa09
--- /dev/null
+++ b/Help/release/dev/drop-HP-UX.rst
@@ -0,0 +1,8 @@
+drop-HP-UX
+----------
+
+* Support for building CMake on HP-UX has been dropped pending better
+ support for C++11 and a port of libuv. See `CMake Issue 17137`_.
+ Use CMake 3.9 or lower instead for HP-UX support.
+
+.. _`CMake Issue 17137`: https://gitlab.kitware.com/cmake/cmake/issues/17137
diff --git a/Help/release/dev/execute_process-pipeline-results.rst b/Help/release/dev/execute_process-pipeline-results.rst
new file mode 100644
index 0000000..9755ef5
--- /dev/null
+++ b/Help/release/dev/execute_process-pipeline-results.rst
@@ -0,0 +1,6 @@
+execute_process-pipeline-results
+--------------------------------
+
+* The :command:`execute_process` command gained a ``RESULTS_VARIABLE``
+ option to collect a list of results from all children in a pipeline
+ of processes when multiple ``COMMAND`` arguments are given.
diff --git a/Help/release/dev/file-generate-relative-paths.rst b/Help/release/dev/file-generate-relative-paths.rst
new file mode 100644
index 0000000..fdeb9e0e
--- /dev/null
+++ b/Help/release/dev/file-generate-relative-paths.rst
@@ -0,0 +1,7 @@
+file-generate-relative-paths
+----------------------------
+
+* The :command:`file(GENERATE)` command now interprets relative paths
+ given to its ``OUTPUT`` and ``INPUT`` arguments with respect to the
+ caller's current binary and source directories, respectively.
+ See policy :policy:`CMP0070`.
diff --git a/Help/release/dev/iar.rst b/Help/release/dev/iar.rst
new file mode 100644
index 0000000..c6678eb
--- /dev/null
+++ b/Help/release/dev/iar.rst
@@ -0,0 +1,4 @@
+iar
+---
+
+* Support for the IAR ARM Compiler was improved.
diff --git a/Help/release/dev/include-guard.rst b/Help/release/dev/include-guard.rst
new file mode 100644
index 0000000..9b0c64c
--- /dev/null
+++ b/Help/release/dev/include-guard.rst
@@ -0,0 +1,8 @@
+include_guard
+-------------
+
+* The :command:`include_guard` command was introduced to allow guarding
+ CMake scripts from being included more than once. The command supports
+ ``DIRECTORY`` and ``GLOBAL`` options to adjust the corresponding include guard
+ scope. If no options given, include guard is similar to basic variable-based
+ check.
diff --git a/Help/release/dev/indented_cmakedefine.rst b/Help/release/dev/indented_cmakedefine.rst
new file mode 100644
index 0000000..fd28b25
--- /dev/null
+++ b/Help/release/dev/indented_cmakedefine.rst
@@ -0,0 +1,7 @@
+indented_cmakedefine
+--------------------
+
+* The :command:`configure_file` command learned to support indented
+ ``# cmakedefine`` and ``# cmakedefine01``. Spaces and/or tabs between
+ the ``#`` character and the ``cmakedefine``/``cmakedefine01`` words
+ are now understood and preserved in the output.
diff --git a/Help/release/dev/labels_for_subprojects.rst b/Help/release/dev/labels_for_subprojects.rst
new file mode 100644
index 0000000..7344502
--- /dev/null
+++ b/Help/release/dev/labels_for_subprojects.rst
@@ -0,0 +1,14 @@
+labels_for_subprojects
+----------------------
+
+* A :variable:`CTEST_LABELS_FOR_SUBPROJECTS` CTest module variable and CTest
+ script variable was added to specify a list of labels that should be treated
+ as subprojects by CDash. To use this value in both the CTest module and the
+ ctest command line `Dashboard Client` mode (e.g. ctest -S) set it in the
+ CTestConfig.cmake config file.
+
+* A :prop_dir:`LABELS` directory property was added to specify labels
+ for all targets and tests in a directory.
+
+* A :variable:`CMAKE_DIRECTORY_LABELS` variable was added to specify
+ labels for all tests in a directory.
diff --git a/Help/release/dev/require-c++11.rst b/Help/release/dev/require-c++11.rst
new file mode 100644
index 0000000..7b849e7
--- /dev/null
+++ b/Help/release/dev/require-c++11.rst
@@ -0,0 +1,5 @@
+require-c++11
+-------------
+
+* Support for building CMake itself with C++98 compilers was dropped.
+ CMake is now implemented using C++11.
diff --git a/Help/release/dev/string_prepend.rst b/Help/release/dev/string_prepend.rst
new file mode 100644
index 0000000..f896e91
--- /dev/null
+++ b/Help/release/dev/string_prepend.rst
@@ -0,0 +1,4 @@
+string_prepend
+--------------
+
+* The :command:`string` command learned a new ``PREPEND`` subcommand.
diff --git a/Help/release/dev/test_include_files.rst b/Help/release/dev/test_include_files.rst
new file mode 100644
index 0000000..b75dd0d
--- /dev/null
+++ b/Help/release/dev/test_include_files.rst
@@ -0,0 +1,7 @@
+test_include_files
+------------------
+
+* A :prop_dir:`TEST_INCLUDE_FILES` directory property was added to
+ list any number of files to be included when running tests with
+ :manual:`ctest(1)`. This generalizes the :prop_dir:`TEST_INCLUDE_FILE`
+ property.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index 6af282c..6c68e65 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -7,6 +7,8 @@ CMake Release Notes
This file should include the adjacent "dev.txt" file
in development versions but not in release versions.
+.. include:: dev.txt
+
Releases
========
diff --git a/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
new file mode 100644
index 0000000..7ed3445
--- /dev/null
+++ b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
@@ -0,0 +1,19 @@
+CMAKE_AUTOMOC_MACRO_NAMES
+----------------------------
+
+Additional macro names used by :variable:`CMAKE_AUTOMOC`
+to determine if a C++ file needs to be processed by ``moc``.
+
+This variable is used to initialize the :prop_tgt:`AUTOMOC_MACRO_NAMES`
+property on all the targets. See that target property for additional
+information.
+
+By default it is empty.
+
+Example
+-------
+Let CMake know that source files that contain ``CUSTOM_MACRO`` must be ``moc``
+processed as well::
+
+ set(CMAKE_AUTOMOC ON)
+ set(CMAKE_AUTOMOC_MACRO_NAMES "CUSTOM_MACRO")
diff --git a/Help/variable/CMAKE_DIRECTORY_LABELS.rst b/Help/variable/CMAKE_DIRECTORY_LABELS.rst
new file mode 100644
index 0000000..2a6c410
--- /dev/null
+++ b/Help/variable/CMAKE_DIRECTORY_LABELS.rst
@@ -0,0 +1,6 @@
+CMAKE_DIRECTORY_LABELS
+-----------------------
+
+Specify labels for the current directory.
+
+This is used to initialize the :prop_dir:`LABELS` directory property.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
new file mode 100644
index 0000000..054c648
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
@@ -0,0 +1,8 @@
+CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID
+-------------------------------------
+
+An internal variable subject to change.
+
+This is used to identify the variant of a compiler based on its target
+architecture. For some compilers this is needed to determine the correct
+usage.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 0fab10c..5204044 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -20,6 +20,7 @@ include:
G95 = G95 Fortran (g95.org)
GNU = GNU Compiler Collection (gcc.gnu.org)
HP = Hewlett-Packard Compiler (hp.com)
+ IAR = IAR Systems (iar.com)
Intel = Intel Compiler (intel.com)
MIPSpro = SGI MIPSpro (sgi.com)
MSVC = Microsoft Visual Studio (microsoft.com)
diff --git a/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst b/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst
index 7961f60..f4e2ba5 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst
@@ -3,4 +3,4 @@ CMAKE_<LANG>_COMPILER_LAUNCHER
Default value for :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property.
This variable is used to initialize the property on each target as it is
-created. This is done only when ``<LANG>`` is ``C`` or ``CXX``.
+created. This is done only when ``<LANG>`` is ``C``, ``CXX``, or ``CUDA``.
diff --git a/Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst b/Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst
new file mode 100644
index 0000000..22e727f
--- /dev/null
+++ b/Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst
@@ -0,0 +1,10 @@
+CMAKE_MSVCIDE_RUN_PATH
+----------------------
+
+Extra PATH locations that should be used when executing
+:command:`add_custom_command` or :command:`add_custom_target` when using the
+:generator:`Visual Studio 9 2008` (or above) generator. This allows
+for running commands and using dll's that the IDE environment is not aware of.
+
+If not set explicitly the value is initialized by the ``CMAKE_MSVCIDE_RUN_PATH``
+environment variable, if set, and otherwise left empty.
diff --git a/Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst b/Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst
new file mode 100644
index 0000000..959596b
--- /dev/null
+++ b/Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst
@@ -0,0 +1,5 @@
+CTEST_LABELS_FOR_SUBPROJECTS
+----------------------------
+
+Specify the CTest ``LabelsForSubprojects`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in
index 4e85474..60ceebc 100644
--- a/Modules/AutogenInfo.cmake.in
+++ b/Modules/AutogenInfo.cmake.in
@@ -4,7 +4,7 @@ set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/")
set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/")
set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/")
set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@")
-set(AM_BUILD_DIR @_autogen_build_dir@)
+set(AM_BUILD_DIR @_build_dir@)
set(AM_SOURCES @_sources@)
set(AM_HEADERS @_headers@)
# Qt environment
@@ -18,6 +18,7 @@ set(AM_MOC_DEFINITIONS @_moc_compile_defs@)
set(AM_MOC_INCLUDES @_moc_incs@)
set(AM_MOC_OPTIONS @_moc_options@)
set(AM_MOC_RELAXED_MODE @_moc_relaxed_mode@)
+set(AM_MOC_MACRO_NAMES @_moc_macro_names@)
set(AM_MOC_DEPEND_FILTERS @_moc_depend_filters@)
set(AM_MOC_PREDEFS_CMD @_moc_predefs_cmd@)
# UIC settings
diff --git a/Modules/CMakeASMCompiler.cmake.in b/Modules/CMakeASMCompiler.cmake.in
index 7b94d0f..a6465f6 100644
--- a/Modules/CMakeASMCompiler.cmake.in
+++ b/Modules/CMakeASMCompiler.cmake.in
@@ -7,8 +7,11 @@ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_RANLIB "@_CMAKE_ASM_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_VERSION "@_CMAKE_ASM_COMPILER_VERSION@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
+@_SET_CMAKE_ASM_COMPILER_ARCHITECTURE_ID@
set(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_ASM@ASM_DIALECT@_LINKER_PREFERENCE 0)
+@CMAKE_ASM_COMPILER_CUSTOM_CODE@
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 974a579..92259dd 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -12,6 +12,7 @@ set(CMAKE_C11_COMPILE_FEATURES "@CMAKE_C11_COMPILE_FEATURES@")
set(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
set(CMAKE_C_SIMULATE_ID "@CMAKE_C_SIMULATE_ID@")
set(CMAKE_C_SIMULATE_VERSION "@CMAKE_C_SIMULATE_VERSION@")
+@_SET_CMAKE_C_COMPILER_ARCHITECTURE_ID@
@SET_MSVC_C_ARCHITECTURE_ID@
@SET_CMAKE_XCODE_CURRENT_ARCH@
set(CMAKE_AR "@CMAKE_AR@")
diff --git a/Modules/CMakeCSharpInformation.cmake b/Modules/CMakeCSharpInformation.cmake
index cd86016..d474c29 100644
--- a/Modules/CMakeCSharpInformation.cmake
+++ b/Modules/CMakeCSharpInformation.cmake
@@ -10,7 +10,7 @@ get_filename_component(CMAKE_BASE_NAME "${CMAKE_CSharp_COMPILER}" NAME_WE)
set(CMAKE_BUILD_TYPE_INIT Debug)
-set(CMAKE_CSharp_FLAGS_INIT "/define:TRACE /langversion:3 /nowin32manifest")
+set(CMAKE_CSharp_FLAGS_INIT "/define:TRACE /langversion:3")
set(CMAKE_CSharp_FLAGS_DEBUG_INIT "/debug:full /optimize- /warn:3 /errorreport:prompt /define:DEBUG")
set(CMAKE_CSharp_FLAGS_RELEASE_INIT "/debug:none /optimize /warn:1 /errorreport:queue")
set(CMAKE_CSharp_FLAGS_RELWITHDEBINFO_INIT "/debug:full /optimize-")
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index 9bba847..f4609cd 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -198,11 +198,11 @@ endif()
#These are used when linking relocatable (dc) cuda code
if(NOT CMAKE_CUDA_DEVICE_LINK_LIBRARY)
set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
- "<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+ "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif()
if(NOT CMAKE_CUDA_DEVICE_LINK_EXECUTABLE)
set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
- "<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+ "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <FLAGS> <CMAKE_CUDA_LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif()
unset(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS)
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index fda7950..47fc624 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -13,6 +13,7 @@ set(CMAKE_CXX17_COMPILE_FEATURES "@CMAKE_CXX17_COMPILE_FEATURES@")
set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
set(CMAKE_CXX_SIMULATE_ID "@CMAKE_CXX_SIMULATE_ID@")
set(CMAKE_CXX_SIMULATE_VERSION "@CMAKE_CXX_SIMULATE_VERSION@")
+@_SET_CMAKE_CXX_COMPILER_ARCHITECTURE_ID@
@SET_MSVC_CXX_ARCHITECTURE_ID@
@SET_CMAKE_XCODE_CURRENT_ARCH@
set(CMAKE_AR "@CMAKE_AR@")
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 9aa096d..6572bb3 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -27,12 +27,18 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@
+#if defined(_MSC_VER) && defined(_MSVC_LANG)
+#define CXX_STD _MSVC_LANG
+#else
+#define CXX_STD __cplusplus
+#endif
+
const char* info_language_dialect_default = "INFO" ":" "dialect_default["
-#if __cplusplus > 201402L
+#if CXX_STD > 201402L
"17"
-#elif __cplusplus >= 201402L
+#elif CXX_STD >= 201402L
"14"
-#elif __cplusplus >= 201103L
+#elif CXX_STD >= 201103L
"11"
#else
"98"
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 87c6b28..f7cf54a 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -84,7 +84,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI "-h")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI "Texas Instruments")
- list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU IAR)
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS IAR)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_IAR )
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_IAR "IAR Assembler")
@@ -103,10 +103,31 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
include(CMakeDetermineCompilerId)
set(userflags)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT} "${userflags}")
+ if("x${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}" STREQUAL "xIAR")
+ # primary necessary to detect architecture, so the right archiver and linker can be picked
+ # eg. IAR Assembler V8.10.1.12857/W32 for ARM
+ # Cut out identification first, newline handling is a pain
+ string(REGEX MATCH "IAR Assembler[^\r\n]*" _compileid "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_OUTPUT}")
+ if("${_compileid}" MATCHES "V([0-9]+\\.[0-9]+\\.[0-9]+)")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_VERSION ${CMAKE_MATCH_1})
+ endif()
+ if("${_compileid}" MATCHES "for[ ]+([A-Za-z0-9]+)")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID ${CMAKE_MATCH_1})
+ endif()
+ endif()
+ unset(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_OUTPUT)
+ unset(_compileid)
endif()
+
if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
- message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
+ if(CMAKE_ASM${ASM_DIALECT}_COMPILER_VERSION)
+ set(_version " ${CMAKE_ASM${ASM_DIALECT}_COMPILER_VERSION}")
+ else()
+ set(_version "")
+ endif()
+ message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}${_version}")
+ unset(_version)
else()
message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
endif()
@@ -143,6 +164,9 @@ endif ()
include(CMakeFindBinUtils)
+set(_CMAKE_PROCESSING_LANGUAGE "ASM")
+include(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-FindBinUtils OPTIONAL)
+unset(_CMAKE_PROCESSING_LANGUAGE)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}")
@@ -152,20 +176,37 @@ else()
message(STATUS "Didn't find assembler")
endif()
-
-set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
-set(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
-set(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}")
-set(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
-set(_CMAKE_ASM_COMPILER_AR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_AR}")
-set(_CMAKE_ASM_COMPILER_RANLIB "${CMAKE_ASM${ASM_DIALECT}_COMPILER_RANLIB}")
+foreach(_var
+ COMPILER
+ COMPILER_ID
+ COMPILER_ARG1
+ COMPILER_ENV_VAR
+ COMPILER_AR
+ COMPILER_RANLIB
+ COMPILER_VERSION
+ )
+ set(_CMAKE_ASM_${_var} "${CMAKE_ASM${ASM_DIALECT}_${_var}}")
+endforeach()
+
+if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID)
+ set(_SET_CMAKE_ASM_COMPILER_ARCHITECTURE_ID
+ "set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID})")
+else()
+ set(_SET_CMAKE_ASM_COMPILER_ARCHITECTURE_ID "")
+endif()
# configure variables set in this file for fast reload later on
configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeASM${ASM_DIALECT}Compiler.cmake @ONLY)
-set(_CMAKE_ASM_COMPILER)
-set(_CMAKE_ASM_COMPILER_ARG1)
-set(_CMAKE_ASM_COMPILER_ENV_VAR)
-set(_CMAKE_ASM_COMPILER_AR)
-set(_CMAKE_ASM_COMPILER_RANLIB)
+foreach(_var
+ COMPILER
+ COMPILER_ID
+ COMPILER_ARG1
+ COMPILER_ENV_VAR
+ COMPILER_AR
+ COMPILER_RANLIB
+ COMPILER_VERSION
+ )
+ unset(_CMAKE_ASM_${_var})
+endforeach()
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 3caccde..fcbda20 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -170,6 +170,13 @@ set(_CMAKE_PROCESSING_LANGUAGE "C")
include(Compiler/${CMAKE_C_COMPILER_ID}-FindBinUtils OPTIONAL)
unset(_CMAKE_PROCESSING_LANGUAGE)
+if(CMAKE_C_COMPILER_ARCHITECTURE_ID)
+ set(_SET_CMAKE_C_COMPILER_ARCHITECTURE_ID
+ "set(CMAKE_C_COMPILER_ARCHITECTURE_ID ${CMAKE_C_COMPILER_ARCHITECTURE_ID})")
+else()
+ set(_SET_CMAKE_C_COMPILER_ARCHITECTURE_ID "")
+endif()
+
if(MSVC_C_ARCHITECTURE_ID)
set(SET_MSVC_C_ARCHITECTURE_ID
"set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 9150962..8c33eb6 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -73,6 +73,9 @@ else()
set(CMAKE_CXX_COMPILER_ID_TEST_FLAGS
# Try compiling to an object file only.
"-c"
+ # IAR does not detect language automatically
+ "--c++"
+ "--ec++"
)
endif()
@@ -165,6 +168,13 @@ set(_CMAKE_PROCESSING_LANGUAGE "CXX")
include(Compiler/${CMAKE_CXX_COMPILER_ID}-FindBinUtils OPTIONAL)
unset(_CMAKE_PROCESSING_LANGUAGE)
+if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID)
+ set(_SET_CMAKE_CXX_COMPILER_ARCHITECTURE_ID
+ "set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID})")
+else()
+ set(_SET_CMAKE_CXX_COMPILER_ARCHITECTURE_ID "")
+endif()
+
if(MSVC_CXX_ARCHITECTURE_ID)
set(SET_MSVC_CXX_ARCHITECTURE_ID
"set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index eeb806f..f11059f 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -102,6 +102,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
+ set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "${CMAKE_${lang}_COMPILER_ARCHITECTURE_ID}" PARENT_SCOPE)
set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE)
set(CMAKE_${lang}_XCODE_CURRENT_ARCH "${CMAKE_${lang}_XCODE_CURRENT_ARCH}" PARENT_SCOPE)
@@ -576,6 +577,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
if(COMPILER_ID AND NOT COMPILER_ID_TWICE)
set(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
set(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
+ set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
set(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
set(CMAKE_${lang}_SIMULATE_ID "${SIMULATE_ID}")
@@ -625,6 +627,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
# Return the information extracted.
set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
+ set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "${CMAKE_${lang}_COMPILER_ARCHITECTURE_ID}" PARENT_SCOPE)
set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE)
set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
@@ -675,6 +678,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang userflags)
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
"matched \"${regex}\":\n${output}")
set(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
+ set(CMAKE_${lang}_COMPILER_ID_OUTPUT "${output}" PARENT_SCOPE)
break()
else()
if("${result}" MATCHES "timeout")
@@ -706,6 +710,7 @@ function(CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX lang userflags)
OUTPUT_VARIABLE out
ERROR_VARIABLE err
RESULT_VARIABLE res
+ ENCODING AUTO # cl prints in current code page
)
if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n]*:[^:\n]*:[ \t]*)")
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_2}" PARENT_SCOPE)
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index d5220b4..5559640 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -261,6 +261,13 @@ set(_CMAKE_PROCESSING_LANGUAGE "Fortran")
include(Compiler/${CMAKE_Fortran_COMPILER_ID}-FindBinUtils OPTIONAL)
unset(_CMAKE_PROCESSING_LANGUAGE)
+if(CMAKE_Fortran_COMPILER_ARCHITECTURE_ID)
+ set(_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID
+ "set(CMAKE_Fortran_COMPILER_ARCHITECTURE_ID ${CMAKE_Fortran_COMPILER_ARCHITECTURE_ID})")
+else()
+ set(_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID "")
+endif()
+
if(MSVC_Fortran_ARCHITECTURE_ID)
set(SET_MSVC_Fortran_ARCHITECTURE_ID
"set(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index d521190..2e34cbb 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -6,6 +6,7 @@ set(CMAKE_Fortran_COMPILER_WRAPPER "@CMAKE_Fortran_COMPILER_WRAPPER@")
set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@")
set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@")
+@_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID@
@SET_MSVC_Fortran_ARCHITECTURE_ID@
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_Fortran_COMPILER_AR "@CMAKE_Fortran_COMPILER_AR@")
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index 47eb00a..c7065b2 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -144,6 +144,16 @@
# define ARCHITECTURE_ID ""
# endif
+#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
+# if defined(__ICCARM__)
+# define ARCHITECTURE_ID "ARM"
+
+# elif defined(__ICCAVR__)
+# define ARCHITECTURE_ID "AVR"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
#else
# define ARCHITECTURE_ID
#endif
diff --git a/Modules/CMakePushCheckState.cmake b/Modules/CMakePushCheckState.cmake
index 2a527d5..98eea05 100644
--- a/Modules/CMakePushCheckState.cmake
+++ b/Modules/CMakePushCheckState.cmake
@@ -62,7 +62,7 @@ macro(CMAKE_PUSH_CHECK_STATE)
set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
set(_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_QUIET})
- if (ARGC GREATER 0 AND ARGV0 STREQUAL "RESET")
+ if (${ARGC} GREATER 0 AND "${ARGV0}" STREQUAL "RESET")
cmake_reset_check_state()
endif()
diff --git a/Modules/CPack.STGZ_Header.sh.in b/Modules/CPack.STGZ_Header.sh.in
index c615851..70f63d2 100755
--- a/Modules/CPack.STGZ_Header.sh.in
+++ b/Modules/CPack.STGZ_Header.sh.in
@@ -7,9 +7,11 @@ cpack_usage()
Usage: $0 [options]
Options: [defaults in brackets after descriptions]
--help print this message
+ --version print cmake installer version
--prefix=dir directory in which to install
--include-subdir include the @CPACK_PACKAGE_FILE_NAME@ subdirectory
--exclude-subdir exclude the @CPACK_PACKAGE_FILE_NAME@ subdirectory
+ --skip-license accept license
EOF
exit 1
}
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index a63fc83..3915943 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -471,6 +471,7 @@ if(NOT CPACK_GENERATOR)
option(CPACK_BINARY_TZ "Enable to build TZ packages" ON)
endif()
option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF)
+ option(CPACK_BINARY_FREEBSD "Enable to build FreeBSD packages" OFF)
option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF)
option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF)
option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON)
@@ -491,6 +492,7 @@ if(NOT CPACK_GENERATOR)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_CYGWIN CygwinBinary)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DEB DEB)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop)
+ cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_FREEBSD FREEBSD)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_IFW IFW)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_NSIS NSIS)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_OSXX11 OSXX11)
@@ -542,6 +544,7 @@ mark_as_advanced(
CPACK_BINARY_CYGWIN
CPACK_BINARY_DEB
CPACK_BINARY_DRAGNDROP
+ CPACK_BINARY_FREEBSD
CPACK_BINARY_IFW
CPACK_BINARY_NSIS
CPACK_BINARY_OSXX11
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index 3a10b99..2374fbd 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -37,6 +37,16 @@
# components defined by the project. The user may set it to only include the
# specified components.
#
+# Instead of specifying all the desired components, it is possible to obtain a
+# list of all defined components and then remove the unwanted ones from the
+# list. The :command:`get_cmake_property` command can be used to obtain the
+# ``COMPONENTS`` property, then the :command:`list(REMOVE_ITEM)` command can be
+# used to remove the unwanted ones. For example, to use all defined components
+# except ``foo`` and ``bar``::
+#
+# get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
+# list(REMOVE_ITEM CPACK_COMPONENTS_ALL "foo" "bar")
+#
# .. variable:: CPACK_<GENNAME>_COMPONENT_INSTALL
#
# Enable/Disable component install for CPack generator <GENNAME>.
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index ddf8b23..85d564e 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -73,7 +73,8 @@
#
# <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
#
-# Alternatively provided package file name must end with ``.deb`` suffix.
+# Alternatively provided package file name must end
+# with either ``.deb`` or ``.ipk`` suffix.
#
# .. note::
#
@@ -497,6 +498,16 @@
#
# This value is not interpreted. It is possible to pass an optional
# revision number of the referenced source package as well.
+#
+# Building Debian packages on Windows
+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+#
+# To communicate UNIX file permissions from the install stage
+# to the CPack DEB generator the "cmake_mode_t" NTFS
+# alternate data stream (ADT) is used.
+#
+# When a filesystem without ADT support is used only owner read/write
+# permissions can be preserved.
# CPack script for creating Debian package
# Author: Mathieu Malaterre
@@ -507,10 +518,6 @@ if(CMAKE_BINARY_DIR)
message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
endif()
-if(NOT UNIX)
- message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
-endif()
-
function(cpack_deb_variable_fallback OUTPUT_VAR_NAME)
set(FALLBACK_VAR_NAMES ${ARGN})
@@ -971,9 +978,9 @@ function(cpack_deb_prepare_package_vars)
else()
cmake_policy(PUSH)
cmake_policy(SET CMP0010 NEW)
- if(NOT CPACK_DEBIAN_FILE_NAME MATCHES ".*\\.deb")
+ if(NOT CPACK_DEBIAN_FILE_NAME MATCHES ".*\\.(deb|ipk)")
cmake_policy(POP)
- message(FATAL_ERROR "'${CPACK_DEBIAN_FILE_NAME}' is not a valid DEB package file name as it must end with '.deb'!")
+ message(FATAL_ERROR "'${CPACK_DEBIAN_FILE_NAME}' is not a valid DEB package file name as it must end with '.deb' or '.ipk'!")
endif()
cmake_policy(POP)
diff --git a/Modules/CPackFreeBSD.cmake b/Modules/CPackFreeBSD.cmake
new file mode 100644
index 0000000..7fec78a
--- /dev/null
+++ b/Modules/CPackFreeBSD.cmake
@@ -0,0 +1,246 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+CPackFreeBSD
+------------
+
+The built in (binary) CPack FreeBSD (pkg) generator (Unix only)
+
+Variables specific to CPack FreeBSD (pkg) generator
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+CPackFreeBSD may be used to create pkg(8) packages -- these may be used
+on FreeBSD, DragonflyBSD, NetBSD, OpenBSD, but also on Linux or OSX,
+depending on the installed package-management tools -- using :module:`CPack`.
+
+CPackFreeBSD is a :module:`CPack` generator and uses the ``CPACK_XXX``
+variables used by :module:`CPack`. It tries to re-use packaging information
+that may already be specified for Debian packages for the :module:`CPackDeb`
+generator. it also tries to re-use RPM packaging information when Debian
+does not specify.
+
+CPackFreeBSD generator should work on any host with libpkg installed. The
+packages it produces are specific to the host architecture and ABI.
+
+CPackFreeBSD sets package-metadata through :code:`CPACK_FREEBSD_XXX` variables.
+CPackFreeBSD, unlike CPackDeb, does not specially support componentized
+packages; a single package is created from all the software artifacts
+created through CMake.
+
+All of the variables can be set specifically for FreeBSD packaging in
+the CPackConfig file or in CMakeLists.txt, but most of them have defaults
+that use general settings (e.g. CMAKE_PROJECT_NAME) or Debian-specific
+variables when those make sense (e.g. the homepage of an upstream project
+is usually unchanged by the flavor of packaging). When there is no Debian
+information to fall back on, but the RPM packaging has it, fall back to
+the RPM information (e.g. package license).
+
+.. variable:: CPACK_FREEBSD_PACKAGE_NAME
+
+ Sets the package name (in the package manifest, but also affects the
+ output filename).
+
+ * Mandatory: YES
+ * Default:
+
+ - :variable:`CPACK_PACKAGE_NAME` (this is always set by CPack itself,
+ based on CMAKE_PROJECT_NAME).
+
+.. variable:: CPACK_FREEBSD_PACKAGE_COMMENT
+
+ Sets the package comment. This is the short description displayed by
+ pkg(8) in standard "pkg info" output.
+
+ * Mandatory: YES
+ * Default:
+
+ - :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY` (this is always set
+ by CPack itself, if nothing else sets it explicitly).
+ - :variable:`PROJECT_DESCRIPTION` (this can be set with the DESCRIPTION
+ parameter for :command:`project`).
+
+.. variable:: CPACK_FREEBSD_PACKAGE_DESCRIPTION
+
+ Sets the package description. This is the long description of the package,
+ given by "pkg info" with a specific package as argument.
+
+ * Mandatory: YES
+ * Default:
+
+ - :variable:`CPACK_DEBIAN_PACKAGE_DESCRIPTION` (this may be set already
+ for Debian packaging, so we may as well re-use it).
+
+.. variable:: CPACK_FREEBSD_PACKAGE_WWW
+
+ The URL of the web site for this package, preferably (when applicable) the
+ site from which the original source can be obtained and any additional
+ upstream documentation or information may be found.
+
+ * Mandatory: YES
+ * Default:
+
+ - :variable:`CPACK_DEBIAN_PACKAGE_HOMEPAGE` (this may be set already
+ for Debian packaging, so we may as well re-use it).
+
+.. variable:: CPACK_FREEBSD_PACKAGE_LICENSE
+
+ The license, or licenses, which apply to this software package. This must
+ be one or more license-identifiers that pkg recognizes as acceptable license
+ identifiers (e.g. "GPLv2").
+
+ * Mandatory: YES
+ * Default:
+
+ - :variable:`CPACK_RPM_PACKAGE_LICENSE`
+
+.. variable:: CPACK_FREEBSD_PACKAGE_LICENSE_LOGIC
+
+ This variable is only of importance if there is more than one license.
+ The default is "single", which is only applicable to a single license.
+ Other acceptable values are determined by pkg -- those are "dual" or "multi" --
+ meaning choice (OR) or simultaneous (AND) application of the licenses.
+
+ * Mandatory: NO
+ * Default: single
+
+.. variable:: CPACK_FREEBSD_PACKAGE_MAINTAINER
+
+ The FreeBSD maintainer (e.g. kde@freebsd.org) of this package.
+
+ * Mandatory: YES
+ * Default: none
+
+.. variable:: CPACK_FREEBSD_PACKAGE_ORIGIN
+
+ The origin (ports label) of this package; for packages built by CPack
+ outside of the ports system this is of less importance. The default
+ puts the package somewhere under misc/, as a stopgap.
+
+ * Mandatory: YES
+ * Default: misc/<package name>
+
+.. variable:: CPACK_FREEBSD_PACKAGE_CATEGORIES
+
+ The ports categories where this package lives (if it were to be built
+ from ports). If none is set a single category is determined based on
+ the package origin.
+
+ * Mandatory: YES
+ * Default: derived from ORIGIN
+
+.. variable:: CPACK_FREEBSD_PACKAGE_DEPS
+
+ A list of package origins that should be added as package dependencies.
+ These are in the form <category>/<packagename>, e.g. x11/libkonq.
+ No version information needs to be provided (this is not included
+ in the manifest).
+
+ * Mandatory: NO
+ * Default: empty
+#]=======================================================================]
+
+
+
+if(CMAKE_BINARY_DIR)
+ message(FATAL_ERROR "CPackFreeBSD.cmake may only be used by CPack internally.")
+endif()
+
+if(NOT UNIX)
+ message(FATAL_ERROR "CPackFreeBSD.cmake may only be used under UNIX.")
+endif()
+
+
+###
+#
+# These bits are copied from the Debian packaging file; slightly modified.
+# They are used for filling in FreeBSD-packaging variables that can take
+# on values from elsewhere -- e.g. the package description may as well be
+# copied from Debian.
+#
+function(_cpack_freebsd_fallback_var OUTPUT_VAR_NAME)
+ set(FALLBACK_VAR_NAMES ${ARGN})
+
+ set(VALUE "${${OUTPUT_VAR_NAME}}")
+ if(VALUE)
+ return()
+ endif()
+
+ foreach(variable_name IN LISTS FALLBACK_VAR_NAMES)
+ if(${variable_name})
+ set(${OUTPUT_VAR_NAME} "${${variable_name}}" PARENT_SCOPE)
+ set(VALUE "${${variable_name}}")
+ break()
+ endif()
+ endforeach()
+ if(NOT VALUE)
+ message(WARNING "Variable ${OUTPUT_VAR_NAME} could not be given a fallback value from any variable ${FALLBACK_VAR_NAMES}.")
+ endif()
+endfunction()
+
+function(check_required_var VAR_NAME)
+ if(NOT ${VAR_NAME})
+ message(FATAL_ERROR "Variable ${VAR_NAME} is not set.")
+ endif()
+endfunction()
+
+set(_cpack_freebsd_fallback_origin "misc/bogus")
+
+_cpack_freebsd_fallback_var("CPACK_FREEBSD_PACKAGE_NAME"
+ "CPACK_PACKAGE_NAME"
+ "CMAKE_PROJECT_NAME"
+ )
+
+set(_cpack_freebsd_fallback_www "http://example.com/?pkg=${CPACK_FREEBSD_PACKAGE_NAME}")
+
+_cpack_freebsd_fallback_var("CPACK_FREEBSD_PACKAGE_COMMENT"
+ "CPACK_PACKAGE_DESCRIPTION_SUMMARY"
+ )
+
+# TODO: maybe read the PACKAGE_DESCRIPTION file for the longer
+# FreeBSD pkg-descr?
+_cpack_freebsd_fallback_var("CPACK_FREEBSD_PACKAGE_DESCRIPTION"
+ "CPACK_DEBIAN_PACKAGE_DESCRIPTION"
+ "CPACK_PACKAGE_DESCRIPTION_SUMMARY"
+ "PACKAGE_DESCRIPTION"
+ )
+
+# There's really only one homepage for a project, so
+# re-use the Debian setting if it's there.
+_cpack_freebsd_fallback_var("CPACK_FREEBSD_PACKAGE_WWW"
+ "CPACK_DEBIAN_PACKAGE_HOMEPAGE"
+ "_cpack_freebsd_fallback_www"
+ )
+
+_cpack_freebsd_fallback_var("CPACK_FREEBSD_PACKAGE_VERSION"
+ "CMAKE_PROJECT_VERSION"
+ "${CMAKE_PROJECT_NAME}_VERSION"
+ "PROJECT_VERSION"
+ "CPACK_PACKAGE_VERSION"
+ "CPACK_PACKAGE_VERSION"
+ )
+
+_cpack_freebsd_fallback_var("CPACK_FREEBSD_PACKAGE_MAINTAINER"
+ "CPACK_PACKAGE_CONTACT"
+ )
+
+_cpack_freebsd_fallback_var("CPACK_FREEBSD_PACKAGE_LICENSE"
+ "CPACK_RPM_PACKAGE_LICENSE"
+ )
+
+_cpack_freebsd_fallback_var("CPACK_FREEBSD_PACKAGE_ORIGIN"
+ "_cpack_freebsd_fallback_origin"
+ )
+
+if(NOT CPACK_FREEBSD_PACKAGE_CATEGORIES)
+ string(REGEX REPLACE "/.*" "" CPACK_FREEBSD_PACKAGE_CATEGORIES ${CPACK_FREEBSD_PACKAGE_ORIGIN})
+endif()
+
+check_required_var("CPACK_FREEBSD_PACKAGE_NAME")
+check_required_var("CPACK_FREEBSD_PACKAGE_ORIGIN")
+check_required_var("CPACK_FREEBSD_PACKAGE_VERSION")
+check_required_var("CPACK_FREEBSD_PACKAGE_MAINTAINER")
+check_required_var("CPACK_FREEBSD_PACKAGE_COMMENT")
+check_required_var("CPACK_FREEBSD_PACKAGE_DESCRIPTION")
+check_required_var("CPACK_FREEBSD_PACKAGE_WWW")
+check_required_var("CPACK_FREEBSD_PACKAGE_LICENSE")
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index c1cb52f..0b42c83 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -221,6 +221,19 @@
# You can use :command:`cpack_ifw_add_package_resources` command to resolve
# relative paths.
#
+# .. variable:: CPACK_IFW_PACKAGE_FILE_EXTENSION
+#
+# The target binary extension.
+#
+# On Linux, the name of the target binary is automatically extended with
+# '.run', if you do not specify the extension.
+#
+# On Windows, the target is created as an application with the extension
+# '.exe', which is automatically added, if not supplied.
+#
+# On Mac, the target is created as an DMG disk image with the extension
+# '.dmg', which is automatically added, if not supplied.
+#
# .. variable:: CPACK_IFW_REPOSITORIES_ALL
#
# The list of remote repositories.
@@ -247,6 +260,12 @@
# Additional prepared packages dirs that will be used to resolve
# dependent components.
#
+# .. variable:: CPACK_IFW_REPOSITORIES_DIRECTORIES
+#
+# Additional prepared repository dirs that will be used to resolve and
+# repack dependent components. This feature available only
+# since QtIFW_ 3.1.
+#
# Tools
# """""
#
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index fa2a6e4..3913494 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -2422,7 +2422,11 @@ mv *.rpm %_rpmdir"
set(RPMBUILD_FLAGS "-bs")
file(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
- "# -*- rpm-spec -*-
+ "# Restore old style debuginfo creation for rpm >= 4.14.
+%undefine _debugsource_packages
+%undefine _debuginfo_subpackages
+
+# -*- rpm-spec -*-
BuildRoot: %_topdir/\@CPACK_PACKAGE_FILE_NAME\@
Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@
Name: \@CPACK_RPM_PACKAGE_NAME\@
@@ -2527,7 +2531,11 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
file(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
- "# -*- rpm-spec -*-
+ "# Restore old style debuginfo creation for rpm >= 4.14.
+%undefine _debugsource_packages
+%undefine _debuginfo_subpackages
+
+# -*- rpm-spec -*-
BuildRoot: %_topdir/\@CPACK_PACKAGE_FILE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH\@
Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@
Name: \@CPACK_RPM_PACKAGE_NAME\@
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 1ba67fc..5a7298b 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -1,26 +1,36 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckCCompilerFlag
-# ------------------
-#
-# Check whether the C compiler supports a given flag.
-#
-# CHECK_C_COMPILER_FLAG(<flag> <var>)
-#
-# ::
-#
-# <flag> - the compiler flag
-# <var> - variable to store the result
-# Will be created as an internal cache variable.
-#
-# This internally calls the check_c_source_compiles macro and sets
-# CMAKE_REQUIRED_DEFINITIONS to <flag>. See help for
-# CheckCSourceCompiles for a listing of variables that can otherwise
-# modify the build. The result only tells that the compiler does not
-# give an error message when it encounters the flag. If the flag has
-# any effect or even a specific one is beyond the scope of this module.
+#[=======================================================================[.rst:
+CheckCCompilerFlag
+------------------
+
+Check whether the C compiler supports a given flag.
+
+.. command:: check_c_compiler_flag
+
+ ::
+
+ check_c_compiler_flag(<flag> <var>)
+
+ Check that the ``<flag>`` is accepted by the compiler without
+ a diagnostic. Stores the result in an internal cache entry
+ named ``<var>``.
+
+This command temporarily sets the ``CMAKE_REQUIRED_DEFINITIONS`` variable
+and calls the ``check_c_source_compiles`` macro from the
+:module:`CheckCSourceCompiles` module. See documentation of that
+module for a listing of variables that can otherwise modify the build.
+
+A positive result from this check indicates only that the compiler did not
+issue a diagnostic message when given the flag. Whether the flag has any
+effect or even a specific one is beyond the scope of this module.
+
+.. note::
+ Since the :command:`try_compile` command forwards flags from variables
+ like :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>`, unknown flags
+ in such variables may cause a false negative for this check.
+#]=======================================================================]
include(CheckCSourceCompiles)
include(CMakeCheckCompilerFlagCommonPatterns)
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index ac2c6c5..56e68d5 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -1,31 +1,65 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckCSourceCompiles
-# --------------------
-#
-# Check if given C source compiles and links into an executable
-#
-# CHECK_C_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>])
-#
-# ::
-#
-# <code> - source code to try to compile, must define 'main'
-# <var> - variable to store whether the source code compiled
-# Will be created as an internal cache variable.
-# <fail-regex> - fail if test output matches this regex
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckCSourceCompiles
+--------------------
+
+Check if given C source compiles and links into an executable.
+
+.. command:: check_c_source_compiles
+
+ ::
+
+ check_c_source_compiles(code resultVar [FAIL_REGEX regex1 [regex2...]])
+
+ Check that the source supplied in ``code`` can be compiled as a C source
+ file and linked as an executable (so it must contain at least a ``main()``
+ function). The result will be stored in the internal cache variable specified
+ by ``resultVar``, with a boolean true value for success and boolean false for
+ failure. If ``FAIL_REGEX`` is provided, then failure is determined by
+ checking if anything in the output matches any of the specified regular
+ expressions.
+
+ The underlying check is performed by the :command:`try_compile` command. The
+ compile and link commands can be influenced by setting any of the following
+ variables prior to calling ``check_c_source_compiles()``:
+
+ ``CMAKE_REQUIRED_FLAGS``
+ Additional flags to pass to the compiler. Note that the contents of
+ :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>` and its associated
+ configuration-specific variable are automatically added to the compiler
+ command before the contents of ``CMAKE_REQUIRED_FLAGS``.
+
+ ``CMAKE_REQUIRED_DEFINITIONS``
+ A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
+ ``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
+ ``resultVar`` will also be added automatically.
+
+ ``CMAKE_REQUIRED_INCLUDES``
+ A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler. These will be the only header search paths used by
+ ``try_compile()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
+ directory property will be ignored.
+
+ ``CMAKE_REQUIRED_LIBRARIES``
+ A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. These can be the name of system libraries or they can be
+ :ref:`Imported Targets <Imported Targets>` (see :command:`try_compile` for
+ further details).
+
+ ``CMAKE_REQUIRED_QUIET``
+ If this variable evaluates to a boolean true value, all status messages
+ associated with the check will be suppressed.
+
+ The check is only performed once, with the result cached in the variable
+ named by ``resultVar``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``code`` changes.
+ In order to force the check to be re-evaluated, the variable named by
+ ``resultVar`` must be manually removed from the cache.
+
+#]=======================================================================]
+
macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
if(NOT DEFINED "${VAR}")
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index 70aa9fd..8da9f1e 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -1,31 +1,64 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckCSourceRuns
-# ----------------
-#
-# Check if the given C source code compiles and runs.
-#
-# CHECK_C_SOURCE_RUNS(<code> <var>)
-#
-# ::
-#
-# <code> - source code to try to compile
-# <var> - variable to store the result
-# (1 for success, empty for failure)
-# Will be created as an internal cache variable.
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckCSourceRuns
+----------------
+
+Check if given C source compiles and links into an executable and can
+subsequently be run.
+
+.. command:: check_c_source_runs
+
+ ::
+
+ check_c_source_runs(code resultVar)
+
+ Check that the source supplied in ``code`` can be compiled as a C source
+ file, linked as an executable and then run. The ``code`` must contain at
+ least a ``main()`` function. If the code could be built and run successfully,
+ the internal cache variable specified by ``resultVar`` will be set to 1,
+ otherwise it will be set to an value that evaluates to boolean false (e.g.
+ an empty string or an error message).
+
+ The underlying check is performed by the :command:`try_run` command. The
+ compile and link commands can be influenced by setting any of the following
+ variables prior to calling ``check_c_source_runs()``:
+
+ ``CMAKE_REQUIRED_FLAGS``
+ Additional flags to pass to the compiler. Note that the contents of
+ :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>` and its associated
+ configuration-specific variable are automatically added to the compiler
+ command before the contents of ``CMAKE_REQUIRED_FLAGS``.
+
+ ``CMAKE_REQUIRED_DEFINITIONS``
+ A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
+ ``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
+ ``resultVar`` will also be added automatically.
+
+ ``CMAKE_REQUIRED_INCLUDES``
+ A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler. These will be the only header search paths used by
+ ``try_run()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
+ directory property will be ignored.
+
+ ``CMAKE_REQUIRED_LIBRARIES``
+ A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. These can be the name of system libraries or they can be
+ :ref:`Imported Targets <Imported Targets>` (see :command:`try_run` for
+ further details).
+
+ ``CMAKE_REQUIRED_QUIET``
+ If this variable evaluates to a boolean true value, all status messages
+ associated with the check will be suppressed.
+
+ The check is only performed once, with the result cached in the variable
+ named by ``resultVar``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``code`` changes.
+ In order to force the check to be re-evaluated, the variable named by
+ ``resultVar`` must be manually removed from the cache.
+
+#]=======================================================================]
macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
if(NOT DEFINED "${VAR}")
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index afbb231..f731b70 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -1,25 +1,36 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckCXXCompilerFlag
-# --------------------
-#
-# Check whether the CXX compiler supports a given flag.
-#
-# CHECK_CXX_COMPILER_FLAG(<flag> <var>)
-#
-# ::
-#
-# <flag> - the compiler flag
-# <var> - variable to store the result
-#
-# This internally calls the check_cxx_source_compiles macro and sets
-# CMAKE_REQUIRED_DEFINITIONS to <flag>. See help for
-# CheckCXXSourceCompiles for a listing of variables that can otherwise
-# modify the build. The result only tells that the compiler does not
-# give an error message when it encounters the flag. If the flag has
-# any effect or even a specific one is beyond the scope of this module.
+#[=======================================================================[.rst:
+CheckCXXCompilerFlag
+------------------------
+
+Check whether the CXX compiler supports a given flag.
+
+.. command:: check_cxx_compiler_flag
+
+ ::
+
+ check_cxx_compiler_flag(<flag> <var>)
+
+ Check that the ``<flag>`` is accepted by the compiler without
+ a diagnostic. Stores the result in an internal cache entry
+ named ``<var>``.
+
+This command temporarily sets the ``CMAKE_REQUIRED_DEFINITIONS`` variable
+and calls the ``check_cxx_source_compiles`` macro from the
+:module:`CheckCXXSourceCompiles` module. See documentation of that
+module for a listing of variables that can otherwise modify the build.
+
+A positive result from this check indicates only that the compiler did not
+issue a diagnostic message when given the flag. Whether the flag has any
+effect or even a specific one is beyond the scope of this module.
+
+.. note::
+ Since the :command:`try_compile` command forwards flags from variables
+ like :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>`, unknown flags
+ in such variables may cause a false negative for this check.
+#]=======================================================================]
include(CheckCXXSourceCompiles)
include(CMakeCheckCompilerFlagCommonPatterns)
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index e54d09e..4634a7b 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -1,31 +1,64 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckCXXSourceCompiles
-# ----------------------
-#
-# Check if given C++ source compiles and links into an executable
-#
-# CHECK_CXX_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>])
-#
-# ::
-#
-# <code> - source code to try to compile, must define 'main'
-# <var> - variable to store whether the source code compiled
-# Will be created as an internal cache variable.
-# <fail-regex> - fail if test output matches this regex
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckCXXSourceCompiles
+----------------------
+
+Check if given C++ source compiles and links into an executable.
+
+.. command:: check_cxx_source_compiles
+
+ ::
+
+ check_cxx_source_compiles(code resultVar [FAIL_REGEX regex1 [regex2...]])
+
+ Check that the source supplied in ``code`` can be compiled as a C++ source
+ file and linked as an executable (so it must contain at least a ``main()``
+ function). The result will be stored in the internal cache variable specified
+ by ``resultVar``, with a boolean true value for success and boolean false for
+ failure. If ``FAIL_REGEX`` is provided, then failure is determined by
+ checking if anything in the output matches any of the specified regular
+ expressions.
+
+ The underlying check is performed by the :command:`try_compile` command. The
+ compile and link commands can be influenced by setting any of the following
+ variables prior to calling ``check_cxx_source_compiles()``:
+
+ ``CMAKE_REQUIRED_FLAGS``
+ Additional flags to pass to the compiler. Note that the contents of
+ :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` and its associated
+ configuration-specific variable are automatically added to the compiler
+ command before the contents of ``CMAKE_REQUIRED_FLAGS``.
+
+ ``CMAKE_REQUIRED_DEFINITIONS``
+ A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
+ ``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
+ ``resultVar`` will also be added automatically.
+
+ ``CMAKE_REQUIRED_INCLUDES``
+ A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler. These will be the only header search paths used by
+ ``try_compile()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
+ directory property will be ignored.
+
+ ``CMAKE_REQUIRED_LIBRARIES``
+ A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. These can be the name of system libraries or they can be
+ :ref:`Imported Targets <Imported Targets>` (see :command:`try_compile` for
+ further details).
+
+ ``CMAKE_REQUIRED_QUIET``
+ If this variable evaluates to a boolean true value, all status messages
+ associated with the check will be suppressed.
+
+ The check is only performed once, with the result cached in the variable
+ named by ``resultVar``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``code`` changes.
+ In order to force the check to be re-evaluated, the variable named by
+ ``resultVar`` must be manually removed from the cache.
+
+#]=======================================================================]
macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
if(NOT DEFINED "${VAR}")
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index e083659..558708c 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -1,31 +1,64 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckCXXSourceRuns
-# ------------------
-#
-# Check if the given C++ source code compiles and runs.
-#
-# CHECK_CXX_SOURCE_RUNS(<code> <var>)
-#
-# ::
-#
-# <code> - source code to try to compile
-# <var> - variable to store the result
-# (1 for success, empty for failure)
-# Will be created as an internal cache variable.
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckCXXSourceRuns
+------------------
+
+Check if given C++ source compiles and links into an executable and can
+subsequently be run.
+
+.. command:: check_cxx_source_runs
+
+ ::
+
+ check_cxx_source_runs(code resultVar)
+
+ Check that the source supplied in ``code`` can be compiled as a C++ source
+ file, linked as an executable and then run. The ``code`` must contain at
+ least a ``main()`` function. If the code could be built and run successfully,
+ the internal cache variable specified by ``resultVar`` will be set to 1,
+ otherwise it will be set to an value that evaluates to boolean false (e.g.
+ an empty string or an error message).
+
+ The underlying check is performed by the :command:`try_run` command. The
+ compile and link commands can be influenced by setting any of the following
+ variables prior to calling ``check_cxx_source_runs()``:
+
+ ``CMAKE_REQUIRED_FLAGS``
+ Additional flags to pass to the compiler. Note that the contents of
+ :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` and its associated
+ configuration-specific variable are automatically added to the compiler
+ command before the contents of ``CMAKE_REQUIRED_FLAGS``.
+
+ ``CMAKE_REQUIRED_DEFINITIONS``
+ A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
+ ``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
+ ``resultVar`` will also be added automatically.
+
+ ``CMAKE_REQUIRED_INCLUDES``
+ A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler. These will be the only header search paths used by
+ ``try_run()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
+ directory property will be ignored.
+
+ ``CMAKE_REQUIRED_LIBRARIES``
+ A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. These can be the name of system libraries or they can be
+ :ref:`Imported Targets <Imported Targets>` (see :command:`try_run` for
+ further details).
+
+ ``CMAKE_REQUIRED_QUIET``
+ If this variable evaluates to a boolean true value, all status messages
+ associated with the check will be suppressed.
+
+ The check is only performed once, with the result cached in the variable
+ named by ``resultVar``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``code`` changes.
+ In order to force the check to be re-evaluated, the variable named by
+ ``resultVar`` must be manually removed from the cache.
+
+#]=======================================================================]
macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
if(NOT DEFINED "${VAR}")
diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake
index 354eea3..8552154 100644
--- a/Modules/CheckCXXSymbolExists.cmake
+++ b/Modules/CheckCXXSymbolExists.cmake
@@ -35,5 +35,5 @@
include(CheckSymbolExists)
macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
- _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
+ __CHECK_SYMBOL_EXISTS_IMPL("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
endmacro()
diff --git a/Modules/CheckFortranCompilerFlag.cmake b/Modules/CheckFortranCompilerFlag.cmake
index 8519fcc..8a1a8b9 100644
--- a/Modules/CheckFortranCompilerFlag.cmake
+++ b/Modules/CheckFortranCompilerFlag.cmake
@@ -1,27 +1,36 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckFortranCompilerFlag
-# ------------------------
-#
-# Check whether the Fortran compiler supports a given flag.
-#
-# CHECK_Fortran_COMPILER_FLAG(<flag> <var>)
-#
-# ::
-#
-# <flag> - the compiler flag
-# <var> - variable to store the result
-# Will be created as an internal cache variable.
-#
-# This internally calls the check_fortran_source_compiles macro and
-# sets CMAKE_REQUIRED_DEFINITIONS to <flag>. See help for
-# CheckFortranSourceCompiles for a listing of variables that can
-# otherwise modify the build. The result only tells that the compiler
-# does not give an error message when it encounters the flag. If the
-# flag has any effect or even a specific one is beyond the scope of
-# this module.
+#[=======================================================================[.rst:
+CheckFortranCompilerFlag
+------------------------
+
+Check whether the Fortran compiler supports a given flag.
+
+.. command:: check_fortran_compiler_flag
+
+ ::
+
+ check_fortran_compiler_flag(<flag> <var>)
+
+ Check that the ``<flag>`` is accepted by the compiler without
+ a diagnostic. Stores the result in an internal cache entry
+ named ``<var>``.
+
+This command temporarily sets the ``CMAKE_REQUIRED_DEFINITIONS`` variable
+and calls the ``check_fortran_source_compiles`` macro from the
+:module:`CheckFortranSourceCompiles` module. See documentation of that
+module for a listing of variables that can otherwise modify the build.
+
+A positive result from this check indicates only that the compiler did not
+issue a diagnostic message when given the flag. Whether the flag has any
+effect or even a specific one is beyond the scope of this module.
+
+.. note::
+ Since the :command:`try_compile` command forwards flags from variables
+ like :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>`, unknown flags
+ in such variables may cause a false negative for this check.
+#]=======================================================================]
include(CheckFortranSourceCompiles)
include(CMakeCheckCompilerFlagCommonPatterns)
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index c42254c..4df17e3 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -1,35 +1,71 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckFortranSourceCompiles
-# --------------------------
-#
-# Check if given Fortran source compiles and links into an executable::
-#
-# CHECK_Fortran_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>]
-# [SRC_EXT <ext>])
-#
-# The arguments are:
-#
-# ``<code>``
-# Source code to try to compile. It must define a PROGRAM entry point.
-# ``<var>``
-# Variable to store whether the source code compiled.
-# Will be created as an internal cache variable.
-# ``FAIL_REGEX <fail-regex>``
-# Fail if test output matches this regex.
-# ``SRC_EXT <ext>``
-# Use source extension ``.<ext>`` instead of the default ``.F``.
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckFortranSourceCompiles
+--------------------------
+
+Check if given Fortran source compiles and links into an executable.
+
+.. command:: check_fortran_source_compiles
+
+ ::
+
+ check_fortran_source_compiles(code resultVar
+ [FAIL_REGEX regex1 [regex2...]]
+ [SRC_EXT ext]
+ )
+
+ Check that the source supplied in ``code`` can be compiled as a Fortran
+ source file and linked as an executable (so it must contain at least a
+ ``PROGRAM`` entry point). The result will be stored in the internal cache
+ variable specified by ``resultVar``, with a boolean true value for success
+ and boolean false for failure. If ``FAIL_REGEX`` is provided, then failure is
+ determined by checking if anything in the output matches any of the specified
+ regular expressions.
+
+ By default, the test source file will be given a ``.F`` file extension. The
+ ``SRC_EXT`` option can be used to override this with ``.ext`` instead.
+
+ The underlying check is performed by the :command:`try_compile` command. The
+ compile and link commands can be influenced by setting any of the following
+ variables prior to calling ``check_fortran_source_compiles()``:
+
+ ``CMAKE_REQUIRED_FLAGS``
+ Additional flags to pass to the compiler. Note that the contents of
+ :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>` and its associated
+ configuration-specific variable are automatically added to the compiler
+ command before the contents of ``CMAKE_REQUIRED_FLAGS``.
+
+ ``CMAKE_REQUIRED_DEFINITIONS``
+ A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
+ ``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
+ ``resultVar`` will also be added automatically.
+
+ ``CMAKE_REQUIRED_INCLUDES``
+ A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler. These will be the only header search paths used by
+ ``try_compile()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
+ directory property will be ignored.
+
+ ``CMAKE_REQUIRED_LIBRARIES``
+ A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. These can be the name of system libraries or they can be
+ :ref:`Imported Targets <Imported Targets>` (see :command:`try_compile` for
+ further details).
+
+ ``CMAKE_REQUIRED_QUIET``
+ If this variable evaluates to a boolean true value, all status messages
+ associated with the check will be suppressed.
+
+ The check is only performed once, with the result cached in the variable
+ named by ``resultVar``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``code`` changes.
+ In order to force the check to be re-evaluated, the variable named by
+ ``resultVar`` must be manually removed from the cache.
+
+#]=======================================================================]
+
macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR)
if(NOT DEFINED "${VAR}")
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index 6f1afcf..6d52d56 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -45,15 +45,15 @@ the way the check is run:
macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
if(CMAKE_C_COMPILER_LOADED)
- _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
+ __CHECK_SYMBOL_EXISTS_IMPL("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
elseif(CMAKE_CXX_COMPILER_LOADED)
- _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
+ __CHECK_SYMBOL_EXISTS_IMPL("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
else()
message(FATAL_ERROR "CHECK_SYMBOL_EXISTS needs either C or CXX language enabled")
endif()
endmacro()
-macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
+macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE)
if(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}")
set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
set(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
diff --git a/Modules/CheckTypeSize.c.in b/Modules/CheckTypeSize.c.in
index b6c3688..2303c4e 100644
--- a/Modules/CheckTypeSize.c.in
+++ b/Modules/CheckTypeSize.c.in
@@ -9,6 +9,12 @@
# define KEY '_','_','p','p','c','_','_'
#elif defined(__ppc64__)
# define KEY '_','_','p','p','c','6','4','_','_'
+#elif defined(__aarch64__)
+# define KEY '_','_','a','a','r','c','h','6','4','_','_'
+#elif defined(__ARM_ARCH_7A__)
+# define KEY '_','_','A','R','M','_','A','R','C','H','_','7','A','_','_'
+#elif defined(__ARM_ARCH_7S__)
+# define KEY '_','_','A','R','M','_','A','R','C','H','_','7','S','_','_'
#endif
#define SIZE (sizeof(@type@))
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index b881e2b..a5f9d84 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -7,14 +7,30 @@ if(WIN32 OR (APPLE AND NOT appleClangPolicy STREQUAL NEW))
endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
- set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
- set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
+ if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
+ set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
- set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
- set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
+ set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
+ set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
- set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
- set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
+ set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
+ set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
+ else()
+ # clang-cl doesn't have any of these
+ set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
+
+ set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C99_EXTENSION_COMPILE_OPTION "")
+
+ set(CMAKE_C11_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C11_EXTENSION_COMPILE_OPTION "")
+ endif()
endif()
-__compiler_check_default_language_standard(C 3.4 99 3.6 11)
+if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
+ __compiler_check_default_language_standard(C 3.4 99 3.6 11)
+else()
+ set(CMAKE_C_STANDARD_DEFAULT "")
+endif()
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index d3707ee..efc68b3 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -10,30 +10,46 @@ if(APPLE AND NOT appleClangPolicy STREQUAL NEW)
return()
endif()
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
- set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
- set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
-endif()
+if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
+ endif()
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
- set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
- set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
-elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
- set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
- set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
-endif()
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
+ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
+ endif()
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
- set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
- set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
-elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
- set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
- set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
-endif()
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
+ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
+ endif()
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
- set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++1z")
- set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
+ set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++1z")
+ set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
+ endif()
+else()
+ # clang-cl does not know these options because it behaves like cl.exe
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "")
endif()
-__compiler_check_default_language_standard(CXX 2.1 98)
+if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ __compiler_check_default_language_standard(CXX 2.1 98)
+else()
+ set(CMAKE_CXX_STANDARD_DEFAULT "")
+endif()
diff --git a/Modules/Compiler/Clang-FindBinUtils.cmake b/Modules/Compiler/Clang-FindBinUtils.cmake
index e2822a1..b852660 100644
--- a/Modules/Compiler/Clang-FindBinUtils.cmake
+++ b/Modules/Compiler/Clang-FindBinUtils.cmake
@@ -2,6 +2,12 @@ if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL
message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
endif()
+# Debian:
+# * /usr/bin/llvm-ar-4.0
+# * /usr/bin/llvm-ranlib-4.0
+string(REGEX MATCH "^([0-9]+\\.[0-9]+)" __version_x_y
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}")
+
# Try to find tools in the same directory as Clang itself
get_filename_component(__clang_hint_1 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" REALPATH)
get_filename_component(__clang_hint_1 "${__clang_hint_1}" DIRECTORY)
@@ -12,6 +18,7 @@ set(__clang_hints ${__clang_hint_1} ${__clang_hint_2})
# http://manpages.ubuntu.com/manpages/precise/en/man1/llvm-ar.1.html
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar-${__version_x_y}"
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar"
HINTS ${__clang_hints}
DOC "LLVM archiver"
@@ -20,6 +27,7 @@ mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
# http://manpages.ubuntu.com/manpages/precise/en/man1/llvm-ranlib.1.html
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib-${__version_x_y}"
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib"
HINTS ${__clang_hints}
DOC "Generate index for LLVM archive"
diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index 94dc275..c333d50 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -7,6 +7,8 @@ set(CMAKE_Fortran_PREPROCESS_SOURCE
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")
+set(CMAKE_Fortran_POSTPROCESS_FLAG "-fpreprocessed")
+
# No -DNDEBUG for Fortran.
string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -Os")
string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
diff --git a/Modules/Compiler/IAR-ASM.cmake b/Modules/Compiler/IAR-ASM.cmake
index 844c30e..651bc3a 100644
--- a/Modules/Compiler/IAR-ASM.cmake
+++ b/Modules/Compiler/IAR-ASM.cmake
@@ -2,13 +2,20 @@
include(Compiler/IAR)
-set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
-
-if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
+if("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
+set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -S <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
+ __compiler_iar_ARM(ASM)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa)
-endif()
+ string(APPEND CMAKE_ASM_FLAGS_INIT " ")
+ string(APPEND CMAKE_ASM_FLAGS_DEBUG_INIT " -r")
+ string(APPEND CMAKE_ASM_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+ string(APPEND CMAKE_ASM_FLAGS_RELEASE_INIT " -DNDEBUG")
+ string(APPEND CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT " -r -DNDEBUG")
-if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR")
+elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
+ set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -S <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
+ __compiler_iar_AVR(ASM)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s90;asm;msa)
+
endif()
diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake
index f65b0c7..55e019e 100644
--- a/Modules/Compiler/IAR-C.cmake
+++ b/Modules/Compiler/IAR-C.cmake
@@ -1,25 +1,32 @@
# This file is processed when the IAR compiler is used for a C file
-
include(Compiler/IAR)
-
-set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
-set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
-set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
-
-set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "-f ")
-set(CMAKE_DEPFILE_FLAGS_C "--dependencies=ns <DEPFILE>")
+include(Compiler/CMakeCommonCompilerMacros)
# The toolchains for ARM and AVR are quite different:
-if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
+if("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
- set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
- set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> <TARGET> --create <LINK_FLAGS> <OBJECTS> ")
+ set(CMAKE_C_EXTENSION_COMPILE_OPTION -e)
-endif()
+ set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION -e)
+ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.10)
+ set(CMAKE_C90_STANDARD_COMPILE_OPTION --c89)
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION --c89 -e)
+ set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C99_EXTENSION_COMPILE_OPTION -e)
+ endif()
+ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.10)
+ set(CMAKE_C11_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C11_EXTENSION_COMPILE_OPTION -e)
+ endif()
-if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR")
+ __compiler_iar_ARM(C)
+ __compiler_check_default_language_standard(C 1.10 90 6.10 99 8.10 11)
+
+elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
+ __compiler_iar_AVR(C)
set(CMAKE_C_OUTPUT_EXTENSION ".r90")
if(NOT CMAKE_C_LINK_FLAGS)
@@ -29,9 +36,8 @@ if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR")
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> -o <TARGET> <OBJECTS> ")
+ # add the target specific include directory:
+ get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
+ get_filename_component(_compilerDir "${_compilerDir}" PATH)
+ include_directories("${_compilerDir}/inc" )
endif()
-
-# add the target specific include directory:
-get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
-get_filename_component(_compilerDir "${_compilerDir}" PATH)
-include_directories("${_compilerDir}/inc" )
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index f49968e..8d86100 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -1,24 +1,41 @@
# This file is processed when the IAR compiler is used for a C++ file
include(Compiler/IAR)
+include(Compiler/CMakeCommonCompilerMacros)
+
+if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
+ # "(extended) embedded C++" Mode
+ # old version: --ec++ or --eec++
+ # since 8.10: --c++ --no_exceptions --no_rtti
+ #
+ # --c++ is full C++ and supported since 6.10
+ if(NOT CMAKE_IAR_CXX_FLAG)
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.10)
+ set(CMAKE_IAR_CXX_FLAG --c++)
+ else()
+ set(CMAKE_IAR_CXX_FLAG --eec++)
+ endif()
+ endif()
-set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
-
-set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
-set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
-
-set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "-f ")
-set(CMAKE_DEPFILE_FLAGS_CXX "--dependencies=ns <DEPFILE>")
-
-if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
+ set(CMAKE_CXX_EXTENSION_COMPILE_OPTION -e)
- set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
- set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> <TARGET> --create <LINK_FLAGS> <OBJECTS> ")
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION -e)
-endif()
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.10)
+ set(CMAKE_CXX03_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX03_EXTENSION_COMPILE_OPTION -e)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION -e)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION -e)
+ endif()
+ __compiler_iar_ARM(CXX)
+ __compiler_check_default_language_standard(CXX 6.10 98 8.10 14)
-if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR")
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
+ __compiler_iar_AVR(CXX)
set(CMAKE_CXX_OUTPUT_EXTENSION ".r90")
if(NOT CMAKE_CXX_LINK_FLAGS)
set(CMAKE_CXX_LINK_FLAGS "-Fmotorola")
@@ -27,9 +44,8 @@ if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR")
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> -o <TARGET> <OBJECTS> ")
+ # add the target specific include directory:
+ get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
+ get_filename_component(_compilerDir "${_compilerDir}" PATH)
+ include_directories("${_compilerDir}/inc")
endif()
-
-# add the target specific include directory:
-get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
-get_filename_component(_compilerDir "${_compilerDir}" PATH)
-include_directories("${_compilerDir}/inc")
diff --git a/Modules/Compiler/IAR-DetermineCompiler.cmake b/Modules/Compiler/IAR-DetermineCompiler.cmake
index c39810a..4ef587b 100644
--- a/Modules/Compiler/IAR-DetermineCompiler.cmake
+++ b/Modules/Compiler/IAR-DetermineCompiler.cmake
@@ -1,4 +1,18 @@
-
# IAR Systems compiler for embedded systems.
# http://www.iar.com
-set(_compiler_id_pp_test "defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC)")
+# http://supp.iar.com/FilesPublic/UPDINFO/004916/arm/doc/EWARM_DevelopmentGuide.ENU.pdf
+#
+# __IAR_SYSTEMS_ICC__ An integer that identifies the IAR compiler platform. The current value is 8. Note that
+# the number could be higher in a future version of the product
+# __ICCARM__ An integer that is set to 1 when the code is compiled with the IAR C/C++ Compiler for ARM
+# __VER__ An integer that identifies the version number of the IAR compiler in use. For example,
+# version 5.11.3 is returned as 5011003.
+
+set(_compiler_id_pp_test "defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)")
+
+set(_compiler_id_version_compute "
+# if defined(__VER__)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__VER__) / 1000000)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(((__VER__) / 1000) % 1000)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@((__VER__) % 1000)
+# endif")
diff --git a/Modules/Compiler/IAR-FindBinUtils.cmake b/Modules/Compiler/IAR-FindBinUtils.cmake
new file mode 100644
index 0000000..2b04795
--- /dev/null
+++ b/Modules/Compiler/IAR-FindBinUtils.cmake
@@ -0,0 +1,54 @@
+if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL "")
+ message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
+endif()
+
+# Try to find tools in the same directory as Clang itself
+get_filename_component(__iar_hint_1 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" REALPATH)
+get_filename_component(__iar_hint_1 "${__iar_hint_1}" DIRECTORY)
+
+get_filename_component(__iar_hint_2 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY)
+
+set(__iar_hints "${__iar_hint_1}" "${__iar_hint_2}")
+
+if("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
+ # could allow using normal binutils ar, since objects are normal ELF files?
+ find_program(CMAKE_IAR_LINKARM ilinkarm.exe HINTS ${__iar_hints}
+ DOC "The IAR ARM linker")
+ find_program(CMAKE_IAR_ARCHIVE iarchive.exe HINTS ${__iar_hints}
+ DOC "The IAR archiver")
+
+ # find auxillary tools
+ find_program(CMAKE_IAR_ELFTOOL ielftool.exe HINTS ${__iar_hints}
+ DOC "The IAR ELF Tool")
+ find_program(CMAKE_IAR_ELFDUMP ielfdumparm.exe HINTS ${__iar_hints}
+ DOC "The IAR ELF Dumper")
+ find_program(CMAKE_IAR_OBJMANIP iobjmanip.exe HINTS ${__iar_hints}
+ DOC "The IAR ELF Object Tool")
+ find_program(CMAKE_IAR_SYMEXPORT isymexport.exe HINTS ${__iar_hints}
+ DOC "The IAR Absolute Symbol Exporter")
+ mark_as_advanced(CMAKE_IAR_LINKARM CMAKE_IAR_ARCHIVE CMAKE_IAR_ELFTOOL CMAKE_IAR_ELFDUMP CMAKE_IAR_OBJMANIP CMAKE_IAR_SYMEXPORT)
+
+ set(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_CUSTOM_CODE
+"set(CMAKE_IAR_LINKARM \"${CMAKE_IAR_LINKARM}\")
+set(CMAKE_IAR_ARCHIVE \"${CMAKE_IAR_ARCHIVE}\")
+set(CMAKE_IAR_ELFTOOL \"${CMAKE_IAR_ELFTOOL}\")
+set(CMAKE_IAR_ELFDUMP \"${CMAKE_IAR_ELFDUMP}\")
+set(CMAKE_IAR_OBJMANIP \"${CMAKE_IAR_OBJMANIP}\")
+set(CMAKE_IAR_LINKARM \"${CMAKE_IAR_LINKARM}\")
+")
+
+
+elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
+
+ # For AVR and AVR32, IAR uses the "xlink" linker and the "xar" archiver:
+ find_program(CMAKE_IAR_LINKER xlink.exe HINTS ${__iar_hints}
+ DOC "The IAR AVR linker")
+ find_program(CMAKE_IAR_AR xar.exe HINTS ${__iar_hints}
+ DOC "The IAR archiver")
+ mark_as_advanced(CMAKE_IAR_LINKER CMAKE_IAR_AR)
+
+ set(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_CUSTOM_CODE
+"set(CMAKE_IAR_LINKER \"${CMAKE_IAR_LINKER}\")
+set(CMAKE_IAR_AR \"${CMAKE_IAR_AR}\")
+")
+endif()
diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake
index 8c45276..52ebaf2 100644
--- a/Modules/Compiler/IAR.cmake
+++ b/Modules/Compiler/IAR.cmake
@@ -2,46 +2,75 @@
# Documentation can be downloaded here: http://www.iar.com/website1/1.0.1.0/675/1/
# The initial feature request is here: https://gitlab.kitware.com/cmake/cmake/issues/10176
# It also contains additional links and information.
+# See USER GUIDES -> C/C++ Development Guide and ReleaseNotes for:
+# version 6.30.8: http://supp.iar.com/FilesPublic/UPDINFO/006607/arm/doc/infocenter/index.ENU.html
+# version 7.60.1: http://supp.iar.com/FilesPublic/UPDINFO/011006/arm/doc/infocenter/index.ENU.html
+# version 8.10.1: http://netstorage.iar.com/SuppDB/Public/UPDINFO/011854/arm/doc/infocenter/index.ENU.html
-if(_IAR_CMAKE_LOADED)
+# C/C++ Standard versions
+#
+# IAR typically only supports one C and C++ Standard version,
+# the exception is C89 which is always supported and can be selected
+# if its not the default
+#
+# C++ is trickier, there were historically 3 switches,
+# and some IAR versions support multiple of those.
+# they are --eec++, --ec++ and --c++ and where used to
+# enable various language features like exceptions
+#
+# recent versions only have --c++ for full support
+# but can choose to disable features with further arguments
+#
+# C/C++ Standard compliance
+#
+# IAR has 3 modes: default, strict and extended
+# the extended mode is needed for popular libraries like CMSIS
+#
+# "Silent" Operation
+#
+# this really is different to most programs I know.
+# nothing meaningfull from the operation is lost, just some redundant
+# code and data size printouts (that can be inspected with common tools).
+
+# This module is shared by multiple languages; use include blocker.
+if(_IARARM_CMAKE_LOADED)
return()
endif()
-set(_IAR_CMAKE_LOADED TRUE)
+set(_IARARM_CMAKE_LOADED 1)
+macro(__compiler_iar_ARM lang)
+ set(CMAKE_EXECUTABLE_SUFFIX ".elf")
+ if (${lang} STREQUAL "C" OR ${lang} STREQUAL "CXX")
-get_filename_component(_CMAKE_C_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
-get_filename_component(_CMAKE_CXX_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
-get_filename_component(_CMAKE_ASM_TOOLCHAIN_LOCATION "${CMAKE_ASM_COMPILER}" PATH)
+ set(CMAKE_${lang}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-f ")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "--dependencies=ns <DEPFILE>")
-if("${CMAKE_C_COMPILER}" MATCHES "arm" OR "${CMAKE_CXX_COMPILER}" MATCHES "arm" OR "${CMAKE_ASM_COMPILER}" MATCHES "arm")
- set(CMAKE_EXECUTABLE_SUFFIX ".elf")
+ string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -r")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Ohz -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -Oh -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -Oh -r -DNDEBUG")
+ endif()
- # For arm, IAR uses the "ilinkarm" linker and "iarchive" archiver:
- find_program(CMAKE_IAR_LINKER ilinkarm HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}")
- find_program(CMAKE_IAR_AR iarchive HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" )
+ set(CMAKE_${lang}_LINK_EXECUTABLE "\"${CMAKE_IAR_LINKARM}\" --silent <OBJECTS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "\"${CMAKE_IAR_ARCHIVE}\" <TARGET> --create <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_CREATE "\"${CMAKE_IAR_ARCHIVE}\" <TARGET> --create <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_APPEND "\"${CMAKE_IAR_ARCHIVE}\" <TARGET> --replace <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_FINISH "")
- set(IAR_TARGET_ARCHITECTURE "ARM" CACHE STRING "IAR compiler target architecture")
-endif()
+ set(CMAKE_LINKER "${CMAKE_IAR_LINKARM}" CACHE FILEPATH "The IAR linker" FORCE)
+ set(CMAKE_AR "${CMAKE_IAR_ARCHIVE}" CACHE FILEPATH "The IAR archiver" FORCE)
+endmacro()
-if("${CMAKE_C_COMPILER}" MATCHES "avr" OR "${CMAKE_CXX_COMPILER}" MATCHES "avr" OR "${CMAKE_ASM_COMPILER}" MATCHES "avr")
+macro(__compiler_iar_AVR lang)
set(CMAKE_EXECUTABLE_SUFFIX ".bin")
- # For AVR and AVR32, IAR uses the "xlink" linker and the "xar" archiver:
- find_program(CMAKE_IAR_LINKER xlink HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" )
- find_program(CMAKE_IAR_AR xar HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" )
-
- set(IAR_TARGET_ARCHITECTURE "AVR" CACHE STRING "IAR compiler target architecture")
-
set(CMAKE_LIBRARY_PATH_FLAG "-I")
-endif()
-
-if(NOT IAR_TARGET_ARCHITECTURE)
- message(FATAL_ERROR "The IAR compiler for this architecture is not yet supported "
- "by CMake. Please go to https://gitlab.kitware.com/cmake/cmake/issues "
- "and enter a feature request there.")
-endif()
-
-set(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE)
-set(CMAKE_AR "${CMAKE_IAR_AR}" CACHE FILEPATH "The IAR archiver" FORCE)
+ set(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE)
+ set(CMAKE_AR "${CMAKE_IAR_AR}" CACHE FILEPATH "The IAR archiver" FORCE)
+endmacro()
diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake
index 9371301..f478b85 100644
--- a/Modules/Compiler/MSVC-CXX.cmake
+++ b/Modules/Compiler/MSVC-CXX.cmake
@@ -3,7 +3,25 @@
include(Compiler/CMakeCommonCompilerMacros)
-if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
+if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.10.25017)
+ # VS 2015 Update 3 and above support language standard level flags,
+ # with the default and minimum level being C++14.
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std:c++14")
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std:c++14")
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.11.25505)
+ set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std:c++17")
+ set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std:c++17")
+ else()
+ set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std:c++latest")
+ set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std:c++latest")
+ endif()
+
+ __compiler_check_default_language_standard(CXX 19.0 14)
+elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
# MSVC has no specific options to set language standards, but set them as
# empty strings anyways so the feature test infrastructure can at least check
# to see if they are defined.
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index 0ff2eed..b86a5a9 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -16,6 +16,9 @@ Site: @SITE@
# Build name is osname-revision-compiler, i.e. Linux-2.4.2-2smp-c++
BuildName: @BUILDNAME@
+# Subprojects
+LabelsForSubprojects: @CTEST_LABELS_FOR_SUBPROJECTS@
+
# Submission information
IsCDash: @CTEST_DROP_SITE_CDASH@
CDashVersion: @CTEST_CDASH_VERSION@
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 2495736..d92eb5f 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -5,413 +5,860 @@
ExternalProject
---------------
-Create custom targets to build projects in external trees
+.. only:: html
+
+ .. contents::
+
+External Project Definition
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. command:: ExternalProject_Add
- The ``ExternalProject_Add`` function creates a custom target to drive
+ The ``ExternalProject_Add()`` function creates a custom target to drive
download, update/patch, configure, build, install and test steps of an
external project::
- ExternalProject_Add(<name> [<option>...])
-
- General options are:
-
- ``DEPENDS <projects>...``
- Targets on which the project depends
- ``PREFIX <dir>``
- Root dir for entire project
- ``LIST_SEPARATOR <sep>``
- Sep to be replaced by ; in cmd lines
- ``TMP_DIR <dir>``
- Directory to store temporary files
- ``STAMP_DIR <dir>``
- Directory to store step timestamps
- ``EXCLUDE_FROM_ALL 1``
- The "all" target does not depend on this
-
- Download step options are:
-
- ``DOWNLOAD_NAME <fname>``
- File name to store (if not end of URL)
- ``DOWNLOAD_DIR <dir>``
- Directory to store downloaded files
- ``DOWNLOAD_COMMAND <cmd>...``
- Command to download source tree
- ``DOWNLOAD_NO_PROGRESS 1``
- Disable download progress reports
- ``CVS_REPOSITORY <cvsroot>``
- CVSROOT of CVS repository
- ``CVS_MODULE <mod>``
- Module to checkout from CVS repo
- ``CVS_TAG <tag>``
- Tag to checkout from CVS repo
- ``SVN_REPOSITORY <url>``
- URL of Subversion repo
- ``SVN_REVISION -r<rev>``
- Revision to checkout from Subversion repo
- ``SVN_USERNAME <username>``
- Username for Subversion checkout and update
- ``SVN_PASSWORD <password>``
- Password for Subversion checkout and update
- ``SVN_TRUST_CERT 1``
- Trust the Subversion server site certificate
- ``GIT_REPOSITORY <url>``
- URL of git repo
- ``GIT_TAG <tag>``
- Git branch name, commit id or tag
- ``GIT_REMOTE_NAME <name>``
- The optional name of the remote, default to ``origin``
- ``GIT_SUBMODULES <module>...``
- Git submodules that shall be updated, all if empty
- ``GIT_SHALLOW 1``
- Tell Git to clone with ``--depth 1``. Use when ``GIT_TAG`` is not
- specified or when it names a branch in order to download only the
- tip of the branch without the rest of its history.
- ``GIT_PROGRESS 1``
- Tell Git to clone with ``--progress``. For large projects, the clone step
- does not output anything which can make the build appear to have stalled.
- This option forces Git to output progress information during the clone step
- so that forward progress is indicated.
- ``GIT_CONFIG <option>...``
- Tell Git to clone with ``--config <option>``. Use additional configuration
- parameters when cloning the project (``key=value`` as expected by ``git
- config``).
- ``HG_REPOSITORY <url>``
- URL of mercurial repo
- ``HG_TAG <tag>``
- Mercurial branch name, commit id or tag
- ``URL /.../src.tgz [/.../src.tgz]...``
- Full path or URL(s) of source. Multiple URLs are allowed as mirrors.
- ``URL_HASH ALGO=value``
- Hash of file at URL
- ``URL_MD5 md5``
- Equivalent to URL_HASH MD5=md5
- ``HTTP_USERNAME <username>``
- Username for download operation
- ``HTTP_PASSWORD <username>``
- Password for download operation
- ``HTTP_HEADER <header>``
- HTTP header for download operation. Suboption can be repeated several times.
- ``TLS_VERIFY <bool>``
- Should certificate for https be checked
- ``TLS_CAINFO <file>``
- Path to a certificate authority file
- ``TIMEOUT <seconds>``
- Time allowed for file download operations
- ``DOWNLOAD_NO_EXTRACT 1``
- Just download the file and do not extract it; the full path to the
- downloaded file is available as ``<DOWNLOADED_FILE>``.
-
- Update/Patch step options are:
-
- ``UPDATE_COMMAND <cmd>...``
- Source work-tree update command
- ``UPDATE_DISCONNECTED 1``
- Never update automatically from the remote repository
- ``PATCH_COMMAND <cmd>...``
- Command to patch downloaded source
-
- Configure step options are:
-
- ``SOURCE_DIR <dir>``
- Source dir to be used for build
- ``SOURCE_SUBDIR <dir>``
- Path to source CMakeLists.txt relative to ``SOURCE_DIR``
- ``CONFIGURE_COMMAND <cmd>...``
- Build tree configuration command
- ``CMAKE_COMMAND /.../cmake``
- Specify alternative cmake executable
- ``CMAKE_GENERATOR <gen>``
- Specify generator for native build
- ``CMAKE_GENERATOR_PLATFORM <platform>``
- Generator-specific platform name
- ``CMAKE_GENERATOR_TOOLSET <toolset>``
- Generator-specific toolset name
- ``CMAKE_ARGS <arg>...``
- Arguments to CMake command line.
- These arguments are passed to CMake command line, and can contain
- arguments other than cache values, see also
- :manual:`CMake Options <cmake(1)>`. Arguments in the form
- ``-Dvar:string=on`` are always passed to the command line, and
- therefore cannot be changed by the user.
- Arguments may use
- :manual:`generator expressions <cmake-generator-expressions(7)>`.
- ``CMAKE_CACHE_ARGS <arg>...``
- Initial cache arguments, of the form ``-Dvar:string=on``.
- These arguments are written in a pre-load a script that populates
- CMake cache, see also :manual:`cmake -C <cmake(1)>`. This allows one to
- overcome command line length limits.
- These arguments are :command:`set` using the ``FORCE`` argument,
- and therefore cannot be changed by the user.
- Arguments may use
- :manual:`generator expressions <cmake-generator-expressions(7)>`.
- ``CMAKE_CACHE_DEFAULT_ARGS <arg>...``
- Initial default cache arguments, of the form ``-Dvar:string=on``.
- These arguments are written in a pre-load a script that populates
- CMake cache, see also :manual:`cmake -C <cmake(1)>`. This allows one to
- overcome command line length limits.
- These arguments can be used as default value that will be set if no
- previous value is found in the cache, and that the user can change
- later.
- Arguments may use
- :manual:`generator expressions <cmake-generator-expressions(7)>`.
-
- Build step options are:
-
- ``BINARY_DIR <dir>``
- Specify build dir location
- ``BUILD_COMMAND <cmd>...``
- Command to drive the native build
- ``BUILD_IN_SOURCE 1``
- Use source dir for build dir
- ``BUILD_ALWAYS 1``
- No stamp file, build step always runs
- ``BUILD_BYPRODUCTS <file>...``
- Files that will be generated by the build command but may or may
- not have their modification time updated by subsequent builds.
-
- Install step options are:
-
- ``INSTALL_DIR <dir>``
- Installation prefix to be placed in the ``<INSTALL_DIR>`` placeholder.
- This does not actually configure the external project to install to
- the given prefix. That must be done by passing appropriate arguments
- to the external project configuration step, e.g. using ``<INSTALL_DIR>``.
- ``INSTALL_COMMAND <cmd>...``
- Command to drive installation of the external project after it has been
- built. This only happens at the *build* time of the calling project.
- In order to install files from the external project alongside the
- locally-built files, a separate local :command:`install` call must be
- added to pick the files up from one of the external project trees.
-
- Test step options are:
-
- ``TEST_BEFORE_INSTALL 1``
- Add test step executed before install step
- ``TEST_AFTER_INSTALL 1``
- Add test step executed after install step
- ``TEST_EXCLUDE_FROM_MAIN 1``
- Main target does not depend on the test step
- ``TEST_COMMAND <cmd>...``
- Command to drive test
-
- Output logging options are:
-
- ``LOG_DOWNLOAD 1``
- Wrap download in script to log output
- ``LOG_UPDATE 1``
- Wrap update in script to log output
- ``LOG_CONFIGURE 1``
- Wrap configure in script to log output
- ``LOG_BUILD 1``
- Wrap build in script to log output
- ``LOG_TEST 1``
- Wrap test in script to log output
- ``LOG_INSTALL 1``
- Wrap install in script to log output
-
- Steps can be given direct access to the terminal if possible. With
- the :generator:`Ninja` generator, this places the steps in the
- ``console`` :prop_gbl:`pool <JOB_POOLS>`. Options are:
-
- ``USES_TERMINAL_DOWNLOAD 1``
- Give download terminal access.
- ``USES_TERMINAL_UPDATE 1``
- Give update terminal access.
- ``USES_TERMINAL_CONFIGURE 1``
- Give configure terminal access.
- ``USES_TERMINAL_BUILD 1``
- Give build terminal access.
- ``USES_TERMINAL_TEST 1``
- Give test terminal access.
- ``USES_TERMINAL_INSTALL 1``
- Give install terminal access.
-
- Other options are:
-
- ``STEP_TARGETS <step-target>...``
- Generate custom targets for these steps
- ``INDEPENDENT_STEP_TARGETS <step-target>...``
- Generate custom targets for these steps that do not depend on other
- external projects even if a dependency is set
-
- The ``*_DIR`` options specify directories for the project, with default
- directories computed as follows. If the ``PREFIX`` option is given to
- ``ExternalProject_Add()`` or the ``EP_PREFIX`` directory property is set,
- then an external project is built and installed under the specified prefix::
-
- TMP_DIR = <prefix>/tmp
- STAMP_DIR = <prefix>/src/<name>-stamp
- DOWNLOAD_DIR = <prefix>/src
- SOURCE_DIR = <prefix>/src/<name>
- BINARY_DIR = <prefix>/src/<name>-build
- INSTALL_DIR = <prefix>
-
- Otherwise, if the ``EP_BASE`` directory property is set then components
- of an external project are stored under the specified base::
-
- TMP_DIR = <base>/tmp/<name>
- STAMP_DIR = <base>/Stamp/<name>
- DOWNLOAD_DIR = <base>/Download/<name>
- SOURCE_DIR = <base>/Source/<name>
- BINARY_DIR = <base>/Build/<name>
- INSTALL_DIR = <base>/Install/<name>
-
- If no ``PREFIX``, ``EP_PREFIX``, or ``EP_BASE`` is specified then the
- default is to set ``PREFIX`` to ``<name>-prefix``. Relative paths are
- interpreted with respect to the build directory corresponding to the
- source directory in which ``ExternalProject_Add`` is invoked.
-
- If ``SOURCE_SUBDIR`` is set and no ``CONFIGURE_COMMAND`` is specified, the
- configure command will run CMake using the ``CMakeLists.txt`` located in the
- relative path specified by ``SOURCE_SUBDIR``, relative to the ``SOURCE_DIR``.
- If no ``SOURCE_SUBDIR`` is given, ``SOURCE_DIR`` is used.
-
- If ``SOURCE_DIR`` is explicitly set to an existing directory the project
- will be built from it. Otherwise a download step must be specified
- using one of the ``DOWNLOAD_COMMAND``, ``CVS_*``, ``SVN_*``, or ``URL``
- options. The ``URL`` option may refer locally to a directory or source
- tarball, or refer to a remote tarball (e.g. ``http://.../src.tgz``).
-
- If ``UPDATE_DISCONNECTED`` is set, the update step is not executed
- automatically when building the main target. The update step can still
- be added as a step target and called manually. This is useful if you
- want to allow one to build the project when you are disconnected from the
- network (you might still need the network for the download step).
- This is disabled by default.
- The directory property ``EP_UPDATE_DISCONNECTED`` can be used to change
- the default value for all the external projects in the current
- directory and its subdirectories.
+ ExternalProject_Add(<name> [<option>...])
+
+ The individual steps within the process can be driven independently if
+ required (e.g. for CDash submission) and extra custom steps can be defined,
+ along with the ability to control the step dependencies. The directory
+ structure used for the management of the external project can also be
+ customized. The function supports a large number of options which can be used
+ to tailor the external project behavior.
+
+ **Directory Options:**
+ Most of the time, the default directory layout is sufficient. It is largely
+ an implementation detail that the main project usually doesn't need to
+ change. In some circumstances, however, control over the directory layout
+ can be useful or necessary. The directory options are potentially more
+ useful from the point of view that the main build can use the
+ :command:`ExternalProject_Get_Property` command to retrieve their values,
+ thereby allowing the main project to refer to build artifacts of the
+ external project.
+
+ ``PREFIX <dir>``
+ Root directory for the external project. Unless otherwise noted below,
+ all other directories associated with the external project will be
+ created under here.
+
+ ``TMP_DIR <dir>``
+ Directory in which to store temporary files.
+
+ ``STAMP_DIR <dir>``
+ Directory in which to store the timestamps of each step. Log files from
+ individual steps are also created in here (see *Logging Options* below).
+
+ ``DOWNLOAD_DIR <dir>``
+ Directory in which to store downloaded files before unpacking them. This
+ directory is only used by the URL download method, all other download
+ methods use ``SOURCE_DIR`` directly instead.
+
+ ``SOURCE_DIR <dir>``
+ Source directory into which downloaded contents will be unpacked, or for
+ non-URL download methods, the directory in which the repository should be
+ checked out, cloned, etc. If no download method is specified, this must
+ point to an existing directory where the external project has already
+ been unpacked or cloned/checked out.
+
+ .. note::
+ If a download method is specified, any existing contents of the source
+ directory may be deleted. Only the URL download method checks whether
+ this directory is either missing or empty before initiating the
+ download, stopping with an error if it is not empty. All other
+ download methods silently discard any previous contents of the source
+ directory.
+
+ ``BINARY_DIR <dir>``
+ Specify the build directory location. This option is ignored if
+ ``BUILD_IN_SOURCE`` is enabled.
+
+ ``INSTALL_DIR <dir>``
+ Installation prefix to be placed in the ``<INSTALL_DIR>`` placeholder.
+ This does not actually configure the external project to install to
+ the given prefix. That must be done by passing appropriate arguments
+ to the external project configuration step, e.g. using ``<INSTALL_DIR>``.
+
+ If any of the above ``..._DIR`` options are not specified, their defaults
+ are computed as follows. If the ``PREFIX`` option is given or the
+ ``EP_PREFIX`` directory property is set, then an external project is built
+ and installed under the specified prefix::
+
+ TMP_DIR = <prefix>/tmp
+ STAMP_DIR = <prefix>/src/<name>-stamp
+ DOWNLOAD_DIR = <prefix>/src
+ SOURCE_DIR = <prefix>/src/<name>
+ BINARY_DIR = <prefix>/src/<name>-build
+ INSTALL_DIR = <prefix>
+
+ Otherwise, if the ``EP_BASE`` directory property is set then components
+ of an external project are stored under the specified base::
+
+ TMP_DIR = <base>/tmp/<name>
+ STAMP_DIR = <base>/Stamp/<name>
+ DOWNLOAD_DIR = <base>/Download/<name>
+ SOURCE_DIR = <base>/Source/<name>
+ BINARY_DIR = <base>/Build/<name>
+ INSTALL_DIR = <base>/Install/<name>
+
+ If no ``PREFIX``, ``EP_PREFIX``, or ``EP_BASE`` is specified, then the
+ default is to set ``PREFIX`` to ``<name>-prefix``. Relative paths are
+ interpreted with respect to :variable:`CMAKE_CURRENT_BINARY_DIR` at the
+ point where ``ExternalProject_Add()`` is called.
+
+ **Download Step Options:**
+ A download method can be omitted if the ``SOURCE_DIR`` option is used to
+ point to an existing non-empty directory. Otherwise, one of the download
+ methods below must be specified (multiple download methods should not be
+ given) or a custom ``DOWNLOAD_COMMAND`` provided.
+
+ ``DOWNLOAD_COMMAND <cmd>...``
+ Overrides the command used for the download step
+ (:manual:`generator expressions <cmake-generator-expressions(7)>` are
+ supported). If this option is specified, all other download options will
+ be ignored. Providing an empty string for ``<cmd>`` effectively disables
+ the download step.
+
+ *URL Download*
+ ``URL <url1> [<url2>...]``
+ List of paths and/or URL(s) of the external project's source. When more
+ than one URL is given, they are tried in turn until one succeeds. A URL
+ may be an ordinary path in the local file system (in which case it
+ must be the only URL provided) or any downloadable URL supported by the
+ :command:`file(DOWNLOAD)` command. A local filesystem path may refer to
+ either an existing directory or to an archive file, whereas a URL is
+ expected to point to a file which can be treated as an archive. When an
+ archive is used, it will be unpacked automatically unless the
+ ``DOWNLOAD_NO_EXTRACT`` option is set to prevent it. The archive type
+ is determined by inspecting the actual content rather than using logic
+ based on the file extension.
+
+ ``URL_HASH ALGO=<value>``
+ Hash of the archive file to be downloaded. The ``<value>`` should be of
+ the form ``algo=hashValue`` where ``algo`` can be any of the hashing
+ algorithms supported by the :command:`file()` command. Specifying this
+ option is strongly recommended for URL downloads, as it ensures the
+ integrity of the downloaded content. It is also used as a check for a
+ previously downloaded file, allowing connection to the remote location
+ to be avoided altogether if the local directory already has a file from
+ an earlier download that matches the specified hash.
+
+ ``URL_MD5 <md5>``
+ Equivalent to ``URL_HASH MD5=<md5>``.
+
+ ``DOWNLOAD_NAME <fname>``
+ File name to use for the downloaded file. If not given, the end of the
+ URL is used to determine the file name. This option is rarely needed,
+ the default name is generally suitable and is not normally used outside
+ of code internal to the ``ExternalProject`` module.
+
+ ``DOWNLOAD_NO_EXTRACT <bool>``
+ Allows the extraction part of the download step to be disabled by
+ passing a boolean true value for this option. If this option is not
+ given, the downloaded contents will be unpacked automatically if
+ required. If extraction has been disabled, the full path to the
+ downloaded file is available as ``<DOWNLOADED_FILE>`` in subsequent
+ steps or as the property ``DOWNLOADED_FILE`` with the
+ :command:`ExternalProject_Get_Property` command.
+
+ ``DOWNLOAD_NO_PROGRESS <bool>``
+ Can be used to disable logging the download progress. If this option is
+ not given, download progress messages will be logged.
+
+ ``TIMEOUT <seconds>``
+ Maximum time allowed for file download operations.
+
+ ``HTTP_USERNAME <username>``
+ Username for the download operation if authentication is required.
+
+ ``HTTP_PASSWORD <password>``
+ Password for the download operation if authentication is required.
+
+ ``HTTP_HEADER <header1> [<header2>...]``
+ Provides an arbitrary list of HTTP headers for the download operation.
+ This can be useful for accessing content in systems like AWS, etc.
+
+ ``TLS_VERIFY <bool>``
+ Specifies whether certificate verification should be performed for
+ https URLs. If this option is not provided, the default behavior is
+ determined by the ``CMAKE_TLS_VERIFY`` variable (see
+ :command:`file(DOWNLOAD)`). If that is also not set, certificate
+ verification will not be performed. In situations where ``URL_HASH``
+ cannot be provided, this option can be an alternative verification
+ measure.
+
+ ``TLS_CAINFO <file>``
+ Specify a custom certificate authority file to use if ``TLS_VERIFY``
+ is enabled. If this option is not specified, the value of the
+ ``CMAKE_TLS_CAINFO`` variable will be used instead (see
+ :command:`file(DOWNLOAD)`)
+
+ *Git*
+ NOTE: A git version of 1.6.5 or later is required if this download method
+ is used.
+
+ ``GIT_REPOSITORY <url>``
+ URL of the git repository. Any URL understood by the ``git`` command
+ may be used.
+
+ ``GIT_TAG <tag>``
+ Git branch name, tag or commit hash. Note that branch names and tags
+ should generally be specified as remote names (i.e. ``origin/myBranch``
+ rather than simply ``myBranch``). This ensures that if the remote end
+ has its tag moved or branch rebased or history rewritten, the local
+ clone will still be updated correctly. In general, however, specifying
+ a commit hash should be preferred for a number of reasons:
+
+ - If the local clone already has the commit corresponding to the hash,
+ no ``git fetch`` needs to be performed to check for changes each time
+ CMake is re-run. This can result in a significant speed up if many
+ external projects are being used.
+ - Using a specific git hash ensures that the main project's own history
+ is fully traceable to a specific point in the external project's
+ evolution. If a branch or tag name is used instead, then checking out
+ a specific commit of the main project doesn't necessarily pin the
+ whole build to a specific point in the life of the external project.
+ The lack of such deterministic behavior makes the main project lose
+ traceability and repeatability.
+
+ ``GIT_REMOTE_NAME <name>``
+ The optional name of the remote. If this option is not specified, it
+ defaults to ``origin``.
+
+ ``GIT_SUBMODULES <module>...``
+ Specific git submodules that should also be updated. If this option is
+ not provided, all git submodules will be updated.
+
+ ``GIT_SHALLOW <bool>``
+ When this option is enabled, the ``git clone`` operation will be given
+ the ``--depth 1`` option. This performs a shallow clone, which avoids
+ downloading the whole history and instead retrieves just the commit
+ denoted by the ``GIT_TAG`` option.
+
+ ``GIT_PROGRESS <bool>``
+ When enabled, this option instructs the ``git clone`` operation to
+ report its progress by passing it the ``--progress`` option. Without
+ this option, the clone step for large projects may appear to make the
+ build stall, since nothing will be logged until the clone operation
+ finishes. While this option can be used to provide progress to prevent
+ the appearance of the build having stalled, it may also make the build
+ overly noisy if lots of external projects are used.
+
+ ``GIT_CONFIG <option1> [<option2>...]``
+ Specify a list of config options to pass to ``git clone``. Each option
+ listed will be transformed into its own ``--config <option>`` on the
+ ``git clone`` command line, with each option required to be in the
+ form ``key=value``.
+
+ *Subversion*
+ ``SVN_REPOSITORY <url>``
+ URL of the Subversion repository.
+
+ ``SVN_REVISION -r<rev>``
+ Revision to checkout from the Subversion repository.
+
+ ``SVN_USERNAME <username>``
+ Username for the Subversion checkout and update.
+
+ ``SVN_PASSWORD <password>``
+ Password for the Subversion checkout and update.
+
+ ``SVN_TRUST_CERT <bool>``
+ Specifies whether to trust the Subversion server site certificate. If
+ enabled, the ``--trust-server-cert`` option is passed to the ``svn``
+ checkout and update commands.
+
+ *Mercurial*
+ ``HG_REPOSITORY <url>``
+ URL of the mercurial repository.
+
+ ``HG_TAG <tag>``
+ Mercurial branch name, tag or commit id.
+
+ *CVS*
+ ``CVS_REPOSITORY <cvsroot>``
+ CVSROOT of the CVS repository.
+
+ ``CVS_MODULE <mod>``
+ Module to checkout from the CVS repository.
+
+ ``CVS_TAG <tag>``
+ Tag to checkout from the CVS repository.
+
+ **Update/Patch Step Options:**
+ Whenever CMake is re-run, by default the external project's sources will be
+ updated if the download method supports updates (e.g. a git repository
+ would be checked if the ``GIT_TAG`` does not refer to a specific commit).
+
+ ``UPDATE_COMMAND <cmd>...``
+ Overrides the download method's update step with a custom command.
+ The command may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+ ``UPDATE_DISCONNECTED <bool>``
+ When enabled, this option causes the update step to be skipped. It does
+ not, however, prevent the download step. The update step can still be
+ added as a step target (see :command:`ExternalProject_Add_StepTargets`)
+ and called manually. This is useful if you want to allow developers to
+ build the project when disconnected from the network (the network may
+ still be needed for the download step though).
+
+ When this option is present, it is generally advisable to make the value
+ a cache variable under the developer's control rather than hard-coding
+ it. If this option is not present, the default value is taken from the
+ ``EP_UPDATE_DISCONNECTED`` directory property. If that is also not
+ defined, updates are performed as normal. The ``EP_UPDATE_DISCONNECTED``
+ directory property is intended as a convenience for controlling the
+ ``UPDATE_DISCONNECTED`` behavior for an entire section of a project's
+ directory hierarchy and may be a more convenient method of giving
+ developers control over whether or not to perform updates (assuming the
+ project also provides a cache variable or some other convenient method
+ for setting the directory property).
+
+ ``PATCH_COMMAND <cmd>...``
+ Specifies a custom command to patch the sources after an update. By
+ default, no patch command is defined. Note that it can be quite difficult
+ to define an appropriate patch command that performs robustly, especially
+ for download methods such as git where changing the ``GIT_TAG`` will not
+ discard changes from a previous patch, but the patch command will be
+ called again after updating to the new tag.
+
+ **Configure Step Options:**
+ The configure step is run after the download and update steps. By default,
+ the external project is assumed to be a CMake project, but this can be
+ overridden if required.
+
+ ``CONFIGURE_COMMAND <cmd>...``
+ The default configure command runs CMake with options based on the main
+ project. For non-CMake external projects, the ``CONFIGURE_COMMAND``
+ option must be used to override this behavior
+ (:manual:`generator expressions <cmake-generator-expressions(7)>` are
+ supported). For projects that require no configure step, specify this
+ option with an empty string as the command to execute.
+
+ ``CMAKE_COMMAND /.../cmake``
+ Specify an alternative cmake executable for the configure step (use an
+ absolute path). This is generally not recommended, since it is
+ usually desirable to use the same CMake version throughout the whole
+ build. This option is ignored if a custom configure command has been
+ specified with ``CONFIGURE_COMMAND``.
+
+ ``CMAKE_GENERATOR <gen>``
+ Override the CMake generator used for the configure step. Without this
+ option, the same generator as the main build will be used. This option is
+ ignored if a custom configure command has been specified with the
+ ``CONFIGURE_COMMAND`` option.
+
+ ``CMAKE_GENERATOR_PLATFORM <platform>``
+ Pass a generator-specific platform name to the CMake command (see
+ :variable:`CMAKE_GENERATOR_PLATFORM`). It is an error to provide this
+ option without the ``CMAKE_GENERATOR`` option.
+
+ ``CMAKE_GENERATOR_TOOLSET <toolset>``
+ Pass a generator-specific toolset name to the CMake command (see
+ :variable:`CMAKE_GENERATOR_TOOLSET`). It is an error to provide this
+ option without the ``CMAKE_GENERATOR`` option.
+
+ ``CMAKE_ARGS <arg>...``
+ The specified arguments are passed to the ``cmake`` command line. They
+ can be any argument the ``cmake`` command understands, not just cache
+ values defined by ``-D...`` arguments (see also
+ :manual:`CMake Options <cmake(1)>`). In addition, arguments may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+ ``CMAKE_CACHE_ARGS <arg>...``
+ This is an alternate way of specifying cache variables where command line
+ length issues may become a problem. The arguments are expected to be in
+ the form ``-Dvar:STRING=value``, which are then transformed into
+ CMake :command:`set` commands with the ``FORCE`` option used. These
+ ``set()`` commands are written to a pre-load script which is then applied
+ using the :manual:`cmake -C <cmake(1)>` command line option. Arguments
+ may use :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+ ``CMAKE_CACHE_DEFAULT_ARGS <arg>...``
+ This is the same as the ``CMAKE_CACHE_ARGS`` option except the ``set()``
+ commands do not include the ``FORCE`` keyword. This means the values act
+ as initial defaults only and will not override any variables already set
+ from a previous run. Use this option with care, as it can lead to
+ different behavior depending on whether the build starts from a fresh
+ build directory or re-uses previous build contents.
+
+ ``SOURCE_SUBDIR <dir>``
+ When no ``CONFIGURE_COMMAND`` option is specified, the configure step
+ assumes the external project has a ``CMakeLists.txt`` file at the top of
+ its source tree (i.e. in ``SOURCE_DIR``). The ``SOURCE_SUBDIR`` option
+ can be used to point to an alternative directory within the source tree
+ to use as the top of the CMake source tree instead. This must be a
+ relative path and it will be interpreted as being relative to
+ ``SOURCE_DIR``.
+
+ **Build Step Options:**
+ If the configure step assumed the external project uses CMake as its build
+ system, the build step will also. Otherwise, the build step will assume a
+ Makefile-based build and simply run ``make`` with no arguments as the
+ default build step. This can be overridden with custom build commands if
+ required.
+
+ ``BUILD_COMMAND <cmd>...``
+ Overrides the default build command
+ (:manual:`generator expressions <cmake-generator-expressions(7)>` are
+ supported). If this option is not given, the default build command will
+ be chosen to integrate with the main build in the most appropriate way
+ (e.g. using recursive ``make`` for Makefile generators or
+ ``cmake --build`` if the project uses a CMake build). This option can be
+ specified with an empty string as the command to make the build step do
+ nothing.
+
+ ``BUILD_IN_SOURCE <bool>``
+ When this option is enabled, the build will be done directly within the
+ external project's source tree. This should generally be avoided, the use
+ of a separate build directory is usually preferred, but it can be useful
+ when the external project assumes an in-source build. The ``BINARY_DIR``
+ option should not be specified if building in-source.
+
+ ``BUILD_ALWAYS <bool>``
+ Enabling this option forces the build step to always be run. This can be
+ the easiest way to robustly ensure that the external project's own build
+ dependencies are evaluated rather than relying on the default
+ success timestamp-based method. This option is not normally needed unless
+ developers are expected to modify something the external project's build
+ depends on in a way that is not detectable via the step target
+ dependencies (e.g. ``SOURCE_DIR`` is used without a download method and
+ developers might modify the sources in ``SOURCE_DIR``).
+
+ ``BUILD_BYPRODUCTS <file>...``
+ Specifies files that will be generated by the build command but which
+ might or might not have their modification time updated by subsequent
+ builds. These ultimately get passed through as ``BYPRODUCTS`` to the
+ build step's own underlying call to :command:`add_custom_command`.
+
+ **Install Step Options:**
+ If the configure step assumed the external project uses CMake as its build
+ system, the install step will also. Otherwise, the install step will assume
+ a Makefile-based build and simply run ``make install`` as the default build
+ step. This can be overridden with custom install commands if required.
+
+ ``INSTALL_COMMAND <cmd>...``
+ The external project's own install step is invoked as part of the main
+ project's *build*. It is done after the external project's build step
+ and may be before or after the external project's test step (see the
+ ``TEST_BEFORE_INSTALL`` option below). The external project's install
+ rules are not part of the main project's install rules, so if anything
+ from the external project should be installed as part of the main build,
+ these need to be specified in the main build as additional
+ :command:`install` commands. The default install step builds the
+ ``install`` target of the external project, but this can be overridden
+ with a custom command using this option
+ (:manual:`generator expressions <cmake-generator-expressions(7)>` are
+ supported). Passing an empty string as the ``<cmd>`` makes the install
+ step do nothing.
+
+ **Test Step Options:**
+ The test step is only defined if at least one of the following ``TEST_...``
+ options are provided.
+
+ ``TEST_COMMAND <cmd>...``
+ Overrides the default test command
+ (:manual:`generator expressions <cmake-generator-expressions(7)>` are
+ supported). If this option is not given, the default behavior of the test
+ step is to build the external project's own ``test`` target. This option
+ can be specified with ``<cmd>`` as an empty string, which allows the test
+ step to still be defined, but it will do nothing. Do not specify any of
+ the other ``TEST_...`` options if providing an empty string as the test
+ command, but prefer to omit all ``TEST_...`` options altogether if the
+ test step target is not needed.
+
+ ``TEST_BEFORE_INSTALL <bool>``
+ When this option is enabled, the test step will be executed before the
+ install step. The default behavior is for the test step to run after the
+ install step.
+
+ ``TEST_AFTER_INSTALL <bool>``
+ This option is mainly useful as a way to indicate that the test step is
+ desired but all default behavior is sufficient. Specifying this option
+ with a boolean true value ensures the test step is defined and that it
+ comes after the install step. If both ``TEST_BEFORE_INSTALL`` and
+ ``TEST_AFTER_INSTALL`` are enabled, the latter is silently ignored.
+
+ ``TEST_EXCLUDE_FROM_MAIN <bool>``
+ If enabled, the main build's default ALL target will not depend on the
+ test step. This can be a useful way of ensuring the test step is defined
+ but only gets invoked when manually requested.
+
+ **Output Logging Options:**
+ Each of the following ``LOG_...`` options can be used to wrap the relevant
+ step in a script to capture its output to files. The log files will be
+ created in the ``STAMP_DIR`` directory with step-specific file names.
+
+ ``LOG_DOWNLOAD <bool>``
+ When enabled, the output of the download step is logged to files.
+
+ ``LOG_UPDATE <bool>``
+ When enabled, the output of the update step is logged to files.
+
+ ``LOG_CONFIGURE <bool>``
+ When enabled, the output of the configure step is logged to files.
+
+ ``LOG_BUILD <bool>``
+ When enabled, the output of the build step is logged to files.
+
+ ``LOG_INSTALL <bool>``
+ When enabled, the output of the install step is logged to files.
+
+ ``LOG_TEST <bool>``
+ When enabled, the output of the test step is logged to files.
+
+ **Terminal Access Options:**
+ Steps can be given direct access to the terminal in some cases. Giving a
+ step access to the terminal may allow it to receive terminal input if
+ required, such as for authentication details not provided by other options.
+ With the :generator:`Ninja` generator, these options place the steps in the
+ ``console`` :prop_gbl:`job pool <JOB_POOLS>`. Each step can be given access
+ to the terminal individually via the following options:
+
+ ``USES_TERMINAL_DOWNLOAD <bool>``
+ Give the download step access to the terminal.
+
+ ``USES_TERMINAL_UPDATE <bool>``
+ Give the update step access to the terminal.
+
+ ``USES_TERMINAL_CONFIGURE <bool>``
+ Give the configure step access to the terminal.
+
+ ``USES_TERMINAL_BUILD <bool>``
+ Give the build step access to the terminal.
+
+ ``USES_TERMINAL_INSTALL <bool>``
+ Give the install step access to the terminal.
+
+ ``USES_TERMINAL_TEST <bool>``
+ Give the test step access to the terminal.
+
+ **Target Options:**
+ ``DEPENDS <targets>...``
+ Specify other targets on which the external project depends. The other
+ targets will be brought up to date before any of the external project's
+ steps are executed. Because the external project uses additional custom
+ targets internally for each step, the ``DEPENDS`` option is the most
+ convenient way to ensure all of those steps depend on the other targets.
+ Simply doing
+ :command:`add_dependencies(\<name\> \<targets\>) <add_dependencies>` will
+ not make any of the steps dependent on ``<targets>``.
+
+ ``EXCLUDE_FROM_ALL <bool>``
+ When enabled, this option excludes the external project from the default
+ ALL target of the main build.
+
+ ``STEP_TARGETS <step-target>...``
+ Generate custom targets for the specified steps. This is required if the
+ steps need to be triggered manually or if they need to be used as
+ dependencies of other targets. If this option is not specified, the
+ default value is taken from the ``EP_STEP_TARGETS`` directory property.
+ See :command:`ExternalProject_Add_Step` below for further discussion of
+ the effects of this option.
+
+ ``INDEPENDENT_STEP_TARGETS <step-target>...``
+ Generate custom targets for the specified steps and prevent these targets
+ from having the usual dependencies applied to them. If this option is not
+ specified, the default value is taken from the
+ ``EP_INDEPENDENT_STEP_TARGETS`` directory property. This option is mostly
+ useful for allowing individual steps to be driven independently, such as
+ for a CDash setup where each step should be initiated and reported
+ individually rather than as one whole build. See
+ :command:`ExternalProject_Add_Step` below for further discussion of the
+ effects of this option.
+
+ **Miscellaneous Options:**
+ ``LIST_SEPARATOR <sep>``
+ For any of the various ``..._COMMAND`` options, replace ``;`` with
+ ``<sep>`` in the specified command lines. This can be useful where list
+ variables may be given in commands where they should end up as
+ space-separated arguments (``<sep>`` would be a single space character
+ string in this case).
+
+ ``COMMAND <cmd>...``
+ Any of the other ``..._COMMAND`` options can have additional commands
+ appended to them by following them with as many ``COMMAND ...`` options
+ as needed
+ (:manual:`generator expressions <cmake-generator-expressions(7)>` are
+ supported). For example::
+
+ ExternalProject_Add(example
+ ... # Download options, etc.
+ BUILD_COMMAND ${CMAKE_COMMAND} -E echo "Starting $<CONFIG> build"
+ COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG>
+ COMMAND ${CMAKE_COMMAND} -E echo "$<CONFIG> build complete"
+ )
+
+ It should also be noted that each build step is created via a call to
+ :command:`ExternalProject_Add_Step`. See that command's documentation for the
+ automatic substitutions that are supported for some options.
+
+Obtaining Project Properties
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. command:: ExternalProject_Get_Property
+
+ The ``ExternalProject_Get_Property()`` function retrieves external project
+ target properties::
+
+ ExternalProject_Get_Property(<name> <prop1> [<prop2>...])
+
+ The function stores property values in variables of the same name. Property
+ names correspond to the keyword argument names of ``ExternalProject_Add()``.
+ For example, the source directory might be retrieved like so:
+
+ .. code-block:: cmake
+
+ ExternalProject_Get_property(myExtProj SOURCE_DIR)
+ message("Source dir of myExtProj = ${SOURCE_DIR}")
+
+Explicit Step Management
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+The ``ExternalProject_Add()`` function on its own is often sufficient for
+incorporating an external project into the main build. Certain scenarios
+require additional work to implement desired behavior, such as adding in a
+custom step or making steps available as manually triggerable targets. The
+``ExternalProject_Add_Step()``, ``ExternalProject_Add_StepTargets()`` and
+``ExternalProject_Add_StepDependencies`` functions provide the lower level
+control needed to implement such step-level capabilities.
.. command:: ExternalProject_Add_Step
- The ``ExternalProject_Add_Step`` function adds a custom step to an
- external project::
+ The ``ExternalProject_Add_Step()`` function specifies an additional custom
+ step for an external project defined by an earlier call to
+ :command:`ExternalProject_Add`::
- ExternalProject_Add_Step(<name> <step> [<option>...])
+ ExternalProject_Add_Step(<name> <step> [<option>...])
- Options are:
+ ``<name>`` is the same as the name passed to the original call to
+ :command:`ExternalProject_Add`. The specified ``<step>`` must not be one of
+ the pre-defined steps (``mkdir``, ``download``, ``update``, ``skip-update``,
+ ``patch``, ``configure``, ``build``, ``install`` or ``test``). The supported
+ options are:
``COMMAND <cmd>...``
- Command line invoked by this step
+ The command line to be executed by this custom step
+ (:manual:`generator expressions <cmake-generator-expressions(7)>` are
+ supported). This option can be repeated multiple times to specify multiple
+ commands to be executed in order.
+
``COMMENT "<text>..."``
- Text printed when step executes
+ Text to be printed when the custom step executes.
+
``DEPENDEES <step>...``
- Steps on which this step depends
+ Other steps (custom or pre-defined) on which this step depends.
+
``DEPENDERS <step>...``
- Steps that depend on this step
+ Other steps (custom or pre-defined) that depend on this new custom step.
+
``DEPENDS <file>...``
- Files on which this step depends
+ Files on which this custom step depends.
+
``BYPRODUCTS <file>...``
- Files that will be generated by this step but may or may not
- have their modification time updated by subsequent builds.
- ``ALWAYS 1``
- No stamp file, step always runs
- ``EXCLUDE_FROM_MAIN 1``
- Main target does not depend on this step
+ Files that will be generated by this custom step but which might or might
+ not have their modification time updated by subsequent builds. This list of
+ files will ultimately be passed through as the ``BYPRODUCTS`` option to the
+ :command:`add_custom_command` used to implement the custom step internally.
+
+ ``ALWAYS <bool>``
+ When enabled, this option specifies that the custom step should always be
+ run (i.e. that it is always considered out of date).
+
+ ``EXCLUDE_FROM_MAIN <bool>``
+ When enabled, this option specifies that the external project's main target
+ does not depend on the custom step.
+
``WORKING_DIRECTORY <dir>``
- Working directory for command
- ``LOG 1``
- Wrap step in script to log output
- ``USES_TERMINAL 1``
- Give the step direct access to the terminal if possible.
+ Specifies the working directory to set before running the custom step's
+ command. If this option is not specified, the directory will be the value
+ of the :variable:`CMAKE_CURRENT_BINARY_DIR` at the point where
+ ``ExternalProject_Add_Step()`` was called.
- The command line, comment, working directory, and byproducts of every
- standard and custom step are processed to replace tokens ``<SOURCE_DIR>``,
- ``<SOURCE_SUBDIR>``, ``<BINARY_DIR>``, ``<INSTALL_DIR>``, and ``<TMP_DIR>``
- with corresponding property values.
+ ``LOG <bool>``
+ If set, this causes the output from the custom step to be captured to files
+ in the external project's ``STAMP_DIR``.
-Any builtin step that specifies a ``<step>_COMMAND cmd...`` or custom
-step that specifies a ``COMMAND cmd...`` may specify additional command
-lines using the form ``COMMAND cmd...``. At build time the commands
-will be executed in order and aborted if any one fails. For example::
+ ``USES_TERMINAL <bool>``
+ If enabled, this gives the custom step direct access to the terminal if
+ possible.
- ... BUILD_COMMAND make COMMAND echo done ...
+ The command line, comment, working directory and byproducts of every
+ standard and custom step are processed to replace the tokens
+ ``<SOURCE_DIR>``, ``<SOURCE_SUBDIR>``, ``<BINARY_DIR>``, ``<INSTALL_DIR>``
+ and ``<TMP_DIR>`` with their corresponding property values defined in the
+ original call to :command:`ExternalProject_Add`.
-specifies to run ``make`` and then ``echo done`` during the build step.
-Whether the current working directory is preserved between commands is
-not defined. Behavior of shell operators like ``&&`` is not defined.
+.. command:: ExternalProject_Add_StepTargets
-Arguments to ``<step>_COMMAND`` or ``COMMAND`` options may use
-:manual:`generator expressions <cmake-generator-expressions(7)>`.
+ The ``ExternalProject_Add_StepTargets()`` function generates targets for the
+ steps listed. The name of each created target will be of the form
+ ``<name>-<step>``::
+
+ ExternalProject_Add_StepTargets(<name> [NO_DEPENDS] <step1> [<step2>...])
+
+ Creating a target for a step allows it to be used as a dependency of another
+ target or to be triggered manually. Having targets for specific steps also
+ allows them to be driven independently of each other by specifying targets on
+ build command lines. For example, you may be submitting to a sub-project
+ based dashboard where you want to drive the configure portion of the build,
+ then submit to the dashboard, followed by the build portion, followed
+ by tests. If you invoke a custom target that depends on a step halfway
+ through the step dependency chain, then all the previous steps will also run
+ to ensure everything is up to date.
+
+ If the ``NO_DEPENDS`` option is specified, the step target will not depend on
+ the dependencies of the external project (i.e. on any dependencies of the
+ ``<name>`` custom target created by :command:`ExternalProject_Add`). This is
+ usually safe for the ``download``, ``update`` and ``patch`` steps, since they
+ do not typically require that the dependencies are updated and built. Using
+ ``NO_DEPENDS`` for any of the other pre-defined steps, however, may break
+ parallel builds. Only use ``NO_DEPENDS`` where it is certain that the named
+ steps genuinely do not have dependencies. For custom steps, consider whether
+ or not the custom commands require the dependencies to be configured, built
+ and installed.
+
+ Internally, :command:`ExternalProject_Add` calls
+ :command:`ExternalProject_Add_Step` to create each step. If any
+ ``STEP_TARGETS`` or ``INDEPENDENT_STEP_TARGETS`` were specified, then
+ ``ExternalProject_Add_StepTargets()`` will also be called after
+ :command:`ExternalProject_Add_Step`. ``INDEPENDENT_STEP_TARGETS`` have the
+ ``NO_DEPENDS`` option set, whereas ``STEP_TARGETS`` do not. Other than that,
+ the two options result in ``ExternalProject_Add_StepTargets()`` being called
+ in the same way. Even if a step is not mentioned in either of those two
+ options, ``ExternalProject_Add_StepTargets()`` can still be called later to
+ manually define a target for the step.
+
+ The ``STEP_TARGETS`` and ``INDEPENDENT_STEP_TARGETS`` options for
+ :command:`ExternalProject_Add` are generally the easiest way to ensure
+ targets are created for specific steps of interest. For custom steps,
+ ``ExternalProject_Add_StepTargets()`` must be called explicitly if a target
+ should also be created for that custom step. An alternative to these two
+ options is to populate the ``EP_STEP_TARGETS`` and
+ ``EP_INDEPENDENT_STEP_TARGETS`` directory properties. These act as defaults
+ for the step target options and can save having to repeatedly specify the
+ same set of step targets when multiple external projects are being defined.
-.. command:: ExternalProject_Get_Property
+.. command:: ExternalProject_Add_StepDependencies
- The ``ExternalProject_Get_Property`` function retrieves external project
- target properties::
+ The ``ExternalProject_Add_StepDependencies()`` function can be used to add
+ dependencies to a step. The dependencies added must be targets CMake already
+ knows about (these can be ordinary executable or library targets, custom
+ targets or even step targets of another external project)::
- ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]])
+ ExternalProject_Add_StepDependencies(<name> <step> <target1> [<target2>...])
- It stores property values in variables of the same name. Property
- names correspond to the keyword argument names of
- ``ExternalProject_Add``.
+ This function takes care to set both target and file level dependencies and
+ will ensure that parallel builds will not break. It should be used instead of
+ :command:`add_dependencies` whenever adding a dependency for some of the step
+ targets generated by the ``ExternalProject`` module.
-.. command:: ExternalProject_Add_StepTargets
+Examples
+^^^^^^^^
- The ``ExternalProject_Add_StepTargets`` function generates custom
- targets for the steps listed::
-
- ExternalProject_Add_StepTargets(<name> [NO_DEPENDS] [step1 [step2 [...]]])
-
-If ``NO_DEPENDS`` is set, the target will not depend on the
-dependencies of the complete project. This is usually safe to use for
-the download, update, and patch steps that do not require that all the
-dependencies are updated and built. Using ``NO_DEPENDS`` for other
-of the default steps might break parallel builds, so you should avoid,
-it. For custom steps, you should consider whether or not the custom
-commands requires that the dependencies are configured, built and
-installed.
-
-If ``STEP_TARGETS`` or ``INDEPENDENT_STEP_TARGETS`` is set then
-``ExternalProject_Add_StepTargets`` is automatically called at the end
-of matching calls to ``ExternalProject_Add_Step``. Pass
-``STEP_TARGETS`` or ``INDEPENDENT_STEP_TARGETS`` explicitly to
-individual ``ExternalProject_Add`` calls, or implicitly to all
-``ExternalProject_Add`` calls by setting the directory properties
-``EP_STEP_TARGETS`` and ``EP_INDEPENDENT_STEP_TARGETS``. The
-``INDEPENDENT`` version of the argument and of the property will call
-``ExternalProject_Add_StepTargets`` with the ``NO_DEPENDS`` argument.
-
-If ``STEP_TARGETS`` and ``INDEPENDENT_STEP_TARGETS`` are not set,
-clients may still manually call ``ExternalProject_Add_StepTargets``
-after calling ``ExternalProject_Add`` or ``ExternalProject_Add_Step``.
-
-This functionality is provided to make it easy to drive the steps
-independently of each other by specifying targets on build command
-lines. For example, you may be submitting to a sub-project based
-dashboard, where you want to drive the configure portion of the build,
-then submit to the dashboard, followed by the build portion, followed
-by tests. If you invoke a custom target that depends on a step
-halfway through the step dependency chain, then all the previous steps
-will also run to ensure everything is up to date.
-
-For example, to drive configure, build and test steps independently
-for each ``ExternalProject_Add`` call in your project, write the following
-line prior to any ``ExternalProject_Add`` calls in your ``CMakeLists.txt``
-file::
-
- set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
+The following example shows how to download and build a hypothetical project
+called *FooBar* from github:
-.. command:: ExternalProject_Add_StepDependencies
+.. code-block:: cmake
+
+ include(ExternalProject)
+ ExternalProject_Add(foobar
+ GIT_REPOSITORY git@github.com:FooCo/FooBar.git
+ GIT_TAG origin/release/1.2.3
+ )
+
+For the sake of the example, also define a second hypothetical external project
+called *SecretSauce*, which is downloaded from a web server. Two URLs are given
+to take advantage of a faster internal network if available, with a fallback to
+a slower external server. The project is a typical ``Makefile`` project with no
+configure step, so some of the default commands are overridden. The build is
+only required to build the *sauce* target:
+
+.. code-block:: cmake
+
+ find_program(MAKE_EXE NAMES gmake nmake make)
+ ExternalProject_Add(secretsauce
+ URL http://intranet.somecompany.com/artifacts/sauce-2.7.tgz
+ https://www.somecompany.com/downloads/sauce-2.7.zip
+ URL_HASH MD5=d41d8cd98f00b204e9800998ecf8427e
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ${MAKE_EXE} sauce
+ )
+
+Suppose the build step of ``secretsauce`` requires that ``foobar`` must already
+be built. This could be enforced like so:
+
+.. code-block:: cmake
+
+ ExternalProject_Add_StepDependencies(secretsauce build foobar)
+
+Another alternative would be to create a custom target for ``foobar``'s build
+step and make ``secretsauce`` depend on that rather than the whole ``foobar``
+project. This would mean ``foobar`` only needs to be built, it doesn't need to
+run its install or test steps before ``secretsauce`` can be built. The
+dependency can also be defined along with the ``secretsauce`` project:
+
+.. code-block:: cmake
+
+ ExternalProject_Add_StepTargets(foobar build)
+ ExternalProject_Add(secretsauce
+ URL http://intranet.somecompany.com/artifacts/sauce-2.7.tgz
+ https://www.somecompany.com/downloads/sauce-2.7.zip
+ URL_HASH MD5=d41d8cd98f00b204e9800998ecf8427e
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ${MAKE_EXE} sauce
+ DEPENDS foobar-build
+ )
+
+Instead of calling :command:`ExternalProject_Add_StepTargets`, the target could
+be defined along with the ``foobar`` project itself:
+
+.. code-block:: cmake
+
+ ExternalProject_Add(foobar
+ GIT_REPOSITORY git@github.com:FooCo/FooBar.git
+ GIT_TAG origin/release/1.2.3
+ STEP_TARGETS build
+ )
+
+If many external projects should have the same set of step targets, setting a
+directory property may be more convenient. The ``build`` step target could be
+created automatically by setting the ``EP_STEP_TARGETS`` directory property
+before creating the external projects with :command:`ExternalProject_Add`:
+
+.. code-block:: cmake
+
+ set_property(DIRECTORY PROPERTY EP_STEP_TARGETS build)
+
+Lastly, suppose that ``secretsauce`` provides a script called ``makedoc`` which
+can be used to generate its own documentation. Further suppose that the script
+expects the output directory to be provided as the only parameter and that it
+should be run from the ``secretsauce`` source directory. A custom step and a
+custom target to trigger the script can be defined like so:
+
+.. code-block:: cmake
+
+ ExternalProject_Add_Step(secretsauce docs
+ COMMAND <SOURCE_DIR>/makedoc <BINARY_DIR>
+ WORKING_DIRECTORY <SOURCE_DIR>
+ COMMENT "Building secretsauce docs"
+ ALWAYS TRUE
+ EXCLUDE_FROM_MAIN TRUE
+ )
+ ExternalProject_Add_StepTargets(secretsauce docs)
- The ``ExternalProject_Add_StepDependencies`` function add some
- dependencies for some external project step::
+The custom step could then be triggered from the main build like so::
- ExternalProject_Add_StepDependencies(<name> <step> [target1 [target2 [...]]])
+ cmake --build . --target secretsauce-docs
- This function takes care to set both target and file level
- dependencies, and will ensure that parallel builds will not break.
- It should be used instead of :command:`add_dependencies()` when adding
- a dependency for some of the step targets generated by
- ``ExternalProject``.
#]=======================================================================]
# Pre-compute a regex to match documented keywords for each command.
-math(EXPR _ep_documentation_line_count "${CMAKE_CURRENT_LIST_LINE} - 16")
+math(EXPR _ep_documentation_line_count "${CMAKE_CURRENT_LIST_LINE} - 4")
file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines
LIMIT_COUNT ${_ep_documentation_line_count}
- REGEX "^\\.\\. command:: [A-Za-z0-9_]+|^ ``[A-Z0-9_]+ .*``$")
+ REGEX "^\\.\\. command:: [A-Za-z0-9_]+|^ +``[A-Z0-9_]+ [^`]*``$")
foreach(line IN LISTS lines)
if("${line}" MATCHES "^\\.\\. command:: ([A-Za-z0-9_]+)")
if(_ep_func)
@@ -421,7 +868,7 @@ foreach(line IN LISTS lines)
#message("function [${_ep_func}]")
set(_ep_keywords_${_ep_func} "^(")
set(_ep_keyword_sep)
- elseif("${line}" MATCHES "^ ``([A-Z0-9_]+) .*``$")
+ elseif("${line}" MATCHES "^ +``([A-Z0-9_]+) [^`]*``$")
set(_ep_key "${CMAKE_MATCH_1}")
#message(" keyword [${_ep_key}]")
string(APPEND _ep_keywords_${_ep_func}
@@ -504,7 +951,7 @@ define_property(DIRECTORY PROPERTY "EP_STEP_TARGETS" INHERITED
BRIEF_DOCS
"List of ExternalProject steps that automatically get corresponding targets"
FULL_DOCS
- "These targets will be dependent on the main target dependencies"
+ "These targets will be dependent on the main target dependencies. "
"See documentation of the ExternalProject_Add_StepTargets() function in the "
"ExternalProject module."
)
@@ -513,7 +960,7 @@ define_property(DIRECTORY PROPERTY "EP_INDEPENDENT_STEP_TARGETS" INHERITED
BRIEF_DOCS
"List of ExternalProject steps that automatically get corresponding targets"
FULL_DOCS
- "These targets will not be dependent on the main target dependencies"
+ "These targets will not be dependent on the main target dependencies. "
"See documentation of the ExternalProject_Add_StepTargets() function in the "
"ExternalProject module."
)
@@ -2012,12 +2459,12 @@ function(_ep_add_download_command name)
" ${source_dir}\n"
"is not an existing non-empty directory. Please specify one of:\n"
" * SOURCE_DIR with an existing non-empty directory\n"
+ " * DOWNLOAD_COMMAND\n"
" * URL\n"
" * GIT_REPOSITORY\n"
+ " * SVN_REPOSITORY\n"
" * HG_REPOSITORY\n"
- " * CVS_REPOSITORY and CVS_MODULE\n"
- " * SVN_REVISION\n"
- " * DOWNLOAD_COMMAND"
+ " * CVS_REPOSITORY and CVS_MODULE"
)
endif()
endif()
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index b4abf75..b28f2b8 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -554,7 +554,10 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
# The addition of a new release should only require it to be run
# against the new release.
set(_Boost_IMPORTED_TARGETS TRUE)
- if(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
+ if(Boost_VERSION VERSION_LESS 103300)
+ message(WARNING "Imported targets and dependency information not available for Boost version ${Boost_VERSION} (all versions older than 1.33)")
+ set(_Boost_IMPORTED_TARGETS FALSE)
+ elseif(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
set(_Boost_IOSTREAMS_DEPENDENCIES regex thread)
set(_Boost_REGEX_DEPENDENCIES thread)
set(_Boost_WAVE_DEPENDENCIES filesystem thread)
@@ -768,8 +771,27 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
else()
- message(WARNING "Imported targets not available for Boost version ${Boost_VERSION}")
- set(_Boost_IMPORTED_TARGETS FALSE)
+ if(NOT Boost_VERSION VERSION_LESS 106500)
+ set(_Boost_CHRONO_DEPENDENCIES system)
+ set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
+ set(_Boost_COROUTINE_DEPENDENCIES context system)
+ set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_NUMPY_DEPENDENCIES python)
+ set(_Boost_RANDOM_DEPENDENCIES system)
+ set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ endif()
+ if(NOT Boost_VERSION VERSION_LESS 106600)
+ message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
+ set(_Boost_IMPORTED_TARGETS FALSE)
+ endif()
endif()
string(TOUPPER ${component} uppercomponent)
@@ -819,6 +841,7 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
set(_Boost_MATH_TR1L_HEADERS "boost/math/tr1.hpp")
set(_Boost_MPI_HEADERS "boost/mpi.hpp")
set(_Boost_MPI_PYTHON_HEADERS "boost/mpi/python/config.hpp")
+ set(_Boost_NUMPY_HEADERS "boost/python/numpy.hpp")
set(_Boost_PRG_EXEC_MONITOR_HEADERS "boost/test/prg_exec_monitor.hpp")
set(_Boost_PROGRAM_OPTIONS_HEADERS "boost/program_options.hpp")
set(_Boost_PYTHON_HEADERS "boost/python.hpp")
@@ -1000,6 +1023,7 @@ else()
# _Boost_COMPONENT_HEADERS. See the instructions at the top of
# _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
+ "1.65.0" "1.65"
"1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
"1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index a4dca54..bd7d0c0 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -2,6 +2,20 @@
# FindCUDA
# --------
#
+# .. note::
+#
+# The FindCUDA module has been superseded by first-class support
+# for the CUDA language in CMake. It is no longer necessary to
+# use this module or call ``find_package(CUDA)``. This module
+# now exists only for compatibility with projects that have not
+# been ported.
+#
+# Instead, list ``CUDA`` among the languages named in the top-level
+# call to the :command:`project` command, or call the
+# :command:`enable_language` command with ``CUDA``.
+# Then one can add CUDA (``.cu``) sources to programs directly
+# in calls to :command:`add_library` and :command:`add_executable`.
+#
# Tools for building CUDA C files: libraries and build dependencies.
#
# This script locates the NVIDIA CUDA C tools. It should work on linux,
@@ -589,7 +603,6 @@ macro(cuda_unset_include_and_libraries)
unset(CUDA_npps_LIBRARY CACHE)
unset(CUDA_nvcuvenc_LIBRARY CACHE)
unset(CUDA_nvcuvid_LIBRARY CACHE)
- unset(CUDA_USE_STATIC_CUDA_RUNTIME CACHE)
unset(CUDA_GPU_DETECT_OUTPUT CACHE)
endmacro()
@@ -679,7 +692,11 @@ if(CMAKE_CROSSCOMPILING)
# add known CUDA targetr root path to the set of directories we search for programs, libraries and headers
set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}")
macro( cuda_find_host_program )
- find_host_program( ${ARGN} )
+ if (COMMAND find_host_program)
+ find_host_program( ${ARGN} )
+ else()
+ find_program( ${ARGN} )
+ endif()
endmacro()
else()
# for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR
@@ -798,12 +815,17 @@ endif()
if(CUDA_cudart_static_LIBRARY)
# If static cudart available, use it by default, but provide a user-visible option to disable it.
option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON)
- set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY)
else()
# If not available, silently disable the option.
set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "")
+endif()
+
+if(CUDA_USE_STATIC_CUDA_RUNTIME)
+ set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY)
+else()
set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY)
endif()
+
if(NOT CUDA_VERSION VERSION_LESS "5.0")
cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library")
mark_as_advanced(CUDA_cudadevrt_LIBRARY)
@@ -1698,6 +1720,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file}
${flags}
COMMENT "Building NVCC intermediate link file ${output_file_relative_path}"
+ COMMAND_EXPAND_LISTS
${_verbatim}
)
else()
@@ -1708,6 +1731,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}"
COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}"
+ COMMAND_EXPAND_LISTS
${_verbatim}
)
endif()
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index 28cc1e9..ec5a099 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -74,7 +74,7 @@ set(CUDA_NVCC_FLAGS @CUDA_NVCC_FLAGS@ ;; @CUDA_WRAP_OPTION_NVCC_FLAGS@) # list
@CUDA_NVCC_FLAGS_CONFIG@
set(nvcc_flags @nvcc_flags@) # list
set(CUDA_NVCC_INCLUDE_DIRS "@CUDA_NVCC_INCLUDE_DIRS@") # list (needs to be in quotes to handle spaces properly).
-set(CUDA_NVCC_COMPILE_DEFINITIONS "@CUDA_NVCC_COMPILE_DEFINITIONS@") # list (needs to be in quotes to handle spaces properly).
+set(CUDA_NVCC_COMPILE_DEFINITIONS [==[@CUDA_NVCC_COMPILE_DEFINITIONS@]==]) # list (needs to be in lua quotes see #16510 ).
set(format_flag "@format_flag@") # string
set(cuda_language_flag @cuda_language_flag@) # list
diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake
index 8fb44d8..b604a17 100644
--- a/Modules/FindCUDA/select_compute_arch.cmake
+++ b/Modules/FindCUDA/select_compute_arch.cmake
@@ -30,12 +30,17 @@ endif ()
if (CUDA_VERSION VERSION_GREATER "7.5")
list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Pascal")
- list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.0" "6.1" "6.1+PTX")
+ list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.0" "6.1")
else()
list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "5.2+PTX")
endif ()
-
+if (CUDA_VERSION VERSION_GREATER "8.5")
+ list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Volta")
+ list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.0" "7.0+PTX")
+else()
+ list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.1+PTX")
+endif()
################################################################################################
# A function for automatic detection of GPUs installed (if autodetection is enabled)
@@ -141,6 +146,9 @@ function(CUDA_SELECT_NVCC_ARCH_FLAGS out_variable)
elseif(${arch_name} STREQUAL "Pascal")
set(arch_bin 6.0 6.1)
set(arch_ptx 6.1)
+ elseif(${arch_name} STREQUAL "Volta")
+ set(arch_bin 7.0 7.0)
+ set(arch_ptx 7.0)
else()
message(SEND_ERROR "Unknown CUDA Architecture Name ${arch_name} in CUDA_SELECT_NVCC_ARCH_FLAGS")
endif()
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index 4365e99..4f59d2c 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -29,6 +29,8 @@
#
# Set ``CURSES_NEED_NCURSES`` to ``TRUE`` before the
# ``find_package(Curses)`` call if NCurses functionality is required.
+# Set ``CURSES_NEED_WIDE`` to ``TRUE`` before the
+# ``find_package(Curses)`` call if unicode functionality is required.
#
# Backward Compatibility
# ^^^^^^^^^^^^^^^^^^^^^^
@@ -42,9 +44,20 @@
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
+# we don't know anything about cursesw, so only ncurses
+# may be ncursesw
+if(NOT CURSES_NEED_WIDE)
+ set(NCURSES_LIBRARY_NAME "ncurses")
+else()
+ set(NCURSES_LIBRARY_NAME "ncursesw")
+ # Also, if we are searchig fo wide curses - we are actually searching
+ # for ncurses, we don't know about any other unicode version.
+ set(CURSES_NEED_NCURSES TRUE)
+endif()
+
find_library(CURSES_CURSES_LIBRARY NAMES curses )
-find_library(CURSES_NCURSES_LIBRARY NAMES ncurses )
+find_library(CURSES_NCURSES_LIBRARY NAMES "${NCURSES_LIBRARY_NAME}" )
set(CURSES_USE_NCURSES FALSE)
if(CURSES_NCURSES_LIBRARY AND ((NOT CURSES_CURSES_LIBRARY) OR CURSES_NEED_NCURSES))
@@ -55,8 +68,14 @@ endif()
# message. Cygwin is an ncurses package, so force ncurses on
# cygwin if the curses.h is missing
if(CYGWIN)
- if(NOT EXISTS /usr/include/curses.h)
- set(CURSES_USE_NCURSES TRUE)
+ if (CURSES_NEED_WIDE)
+ if(NOT EXISTS /usr/include/ncursesw/curses.h)
+ set(CURSES_USE_NCURSES TRUE)
+ endif()
+ else()
+ if(NOT EXISTS /usr/include/curses.h)
+ set(CURSES_USE_NCURSES TRUE)
+ endif()
endif()
endif()
@@ -96,17 +115,32 @@ if(CURSES_USE_NCURSES)
# Use CURSES_NCURSES_INCLUDE_PATH if set, for compatibility.
if(CURSES_NCURSES_INCLUDE_PATH)
+ if (CURSES_NEED_WIDE)
+ find_path(CURSES_INCLUDE_PATH
+ NAMES ncursesw/ncurses.h ncursesw/curses.h
+ PATHS ${CURSES_NCURSES_INCLUDE_PATH}
+ NO_DEFAULT_PATH
+ )
+ else()
+ find_path(CURSES_INCLUDE_PATH
+ NAMES ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h
+ PATHS ${CURSES_NCURSES_INCLUDE_PATH}
+ NO_DEFAULT_PATH
+ )
+ endif()
+ endif()
+
+ if (CURSES_NEED_WIDE)
+ find_path(CURSES_INCLUDE_PATH
+ NAMES ncursesw/ncurses.h ncursesw/curses.h
+ HINTS "${_cursesParentDir}/include"
+ )
+ else()
find_path(CURSES_INCLUDE_PATH
NAMES ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h
- PATHS ${CURSES_NCURSES_INCLUDE_PATH}
- NO_DEFAULT_PATH
+ HINTS "${_cursesParentDir}/include"
)
- endif()
-
- find_path(CURSES_INCLUDE_PATH
- NAMES ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h
- HINTS "${_cursesParentDir}/include"
- )
+ endif()
# Previous versions of FindCurses provided these values.
if(NOT DEFINED CURSES_LIBRARY)
@@ -123,10 +157,14 @@ else()
get_filename_component(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
- find_path(CURSES_INCLUDE_PATH
- NAMES curses.h
- HINTS "${_cursesParentDir}/include"
- )
+ #We can't find anything with CURSES_NEED_WIDE because we know
+ #only about ncursesw unicode curses version
+ if(NOT CURSES_NEED_WIDE)
+ find_path(CURSES_INCLUDE_PATH
+ NAMES curses.h
+ HINTS "${_cursesParentDir}/include"
+ )
+ endif()
# Previous versions of FindCurses provided these values.
if(NOT DEFINED CURSES_CURSES_H_PATH)
@@ -139,31 +177,44 @@ endif()
# Report whether each possible header name exists in the include directory.
if(NOT DEFINED CURSES_HAVE_NCURSES_NCURSES_H)
- if(EXISTS "${CURSES_INCLUDE_PATH}/ncurses/ncurses.h")
+ if(CURSES_NEED_WIDE)
+ if(EXISTS "${CURSES_INCLUDE_PATH}/ncursesw/ncurses.h")
+ set(CURSES_HAVE_NCURSES_NCURSES_H "${CURSES_INCLUDE_PATH}/ncursesw/ncurses.h")
+ endif()
+ elseif(EXISTS "${CURSES_INCLUDE_PATH}/ncurses/ncurses.h")
set(CURSES_HAVE_NCURSES_NCURSES_H "${CURSES_INCLUDE_PATH}/ncurses/ncurses.h")
- else()
+ endif()
+ if(NOT DEFINED CURSES_HAVE_NCURSES_NCURSES_H)
set(CURSES_HAVE_NCURSES_NCURSES_H "CURSES_HAVE_NCURSES_NCURSES_H-NOTFOUND")
endif()
endif()
if(NOT DEFINED CURSES_HAVE_NCURSES_CURSES_H)
- if(EXISTS "${CURSES_INCLUDE_PATH}/ncurses/curses.h")
+ if(CURSES_NEED_WIDE)
+ if(EXISTS "${CURSES_INCLUDE_PATH}/ncursesw/curses.h")
+ set(CURSES_HAVE_NCURSES_CURSES_H "${CURSES_INCLUDE_PATH}/ncursesw/curses.h")
+ endif()
+ elseif(EXISTS "${CURSES_INCLUDE_PATH}/ncurses/curses.h")
set(CURSES_HAVE_NCURSES_CURSES_H "${CURSES_INCLUDE_PATH}/ncurses/curses.h")
- else()
+ endif()
+ if(NOT DEFINED CURSES_HAVE_NCURSES_CURSES_H)
set(CURSES_HAVE_NCURSES_CURSES_H "CURSES_HAVE_NCURSES_CURSES_H-NOTFOUND")
endif()
endif()
-if(NOT DEFINED CURSES_HAVE_NCURSES_H)
- if(EXISTS "${CURSES_INCLUDE_PATH}/ncurses.h")
- set(CURSES_HAVE_NCURSES_H "${CURSES_INCLUDE_PATH}/ncurses.h")
- else()
- set(CURSES_HAVE_NCURSES_H "CURSES_HAVE_NCURSES_H-NOTFOUND")
+if(NOT CURSES_NEED_WIDE)
+ #ncursesw can't be found for this paths
+ if(NOT DEFINED CURSES_HAVE_NCURSES_H)
+ if(EXISTS "${CURSES_INCLUDE_PATH}/ncurses.h")
+ set(CURSES_HAVE_NCURSES_H "${CURSES_INCLUDE_PATH}/ncurses.h")
+ else()
+ set(CURSES_HAVE_NCURSES_H "CURSES_HAVE_NCURSES_H-NOTFOUND")
+ endif()
endif()
-endif()
-if(NOT DEFINED CURSES_HAVE_CURSES_H)
- if(EXISTS "${CURSES_INCLUDE_PATH}/curses.h")
- set(CURSES_HAVE_CURSES_H "${CURSES_INCLUDE_PATH}/curses.h")
- else()
- set(CURSES_HAVE_CURSES_H "CURSES_HAVE_CURSES_H-NOTFOUND")
+ if(NOT DEFINED CURSES_HAVE_CURSES_H)
+ if(EXISTS "${CURSES_INCLUDE_PATH}/curses.h")
+ set(CURSES_HAVE_CURSES_H "${CURSES_INCLUDE_PATH}/curses.h")
+ else()
+ set(CURSES_HAVE_CURSES_H "CURSES_HAVE_CURSES_H-NOTFOUND")
+ endif()
endif()
endif()
@@ -199,4 +250,5 @@ mark_as_advanced(
CURSES_CURSES_LIBRARY
CURSES_NCURSES_LIBRARY
CURSES_EXTRA_LIBRARY
+ CURSES_FORM_LIBRARY
)
diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake
index b2ed703..092a3bd 100644
--- a/Modules/FindCygwin.cmake
+++ b/Modules/FindCygwin.cmake
@@ -8,14 +8,19 @@
# this module looks for Cygwin
if (WIN32)
- find_program(CYGWIN_INSTALL_PATH
- cygwin.bat
- "C:/Cygwin"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir]"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]"
- )
- get_filename_component(CYGWIN_INSTALL_PATH "${CYGWIN_INSTALL_PATH}" DIRECTORY)
- mark_as_advanced(
- CYGWIN_INSTALL_PATH
+ if(CYGWIN_INSTALL_PATH)
+ set(CYGWIN_BAT "${CYGWIN_INSTALL_PATH}/cygwin.bat")
+ endif()
+
+ find_program(CYGWIN_BAT
+ NAMES cygwin.bat
+ PATHS
+ "C:/Cygwin"
+ "C:/Cygwin64"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir]"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]"
)
+ get_filename_component(CYGWIN_INSTALL_PATH "${CYGWIN_BAT}" DIRECTORY)
+ mark_as_advanced(CYGWIN_BAT)
+
endif ()
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index c4b4535..cb71ef1 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -71,7 +71,7 @@
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
# See :module:`GoogleTest` for information on the :command:`gtest_add_tests`
-# command.
+# and :command:`gtest_discover_tests` commands.
include(${CMAKE_CURRENT_LIST_DIR}/GoogleTest.cmake)
diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake
index 8035507..9623b85 100644
--- a/Modules/FindGettext.cmake
+++ b/Modules/FindGettext.cmake
@@ -66,10 +66,14 @@ if(GETTEXT_MSGMERGE_EXECUTABLE)
OUTPUT_VARIABLE gettext_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
- if (gettext_version MATCHES "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)")
- set(GETTEXT_VERSION_STRING "${CMAKE_MATCH_1}")
+ get_filename_component(msgmerge_name ${GETTEXT_MSGMERGE_EXECUTABLE} NAME)
+ get_filename_component(msgmerge_namewe ${GETTEXT_MSGMERGE_EXECUTABLE} NAME_WE)
+ if (gettext_version MATCHES "^(${msgmerge_name}|${msgmerge_namewe}) \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)")
+ set(GETTEXT_VERSION_STRING "${CMAKE_MATCH_2}")
endif()
unset(gettext_version)
+ unset(msgmerge_name)
+ unset(msgmerge_namewe)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 5962c5b..de20049 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -23,7 +23,7 @@
# Fortran_HL. If the COMPONENTS argument is not given, the module will
# attempt to find only the C bindings.
#
-# On UNIX systems, this module will read the variable
+# This module will read the variable
# HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer a
# static link to a dynamic link for HDF5 and all of it's dependencies.
# To use this feature, make sure that the HDF5_USE_STATIC_LIBRARIES
@@ -187,8 +187,16 @@ function(_HDF5_test_regular_compiler_C success version is_parallel)
file(WRITE ${test_file}
"#include <hdf5.h>\n"
"#include <hdf5_hl.h>\n"
- "int main(void) {\n"
- " char const* info_ver = \"INFO\" \":\" H5_VERSION;\n"
+ "const char* info_ver = \"INFO\" \":\" H5_VERSION;\n"
+ "#ifdef H5_HAVE_PARALLEL\n"
+ "const char* info_parallel = \"INFO\" \":\" \"PARALLEL\";\n"
+ "#endif\n"
+ "int main(int argc, char **argv) {\n"
+ " int require = 0;\n"
+ " require += info_ver[argc];\n"
+ "#ifdef H5_HAVE_PARALLEL\n"
+ " require += info_parallel[argc];\n"
+ "#endif\n"
" hid_t fid;\n"
" fid = H5Fcreate(\"foo.h5\",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT);\n"
" return 0;\n"
@@ -198,11 +206,11 @@ function(_HDF5_test_regular_compiler_C success version is_parallel)
)
endif()
if(${success})
- file(STRINGS ${scratch_directory}/compiler_has_h5_c INFO_VER
- REGEX "^INFO:([0-9]+\\.[0-9]+\\.[0-9]+)(-patch([0-9]+))?"
+ file(STRINGS ${scratch_directory}/compiler_has_h5_c INFO_STRINGS
+ REGEX "^INFO:"
)
string(REGEX MATCH "^INFO:([0-9]+\\.[0-9]+\\.[0-9]+)(-patch([0-9]+))?"
- INFO_VER "${INFO_VER}"
+ INFO_VER "${INFO_STRINGS}"
)
set(${version} ${CMAKE_MATCH_1})
if(CMAKE_MATCH_3)
@@ -210,12 +218,7 @@ function(_HDF5_test_regular_compiler_C success version is_parallel)
endif()
set(${version} ${${version}} PARENT_SCOPE)
- execute_process(COMMAND ${CMAKE_C_COMPILER} -showconfig
- OUTPUT_VARIABLE config_output
- ERROR_VARIABLE config_error
- RESULT_VARIABLE config_result
- )
- if(config_output MATCHES "Parallel HDF5: yes")
+ if(INFO_STRINGS MATCHES "INFO:PARALLEL")
set(${is_parallel} TRUE PARENT_SCOPE)
else()
set(${is_parallel} FALSE PARENT_SCOPE)
@@ -233,8 +236,16 @@ function(_HDF5_test_regular_compiler_CXX success version is_parallel)
"#ifndef H5_NO_NAMESPACE\n"
"using namespace H5;\n"
"#endif\n"
+ "const char* info_ver = \"INFO\" \":\" H5_VERSION;\n"
+ "#ifdef H5_HAVE_PARALLEL\n"
+ "const char* info_parallel = \"INFO\" \":\" \"PARALLEL\";\n"
+ "#endif\n"
"int main(int argc, char **argv) {\n"
- " char const* info_ver = \"INFO\" \":\" H5_VERSION;\n"
+ " int require = 0;\n"
+ " require += info_ver[argc];\n"
+ "#ifdef H5_HAVE_PARALLEL\n"
+ " require += info_parallel[argc];\n"
+ "#endif\n"
" H5File file(\"foo.h5\", H5F_ACC_TRUNC);\n"
" return 0;\n"
"}")
@@ -243,11 +254,11 @@ function(_HDF5_test_regular_compiler_CXX success version is_parallel)
)
endif()
if(${success})
- file(STRINGS ${scratch_directory}/compiler_has_h5_cxx INFO_VER
- REGEX "^INFO:([0-9]+\\.[0-9]+\\.[0-9]+)(-patch([0-9]+))?"
+ file(STRINGS ${scratch_directory}/compiler_has_h5_cxx INFO_STRINGS
+ REGEX "^INFO:"
)
string(REGEX MATCH "^INFO:([0-9]+\\.[0-9]+\\.[0-9]+)(-patch([0-9]+))?"
- INFO_VER "${INFO_VER}"
+ INFO_VER "${INFO_STRINGS}"
)
set(${version} ${CMAKE_MATCH_1})
if(CMAKE_MATCH_3)
@@ -255,12 +266,7 @@ function(_HDF5_test_regular_compiler_CXX success version is_parallel)
endif()
set(${version} ${${version}} PARENT_SCOPE)
- execute_process(COMMAND ${CMAKE_CXX_COMPILER} -showconfig
- OUTPUT_VARIABLE config_output
- ERROR_VARIABLE config_error
- RESULT_VARIABLE config_result
- )
- if(config_output MATCHES "Parallel HDF5: yes")
+ if(INFO_STRINGS MATCHES "INFO:PARALLEL")
set(${is_parallel} TRUE PARENT_SCOPE)
else()
set(${is_parallel} FALSE PARENT_SCOPE)
@@ -390,6 +396,45 @@ macro( _HDF5_parse_compile_line
endforeach()
endmacro()
+# Select a preferred imported configuration from a target
+function(_HDF5_select_imported_config target imported_conf)
+ # We will first assign the value to a local variable _imported_conf, then assign
+ # it to the function argument at the end.
+ get_target_property(_imported_conf ${target} MAP_IMPORTED_CONFIG_${CMAKE_BUILD_TYPE})
+ if (NOT _imported_conf)
+ # Get available imported configurations by examining target properties
+ get_target_property(_imported_conf ${target} IMPORTED_CONFIGURATIONS)
+ if(HDF5_FIND_DEBUG)
+ message(STATUS "Found imported configurations: ${_imported_conf}")
+ endif()
+ # Find the imported configuration that we prefer.
+ # We do this by making list of configurations in order of preference,
+ # starting with ${CMAKE_BUILD_TYPE} and ending with the first imported_conf
+ set(_preferred_confs ${CMAKE_BUILD_TYPE})
+ list(GET _imported_conf 0 _fallback_conf)
+ list(APPEND _preferred_confs RELWITHDEBINFO RELEASE DEBUG ${_fallback_conf})
+ if(HDF5_FIND_DEBUG)
+ message(STATUS "Start search through imported configurations in the following order: ${_preferred_confs}")
+ endif()
+ # Now find the first of these that is present in imported_conf
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0057 NEW) # support IN_LISTS
+ foreach (_conf IN LISTS _preferred_confs)
+ if (${_conf} IN_LIST _imported_conf)
+ set(_imported_conf ${_conf})
+ break()
+ endif()
+ endforeach()
+ cmake_policy(POP)
+ endif()
+ if(HDF5_FIND_DEBUG)
+ message(STATUS "Selected imported configuration: ${_imported_conf}")
+ endif()
+ # assign value to function argument
+ set(${imported_conf} ${_imported_conf} PARENT_SCOPE)
+endfunction()
+
+
if(NOT HDF5_ROOT)
set(HDF5_ROOT $ENV{HDF5_ROOT})
endif()
@@ -446,30 +491,39 @@ if(NOT HDF5_FOUND AND NOT HDF5_NO_FIND_PACKAGE_CONFIG_FILE)
message(STATUS "Trying to get properties of target ${HDF5_${_lang}_TARGET}${_suffix}")
endif()
# Find library for this target. Complicated as on Windows with a DLL, we need to search for the import-lib.
- get_target_property(_imported_conf ${HDF5_${_lang}_TARGET}${_suffix} IMPORTED_CONFIGURATIONS)
- get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} IMPORTED_IMPLIB_${_imported_conf} )
- if (NOT _lang_location)
+ _HDF5_select_imported_config(${HDF5_${_lang}_TARGET}${_suffix} _hdf5_imported_conf)
+ get_target_property(_hdf5_lang_location ${HDF5_${_lang}_TARGET}${_suffix} IMPORTED_IMPLIB_${_hdf5_imported_conf} )
+ if (NOT _hdf5_lang_location)
# no import lib, just try LOCATION
- get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION)
+ get_target_property(_hdf5_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION_${_hdf5_imported_conf})
+ if (NOT _hdf5_lang_location)
+ get_target_property(_hdf5_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION)
+ endif()
endif()
- if( _lang_location )
- set(HDF5_${_lang}_LIBRARY ${_lang_location})
+ if( _hdf5_lang_location )
+ set(HDF5_${_lang}_LIBRARY ${_hdf5_lang_location})
list(APPEND HDF5_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix})
set(HDF5_${_lang}_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix})
set(HDF5_${_lang}_FOUND True)
endif()
if(FIND_HL)
- get_target_property(__lang_hl_location ${HDF5_${_lang}_HL_TARGET}${_suffix} IMPORTED_IMPLIB_${_imported_conf} )
- if (NOT _lang_hl_location)
- get_target_property(_lang_hl_location ${HDF5_${_lang}_HL_TARGET}${_suffix} LOCATION)
+ get_target_property(__lang_hl_location ${HDF5_${_lang}_HL_TARGET}${_suffix} IMPORTED_IMPLIB_${_hdf5_imported_conf} )
+ if (NOT _hdf5_lang_hl_location)
+ get_target_property(_hdf5_lang_hl_location ${HDF5_${_lang}_HL_TARGET}${_suffix} LOCATION_${_hdf5_imported_conf})
+ if (NOT _hdf5_hl_lang_location)
+ get_target_property(_hdf5_hl_lang_location ${HDF5_${_lang}_HL_TARGET}${_suffix} LOCATION)
+ endif()
endif()
- if( _lang_hl_location )
- set(HDF5_${_lang}_HL_LIBRARY ${_lang_hl_location})
- list(APPEND HDF5_HL_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix})
- set(HDF5_${_lang}_HL_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix})
+ if( _hdf5_lang_hl_location )
+ set(HDF5_${_lang}_HL_LIBRARY ${_hdf5_lang_hl_location})
+ list(APPEND HDF5_HL_LIBRARIES ${HDF5_${_lang}_HL_TARGET}${_suffix})
+ set(HDF5_${_lang}_HL_LIBRARIES ${HDF5_${_lang}_HL_TARGET}${_suffix})
set(HDF5_HL_FOUND True)
endif()
+ unset(_hdf5_lang_hl_location)
endif()
+ unset(_hdf5_imported_conf)
+ unset(_hdf5_lang_location)
endforeach()
endif()
endif()
@@ -545,8 +599,12 @@ if(NOT HDF5_FOUND)
if("x${L}" MATCHES "hdf5")
# hdf5 library
set(_HDF5_SEARCH_OPTS_LOCAL ${_HDF5_SEARCH_OPTS})
- if(UNIX AND HDF5_USE_STATIC_LIBRARIES)
- set(_HDF5_SEARCH_NAMES_LOCAL lib${L}.a)
+ if(HDF5_USE_STATIC_LIBRARIES)
+ if(WIN32)
+ set(_HDF5_SEARCH_NAMES_LOCAL lib${L})
+ else()
+ set(_HDF5_SEARCH_NAMES_LOCAL lib${L}.a)
+ endif()
endif()
else()
# external library
@@ -573,8 +631,12 @@ if(NOT HDF5_FOUND)
if("x${L}" MATCHES "hdf5")
# hdf5 library
set(_HDF5_SEARCH_OPTS_LOCAL ${_HDF5_SEARCH_OPTS})
- if(UNIX AND HDF5_USE_STATIC_LIBRARIES)
- set(_HDF5_SEARCH_NAMES_LOCAL lib${L}.a)
+ if(HDF5_USE_STATIC_LIBRARIES)
+ if(WIN32)
+ set(_HDF5_SEARCH_NAMES_LOCAL lib${L})
+ else()
+ set(_HDF5_SEARCH_NAMES_LOCAL lib${L}.a)
+ endif()
endif()
else()
# external library
@@ -706,19 +768,22 @@ if( NOT HDF5_FOUND )
# find the HDF5 libraries
foreach(LIB IN LISTS HDF5_${__lang}_LIBRARY_NAMES)
- if(UNIX AND HDF5_USE_STATIC_LIBRARIES)
+ if(HDF5_USE_STATIC_LIBRARIES)
# According to bug 1643 on the CMake bug tracker, this is the
# preferred method for searching for a static library.
# See https://gitlab.kitware.com/cmake/cmake/issues/1643. We search
# first for the full static library name, but fall back to a
# generic search on the name if the static search fails.
set( THIS_LIBRARY_SEARCH_DEBUG
- lib${LIB}d.a lib${LIB}_debug.a ${LIB}d ${LIB}_debug
- lib${LIB}d-static.a lib${LIB}_debug-static.a ${LIB}d-static ${LIB}_debug-static )
- set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} lib${LIB}-static.a ${LIB}-static)
+ lib${LIB}d.a lib${LIB}_debug.a lib${LIB}d lib${LIB}_D lib${LIB}_debug
+ lib${LIB}d-static.a lib${LIB}_debug-static.a ${LIB}d-static ${LIB}_D-static ${LIB}_debug-static )
+ set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a lib${LIB} lib${LIB}-static.a ${LIB}-static)
else()
- set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_debug ${LIB}d-shared ${LIB}_debug-shared)
+ set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_D ${LIB}_debug ${LIB}d-shared ${LIB}_D-shared ${LIB}_debug-shared)
set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} ${LIB}-shared)
+ if(WIN32)
+ list(APPEND HDF5_DEFINITIONS "-DH5_BUILT_AS_DYNAMIC_LIB")
+ endif()
endif()
find_library(HDF5_${LIB}_LIBRARY_DEBUG
NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
@@ -743,18 +808,18 @@ if( NOT HDF5_FOUND )
if(FIND_HL)
foreach(LIB IN LISTS HDF5_${__lang}_HL_LIBRARY_NAMES)
- if(UNIX AND HDF5_USE_STATIC_LIBRARIES)
+ if(HDF5_USE_STATIC_LIBRARIES)
# According to bug 1643 on the CMake bug tracker, this is the
# preferred method for searching for a static library.
# See https://gitlab.kitware.com/cmake/cmake/issues/1643. We search
# first for the full static library name, but fall back to a
# generic search on the name if the static search fails.
set( THIS_LIBRARY_SEARCH_DEBUG
- lib${LIB}d.a lib${LIB}_debug.a ${LIB}d ${LIB}_debug
- lib${LIB}d-static.a lib${LIB}_debug-static.a ${LIB}d-static ${LIB}_debug-static )
- set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} lib${LIB}-static.a ${LIB}-static)
+ lib${LIB}d.a lib${LIB}_debug.a lib${LIB}d lib${LIB}_D lib${LIB}_debug
+ lib${LIB}d-static.a lib${LIB}_debug-static.a lib${LIB}d-static lib${LIB}_D-static lib${LIB}_debug-static )
+ set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} lib${LIB}-static.a lib${LIB}-static)
else()
- set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_debug ${LIB}d-shared ${LIB}_debug-shared)
+ set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_D ${LIB}_debug ${LIB}d-shared ${LIB}_D-shared ${LIB}_debug-shared)
set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} ${LIB}-shared)
endif()
find_library(HDF5_${LIB}_LIBRARY_DEBUG
@@ -780,6 +845,7 @@ if( NOT HDF5_FOUND )
set(HDF5_HL_FOUND True)
endif()
+ _HDF5_remove_duplicates_from_beginning(HDF5_DEFINITIONS)
_HDF5_remove_duplicates_from_beginning(HDF5_INCLUDE_DIRS)
_HDF5_remove_duplicates_from_beginning(HDF5_LIBRARIES)
_HDF5_remove_duplicates_from_beginning(HDF5_HL_LIBRARIES)
@@ -855,11 +921,14 @@ if (HDF5_FIND_DEBUG)
message(STATUS "HDF5_DEFINITIONS: ${HDF5_DEFINITIONS}")
message(STATUS "HDF5_INCLUDE_DIRS: ${HDF5_INCLUDE_DIRS}")
message(STATUS "HDF5_LIBRARIES: ${HDF5_LIBRARIES}")
+ message(STATUS "HDF5_HL_LIBRARIES: ${HDF5_HL_LIBRARIES}")
foreach(__lang IN LISTS HDF5_LANGUAGE_BINDINGS)
message(STATUS "HDF5_${__lang}_DEFINITIONS: ${HDF5_${__lang}_DEFINITIONS}")
message(STATUS "HDF5_${__lang}_INCLUDE_DIR: ${HDF5_${__lang}_INCLUDE_DIR}")
message(STATUS "HDF5_${__lang}_INCLUDE_DIRS: ${HDF5_${__lang}_INCLUDE_DIRS}")
message(STATUS "HDF5_${__lang}_LIBRARY: ${HDF5_${__lang}_LIBRARY}")
message(STATUS "HDF5_${__lang}_LIBRARIES: ${HDF5_${__lang}_LIBRARIES}")
+ message(STATUS "HDF5_${__lang}_HL_LIBRARY: ${HDF5_${__lang}_HL_LIBRARY}")
+ message(STATUS "HDF5_${__lang}_HL_LIBRARIES: ${HDF5_${__lang}_HL_LIBRARIES}")
endforeach()
endif()
diff --git a/Modules/FindHTMLHelp.cmake b/Modules/FindHTMLHelp.cmake
index 84e2458..6aab8a7 100644
--- a/Modules/FindHTMLHelp.cmake
+++ b/Modules/FindHTMLHelp.cmake
@@ -18,28 +18,28 @@
if(WIN32)
find_program(HTML_HELP_COMPILER
- hhc
- "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]"
- "$ENV{ProgramFiles}/HTML Help Workshop"
- "C:/Program Files/HTML Help Workshop"
+ NAMES hhc
+ PATHS
+ "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]"
+ PATH_SUFFIXES "HTML Help Workshop"
)
get_filename_component(HTML_HELP_COMPILER_PATH "${HTML_HELP_COMPILER}" PATH)
find_path(HTML_HELP_INCLUDE_PATH
- htmlhelp.h
- "${HTML_HELP_COMPILER_PATH}/include"
- "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]/include"
- "$ENV{ProgramFiles}/HTML Help Workshop/include"
- "C:/Program Files/HTML Help Workshop/include"
+ NAMES htmlhelp.h
+ PATHS
+ "${HTML_HELP_COMPILER_PATH}/include"
+ "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]/include"
+ PATH_SUFFIXES "HTML Help Workshop/include"
)
find_library(HTML_HELP_LIBRARY
- htmlhelp
- "${HTML_HELP_COMPILER_PATH}/lib"
- "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]/lib"
- "$ENV{ProgramFiles}/HTML Help Workshop/lib"
- "C:/Program Files/HTML Help Workshop/lib"
+ NAMES htmlhelp
+ PATHS
+ "${HTML_HELP_COMPILER_PATH}/lib"
+ "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]/lib"
+ PATH_SUFFIXES "HTML Help Workshop/lib"
)
mark_as_advanced(
diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake
index 5210f08..d9705d9 100644
--- a/Modules/FindICU.cmake
+++ b/Modules/FindICU.cmake
@@ -55,6 +55,11 @@
# ICU_<C>_FOUND - ON if component was found
# ICU_<C>_LIBRARIES - libraries for component
#
+# ICU datafiles are reported in::
+#
+# ICU_MAKEFILE_INC - Makefile.inc
+# ICU_PKGDATA_INC - pkgdata.inc
+#
# Note that ``<C>`` is the uppercased name of the component.
#
# This module reads hints about search results from::
@@ -100,6 +105,10 @@ set(icu_programs
icupkg
gencmn)
+set(icu_data
+ Makefile.inc
+ pkgdata.inc)
+
# The ICU checks are contained in a function due to the large number
# of temporary variables needed.
function(_ICU_FIND)
@@ -116,6 +125,28 @@ function(_ICU_FIND)
endif()
endif()
+ # Find include directory
+ list(APPEND icu_include_suffixes "include")
+ find_path(ICU_INCLUDE_DIR
+ NAMES "unicode/utypes.h"
+ HINTS ${icu_roots}
+ PATH_SUFFIXES ${icu_include_suffixes}
+ DOC "ICU include directory")
+ set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)
+
+ # Get version
+ if(ICU_INCLUDE_DIR AND EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
+ file(STRINGS "${ICU_INCLUDE_DIR}/unicode/uvernum.h" icu_header_str
+ REGEX "^#define[\t ]+U_ICU_VERSION[\t ]+\".*\".*")
+
+ string(REGEX REPLACE "^#define[\t ]+U_ICU_VERSION[\t ]+\"([^ \\n]*)\".*"
+ "\\1" icu_version_string "${icu_header_str}")
+ set(ICU_VERSION "${icu_version_string}")
+ set(ICU_VERSION "${icu_version_string}" PARENT_SCOPE)
+ unset(icu_header_str)
+ unset(icu_version_string)
+ endif()
+
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
# 64-bit binary directory
set(_bin64 "bin64")
@@ -123,12 +154,9 @@ function(_ICU_FIND)
set(_lib64 "lib64")
endif()
- # Generic 64-bit and 32-bit directories
- list(APPEND icu_binary_suffixes "${_bin64}" "bin")
- list(APPEND icu_library_suffixes "${_lib64}" "lib")
- list(APPEND icu_include_suffixes "include")
# Find all ICU programs
+ list(APPEND icu_binary_suffixes "${_bin64}" "bin")
foreach(program ${icu_programs})
string(TOUPPER "${program}" program_upcase)
set(cache_var "ICU_${program_upcase}_EXECUTABLE")
@@ -141,27 +169,8 @@ function(_ICU_FIND)
set("${program_var}" "${${cache_var}}" PARENT_SCOPE)
endforeach()
- # Find include directory
- find_path(ICU_INCLUDE_DIR
- NAMES "unicode/utypes.h"
- HINTS ${icu_roots}
- PATH_SUFFIXES ${icu_include_suffixes}
- DOC "ICU include directory")
- set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)
-
- # Get version
- if(ICU_INCLUDE_DIR AND EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
- file(STRINGS "${ICU_INCLUDE_DIR}/unicode/uvernum.h" icu_header_str
- REGEX "^#define[\t ]+U_ICU_VERSION[\t ]+\".*\".*")
-
- string(REGEX REPLACE "^#define[\t ]+U_ICU_VERSION[\t ]+\"([^ \\n]*)\".*"
- "\\1" icu_version_string "${icu_header_str}")
- set(ICU_VERSION "${icu_version_string}" PARENT_SCOPE)
- unset(icu_header_str)
- unset(icu_version_string)
- endif()
-
# Find all ICU libraries
+ list(APPEND icu_library_suffixes "${_lib64}" "lib")
set(ICU_REQUIRED_LIBS_FOUND ON)
foreach(component ${ICU_FIND_COMPONENTS})
string(TOUPPER "${component}" component_upcase)
@@ -233,6 +242,32 @@ function(_ICU_FIND)
set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
+ # Find all ICU data files
+ if(CMAKE_LIBRARY_ARCHITECTURE)
+ list(APPEND icu_data_suffixes
+ "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
+ "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
+ "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu"
+ "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu")
+ endif()
+ list(APPEND icu_data_suffixes
+ "${_lib64}/icu/${ICU_VERSION}"
+ "lib/icu/${ICU_VERSION}"
+ "${_lib64}/icu"
+ "lib/icu")
+ foreach(data ${icu_data})
+ string(TOUPPER "${data}" data_upcase)
+ string(REPLACE "." "_" data_upcase "${data_upcase}")
+ set(cache_var "ICU_${data_upcase}")
+ set(data_var "ICU_${data_upcase}")
+ find_file("${cache_var}" "${data}"
+ HINTS ${icu_roots}
+ PATH_SUFFIXES ${icu_data_suffixes}
+ DOC "ICU ${data} data file")
+ mark_as_advanced(cache_var)
+ set("${data_var}" "${${cache_var}}" PARENT_SCOPE)
+ endforeach()
+
if(NOT ICU_FIND_QUIETLY)
if(ICU_LIBS_FOUND)
message(STATUS "Found the following ICU libraries:")
@@ -334,6 +369,15 @@ if(ICU_DEBUG)
unset(program_lib)
endforeach()
+ foreach(data IN LISTS icu_data)
+ string(TOUPPER "${data}" data_upcase)
+ string(REPLACE "." "_" data_upcase "${data_upcase}")
+ set(data_lib "ICU_${data_upcase}")
+ message(STATUS "${data} data: ${${data_lib}}")
+ unset(data_upcase)
+ unset(data_lib)
+ endforeach()
+
foreach(component IN LISTS ICU_FIND_COMPONENTS)
string(TOUPPER "${component}" component_upcase)
set(component_lib "ICU_${component_upcase}_LIBRARIES")
diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake
index e0286ee..b37f796 100644
--- a/Modules/FindIce.cmake
+++ b/Modules/FindIce.cmake
@@ -10,8 +10,16 @@
#
# This module supports multiple components.
# Components can include any of: ``Freeze``, ``Glacier2``, ``Ice``,
-# ``IceBox``, ``IceDB``, ``IceGrid``, ``IcePatch``, ``IceSSL``,
-# ``IceStorm``, ``IceUtil``, ``IceXML``, or ``Slice``.
+# ``IceBox``, ``IceDB``, ``IceDiscovery``, ``IceGrid``,
+# ``IceLocatorDiscovery``, ``IcePatch``, ``IceSSL``, ``IceStorm``,
+# ``IceUtil``, ``IceXML``, or ``Slice``.
+#
+# Ice 3.7 and later also include C++11-specific components:
+# ``Glacier2++11``, ``Ice++11``, ``IceBox++11``, ``IceDiscovery++11``
+# ``IceGrid``, ``IceLocatorDiscovery++11``, ``IceSSL++11``,
+# ``IceStorm++11``
+#
+# Note that the set of supported components is Ice version-specific.
#
# This module reports information about the Ice installation in
# several variables. General variables::
@@ -28,7 +36,7 @@
# Ice::<C>
#
# Where ``<C>`` is the name of an Ice component, for example
-# ``Ice::Glacier2``.
+# ``Ice::Glacier2`` or ``Ice++11``.
#
# Ice slice programs are reported in::
#
@@ -39,6 +47,7 @@
# Ice_SLICE2HTML_EXECUTABLE - path to slice2html executable
# Ice_SLICE2JAVA_EXECUTABLE - path to slice2java executable
# Ice_SLICE2JS_EXECUTABLE - path to slice2js executable
+# Ice_SLICE2OBJC_EXECUTABLE - path to slice2objc executable
# Ice_SLICE2PHP_EXECUTABLE - path to slice2php executable
# Ice_SLICE2PY_EXECUTABLE - path to slice2py executable
# Ice_SLICE2RB_EXECUTABLE - path to slice2rb executable
@@ -47,10 +56,13 @@
#
# Ice_GLACIER2ROUTER_EXECUTABLE - path to glacier2router executable
# Ice_ICEBOX_EXECUTABLE - path to icebox executable
+# Ice_ICEBOXXX11_EXECUTABLE - path to icebox++11 executable
# Ice_ICEBOXADMIN_EXECUTABLE - path to iceboxadmin executable
# Ice_ICEBOXD_EXECUTABLE - path to iceboxd executable
# Ice_ICEBOXNET_EXECUTABLE - path to iceboxnet executable
+# Ice_ICEBRIDGE_EXECUTABLE - path to icebridge executable
# Ice_ICEGRIDADMIN_EXECUTABLE - path to icegridadmin executable
+# Ice_ICEGRIDDB_EXECUTABLE - path to icegriddb executable
# Ice_ICEGRIDNODE_EXECUTABLE - path to icegridnode executable
# Ice_ICEGRIDNODED_EXECUTABLE - path to icegridnoded executable
# Ice_ICEGRIDREGISTRY_EXECUTABLE - path to icegridregistry executable
@@ -60,6 +72,7 @@
# Ice_ICEPATCH2SERVER_EXECUTABLE - path to icepatch2server executable
# Ice_ICESERVICEINSTALL_EXECUTABLE - path to iceserviceinstall executable
# Ice_ICESTORMADMIN_EXECUTABLE - path to icestormadmin executable
+# Ice_ICESTORMDB_EXECUTABLE - path to icestormdb executable
# Ice_ICESTORMMIGRATE_EXECUTABLE - path to icestormmigrate executable
#
# Ice db programs (Windows only; standard system versions on all other
@@ -95,6 +108,13 @@
# The environment variable ``ICE_HOME`` may also be used; the
# Ice_HOME variable takes precedence.
#
+# .. note::
+# On Windows, Ice 3.7.0 and later provide libraries via the NuGet
+# package manager. Appropriate NuGet packages will be searched for
+# using ``CMAKE_PREFIX_PATH``, or alternatively ``Ice_HOME`` may be
+# set to the location of a specific NuGet package to restrict the
+# search.
+#
# The following cache variables may also be set::
#
# Ice_<P>_EXECUTABLE - the path to executable <P>
@@ -124,12 +144,67 @@
# Written by Roger Leigh <rleigh@codelibre.net>
+ set(_Ice_db_programs
+ db_archive
+ db_checkpoint
+ db_deadlock
+ db_dump
+ db_hotbackup
+ db_load
+ db_log_verify
+ db_printlog
+ db_recover
+ db_stat
+ db_tuner
+ db_upgrade
+ db_verify
+ dumpdb
+ transformdb)
+
+ set(_Ice_programs
+ glacier2router
+ icebox
+ icebox++11
+ iceboxadmin
+ iceboxd
+ iceboxnet
+ icebridge
+ icegridadmin
+ icegriddb
+ icegridnode
+ icegridnoded
+ icegridregistry
+ icegridregistryd
+ icepatch2calc
+ icepatch2client
+ icepatch2server
+ iceserviceinstall
+ icestormadmin
+ icestormdb
+ icestormmigrate)
+
+ set(_Ice_slice_programs
+ slice2cpp
+ slice2cs
+ slice2freezej
+ slice2freeze
+ slice2html
+ slice2java
+ slice2js
+ slice2objc
+ slice2php
+ slice2py
+ slice2rb)
+
+
# The Ice checks are contained in a function due to the large number
# of temporary variables needed.
function(_Ice_FIND)
# Released versions of Ice, including generic short forms
set(ice_versions
3
+ 3.7
+ 3.7.0
3.6
3.6.3
3.6.2
@@ -146,6 +221,14 @@ function(_Ice_FIND)
3.3.1
3.3.0)
+ foreach(ver ${ice_versions})
+ string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\$" two_digit_version_match "${ver}")
+ if(two_digit_version_match)
+ string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\$" "\\1\\2" two_digit_version "${ver}")
+ list(APPEND ice_suffix_versions "${two_digit_version}")
+ endif()
+ endforeach()
+
# Set up search paths, taking compiler into account. Search Ice_HOME,
# with ICE_HOME in the environment as a fallback if unset.
if(Ice_HOME)
@@ -159,52 +242,85 @@ function(_Ice_FIND)
endif()
endif()
+ set(_bin "bin/Win32")
+ set(_lib "lib/Win32")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(_bin "bin/x64")
+ set(_lib "lib/x64")
# 64-bit path suffix
set(_x64 "/x64")
# 64-bit library directory
set(_lib64 "lib64")
endif()
- if(MSVC_VERSION)
- # VS 8.0
- if(NOT MSVC_VERSION VERSION_LESS 1400 AND MSVC_VERSION VERSION_LESS 1500)
- set(vcver "vc80")
- set(vcyear "2005")
- # VS 9.0
- elseif(NOT MSVC_VERSION VERSION_LESS 1500 AND MSVC_VERSION VERSION_LESS 1600)
- set(vcver "vc90")
+ unset(vcvers)
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10)
+ set(vcvers "141;140")
+ elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
+ set(vcvers "140")
+ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18)
+ set(vcvers "120")
+ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17)
+ set(vcvers "110")
+ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
+ set(vcvers "100")
+ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15)
+ set(vcvers "90")
set(vcyear "2008")
- # VS 10.0
- elseif(NOT MSVC_VERSION VERSION_LESS 1600 AND MSVC_VERSION VERSION_LESS 1700)
- set(vcver "vc100")
- # VS 11.0
- elseif(NOT MSVC_VERSION VERSION_LESS 1700 AND MSVC_VERSION VERSION_LESS 1800)
- set(vcver "vc110")
- # VS 12.0
- elseif(NOT MSVC_VERSION VERSION_LESS 1800 AND MSVC_VERSION VERSION_LESS 1900)
- set(vcver "vc120")
- # VS 14.0
- elseif(NOT MSVC_VERSION VERSION_LESS 1900 AND MSVC_VERSION VERSION_LESS 2000)
- set(vcver "vc140")
+ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
+ set(vcvers "80")
+ set(vcyear "2005")
+ else() # Unknown version
+ set(vcvers Unknown)
endif()
endif()
# For compatibility with ZeroC Windows builds.
- if(vcver)
- # Earlier Ice (3.3) builds don't use vcnnn subdirectories, but are harmless to check.
- list(APPEND ice_binary_suffixes "bin/${vcver}${_x64}" "bin/${vcver}")
- list(APPEND ice_library_suffixes "lib/${vcver}${_x64}" "lib/${vcver}")
+ if(vcvers)
+ list(APPEND ice_binary_suffixes "build/native/${_bin}/Release" "tools")
+ list(APPEND ice_debug_library_suffixes "build/native/${_lib}/Debug")
+ list(APPEND ice_release_library_suffixes "build/native/${_lib}/Release")
+ foreach(vcver IN LISTS vcvers)
+ # Earlier Ice (3.3) builds don't use vcnnn subdirectories, but are harmless to check.
+ list(APPEND ice_binary_suffixes "bin/vc${vcver}${_x64}" "bin/vc${vcver}")
+ list(APPEND ice_debug_library_suffixes "lib/vc${vcver}${_x64}" "lib/vc${vcver}")
+ list(APPEND ice_release_library_suffixes "lib/vc${vcver}${_x64}" "lib/vc${vcver}")
+ endforeach()
endif()
# Generic 64-bit and 32-bit directories
list(APPEND ice_binary_suffixes "bin${_x64}" "bin")
- list(APPEND ice_library_suffixes "libx32" "${_lib64}" "lib${_x64}" "lib")
+ list(APPEND ice_debug_library_suffixes "libx32" "${_lib64}" "lib${_x64}" "lib")
+ list(APPEND ice_release_library_suffixes "libx32" "${_lib64}" "lib${_x64}" "lib")
+ if(vcvers)
+ list(APPEND ice_include_suffixes "build/native/include")
+ endif()
list(APPEND ice_include_suffixes "include")
list(APPEND ice_slice_suffixes "slice")
# On Windows, look in the registry for install locations. Different
# versions of Ice install support different compiler versions.
- if(vcver)
+ if(vcvers)
+ foreach(ice_version ${ice_versions})
+ foreach(vcver IN LISTS vcvers)
+ list(APPEND ice_nuget_dirs "zeroc.ice.v${vcver}.${ice_version}")
+ list(APPEND freeze_nuget_dirs "zeroc.freeze.v${vcver}.${ice_version}")
+ endforeach()
+ endforeach()
+ find_path(Ice_NUGET_DIR
+ NAMES "tools/slice2cpp.exe"
+ PATH_SUFFIXES ${ice_nuget_dirs}
+ DOC "Ice NuGet directory")
+ if(Ice_NUGET_DIR)
+ list(APPEND ice_roots "${Ice_NUGET_DIR}")
+ endif()
+ find_path(Freeze_NUGET_DIR
+ NAMES "tools/slice2freeze.exe"
+ PATH_SUFFIXES ${freeze_nuget_dirs}
+ DOC "Freeze NuGet directory")
+ if(Freeze_NUGET_DIR)
+ list(APPEND ice_roots "${Freeze_NUGET_DIR}")
+ endif()
foreach(ice_version ${ice_versions})
# Ice 3.3 releases use a Visual Studio year suffix and value is
# enclosed in double quotes, though only the leading quote is
@@ -239,55 +355,8 @@ function(_Ice_FIND)
endforeach()
endif()
- set(db_programs
- db_archive
- db_checkpoint
- db_deadlock
- db_dump
- db_hotbackup
- db_load
- db_log_verify
- db_printlog
- db_recover
- db_stat
- db_tuner
- db_upgrade
- db_verify
- dumpdb
- transformdb)
-
- set(ice_programs
- glacier2router
- icebox
- iceboxadmin
- iceboxd
- iceboxnet
- icegridadmin
- icegridnode
- icegridnoded
- icegridregistry
- icegridregistryd
- icepatch2calc
- icepatch2client
- icepatch2server
- iceserviceinstall
- icestormadmin
- icestormmigrate)
-
- set(slice_programs
- slice2cpp
- slice2cs
- slice2freezej
- slice2freeze
- slice2html
- slice2java
- slice2js
- slice2php
- slice2py
- slice2rb)
-
# Find all Ice programs
- foreach(program ${db_programs} ${ice_programs} ${slice_programs})
+ foreach(program ${_Ice_db_programs} ${_Ice_programs} ${_Ice_slice_programs})
string(TOUPPER "${program}" program_upcase)
set(cache_var "Ice_${program_upcase}_EXECUTABLE")
set(program_var "Ice_${program_upcase}_EXECUTABLE")
@@ -329,6 +398,13 @@ function(_Ice_FIND)
DOC "Ice include directory")
set(Ice_INCLUDE_DIR "${Ice_INCLUDE_DIR}" PARENT_SCOPE)
+ find_path(Freeze_INCLUDE_DIR
+ NAMES "Freeze/Freeze.h"
+ HINTS ${ice_roots}
+ PATH_SUFFIXES ${ice_include_suffixes}
+ DOC "Freeze include directory")
+ set(Freeze_INCLUDE_DIR "${Freeze_INCLUDE_DIR}" PARENT_SCOPE)
+
# In common use on Linux, MacOS X (homebrew) and FreeBSD; prefer
# version-specific dir
list(APPEND ice_slice_paths
@@ -336,6 +412,7 @@ function(_Ice_FIND)
list(APPEND ice_slice_suffixes
"Ice-${Ice_VERSION_SLICE2CPP_FULL}/slice"
"Ice-${Ice_VERSION_SLICE2CPP_SHORT}/slice"
+ "ice/slice"
Ice)
# Find slice directory
@@ -356,13 +433,39 @@ function(_Ice_FIND)
set(component_cache_release "${component_cache}_RELEASE")
set(component_cache_debug "${component_cache}_DEBUG")
set(component_found "${component_upcase}_FOUND")
- find_library("${component_cache_release}" "${component}"
+ set(component_library "${component}")
+ unset(component_library_release_names)
+ unset(component_library_debug_names)
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ string(REGEX MATCH ".+\\+\\+11$" component_library_cpp11 "${component_library}")
+ if(component_library_cpp11)
+ string(REGEX REPLACE "^(.+)(\\+\\+11)$" "\\1" component_library "${component_library}")
+ endif()
+ foreach(suffix_ver ${ice_suffix_versions})
+ set(_name "${component_library}${suffix_ver}")
+ if(component_library_cpp11)
+ string(APPEND _name "++11")
+ endif()
+ list(APPEND component_library_debug_names "${_name}d")
+ list(APPEND component_library_release_names "${_name}")
+ endforeach()
+ set(_name "${component_library}")
+ if(component_library_cpp11)
+ string(APPEND _name "++11")
+ endif()
+ list(APPEND component_library_debug_names "${_name}d")
+ list(APPEND component_library_release_names "${_name}")
+ else()
+ list(APPEND component_library_debug_names "${component_library}d")
+ list(APPEND component_library_release_names "${component_library}")
+ endif()
+ find_library("${component_cache_release}" ${component_library_release_names}
HINTS ${ice_roots}
- PATH_SUFFIXES ${ice_library_suffixes}
+ PATH_SUFFIXES ${ice_release_library_suffixes}
DOC "Ice ${component} library (release)")
- find_library("${component_cache_debug}" "${component}d"
+ find_library("${component_cache_debug}" ${component_library_debug_names}
HINTS ${ice_roots}
- PATH_SUFFIXES ${ice_library_suffixes}
+ PATH_SUFFIXES ${ice_debug_library_suffixes}
DOC "Ice ${component} library (debug)")
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(Ice_${component_upcase})
@@ -410,9 +513,14 @@ function(_Ice_FIND)
if(Ice_DEBUG)
message(STATUS "--------FindIce.cmake search debug--------")
message(STATUS "ICE binary path search order: ${ice_roots}")
+ message(STATUS "ICE binary suffixes: ${ice_binary_suffixes}")
message(STATUS "ICE include path search order: ${ice_roots}")
+ message(STATUS "ICE include suffixes: ${ice_include_suffixes}")
message(STATUS "ICE slice path search order: ${ice_roots} ${ice_slice_paths}")
+ message(STATUS "ICE slice suffixes: ${ice_slice_suffixes}")
message(STATUS "ICE library path search order: ${ice_roots}")
+ message(STATUS "ICE debug library suffixes: ${ice_debug_library_suffixes}")
+ message(STATUS "ICE release library suffixes: ${ice_release_library_suffixes}")
message(STATUS "----------------")
endif()
endfunction()
@@ -434,6 +542,9 @@ unset(_Ice_REQUIRED_LIBS_FOUND)
if(Ice_FOUND)
set(Ice_INCLUDE_DIRS "${Ice_INCLUDE_DIR}")
+ if (Freeze_INCLUDE_DIR)
+ list(APPEND Ice_INCLUDE_DIRS "${Freeze_INCLUDE_DIR}")
+ endif()
set(Ice_SLICE_DIRS "${Ice_SLICE_DIR}")
set(Ice_LIBRARIES "${Ice_LIBRARY}")
foreach(_Ice_component ${Ice_FIND_COMPONENTS})
@@ -448,10 +559,8 @@ if(Ice_FOUND)
set("${_Ice_component_lib}" "${${_Ice_component_cache}}")
if(NOT TARGET ${_Ice_imported_target})
add_library(${_Ice_imported_target} UNKNOWN IMPORTED)
- if()
- set_target_properties(${_Ice_imported_target} PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${Ice_INCLUDE_DIR}")
- endif()
+ set_target_properties(${_Ice_imported_target} PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${Ice_INCLUDE_DIRS}")
if(EXISTS "${${_Ice_component_cache}}")
set_target_properties(${_Ice_imported_target} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
@@ -488,50 +597,13 @@ if(Ice_DEBUG)
message(STATUS "Ice_INCLUDE_DIR directory: ${Ice_INCLUDE_DIR}")
message(STATUS "Ice_SLICE_DIR directory: ${Ice_SLICE_DIR}")
message(STATUS "Ice_LIBRARIES: ${Ice_LIBRARIES}")
+ message(STATUS "Freeze_INCLUDE_DIR directory: ${Freeze_INCLUDE_DIR}")
+ message(STATUS "Ice_INCLUDE_DIRS directory: ${Ice_INCLUDE_DIRS}")
- message(STATUS "slice2cpp executable: ${Ice_SLICE2CPP_EXECUTABLE}")
- message(STATUS "slice2cs executable: ${Ice_SLICE2CS_EXECUTABLE}")
- message(STATUS "slice2freezej executable: ${Ice_SLICE2FREEZEJ_EXECUTABLE}")
- message(STATUS "slice2freeze executable: ${Ice_SLICE2FREEZE_EXECUTABLE}")
- message(STATUS "slice2html executable: ${Ice_SLICE2HTML_EXECUTABLE}")
- message(STATUS "slice2java executable: ${Ice_SLICE2JAVA_EXECUTABLE}")
- message(STATUS "slice2js executable: ${Ice_SLICE2JS_EXECUTABLE}")
- message(STATUS "slice2php executable: ${Ice_SLICE2PHP_EXECUTABLE}")
- message(STATUS "slice2py executable: ${Ice_SLICE2PY_EXECUTABLE}")
- message(STATUS "slice2rb executable: ${Ice_SLICE2RB_EXECUTABLE}")
- message(STATUS "glacier2router executable: ${Ice_GLACIER2ROUTER_EXECUTABLE}")
-
- message(STATUS "icebox executable: ${Ice_ICEBOX_EXECUTABLE}")
- message(STATUS "iceboxadmin executable: ${Ice_ICEBOXADMIN_EXECUTABLE}")
- message(STATUS "iceboxd executable: ${Ice_ICEBOXD_EXECUTABLE}")
- message(STATUS "iceboxnet executable: ${Ice_ICEBOXNET_EXECUTABLE}")
- message(STATUS "icegridadmin executable: ${Ice_ICEGRIDADMIN_EXECUTABLE}")
- message(STATUS "icegridnode executable: ${Ice_ICEGRIDNODE_EXECUTABLE}")
- message(STATUS "icegridnoded executable: ${Ice_ICEGRIDNODED_EXECUTABLE}")
- message(STATUS "icegridregistry executable: ${Ice_ICEGRIDREGISTRY_EXECUTABLE}")
- message(STATUS "icegridregistryd executable: ${Ice_ICEGRIDREGISTRYD_EXECUTABLE}")
- message(STATUS "icepatch2calc executable: ${Ice_ICEPATCH2CALC_EXECUTABLE}")
- message(STATUS "icepatch2client executable: ${Ice_ICEPATCH2CLIENT_EXECUTABLE}")
- message(STATUS "icepatch2server executable: ${Ice_ICEPATCH2SERVER_EXECUTABLE}")
- message(STATUS "iceserviceinstall executable: ${Ice_ICESERVICEINSTALL_EXECUTABLE}")
- message(STATUS "icestormadmin executable: ${Ice_ICESTORMADMIN_EXECUTABLE}")
- message(STATUS "icestormmigrate executable: ${Ice_ICESTORMMIGRATE_EXECUTABLE}")
-
- message(STATUS "db_archive executable: ${Ice_DB_ARCHIVE_EXECUTABLE}")
- message(STATUS "db_checkpoint executable: ${Ice_DB_CHECKPOINT_EXECUTABLE}")
- message(STATUS "db_deadlock executable: ${Ice_DB_DEADLOCK_EXECUTABLE}")
- message(STATUS "db_dump executable: ${Ice_DB_DUMP_EXECUTABLE}")
- message(STATUS "db_hotbackup executable: ${Ice_DB_HOTBACKUP_EXECUTABLE}")
- message(STATUS "db_load executable: ${Ice_DB_LOAD_EXECUTABLE}")
- message(STATUS "db_log_verify executable: ${Ice_DB_LOG_VERIFY_EXECUTABLE}")
- message(STATUS "db_printlog executable: ${Ice_DB_PRINTLOG_EXECUTABLE}")
- message(STATUS "db_recover executable: ${Ice_DB_RECOVER_EXECUTABLE}")
- message(STATUS "db_stat executable: ${Ice_DB_STAT_EXECUTABLE}")
- message(STATUS "db_tuner executable: ${Ice_DB_TUNER_EXECUTABLE}")
- message(STATUS "db_upgrade executable: ${Ice_DB_UPGRADE_EXECUTABLE}")
- message(STATUS "db_verify executable: ${Ice_DB_VERIFY_EXECUTABLE}")
- message(STATUS "dumpdb executable: ${Ice_DUMPDB_EXECUTABLE}")
- message(STATUS "transformdb executable: ${Ice_TRANSFORMDB_EXECUTABLE}")
+ foreach(program ${_Ice_db_programs} ${_Ice_programs} ${_Ice_slice_programs})
+ string(TOUPPER "${program}" program_upcase)
+ message(STATUS "${program} executable: ${Ice_${program_upcase}_EXECUTABLE}")
+ endforeach()
foreach(component ${Ice_FIND_COMPONENTS})
string(TOUPPER "${component}" component_upcase)
@@ -542,3 +614,7 @@ if(Ice_DEBUG)
endforeach()
message(STATUS "----------------")
endif()
+
+unset(_Ice_db_programs)
+unset(_Ice_programs)
+unset(_Ice_slice_programs)
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 613f927..8ac2980 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -5,18 +5,37 @@
# FindLibXml2
# -----------
#
-# Try to find the LibXml2 xml processing library
+# Find the XML processing library (libxml2).
#
-# Once done this will define
+# Result variables
+# ^^^^^^^^^^^^^^^^
#
-# ::
+# This module will set the following variables in your project:
#
-# LIBXML2_FOUND - System has LibXml2
-# LIBXML2_INCLUDE_DIR - The LibXml2 include directory
-# LIBXML2_LIBRARIES - The libraries needed to use LibXml2
-# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
-# LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
-# LIBXML2_VERSION_STRING - the version of LibXml2 found (since CMake 2.8.8)
+# ``LIBXML2_FOUND``
+# true if libxml2 headers and libraries were found
+# ``LIBXML2_INCLUDE_DIR``
+# the directory containing LibXml2 headers
+# ``LIBXML2_INCLUDE_DIRS``
+# list of the include directories needed to use LibXml2
+# ``LIBXML2_LIBRARIES``
+# LibXml2 libraries to be linked
+# ``LIBXML2_DEFINITIONS``
+# the compiler switches required for using LibXml2
+# ``LIBXML2_XMLLINT_EXECUTABLE``
+# path to the XML checking tool xmllint coming with LibXml2
+# ``LIBXML2_VERSION_STRING``
+# the version of LibXml2 found (since CMake 2.8.8)
+#
+# Cache variables
+# ^^^^^^^^^^^^^^^
+#
+# The following cache variables may also be set:
+#
+# ``LIBXML2_INCLUDE_DIR``
+# the directory containing LibXml2 headers
+# ``LIBXML2_LIBRARY``
+# path to the LibXml2 library
# use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
@@ -31,7 +50,14 @@ find_path(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
PATH_SUFFIXES libxml2
)
-find_library(LIBXML2_LIBRARIES NAMES xml2 libxml2
+# CMake 3.9 and below used 'LIBXML2_LIBRARIES' as the name of
+# the cache entry storing the find_library result. Use the
+# value if it was set by the project or user.
+if(DEFINED LIBXML2_LIBRARIES AND NOT DEFINED LIBXML2_LIBRARY)
+ set(LIBXML2_LIBRARY ${LIBXML2_LIBRARIES})
+endif()
+
+find_library(LIBXML2_LIBRARY NAMES xml2 libxml2
HINTS
${PC_LIBXML_LIBDIR}
${PC_LIBXML_LIBRARY_DIRS}
@@ -52,9 +78,12 @@ elseif(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.
unset(libxml2_version_str)
endif()
+set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR} ${PC_LIBXML_INCLUDE_DIRS})
+set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
- REQUIRED_VARS LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR
+ REQUIRED_VARS LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR
VERSION_VAR LIBXML2_VERSION_STRING)
-mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
+mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARY LIBXML2_XMLLINT_EXECUTABLE)
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake
index 5c2dbbf..3baaf32 100644
--- a/Modules/FindMFC.cmake
+++ b/Modules/FindMFC.cmake
@@ -31,6 +31,7 @@ if(MFC_ATTEMPT_TRY_COMPILE)
configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
message(STATUS "Looking for MFC")
+ # Try both shared and static as the root project may have set the /MT flag
try_compile(MFC_HAVE_MFC
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
@@ -38,6 +39,16 @@ if(MFC_ATTEMPT_TRY_COMPILE)
-DCMAKE_MFC_FLAG:STRING=2
-DCOMPILE_DEFINITIONS:STRING=-D_AFXDLL
OUTPUT_VARIABLE OUTPUT)
+ if(NOT MFC_HAVE_MFC)
+ configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
+ try_compile(MFC_HAVE_MFC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
+ CMAKE_FLAGS
+ -DCMAKE_MFC_FLAG:STRING=1
+ OUTPUT_VARIABLE OUTPUT)
+ endif()
if(MFC_HAVE_MFC)
message(STATUS "Looking for MFC - found")
set(MFC_HAVE_MFC 1 CACHE INTERNAL "Have MFC?")
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 80bcda3..cd8246d 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -721,7 +721,7 @@ endfunction()
# matlab_add_unit_test(
# NAME <name>
# UNITTEST_FILE matlab_file_containing_unittest.m
-# [CUSTOM_MATLAB_COMMAND matlab_command_to_run_as_test]
+# [CUSTOM_TEST_COMMAND matlab_command_to_run_as_test]
# [UNITTEST_PRECOMMAND matlab_command_to_run]
# [TIMEOUT timeout]
# [ADDITIONAL_PATH path1 [path2 ...]]
@@ -737,7 +737,7 @@ endfunction()
# ``UNITTEST_FILE``
# the matlab unittest file. Its path will be automatically
# added to the Matlab path.
-# ``CUSTOM_MATLAB_COMMAND``
+# ``CUSTOM_TEST_COMMAND``
# Matlab script command to run as the test.
# If this is not set, then the following is run:
# ``runtests('matlab_file_name'), exit(max([ans(1,:).Failed]))``
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index a5357fa..76afa8a 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -323,6 +323,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
endif()
endif()
endif()
+ if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_CROSSCOMPILING)
+ list(APPEND _lib_dirs "libdata/pkgconfig")
+ endif()
list(APPEND _lib_dirs "lib/pkgconfig")
list(APPEND _lib_dirs "share/pkgconfig")
@@ -584,7 +587,9 @@ endmacro()
macro(pkg_check_modules _prefix _module0)
_pkgconfig_parse_options(_pkg_modules _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target "${_module0}" ${ARGN})
# check cached value
- if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND OR NOT "${__pkg_config_arguments_${_prefix}}" STREQUAL "${_module0};${ARGN}")
+ if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND OR
+ (NOT "${ARGN}" STREQUAL "" AND NOT "${__pkg_config_arguments_${_prefix}}" STREQUAL "${_module0};${ARGN}") OR
+ ( "${ARGN}" STREQUAL "" AND NOT "${__pkg_config_arguments_${_prefix}}" STREQUAL "${_module0}"))
_pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} "${_prefix}" ${_pkg_modules})
_pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 33262f3..90f7a2e 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -48,6 +48,8 @@
# The protobuf lite library.
# ``protobuf::libprotoc``
# The protoc library.
+# ``protobuf::protoc``
+# The protoc compiler.
#
# The following cache variables are also available to set or use:
#
@@ -172,9 +174,9 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
- COMMAND ${Protobuf_PROTOC_EXECUTABLE}
+ COMMAND protobuf::protoc
ARGS "--cpp_out=${DLL_EXPORT_DECL}${CMAKE_CURRENT_BINARY_DIR}" ${_protobuf_include_path} ${ABS_FIL}
- DEPENDS ${ABS_FIL} ${Protobuf_PROTOC_EXECUTABLE}
+ DEPENDS ${ABS_FIL} protobuf::protoc
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
VERBATIM )
endforeach()
@@ -232,8 +234,8 @@ function(PROTOBUF_GENERATE_PYTHON SRCS)
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py")
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py"
- COMMAND ${Protobuf_PROTOC_EXECUTABLE} --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
- DEPENDS ${ABS_FIL} ${Protobuf_PROTOC_EXECUTABLE}
+ COMMAND protobuf::protoc --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
+ DEPENDS ${ABS_FIL} protobuf::protoc
COMMENT "Running Python protocol buffer compiler on ${FIL}"
VERBATIM )
endforeach()
@@ -501,6 +503,16 @@ if(Protobuf_INCLUDE_DIR)
endif()
endif()
endif()
+
+ if(Protobuf_PROTOC_EXECUTABLE)
+ if(NOT TARGET protobuf::protoc)
+ add_executable(protobuf::protoc IMPORTED)
+ if(EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
+ set_target_properties(protobuf::protoc PROPERTIES
+ IMPORTED_LOCATION "${Protobuf_PROTOC_EXECUTABLE}")
+ endif()
+ endif()
+ endif()
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index b0c49e5..c67d0be 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -355,19 +355,21 @@ macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
if (QT_${basename}_LIBRARY_RELEASE)
set_property(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
- if(QT_USE_FRAMEWORKS)
- set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}/${_camelCaseBasename}" )
+ set(_location "${QT_${basename}_LIBRARY_RELEASE}")
+ if(QT_USE_FRAMEWORKS AND EXISTS ${_location}/${_camelCaseBasename})
+ set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${_location}/${_camelCaseBasename}" )
else()
- set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
+ set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${_location}" )
endif()
endif ()
if (QT_${basename}_LIBRARY_DEBUG)
set_property(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
- if(QT_USE_FRAMEWORKS)
- set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}/${_camelCaseBasename}" )
+ set(_location "${QT_${basename}_LIBRARY_DEBUG}")
+ if(QT_USE_FRAMEWORKS AND EXISTS ${_location}/${_camelCaseBasename})
+ set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${_location}/${_camelCaseBasename}" )
else()
- set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
+ set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${_location}" )
endif()
endif ()
set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY
diff --git a/Modules/FindXCTest.cmake b/Modules/FindXCTest.cmake
index ffdf677..8497336 100644
--- a/Modules/FindXCTest.cmake
+++ b/Modules/FindXCTest.cmake
@@ -136,7 +136,7 @@ function(xctest_add_bundle target testee)
XCODE_ATTRIBUTE_TEST_HOST "$<TARGET_FILE:${testee}>")
if(NOT XCODE_VERSION VERSION_LESS 7.3)
set_target_properties(${target} PROPERTIES
- LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:${testee}>/../PlugIns")
+ LIBRARY_OUTPUT_DIRECTORY "$<TARGET_BUNDLE_CONTENT_DIR:${testee}>/PlugIns")
endif()
else(XCODE)
target_link_libraries(${target}
@@ -183,7 +183,7 @@ function(xctest_add_test name bundle)
add_test(
NAME ${name}
- COMMAND ${XCTest_EXECUTABLE} $<TARGET_LINKER_FILE_DIR:${bundle}>/../..)
+ COMMAND ${XCTest_EXECUTABLE} $<TARGET_BUNDLE_DIR:${bundle}>)
# point loader to testee in case rpath is disabled
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index af4daf0..be84999 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -527,8 +527,10 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
mswunivu/wx/setup.h
mswunivud/wx/setup.h
PATHS
+ ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}_xp${_WX_ARCH}_dll # prefer shared
${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}${_WX_ARCH}_dll # prefer shared
${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_ARCH}_dll # prefer shared
+ ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}_xp${_WX_ARCH}_lib
${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}${_WX_ARCH}_lib
${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_ARCH}_lib
DOC "Path to wxWidgets libraries"
@@ -546,8 +548,10 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
mswunivu/wx/setup.h
mswunivud/wx/setup.h
PATHS
+ ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}_xp${_WX_ARCH}_lib # prefer static
${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}${_WX_ARCH}_lib # prefer static
${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_ARCH}_lib # prefer static
+ ${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}_xp${_WX_ARCH}_dll
${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_TOOLVER}${_WX_ARCH}_dll
${WX_ROOT_DIR}/lib/${_WX_TOOL}${_WX_ARCH}_dll
DOC "Path to wxWidgets libraries"
@@ -778,28 +782,24 @@ else()
)
if(RET EQUAL 0)
string(STRIP "${wxWidgets_CXX_FLAGS}" wxWidgets_CXX_FLAGS)
- separate_arguments(wxWidgets_CXX_FLAGS)
+ separate_arguments(wxWidgets_CXX_FLAGS_LIST NATIVE_COMMAND "${wxWidgets_CXX_FLAGS}")
DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
- # parse definitions from cxxflags;
- # drop -D* from CXXFLAGS and the -D prefix
- string(REGEX MATCHALL "-D[^;]+"
- wxWidgets_DEFINITIONS "${wxWidgets_CXX_FLAGS}")
- string(REGEX REPLACE "-D[^;]+(;|$)" ""
- wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
- string(REGEX REPLACE ";$" ""
- wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
- string(REPLACE "-D" ""
- wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}")
-
- # parse include dirs from cxxflags; drop -I prefix
- string(REGEX MATCHALL "-I[^;]+"
- wxWidgets_INCLUDE_DIRS "${wxWidgets_CXX_FLAGS}")
- string(REGEX REPLACE "-I[^;]+;" ""
- wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
- string(REPLACE "-I" ""
- wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
+ # parse definitions and include dirs from cxxflags
+ # drop the -D and -I prefixes
+ set(wxWidgets_CXX_FLAGS)
+ foreach(arg IN LISTS wxWidgets_CXX_FLAGS_LIST)
+ if("${arg}" MATCHES "^-I(.*)$")
+ # include directory
+ list(APPEND wxWidgets_INCLUDE_DIRS "${CMAKE_MATCH_1}")
+ elseif("${arg}" MATCHES "^-D(.*)$")
+ # compile definition
+ list(APPEND wxWidgets_DEFINITIONS "${CMAKE_MATCH_1}")
+ else()
+ list(APPEND wxWidgets_CXX_FLAGS "${arg}")
+ endif()
+ endforeach()
DBG_MSG_V("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
DBG_MSG_V("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake
index 7415e06..41bd1dc 100644
--- a/Modules/GoogleTest.cmake
+++ b/Modules/GoogleTest.cmake
@@ -5,7 +5,33 @@
GoogleTest
----------
-This module defines functions to help use the Google Test infrastructure.
+This module defines functions to help use the Google Test infrastructure. Two
+mechanisms for adding tests are provided. :command:`gtest_add_tests` has been
+around for some time, originally via ``find_package(GTest)``.
+:command:`gtest_discover_tests` was introduced in CMake 3.10.
+
+The (older) :command:`gtest_add_tests` scans source files to identify tests.
+This is usually effective, with some caveats, including in cross-compiling
+environments, and makes setting additional properties on tests more convenient.
+However, its handling of parameterized tests is less comprehensive, and it
+requires re-running CMake to detect changes to the list of tests.
+
+The (newer) :command:`gtest_discover_tests` discovers tests by asking the
+compiled test executable to enumerate its tests. This is more robust and
+provides better handling of parameterized tests, and does not require CMake
+to be re-run when tests change. However, it may not work in a cross-compiling
+environment, and setting test properties is less convenient.
+
+More details can be found in the documentation of the respective functions.
+
+Both commands are intended to replace use of :command:`add_test` to register
+tests, and will create a separate CTest test for each Google Test test case.
+Note that this is in some cases less efficient, as common set-up and tear-down
+logic cannot be shared by multiple test cases executing in the same instance.
+However, it provides more fine-grained pass/fail information to CTest, which is
+usually considered as more beneficial. By default, the CTest test name is the
+same as the Google Test name (i.e. ``suite.testcase``); see also
+``TEST_PREFIX`` and ``TEST_SUFFIX``.
.. command:: gtest_add_tests
@@ -22,12 +48,25 @@ This module defines functions to help use the Google Test infrastructure.
[TEST_LIST outVar]
)
+ ``gtest_add_tests`` attempts to identify tests by scanning source files.
+ Although this is generally effective, it uses only a basic regular expression
+ match, which can be defeated by atypical test declarations, and is unable to
+ fully "split" parameterized tests. Additionally, it requires that CMake be
+ re-run to discover any newly added, removed or renamed tests (by default,
+ this means that CMake is re-run when any test source file is changed, but see
+ ``SKIP_DEPENDENCY``). However, it has the advantage of declaring tests at
+ CMake time, which somewhat simplifies setting additional properties on tests,
+ and always works in a cross-compiling environment.
+
+ The options are:
+
``TARGET target``
- This must be a known CMake target. CMake will substitute the location of
- the built executable when running the test.
+ Specifies the Google Test executable, which must be a known CMake
+ executable target. CMake will substitute the location of the built
+ executable when running the test.
``SOURCES src1...``
- When provided, only the listed files will be scanned for test cases. If
+ When provided, only the listed files will be scanned for test cases. If
this option is not given, the :prop_tgt:`SOURCES` property of the
specified ``target`` will be used to obtain the list of sources.
@@ -35,31 +74,30 @@ This module defines functions to help use the Google Test infrastructure.
Any extra arguments to pass on the command line to each test case.
``WORKING_DIRECTORY dir``
- Specifies the directory in which to run the discovered test cases. If this
+ Specifies the directory in which to run the discovered test cases. If this
option is not provided, the current binary directory is used.
``TEST_PREFIX prefix``
- Allows the specified ``prefix`` to be prepended to the name of each
- discovered test case. This can be useful when the same source files are
- being used in multiple calls to ``gtest_add_test()`` but with different
- ``EXTRA_ARGS``.
+ Specifies a ``prefix`` to be prepended to the name of each discovered test
+ case. This can be useful when the same source files are being used in
+ multiple calls to ``gtest_add_test()`` but with different ``EXTRA_ARGS``.
``TEST_SUFFIX suffix``
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
- every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` can be
- specified.
+ every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
+ be specified.
``SKIP_DEPENDENCY``
Normally, the function creates a dependency which will cause CMake to be
- re-run if any of the sources being scanned are changed. This is to ensure
- that the list of discovered tests is updated. If this behavior is not
+ re-run if any of the sources being scanned are changed. This is to ensure
+ that the list of discovered tests is updated. If this behavior is not
desired (as may be the case while actually writing the test cases), this
option can be used to prevent the dependency from being added.
``TEST_LIST outVar``
The variable named by ``outVar`` will be populated in the calling scope
- with the list of discovered test cases. This allows the caller to do things
- like manipulate test properties of the discovered tests.
+ with the list of discovered test cases. This allows the caller to do
+ things like manipulate test properties of the discovered tests.
.. code-block:: cmake
@@ -77,7 +115,7 @@ This module defines functions to help use the Google Test infrastructure.
set_tests_properties(${noArgsTests} PROPERTIES TIMEOUT 10)
set_tests_properties(${withArgsTests} PROPERTIES TIMEOUT 20)
- For backward compatibility reasons, the following form is also supported::
+ For backward compatibility, the following form is also supported::
gtest_add_tests(exe args files...)
@@ -99,8 +137,89 @@ This module defines functions to help use the Google Test infrastructure.
add_executable(FooTest FooUnitTest.cxx)
gtest_add_tests(FooTest "${FooTestArgs}" AUTO)
+.. command:: gtest_discover_tests
+
+ Automatically add tests with CTest by querying the compiled test executable
+ for available tests::
+
+ gtest_discover_tests(target
+ [EXTRA_ARGS arg1...]
+ [WORKING_DIRECTORY dir]
+ [TEST_PREFIX prefix]
+ [TEST_SUFFIX suffix]
+ [NO_PRETTY_TYPES] [NO_PRETTY_VALUES]
+ [PROPERTIES name1 value1...]
+ [TEST_LIST var]
+ )
+
+ ``gtest_discover_tests`` sets up a post-build command on the test executable
+ that generates the list of tests by parsing the output from running the test
+ with the ``--gtest_list_tests`` argument. Compared to the source parsing
+ approach of :command:`gtest_add_tests`, this ensures that the full list of
+ tests, including instantiations of parameterized tests, is obtained. Since
+ test discovery occurs at build time, it is not necessary to re-run CMake when
+ the list of tests changes.
+ However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
+ in order to function in a cross-compiling environment.
+
+ Additionally, setting properties on tests is somewhat less convenient, since
+ the tests are not available at CMake time. Additional test properties may be
+ assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
+ more fine-grained test control is needed, custom content may be provided
+ through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
+ directory property. The set of discovered tests is made accessible to such a
+ script via the ``<target>_TESTS`` variable.
+
+ The options are:
+
+ ``target``
+ Specifies the Google Test executable, which must be a known CMake
+ executable target. CMake will substitute the location of the built
+ executable when running the test.
+
+ ``EXTRA_ARGS arg1...``
+ Any extra arguments to pass on the command line to each test case.
+
+ ``WORKING_DIRECTORY dir``
+ Specifies the directory in which to run the discovered test cases. If this
+ option is not provided, the current binary directory is used.
+
+ ``TEST_PREFIX prefix``
+ Specifies a ``prefix`` to be prepended to the name of each discovered test
+ case. This can be useful when the same test executable is being used in
+ multiple calls to ``gtest_discover_tests()`` but with different
+ ``EXTRA_ARGS``.
+
+ ``TEST_SUFFIX suffix``
+ Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
+ every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
+ be specified.
+
+ ``NO_PRETTY_TYPES``
+ By default, the type index of type-parameterized tests is replaced by the
+ actual type name in the CTest test name. If this behavior is undesirable
+ (e.g. because the type names are unwieldy), this option will suppress this
+ behavior.
+
+ ``NO_PRETTY_VALUES``
+ By default, the value index of value-parameterized tests is replaced by the
+ actual value in the CTest test name. If this behavior is undesirable
+ (e.g. because the value strings are unwieldy), this option will suppress
+ this behavior.
+
+ ``PROPERTIES name1 value1...``
+ Specifies additional properties to be set on all tests discovered by this
+ invocation of ``gtest_discover_tests``.
+
+ ``TEST_LIST var``
+ Make the list of tests available in the variable ``var``, rather than the
+ default ``<target>_TESTS``. This can be useful when the same test
+ executable is being used in multiple calls to ``gtest_discover_tests()``.
+ Note that this variable is only available in CTest.
+
#]=======================================================================]
+#------------------------------------------------------------------------------
function(gtest_add_tests)
if (ARGC LESS 1)
@@ -224,3 +343,68 @@ function(gtest_add_tests)
endif()
endfunction()
+
+#------------------------------------------------------------------------------
+function(gtest_discover_tests TARGET)
+ cmake_parse_arguments(
+ ""
+ "NO_PRETTY_TYPES;NO_PRETTY_VALUES"
+ "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST"
+ "EXTRA_ARGS;PROPERTIES"
+ ${ARGN}
+ )
+
+ if(NOT _WORKING_DIRECTORY)
+ set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ endif()
+ if(NOT _TEST_LIST)
+ set(_TEST_LIST ${TARGET}_TESTS)
+ endif()
+
+ # Define rule to generate test list for aforementioned test executable
+ set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include.cmake")
+ set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests.cmake")
+ get_property(crosscompiling_emulator
+ TARGET ${TARGET}
+ PROPERTY CROSSCOMPILING_EMULATOR
+ )
+ add_custom_command(
+ TARGET ${TARGET} POST_BUILD
+ BYPRODUCTS "${ctest_tests_file}"
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_TARGET=${TARGET}"
+ -D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
+ -D "TEST_EXECUTOR=${crosscompiling_emulator}"
+ -D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
+ -D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
+ -D "TEST_PROPERTIES=${_PROPERTIES}"
+ -D "TEST_PREFIX=${_TEST_PREFIX}"
+ -D "TEST_SUFFIX=${_TEST_SUFFIX}"
+ -D "NO_PRETTY_TYPES=${_NO_PRETTY_TYPES}"
+ -D "NO_PRETTY_VALUES=${_NO_PRETTY_VALUES}"
+ -D "TEST_LIST=${_TEST_LIST}"
+ -D "CTEST_FILE=${ctest_tests_file}"
+ -P "${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}"
+ VERBATIM
+ )
+
+ file(WRITE "${ctest_include_file}"
+ "if(EXISTS \"${ctest_tests_file}\")\n"
+ " include(\"${ctest_tests_file}\")\n"
+ "else()\n"
+ " add_test(${TARGET}_NOT_BUILT ${TARGET}_NOT_BUILT)\n"
+ "endif()\n"
+ )
+
+ # Add discovered tests to directory TEST_INCLUDE_FILES
+ set_property(DIRECTORY
+ APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
+ )
+
+endfunction()
+
+###############################################################################
+
+set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
+ ${CMAKE_CURRENT_LIST_DIR}/GoogleTestAddTests.cmake
+)
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
new file mode 100644
index 0000000..7d0d909
--- /dev/null
+++ b/Modules/GoogleTestAddTests.cmake
@@ -0,0 +1,100 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+set(prefix "${TEST_PREFIX}")
+set(suffix "${TEST_SUFFIX}")
+set(extra_args ${TEST_EXTRA_ARGS})
+set(properties ${TEST_PROPERTIES})
+set(script)
+set(suite)
+set(tests)
+
+function(add_command NAME)
+ set(_args "")
+ foreach(_arg ${ARGN})
+ if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
+ set(_args "${_args} [==[${_arg}]==]")
+ else()
+ set(_args "${_args} ${_arg}")
+ endif()
+ endforeach()
+ set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE)
+endfunction()
+
+# Run test executable to get list of available tests
+if(NOT EXISTS "${TEST_EXECUTABLE}")
+ message(FATAL_ERROR
+ "Specified test executable '${TEST_EXECUTABLE}' does not exist"
+ )
+endif()
+execute_process(
+ COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" --gtest_list_tests
+ OUTPUT_VARIABLE output
+ RESULT_VARIABLE result
+)
+if(NOT ${result} EQUAL 0)
+ message(FATAL_ERROR
+ "Error running test executable '${TEST_EXECUTABLE}':\n"
+ " Result: ${result}\n"
+ " Output: ${output}\n"
+ )
+endif()
+
+string(REPLACE "\n" ";" output "${output}")
+
+# Parse output
+foreach(line ${output})
+ # Skip header
+ if(NOT line MATCHES "gtest_main\\.cc")
+ # Do we have a module name or a test name?
+ if(NOT line MATCHES "^ ")
+ # Module; remove trailing '.' to get just the name...
+ string(REGEX REPLACE "\\.( *#.*)?" "" suite "${line}")
+ if(line MATCHES "#" AND NOT NO_PRETTY_TYPES)
+ string(REGEX REPLACE "/[0-9]\\.+ +#.*= +" "/" pretty_suite "${line}")
+ else()
+ set(pretty_suite "${suite}")
+ endif()
+ string(REGEX REPLACE "^DISABLED_" "" pretty_suite "${pretty_suite}")
+ else()
+ # Test name; strip spaces and comments to get just the name...
+ string(REGEX REPLACE " +" "" test "${line}")
+ if(test MATCHES "#" AND NOT NO_PRETTY_VALUES)
+ string(REGEX REPLACE "/[0-9]+#GetParam..=" "/" pretty_test "${test}")
+ else()
+ string(REGEX REPLACE "#.*" "" pretty_test "${test}")
+ endif()
+ string(REGEX REPLACE "^DISABLED_" "" pretty_test "${pretty_test}")
+ string(REGEX REPLACE "#.*" "" test "${test}")
+ # ...and add to script
+ add_command(add_test
+ "${prefix}${pretty_suite}.${pretty_test}${suffix}"
+ ${TEST_EXECUTOR}
+ "${TEST_EXECUTABLE}"
+ "--gtest_filter=${suite}.${test}"
+ "--gtest_also_run_disabled_tests"
+ ${extra_args}
+ )
+ if(suite MATCHES "^DISABLED" OR test MATCHES "^DISABLED")
+ add_command(set_tests_properties
+ "${prefix}${pretty_suite}.${pretty_test}${suffix}"
+ PROPERTIES DISABLED TRUE
+ )
+ endif()
+ add_command(set_tests_properties
+ "${prefix}${pretty_suite}.${pretty_test}${suffix}"
+ PROPERTIES
+ WORKING_DIRECTORY "${TEST_WORKING_DIR}"
+ ${properties}
+ )
+ list(APPEND tests "${prefix}${pretty_suite}.${pretty_test}${suffix}")
+ endif()
+ endif()
+endforeach()
+
+# Create a list of all discovered tests, which users may use to e.g. set
+# properties on the tests
+add_command(set ${TEST_LIST} ${tests})
+
+# Write CTest script
+file(WRITE "${CTEST_FILE}" "${script}")
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 6d33fc6..1a4e268 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -89,6 +89,8 @@ if(MSVC)
endif()
if(MSVC_VERSION EQUAL 1400)
+ set(MSVC_REDIST_NAME VC80)
+
# Find the runtime library redistribution directory.
get_filename_component(msvc_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
@@ -129,6 +131,8 @@ if(MSVC)
endif()
if(MSVC_VERSION EQUAL 1500)
+ set(MSVC_REDIST_NAME VC90)
+
# Find the runtime library redistribution directory.
get_filename_component(msvc_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
@@ -171,22 +175,32 @@ if(MSVC)
endif()
endif()
- if(MSVC_VERSION EQUAL 1910)
+ if(MSVC_VERSION EQUAL 1911)
+ set(MSVC_REDIST_NAME VC141)
+ set(_MSVCRT_DLL_VERSION 140)
+ set(_MSVCRT_IDE_VERSION 15)
+ elseif(MSVC_VERSION EQUAL 1910)
+ set(MSVC_REDIST_NAME VC150)
set(_MSVCRT_DLL_VERSION 140)
set(_MSVCRT_IDE_VERSION 15)
elseif(MSVC_VERSION EQUAL 1900)
+ set(MSVC_REDIST_NAME VC140)
set(_MSVCRT_DLL_VERSION 140)
set(_MSVCRT_IDE_VERSION 14)
elseif(MSVC_VERSION EQUAL 1800)
+ set(MSVC_REDIST_NAME VC120)
set(_MSVCRT_DLL_VERSION 120)
set(_MSVCRT_IDE_VERSION 12)
elseif(MSVC_VERSION EQUAL 1700)
+ set(MSVC_REDIST_NAME VC110)
set(_MSVCRT_DLL_VERSION 110)
set(_MSVCRT_IDE_VERSION 11)
elseif(MSVC_VERSION EQUAL 1600)
+ set(MSVC_REDIST_NAME VC100)
set(_MSVCRT_DLL_VERSION 100)
set(_MSVCRT_IDE_VERSION 10)
else()
+ set(MSVC_REDIST_NAME "")
set(_MSVCRT_DLL_VERSION "")
set(_MSVCRT_IDE_VERSION "")
endif()
@@ -219,10 +233,10 @@ if(MSVC)
unset(_vs_dir)
unset(programfilesx86)
endif()
- find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.CRT PATHS ${_vs_redist_paths})
+ find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT PATHS ${_vs_redist_paths})
unset(_vs_redist_paths)
mark_as_advanced(MSVC_REDIST_DIR)
- set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.CRT")
+ set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs
@@ -242,7 +256,7 @@ if(MSVC)
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_CRT_DIR
- "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.DebugCRT")
+ "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugCRT")
set(__install__libs ${__install__libs}
"${MSVC_CRT_DIR}/msvcp${v}d.dll"
)
@@ -383,7 +397,10 @@ if(MSVC)
)
endif()
- if(MSVC_VERSION EQUAL 1910)
+ if(MSVC_VERSION EQUAL 1911)
+ set(_MFC_DLL_VERSION 140)
+ set(_MFC_IDE_VERSION 15)
+ elseif(MSVC_VERSION EQUAL 1910)
set(_MFC_DLL_VERSION 140)
set(_MFC_IDE_VERSION 15)
elseif(MSVC_VERSION EQUAL 1900)
@@ -410,7 +427,7 @@ if(MSVC)
# Starting with VS 15 the MFC DLLs may be in a different directory.
if (NOT vs VERSION_LESS 15)
file(GLOB _MSVC_REDIST_DIRS "${MSVC_REDIST_DIR}/../*")
- find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.MFC
+ find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC
PATHS ${_MSVC_REDIST_DIRS} NO_DEFAULT_PATH)
mark_as_advanced(MSVC_REDIST_MFC_DIR)
unset(_MSVC_REDIST_DIRS)
@@ -424,7 +441,7 @@ if(MSVC)
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_MFC_DIR
- "${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.DebugMFC")
+ "${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugMFC")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}ud.dll"
"${MSVC_MFC_DIR}/mfcm${v}ud.dll"
@@ -437,7 +454,7 @@ if(MSVC)
endif()
endif()
- set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.MFC")
+ set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}u.dll"
@@ -452,7 +469,7 @@ if(MSVC)
endif()
# include the language dll's as well as the actuall dll's
- set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.MFCLOC")
+ set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFCLOC")
set(__install__libs ${__install__libs}
"${MSVC_MFCLOC_DIR}/mfc${v}chs.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}cht.dll"
@@ -471,7 +488,10 @@ if(MSVC)
# MSVC 8 was the first version with OpenMP
# Furthermore, there is no debug version of this
if(CMAKE_INSTALL_OPENMP_LIBRARIES)
- if(MSVC_VERSION EQUAL 1910)
+ if(MSVC_VERSION EQUAL 1911)
+ set(_MSOMP_DLL_VERSION 140)
+ set(_MSOMP_IDE_VERSION 15)
+ elseif(MSVC_VERSION EQUAL 1910)
set(_MSOMP_DLL_VERSION 140)
set(_MSOMP_IDE_VERSION 15)
elseif(MSVC_VERSION EQUAL 1900)
@@ -500,7 +520,7 @@ if(MSVC)
if(_MSOMP_DLL_VERSION)
set(v "${_MSOMP_DLL_VERSION}")
set(vs "${_MSOMP_IDE_VERSION}")
- set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.OPENMP")
+ set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.OPENMP")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}
diff --git a/Modules/MacOSXBundleInfo.plist.in b/Modules/MacOSXBundleInfo.plist.in
index e06b17e..a4009bc 100644
--- a/Modules/MacOSXBundleInfo.plist.in
+++ b/Modules/MacOSXBundleInfo.plist.in
@@ -30,9 +30,5 @@
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
- <key>NSHighResolutionCapable</key>
- <string>True</string>
</dict>
</plist>
diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Initialize.cmake
index fcda6f6..bf61d7b 100644
--- a/Modules/Platform/GHS-MULTI-Initialize.cmake
+++ b/Modules/Platform/GHS-MULTI-Initialize.cmake
@@ -10,7 +10,7 @@ if (NOT GHS_INT_DIRECTORY)
if (EXISTS ${GHS_EXPECTED_ROOT})
FILE(GLOB GHS_CANDIDATE_INT_DIRS RELATIVE
${GHS_EXPECTED_ROOT} ${GHS_EXPECTED_ROOT}/*)
- string(REGEX MATCHALL "int[0-9][0-9][0-9][0-9]" GHS_CANDIDATE_INT_DIRS
+ string(REGEX MATCHALL "int[0-9][0-9][0-9][0-9a-z]" GHS_CANDIDATE_INT_DIRS
${GHS_CANDIDATE_INT_DIRS})
if (GHS_CANDIDATE_INT_DIRS)
list(SORT GHS_CANDIDATE_INT_DIRS)
diff --git a/Modules/Platform/GNUtoMS_lib.bat.in b/Modules/Platform/GNUtoMS_lib.bat.in
index 2da920a..62776f4 100644
--- a/Modules/Platform/GNUtoMS_lib.bat.in
+++ b/Modules/Platform/GNUtoMS_lib.bat.in
@@ -1,3 +1,4 @@
-@echo off
-call "@CMAKE_GNUtoMS_BAT@"
-lib /machine:"@CMAKE_GNUtoMS_ARCH@" %*
+@echo off
+set VSCMD_START_DIR=.
+call "@CMAKE_GNUtoMS_BAT@"
+lib /machine:"@CMAKE_GNUtoMS_ARCH@" %*
diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake
index bbefe19..4b3912a 100644
--- a/Modules/Platform/Generic-SDCC-C.cmake
+++ b/Modules/Platform/Generic-SDCC-C.cmake
@@ -41,7 +41,7 @@ endif()
set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
# link object files to an executable
-set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <OBJECTS> --out-fmt-ihx -o <TARGET> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
+set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <OBJECTS> -o <TARGET> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
# needs sdcc 2.7.0 + sddclib from cvs
set(CMAKE_C_CREATE_STATIC_LIBRARY
diff --git a/Modules/SquishRunTestCase.bat b/Modules/SquishRunTestCase.bat
index 5c5d388..293e88f 100755
--- a/Modules/SquishRunTestCase.bat
+++ b/Modules/SquishRunTestCase.bat
@@ -1,11 +1,11 @@
-echo 'Starting the squish server...'
-start %1
-
-echo 'Running the test case...'
-%2 --testcase %3 --wrapper %4 --aut %5
-set result=%ERRORLEVEL%
-
-echo 'Stopping the squish server...'
-%1 --stop
-
-exit \b %result%
+echo 'Starting the squish server...'
+start %1
+
+echo 'Running the test case...'
+%2 --testcase %3 --wrapper %4 --aut %5
+set result=%ERRORLEVEL%
+
+echo 'Stopping the squish server...'
+%1 --stop
+
+exit \b %result%
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index fc815dd..c8b1cd7 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -82,10 +82,6 @@ macro(SWIG_MODULE_INITIALIZE name language)
set(SWIG_MODULE_${name}_REAL_NAME "_${name}")
elseif("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xPERL")
set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
- elseif("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xCSHARP")
- # This makes sure that the name used in the generated DllImport
- # matches the library name created by CMake
- set(SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport;${name}")
endif()
endmacro()
@@ -194,6 +190,13 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
if(swig_source_file_cplusplus)
set(swig_special_flags ${swig_special_flags} "-c++")
endif()
+ if("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xCSHARP")
+ if(NOT ";${swig_source_file_flags};${CMAKE_SWIG_FLAGS};" MATCHES ";-dllimport;")
+ # This makes sure that the name used in the generated DllImport
+ # matches the library name created by CMake
+ set(SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport;${name}")
+ endif()
+ endif()
set(swig_extra_flags)
if(SWIG_MODULE_${name}_EXTRA_FLAGS)
set(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS})
diff --git a/README.rst b/README.rst
index d5acd4a..3cef06d 100644
--- a/README.rst
+++ b/README.rst
@@ -36,7 +36,7 @@ Supported Platforms
* FreeBSD
* OpenBSD
* Solaris
-* HP-UX
+* AIX
Other UNIX-like operating systems may work too out of the box, if not
it should not be a major problem to port CMake to this platform.
@@ -51,7 +51,7 @@ Building CMake from Scratch
UNIX/Mac OSX/MinGW/MSYS/Cygwin
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-You need to have a compiler and a make installed.
+You need to have a C++ compiler (supporting C++11) and a ``make`` installed.
Run the ``bootstrap`` script you find in the source directory of CMake.
You can use the ``--help`` option to see the supported options.
You may use the ``--prefix=<install_prefix>`` option to specify a custom
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 40403ca..bcc3437 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -469,6 +469,8 @@ set(SRCS
cmIncludeDirectoryCommand.h
cmIncludeExternalMSProjectCommand.cxx
cmIncludeExternalMSProjectCommand.h
+ cmIncludeGuardCommand.cxx
+ cmIncludeGuardCommand.h
cmIncludeRegularExpressionCommand.cxx
cmIncludeRegularExpressionCommand.h
cmInstallCommand.cxx
@@ -874,6 +876,7 @@ set(CPACK_SRCS
CPack/cmCPackTarCompressGenerator.cxx
CPack/cmCPackZIPGenerator.cxx
CPack/cmCPack7zGenerator.cxx
+ CPack/cmCPackDebGenerator.cxx
)
# CPack IFW generator
set(CPACK_SRCS ${CPACK_SRCS}
@@ -896,11 +899,39 @@ if(CYGWIN)
)
endif()
+option(CPACK_ENABLE_FREEBSD_PKG "Add FreeBSD pkg(8) generator to CPack." OFF)
+
if(UNIX)
set(CPACK_SRCS ${CPACK_SRCS}
- CPack/cmCPackDebGenerator.cxx
CPack/cmCPackRPMGenerator.cxx
)
+
+ # Optionally, try to use pkg(8)
+ if(CPACK_ENABLE_FREEBSD_PKG)
+ # On UNIX, you may find FreeBSD's pkg(8) and attendant
+ # library -- it can be used on FreeBSD, Dragonfly, NetBSD,
+ # OpenBSD and also Linux and OSX. Look for the header and
+ # the library; it's a warning on FreeBSD if they're not
+ # found, and informational on other platforms.
+ find_path(FREEBSD_PKG_INCLUDE_DIRS "pkg.h" PATHS /usr/local)
+ if(FREEBSD_PKG_INCLUDE_DIRS)
+ find_library(FREEBSD_PKG_LIBRARIES
+ pkg
+ DOC "FreeBSD pkg(8) library")
+ if(FREEBSD_PKG_LIBRARIES)
+ set(CPACK_SRCS ${CPACK_SRCS}
+ CPack/cmCPackFreeBSDGenerator.cxx
+ )
+ endif()
+ endif()
+
+ if (NOT FREEBSD_PKG_INCLUDE_DIRS OR NOT FREEBSD_PKG_LIBRARIES)
+ message(FATAL_ERROR "CPack needs libpkg(3) to produce FreeBSD packages natively.")
+ endif()
+ else()
+ set(FREEBSD_PKG_INCLUDE_DIRS NOTFOUND)
+ set(FREEBSD_PKG_LIBRARIES NOTFOUND)
+ endif()
endif()
if(WIN32)
@@ -958,6 +989,11 @@ if(APPLE)
"See CMakeFiles/CMakeError.log for details of the failure.")
endif()
endif()
+if(CPACK_ENABLE_FREEBSD_PKG AND FREEBSD_PKG_INCLUDE_DIRS AND FREEBSD_PKG_LIBRARIES)
+ target_link_libraries(CPackLib ${FREEBSD_PKG_LIBRARIES})
+ include_directories(${FREEBSD_PKG_INCLUDE_DIRS})
+ add_definitions(-DHAVE_FREEBSD_PKG)
+endif()
if(APPLE)
add_executable(cmakexbuild cmakexbuild.cxx)
@@ -974,18 +1010,16 @@ add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h ${MANIFEST_FILE})
list(APPEND _tools cmake)
target_link_libraries(cmake CMakeLib)
-if(CMake_ENABLE_SERVER_MODE)
- add_library(CMakeServerLib
- cmFileMonitor.cxx cmFileMonitor.h
- cmServer.cxx cmServer.h
- cmServerConnection.cxx cmServerConnection.h
- cmServerProtocol.cxx cmServerProtocol.h
- )
- target_link_libraries(CMakeServerLib CMakeLib)
- set_property(SOURCE cmcmd.cxx APPEND PROPERTY COMPILE_DEFINITIONS HAVE_SERVER_MODE=1)
-
- target_link_libraries(cmake CMakeServerLib)
-endif()
+add_library(CMakeServerLib
+ cmConnection.h cmConnection.cxx
+ cmFileMonitor.cxx cmFileMonitor.h
+ cmPipeConnection.cxx cmPipeConnection.h
+ cmServer.cxx cmServer.h
+ cmServerConnection.cxx cmServerConnection.h
+ cmServerProtocol.cxx cmServerProtocol.h
+ )
+target_link_libraries(CMakeServerLib CMakeLib)
+target_link_libraries(cmake CMakeServerLib)
# Build CTest executable
add_executable(ctest ctest.cxx ${MANIFEST_FILE})
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 8b9cbbd..0e0c748 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 9)
-set(CMake_VERSION_PATCH 1)
-#set(CMake_VERSION_RC 0)
+set(CMake_VERSION_PATCH 20170830)
+#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/IFW/cmCPackIFWCommon.cxx b/Source/CPack/IFW/cmCPackIFWCommon.cxx
index e8f05bd..1e72641 100644
--- a/Source/CPack/IFW/cmCPackIFWCommon.cxx
+++ b/Source/CPack/IFW/cmCPackIFWCommon.cxx
@@ -15,14 +15,14 @@
#include <vector>
cmCPackIFWCommon::cmCPackIFWCommon()
- : Generator(CM_NULLPTR)
+ : Generator(nullptr)
{
}
const char* cmCPackIFWCommon::GetOption(const std::string& op) const
{
return this->Generator ? this->Generator->cmCPackGenerator::GetOption(op)
- : CM_NULLPTR;
+ : nullptr;
}
bool cmCPackIFWCommon::IsOn(const std::string& op) const
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index 226ea0a..97e792a 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -56,6 +56,22 @@ int cmCPackIFWGenerator::PackageFiles()
}
}
+ if (!this->RepoDirsVector.empty()) {
+ if (!this->IsVersionLess("3.1")) {
+ for (std::vector<std::string>::iterator it =
+ this->RepoDirsVector.begin();
+ it != this->RepoDirsVector.end(); ++it) {
+ ifwCmd += " --repository " + *it;
+ }
+ } else {
+ cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" "
+ << "variable is set, but content will be skiped, "
+ << "because this feature available only since "
+ << "QtIFW 3.1. Please update your QtIFW instance."
+ << std::endl);
+ }
+ }
+
if (!this->OnlineOnly && !this->DownloadedPackages.empty()) {
ifwCmd += " -i ";
std::set<cmCPackIFWPackage*>::iterator it =
@@ -73,7 +89,7 @@ int cmCPackIFWGenerator::PackageFiles()
int retVal = 1;
cmCPackIFWLogger(OUTPUT, "- Generate repository" << std::endl);
bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output,
- &output, &retVal, CM_NULLPTR,
+ &output, &retVal, nullptr,
this->GeneratorVerbose, 0);
if (!res || retVal) {
cmGeneratedFileStream ofs(ifwTmpFile.c_str());
@@ -128,6 +144,22 @@ int cmCPackIFWGenerator::PackageFiles()
}
}
+ if (!this->RepoDirsVector.empty()) {
+ if (!this->IsVersionLess("3.1")) {
+ for (std::vector<std::string>::iterator it =
+ this->RepoDirsVector.begin();
+ it != this->RepoDirsVector.end(); ++it) {
+ ifwCmd += " --repository " + *it;
+ }
+ } else {
+ cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" "
+ << "variable is set, but content will be skipped, "
+ << "because this feature available only since "
+ << "QtIFW 3.1. Please update your QtIFW instance."
+ << std::endl);
+ }
+ }
+
if (this->OnlineOnly) {
ifwCmd += " --online-only";
} else if (!this->DownloadedPackages.empty() &&
@@ -164,13 +196,14 @@ int cmCPackIFWGenerator::PackageFiles()
ifwCmd += " " + this->packageFileNames[0];
} else {
ifwCmd += " installer";
+ ifwCmd += this->OutputExtension;
}
cmCPackIFWLogger(VERBOSE, "Execute: " << ifwCmd << std::endl);
std::string output;
int retVal = 1;
cmCPackIFWLogger(OUTPUT, "- Generate package" << std::endl);
bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output,
- &output, &retVal, CM_NULLPTR,
+ &output, &retVal, nullptr,
this->GeneratorVerbose, 0);
if (!res || retVal) {
cmGeneratedFileStream ofs(ifwTmpFile.c_str());
@@ -205,7 +238,7 @@ const char* cmCPackIFWGenerator::GetPackagingInstallPrefix()
const char* cmCPackIFWGenerator::GetOutputExtension()
{
- return this->ExecutableSuffix.c_str();
+ return this->OutputExtension.c_str();
}
int cmCPackIFWGenerator::InitializeInternal()
@@ -265,6 +298,13 @@ int cmCPackIFWGenerator::InitializeInternal()
cmSystemTools::ExpandListArgument(dirs, this->PkgsDirsVector);
}
+ // Additional repositories dirs
+ this->RepoDirsVector.clear();
+ if (const char* dirs =
+ this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) {
+ cmSystemTools::ExpandListArgument(dirs, this->RepoDirsVector);
+ }
+
// Installer
this->Installer.Generator = this;
this->Installer.ConfigureFromOptions();
@@ -305,16 +345,29 @@ int cmCPackIFWGenerator::InitializeInternal()
}
// Executable suffix
- if (const char* optExeSuffix = this->GetOption("CMAKE_EXECUTABLE_SUFFIX")) {
- this->ExecutableSuffix = optExeSuffix;
- if (this->ExecutableSuffix.empty()) {
- std::string sysName(this->GetOption("CMAKE_SYSTEM_NAME"));
- if (sysName == "Linux") {
- this->ExecutableSuffix = ".run";
- }
- }
+ std::string exeSuffix(this->GetOption("CMAKE_EXECUTABLE_SUFFIX"));
+ std::string sysName(this->GetOption("CMAKE_SYSTEM_NAME"));
+ if (sysName == "Linux") {
+ this->ExecutableSuffix = ".run";
+ } else if (sysName == "Windows") {
+ this->ExecutableSuffix = ".exe";
+ } else if (sysName == "Darwin") {
+ this->ExecutableSuffix = ".app";
} else {
- this->ExecutableSuffix = this->cmCPackGenerator::GetOutputExtension();
+ this->ExecutableSuffix = exeSuffix;
+ }
+
+ // Output extension
+ if (const char* optOutExt =
+ this->GetOption("CPACK_IFW_PACKAGE_FILE_EXTENSION")) {
+ this->OutputExtension = optOutExt;
+ } else if (sysName == "Darwin") {
+ this->OutputExtension = ".dmg";
+ } else {
+ this->OutputExtension = this->ExecutableSuffix;
+ }
+ if (this->OutputExtension.empty()) {
+ this->OutputExtension = this->cmCPackGenerator::GetOutputExtension();
}
return this->Superclass::InitializeInternal();
@@ -520,7 +573,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetGroupPackage(
{
std::map<cmCPackComponentGroup*, cmCPackIFWPackage*>::const_iterator pit =
this->GroupPackages.find(group);
- return pit != this->GroupPackages.end() ? pit->second : CM_NULLPTR;
+ return pit != this->GroupPackages.end() ? pit->second : nullptr;
}
cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage(
@@ -528,7 +581,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage(
{
std::map<cmCPackComponent*, cmCPackIFWPackage*>::const_iterator pit =
this->ComponentPackages.find(component);
- return pit != this->ComponentPackages.end() ? pit->second : CM_NULLPTR;
+ return pit != this->ComponentPackages.end() ? pit->second : nullptr;
}
cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
@@ -550,7 +603,7 @@ cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
}
} else {
this->Repositories.erase(repositoryName);
- repository = CM_NULLPTR;
+ repository = nullptr;
cmCPackIFWLogger(WARNING, "Invalid repository \""
<< repositoryName << "\""
<< " configuration. Repository will be skipped."
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.h b/Source/CPack/IFW/cmCPackIFWGenerator.h
index 8348cee..9fd14bd 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.h
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.h
@@ -61,8 +61,8 @@ protected:
const char* GetPackagingInstallPrefix() CM_OVERRIDE;
/**
- * @brief Extension of binary installer
- * @return Executable suffix or value from default implementation
+ * @brief Target binary extension
+ * @return Executable suffix or disk image format
*/
const char* GetOutputExtension() CM_OVERRIDE;
@@ -143,10 +143,12 @@ private:
std::string BinCreator;
std::string FrameworkVersion;
std::string ExecutableSuffix;
+ std::string OutputExtension;
bool OnlineOnly;
bool ResolveDuplicateNames;
std::vector<std::string> PkgsDirsVector;
+ std::vector<std::string> RepoDirsVector;
};
#endif
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index c5311c3..8461309 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -92,7 +92,7 @@ std::string cmCPackIFWPackage::DependenceStruct::NameWithCompare() const
//------------------------------------------------------ cmCPackIFWPackage ---
cmCPackIFWPackage::cmCPackIFWPackage()
- : Installer(CM_NULLPTR)
+ : Installer(nullptr)
{
}
diff --git a/Source/CPack/WiX/cmWIXPatchParser.cxx b/Source/CPack/WiX/cmWIXPatchParser.cxx
index 0dcc74a..b050b85 100644
--- a/Source/CPack/WiX/cmWIXPatchParser.cxx
+++ b/Source/CPack/WiX/cmWIXPatchParser.cxx
@@ -72,7 +72,7 @@ void cmWIXPatchParser::StartElement(const std::string& name, const char** atts)
void cmWIXPatchParser::StartFragment(const char** attributes)
{
- cmWIXPatchElement* new_element = CM_NULLPTR;
+ cmWIXPatchElement* new_element = nullptr;
/* find the id of for fragment */
for (size_t i = 0; attributes[i]; i += 2) {
const std::string key = attributes[i];
diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
index 30df878..21be8ee 100644
--- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
+++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
@@ -3,7 +3,7 @@
#ifndef cmWIXRichTextFormatWriter_h
#define cmWIXRichTextFormatWriter_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmsys/FStream.hxx"
#include <string>
diff --git a/Source/CPack/cmCPack7zGenerator.h b/Source/CPack/cmCPack7zGenerator.h
index 42a4781..31c02a4 100644
--- a/Source/CPack/cmCPack7zGenerator.h
+++ b/Source/CPack/cmCPack7zGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPack7zGenerator_h
#define cmCPack7zGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCPackArchiveGenerator.h"
#include "cmCPackGenerator.h"
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 575c949..1e45b48 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -79,7 +79,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
++fileIt) {
std::string rp = filePrefix + *fileIt;
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file: " << rp << std::endl);
- archive.Add(rp, 0, CM_NULLPTR, false);
+ archive.Add(rp, 0, nullptr, false);
if (!archive) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: "
<< archive.GetError() << std::endl);
@@ -146,7 +146,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
for (compIt = this->Components.begin(); compIt != this->Components.end();
++compIt) {
// Does the component belong to a group?
- if (compIt->second.Group == CM_NULLPTR) {
+ if (compIt->second.Group == nullptr) {
cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <"
<< compIt->second.Name
@@ -255,7 +255,7 @@ int cmCPackArchiveGenerator::PackageFiles()
// Get the relative path to the file
std::string rp =
cmSystemTools::RelativePath(toplevel.c_str(), fileIt->c_str());
- archive.Add(rp, 0, CM_NULLPTR, false);
+ archive.Add(rp, 0, nullptr, false);
if (!archive) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< "
<< *fileIt << "> to archive <" << packageFileNames[0]
diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h
index e7116c4..72ba1b2 100644
--- a/Source/CPack/cmCPackArchiveGenerator.h
+++ b/Source/CPack/cmCPackArchiveGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackArchiveGenerator_h
#define cmCPackArchiveGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmArchiveWrite.h"
#include "cmCPackGenerator.h"
diff --git a/Source/CPack/cmCPackBundleGenerator.h b/Source/CPack/cmCPackBundleGenerator.h
index 861fe4b..e99bf43 100644
--- a/Source/CPack/cmCPackBundleGenerator.h
+++ b/Source/CPack/cmCPackBundleGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackBundleGenerator_h
#define cmCPackBundleGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
@@ -21,7 +21,7 @@ public:
cmCPackTypeMacro(cmCPackBundleGenerator, cmCPackDragNDropGenerator);
cmCPackBundleGenerator();
- virtual ~cmCPackBundleGenerator();
+ ~cmCPackBundleGenerator() CM_OVERRIDE;
protected:
int InitializeInternal() CM_OVERRIDE;
diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h
index 26d69ba..f2907db 100644
--- a/Source/CPack/cmCPackComponentGroup.h
+++ b/Source/CPack/cmCPackComponentGroup.h
@@ -3,7 +3,7 @@
#ifndef cmCPackComponentGroup_h
#define cmCPackComponentGroup_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
@@ -36,7 +36,7 @@ class cmCPackComponent
{
public:
cmCPackComponent()
- : Group(CM_NULLPTR)
+ : Group(nullptr)
, IsRequired(true)
, IsHidden(false)
, IsDisabledByDefault(false)
@@ -114,7 +114,7 @@ class cmCPackComponentGroup
{
public:
cmCPackComponentGroup()
- : ParentGroup(CM_NULLPTR)
+ : ParentGroup(nullptr)
{
}
diff --git a/Source/CPack/cmCPackCygwinBinaryGenerator.h b/Source/CPack/cmCPackCygwinBinaryGenerator.h
index 58e80bd..b5a0531 100644
--- a/Source/CPack/cmCPackCygwinBinaryGenerator.h
+++ b/Source/CPack/cmCPackCygwinBinaryGenerator.h
@@ -17,7 +17,7 @@ public:
* Construct generator
*/
cmCPackCygwinBinaryGenerator();
- virtual ~cmCPackCygwinBinaryGenerator();
+ ~cmCPackCygwinBinaryGenerator() CM_OVERRIDE;
protected:
virtual int InitializeInternal();
diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.h b/Source/CPack/cmCPackCygwinSourceGenerator.h
index 896de1d..d19f87c 100644
--- a/Source/CPack/cmCPackCygwinSourceGenerator.h
+++ b/Source/CPack/cmCPackCygwinSourceGenerator.h
@@ -17,7 +17,7 @@ public:
* Construct generator
*/
cmCPackCygwinSourceGenerator();
- virtual ~cmCPackCygwinSourceGenerator();
+ ~cmCPackCygwinSourceGenerator() CM_OVERRIDE;
protected:
const char* GetPackagingInstallPrefix();
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index af54fce..18d559e 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -6,28 +6,18 @@
#include "cmCPackComponentGroup.h"
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
+#include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h"
#include "cmSystemTools.h"
#include "cm_sys_stat.h"
#include "cmsys/Glob.hxx"
-#include <limits.h>
#include <map>
#include <ostream>
#include <set>
-#include <stdio.h>
#include <string.h>
#include <utility>
-// NOTE:
-// A debian package .deb is simply an 'ar' archive. The only subtle difference
-// is that debian uses the BSD ar style archive whereas most Linux distro have
-// a GNU ar.
-// See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=161593 for more info
-// Therefore we provide our own implementation of a BSD-ar:
-static int ar_append(const char* archive,
- const std::vector<std::string>& files);
-
cmCPackDebGenerator::cmCPackDebGenerator()
{
}
@@ -128,7 +118,7 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup)
for (compIt = this->Components.begin(); compIt != this->Components.end();
++compIt) {
// Does the component belong to a group?
- if (compIt->second.Group == CM_NULLPTR) {
+ if (compIt->second.Group == nullptr) {
cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <"
<< compIt->second.Name
@@ -479,6 +469,25 @@ int cmCPackDebGenerator::createDeb()
cmCPackLogger(cmCPackLog::LOG_DEBUG, "RELATIVEDIR: \""
<< relativeDir << "\"" << std::endl);
+#ifdef WIN32
+ std::string mode_t_adt_filename = *fileIt + ":cmake_mode_t";
+ cmsys::ifstream permissionStream(mode_t_adt_filename.c_str());
+
+ mode_t permissions = 0;
+
+ if (permissionStream) {
+ permissionStream >> std::oct >> permissions;
+ }
+
+ if (permissions != 0) {
+ data_tar.SetPermissions(permissions);
+ } else if (cmSystemTools::FileIsDirectory(*fileIt)) {
+ data_tar.SetPermissions(0755);
+ } else {
+ data_tar.ClearPermissions();
+ }
+#endif
+
// do not recurse because the loop will do it
if (!data_tar.Add(*fileIt, topLevelLength, ".", false)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem adding file to tar:"
@@ -508,15 +517,13 @@ int cmCPackDebGenerator::createDeb()
continue;
}
- char md5sum[33];
- if (!cmSystemTools::ComputeFileMD5(*fileIt, md5sum)) {
+ std::string output =
+ cmSystemTools::ComputeFileHash(*fileIt, cmCryptoHash::AlgoMD5);
+ if (output.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem computing the md5 of "
<< *fileIt << std::endl);
}
- md5sum[32] = 0;
-
- std::string output(md5sum);
output += " " + *fileIt + "\n";
// debian md5sums entries are like this:
// 014f3604694729f3bf19263bac599765 usr/bin/ccmake
@@ -553,8 +560,8 @@ int cmCPackDebGenerator::createDeb()
and
https://lintian.debian.org/tags/control-file-has-bad-permissions.html
*/
- const mode_t permission644 = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
- const mode_t permissionExecute = S_IXUSR | S_IXGRP | S_IXOTH;
+ const mode_t permission644 = 0644;
+ const mode_t permissionExecute = 0111;
const mode_t permission755 = permission644 | permissionExecute;
// for md5sum and control (that we have generated here), we use 644
@@ -654,23 +661,25 @@ int cmCPackDebGenerator::createDeb()
}
// ar -r your-package-name.deb debian-binary control.tar.* data.tar.*
- // since debian packages require BSD ar (most Linux distros and even
- // FreeBSD and NetBSD ship GNU ar) we use a copy of OpenBSD ar here.
- std::vector<std::string> arFiles;
- std::string topLevelString = strGenWDIR + "/";
- arFiles.push_back(topLevelString + "debian-binary");
- arFiles.push_back(topLevelString + "control.tar.gz");
- arFiles.push_back(topLevelString + "data.tar" + compression_suffix);
- std::string outputFileName = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
- outputFileName += "/";
- outputFileName += this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME");
- int res = ar_append(outputFileName.c_str(), arFiles);
- if (res != 0) {
- std::string tmpFile =
- this->GetOption("GEN_CPACK_TEMPORARY_PACKAGE_FILE_NAME");
- tmpFile += "/Deb.log";
- cmGeneratedFileStream ofs(tmpFile.c_str());
- ofs << "# Problem creating archive using: " << res << std::endl;
+ // A debian package .deb is simply an 'ar' archive. The only subtle
+ // difference is that debian uses the BSD ar style archive whereas most
+ // Linux distro have a GNU ar.
+ // See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=161593 for more info
+ std::string const outputDir = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
+ std::string const outputName = this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME");
+ std::string const outputPath = outputDir + "/" + outputName;
+ std::string const tlDir = strGenWDIR + "/";
+ cmGeneratedFileStream debStream;
+ debStream.Open(outputPath.c_str(), false, true);
+ cmArchiveWrite deb(debStream, cmArchiveWrite::CompressNone, "arbsd");
+ if (!deb.Add(tlDir + "debian-binary", tlDir.length()) ||
+ !deb.Add(tlDir + "control.tar.gz", tlDir.length()) ||
+ !deb.Add(tlDir + "data.tar" + compression_suffix, tlDir.length())) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Error creating debian package:"
+ << std::endl
+ << "#top level directory: " << outputDir << std::endl
+ << "#file: " << outputName << std::endl
+ << "#error:" << deb.GetError() << std::endl);
return 0;
}
return 1;
@@ -695,252 +704,8 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix(
// the current COMPONENT belongs to.
std::string groupVar =
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
- if (CM_NULLPTR != GetOption(groupVar)) {
+ if (nullptr != GetOption(groupVar)) {
return std::string(GetOption(groupVar));
}
return componentName;
}
-
-// The following code is taken from OpenBSD ar:
-// http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ar/
-// It has been slightly modified:
-// -return error codes instead exit() in functions
-// -use the stdio file I/O functions instead the file descriptor based ones
-// -merged into one cxx file
-// -no additional options supported
-// The coding style hasn't been modified.
-
-/*-
- * Copyright (c) 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Hugh Smith at The University of Guelph.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#define ARMAG "!<arch>\n" /* ar "magic number" */
-#define SARMAG 8 /* strlen(ARMAG); */
-
-#define AR_EFMT1 "#1/" /* extended format #1 */
-#define ARFMAG "`\n"
-
-/* Header format strings. */
-#define HDR1 "%s%-13d%-12ld%-6u%-6u%-8o%-10lld%2s"
-#define HDR2 "%-16.16s%-12ld%-6u%-6u%-8o%-10lld%2s"
-
-struct ar_hdr
-{
- char ar_name[16]; /* name */
- char ar_date[12]; /* modification time */
- char ar_uid[6]; /* user id */
- char ar_gid[6]; /* group id */
- char ar_mode[8]; /* octal file permissions */
- char ar_size[10]; /* size in bytes */
- char ar_fmag[2]; /* consistency check */
-};
-
-/* Set up file copy. */
-#define SETCF(from, fromname, to, toname, pad) \
- { \
- cf.rFile = from; \
- cf.rname = fromname; \
- cf.wFile = to; \
- cf.wname = toname; \
- cf.flags = pad; \
- }
-
-/* File copy structure. */
-typedef struct
-{
- FILE* rFile; /* read file descriptor */
- const char* rname; /* read name */
- FILE* wFile; /* write file descriptor */
- const char* wname; /* write name */
-#define NOPAD 0x00 /* don't pad */
-#define WPAD 0x02 /* pad on writes */
- unsigned int flags; /* pad flags */
-} CF;
-
-/* misc.c */
-
-static const char* ar_rname(const char* path)
-{
- const char* ind = strrchr(path, '/');
- return (ind) ? ind + 1 : path;
-}
-
-/* archive.c */
-
-typedef struct ar_hdr HDR;
-static char ar_hb[sizeof(HDR) + 1]; /* real header */
-
-static size_t ar_already_written;
-
-/* copy_ar --
- * Copy size bytes from one file to another - taking care to handle the
- * extra byte (for odd size files) when reading archives and writing an
- * extra byte if necessary when adding files to archive. The length of
- * the object is the long name plus the object itself; the variable
- * already_written gets set if a long name was written.
- *
- * The padding is really unnecessary, and is almost certainly a remnant
- * of early archive formats where the header included binary data which
- * a PDP-11 required to start on an even byte boundary. (Or, perhaps,
- * because 16-bit word addressed copies were faster?) Anyhow, it should
- * have been ripped out long ago.
- */
-static int copy_ar(CF* cfp, off_t size)
-{
- static char pad = '\n';
- off_t sz = size;
- size_t nr, nw;
- char buf[8 * 1024];
-
- if (sz == 0) {
- return 0;
- }
-
- FILE* from = cfp->rFile;
- FILE* to = cfp->wFile;
- while (sz &&
- (nr = fread(buf, 1, sz < static_cast<off_t>(sizeof(buf))
- ? static_cast<size_t>(sz)
- : sizeof(buf),
- from)) > 0) {
- sz -= nr;
- for (size_t off = 0; off < nr; nr -= off, off += nw) {
- if ((nw = fwrite(buf + off, 1, nr, to)) < nr) {
- return -1;
- }
- }
- }
- if (sz) {
- return -2;
- }
-
- if (cfp->flags & WPAD && (size + ar_already_written) & 1 &&
- fwrite(&pad, 1, 1, to) != 1) {
- return -4;
- }
-
- return 0;
-}
-
-/* put_arobj -- Write an archive member to a file. */
-static int put_arobj(CF* cfp, struct stat* sb)
-{
- int result = 0;
- struct ar_hdr* hdr;
-
- /* If passed an sb structure, reading a file from disk. Get stat(2)
- * information, build a name and construct a header. (Files are named
- * by their last component in the archive.) */
- const char* name = ar_rname(cfp->rname);
- (void)stat(cfp->rname, sb);
-
- /* If not truncating names and the name is too long or contains
- * a space, use extended format 1. */
- size_t lname = strlen(name);
- uid_t uid = sb->st_uid;
- gid_t gid = sb->st_gid;
- if (uid > USHRT_MAX) {
- uid = USHRT_MAX;
- }
- if (gid > USHRT_MAX) {
- gid = USHRT_MAX;
- }
- if (lname > sizeof(hdr->ar_name) || strchr(name, ' ')) {
- (void)sprintf(ar_hb, HDR1, AR_EFMT1, (int)lname, (long int)sb->st_mtime,
- (unsigned)uid, (unsigned)gid, (unsigned)sb->st_mode,
- (long long)sb->st_size + lname, ARFMAG);
- } else {
- lname = 0;
- (void)sprintf(ar_hb, HDR2, name, (long int)sb->st_mtime, (unsigned)uid,
- (unsigned)gid, (unsigned)sb->st_mode, (long long)sb->st_size,
- ARFMAG);
- }
- off_t size = sb->st_size;
-
- if (fwrite(ar_hb, 1, sizeof(HDR), cfp->wFile) != sizeof(HDR)) {
- return -1;
- }
-
- if (lname) {
- if (fwrite(name, 1, lname, cfp->wFile) != lname) {
- return -2;
- }
- ar_already_written = lname;
- }
- result = copy_ar(cfp, size);
- ar_already_written = 0;
- return result;
-}
-
-/* append.c */
-
-/* append --
- * Append files to the archive - modifies original archive or creates
- * a new archive if named archive does not exist.
- */
-static int ar_append(const char* archive,
- const std::vector<std::string>& files)
-{
- int eval = 0;
- FILE* aFile = cmSystemTools::Fopen(archive, "wb+");
- if (aFile != CM_NULLPTR) {
- fwrite(ARMAG, SARMAG, 1, aFile);
- if (fseek(aFile, 0, SEEK_END) != -1) {
- CF cf;
- struct stat sb;
- /* Read from disk, write to an archive; pad on write. */
- SETCF(CM_NULLPTR, CM_NULLPTR, aFile, archive, WPAD);
- for (std::vector<std::string>::const_iterator fileIt = files.begin();
- fileIt != files.end(); ++fileIt) {
- const char* filename = fileIt->c_str();
- FILE* file = cmSystemTools::Fopen(filename, "rb");
- if (file == CM_NULLPTR) {
- eval = -1;
- continue;
- }
- cf.rFile = file;
- cf.rname = filename;
- int result = put_arobj(&cf, &sb);
- (void)fclose(file);
- if (result != 0) {
- eval = -2;
- break;
- }
- }
- } else {
- eval = -3;
- }
- fclose(aFile);
- } else {
- eval = -4;
- }
- return eval;
-}
diff --git a/Source/CPack/cmCPackDebGenerator.h b/Source/CPack/cmCPackDebGenerator.h
index e7cde11..21fc3be 100644
--- a/Source/CPack/cmCPackDebGenerator.h
+++ b/Source/CPack/cmCPackDebGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackDebGenerator_h
#define cmCPackDebGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCPackGenerator.h"
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 9864cf3..8758d32 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -9,6 +9,7 @@
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
+#include <algorithm>
#include <iomanip>
#include <map>
#include <stdlib.h>
@@ -447,6 +448,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
cmsys::RegularExpression mountpoint_regex(".*(/Volumes/[^\n]+)\n.*");
mountpoint_regex.find(attach_output.c_str());
std::string const temp_mount = mountpoint_regex.match(1);
+ std::string const temp_mount_name =
+ temp_mount.substr(sizeof("/Volumes/") - 1);
// Remove dummy padding file so we have enough space on RW image ...
std::ostringstream dummy_padding;
@@ -480,7 +483,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
std::ostringstream setup_script_command;
setup_script_command << "osascript"
<< " \"" << cpack_dmg_ds_store_setup_script << "\""
- << " \"" << cpack_dmg_volume_name << "\"";
+ << " \"" << temp_mount_name << "\"";
std::string error;
if (!this->RunCommand(setup_script_command, &error)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h
index ae2cc17..4606c3c 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.h
+++ b/Source/CPack/cmCPackDragNDropGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackDragNDropGenerator_h
#define cmCPackDragNDropGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <sstream>
#include <stddef.h>
@@ -23,7 +23,7 @@ public:
cmCPackTypeMacro(cmCPackDragNDropGenerator, cmCPackGenerator);
cmCPackDragNDropGenerator();
- virtual ~cmCPackDragNDropGenerator();
+ ~cmCPackDragNDropGenerator() CM_OVERRIDE;
protected:
int InitializeInternal() CM_OVERRIDE;
@@ -40,8 +40,6 @@ protected:
int CreateDMG(const std::string& src_dir, const std::string& output_file);
- std::string InstallPrefix;
-
private:
std::string slaDirectory;
bool singleLicense;
diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx
new file mode 100644
index 0000000..ae17b79
--- /dev/null
+++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx
@@ -0,0 +1,359 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmCPackFreeBSDGenerator.h"
+
+#include "cmArchiveWrite.h"
+#include "cmCPackArchiveGenerator.h"
+#include "cmCPackLog.h"
+#include "cmGeneratedFileStream.h"
+#include "cmSystemTools.h"
+
+// Needed for ::open() and ::stat()
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <pkg.h>
+
+#include <algorithm>
+
+cmCPackFreeBSDGenerator::cmCPackFreeBSDGenerator()
+ : cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, "paxr")
+{
+}
+
+int cmCPackFreeBSDGenerator::InitializeInternal()
+{
+ this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr/local");
+ this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", "0");
+ return this->Superclass::InitializeInternal();
+}
+
+cmCPackFreeBSDGenerator::~cmCPackFreeBSDGenerator()
+{
+}
+
+// This is a wrapper, for use only in stream-based output,
+// that will output a string in UCL escaped fashion (in particular,
+// quotes and backslashes are escaped). The list of characters
+// to escape is taken from https://github.com/vstakhov/libucl
+// (which is the reference implementation pkg(8) refers to).
+class EscapeQuotes
+{
+public:
+ const std::string& value;
+
+ EscapeQuotes(const std::string& s)
+ : value(s)
+ {
+ }
+};
+
+// Output a string as "string" with escaping applied.
+cmGeneratedFileStream& operator<<(cmGeneratedFileStream& s,
+ const EscapeQuotes& v)
+{
+ s << '"';
+ for (std::string::size_type i = 0; i < v.value.length(); ++i) {
+ char c = v.value[i];
+ switch (c) {
+ case '\n':
+ s << "\\n";
+ break;
+ case '\r':
+ s << "\\r";
+ break;
+ case '\b':
+ s << "\\b";
+ break;
+ case '\t':
+ s << "\\t";
+ break;
+ case '\f':
+ s << "\\f";
+ break;
+ case '\\':
+ s << "\\\\";
+ break;
+ case '"':
+ s << "\\\"";
+ break;
+ default:
+ s << c;
+ break;
+ }
+ }
+ s << '"';
+ return s;
+}
+
+// The following classes are all helpers for writing out the UCL
+// manifest file (it also looks like JSON). ManifestKey just has
+// a (string-valued) key; subclasses add a specific kind of
+// value-type to the key, and implement write_value() to output
+// the corresponding UCL.
+class ManifestKey
+{
+public:
+ std::string key;
+
+ ManifestKey(const std::string& k)
+ : key(k)
+ {
+ }
+
+ virtual ~ManifestKey() {}
+
+ // Output the value associated with this key to the stream @p s.
+ // Format is to be decided by subclasses.
+ virtual void write_value(cmGeneratedFileStream& s) const = 0;
+};
+
+// Basic string-value (e.g. "name": "cmake")
+class ManifestKeyValue : public ManifestKey
+{
+public:
+ std::string value;
+
+ ManifestKeyValue(const std::string& k, const std::string& v)
+ : ManifestKey(k)
+ , value(v)
+ {
+ }
+
+ void write_value(cmGeneratedFileStream& s) const CM_OVERRIDE
+ {
+ s << EscapeQuotes(value);
+ }
+};
+
+// List-of-strings values (e.g. "licenses": ["GPLv2", "LGPLv2"])
+class ManifestKeyListValue : public ManifestKey
+{
+public:
+ typedef std::vector<std::string> VList;
+ VList value;
+
+ ManifestKeyListValue(const std::string& k)
+ : ManifestKey(k)
+ {
+ }
+
+ ManifestKeyListValue& operator<<(const std::string& v)
+ {
+ value.push_back(v);
+ return *this;
+ }
+
+ ManifestKeyListValue& operator<<(const std::vector<std::string>& v)
+ {
+ for (VList::const_iterator it = v.begin(); it != v.end(); ++it) {
+ (*this) << (*it);
+ }
+ return *this;
+ }
+
+ void write_value(cmGeneratedFileStream& s) const CM_OVERRIDE
+ {
+ bool with_comma = false;
+
+ s << '[';
+ for (VList::const_iterator it = value.begin(); it != value.end(); ++it) {
+ s << (with_comma ? ',' : ' ');
+ s << EscapeQuotes(*it);
+ with_comma = true;
+ }
+ s << " ]";
+ }
+};
+
+// Deps: actually a dictionary, but we'll treat it as a
+// list so we only name the deps, and produce dictionary-
+// like output via write_value()
+class ManifestKeyDepsValue : public ManifestKeyListValue
+{
+public:
+ ManifestKeyDepsValue(const std::string& k)
+ : ManifestKeyListValue(k)
+ {
+ }
+
+ void write_value(cmGeneratedFileStream& s) const CM_OVERRIDE
+ {
+ s << "{\n";
+ for (VList::const_iterator it = value.begin(); it != value.end(); ++it) {
+ s << " \"" << *it << "\": {\"origin\": \"" << *it << "\"},\n";
+ }
+ s << '}';
+ }
+};
+
+// Write one of the key-value classes (above) to the stream @p s
+cmGeneratedFileStream& operator<<(cmGeneratedFileStream& s,
+ const ManifestKey& v)
+{
+ s << '"' << v.key << "\": ";
+ v.write_value(s);
+ s << ",\n";
+ return s;
+}
+
+// Look up variable; if no value is set, returns an empty string;
+// basically a wrapper that handles the NULL-ptr return from GetOption().
+std::string cmCPackFreeBSDGenerator::var_lookup(const char* var_name)
+{
+ const char* pv = this->GetOption(var_name);
+ if (!pv) {
+ return std::string();
+ } else {
+ return pv;
+ }
+}
+
+// Produce UCL in the given @p manifest file for the common
+// manifest fields (common to the compact and regular formats),
+// by reading the CPACK_FREEBSD_* variables.
+void cmCPackFreeBSDGenerator::write_manifest_fields(
+ cmGeneratedFileStream& manifest)
+{
+ manifest << ManifestKeyValue("name",
+ var_lookup("CPACK_FREEBSD_PACKAGE_NAME"));
+ manifest << ManifestKeyValue("origin",
+ var_lookup("CPACK_FREEBSD_PACKAGE_ORIGIN"));
+ manifest << ManifestKeyValue("version",
+ var_lookup("CPACK_FREEBSD_PACKAGE_VERSION"));
+ manifest << ManifestKeyValue("maintainer",
+ var_lookup("CPACK_FREEBSD_PACKAGE_MAINTAINER"));
+ manifest << ManifestKeyValue("comment",
+ var_lookup("CPACK_FREEBSD_PACKAGE_COMMENT"));
+ manifest << ManifestKeyValue(
+ "desc", var_lookup("CPACK_FREEBSD_PACKAGE_DESCRIPTION"));
+ manifest << ManifestKeyValue("www", var_lookup("CPACK_FREEBSD_PACKAGE_WWW"));
+ std::vector<std::string> licenses;
+ cmSystemTools::ExpandListArgument(
+ var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE"), licenses);
+ std::string licenselogic("single");
+ if (licenses.size() < 1) {
+ cmSystemTools::SetFatalErrorOccured();
+ } else if (licenses.size() > 1) {
+ licenselogic = var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE_LOGIC");
+ }
+ manifest << ManifestKeyValue("licenselogic", licenselogic);
+ manifest << (ManifestKeyListValue("licenses") << licenses);
+ std::vector<std::string> categories;
+ cmSystemTools::ExpandListArgument(
+ var_lookup("CPACK_FREEBSD_PACKAGE_CATEGORIES"), categories);
+ manifest << (ManifestKeyListValue("categories") << categories);
+ manifest << ManifestKeyValue("prefix", var_lookup("CMAKE_INSTALL_PREFIX"));
+ std::vector<std::string> deps;
+ cmSystemTools::ExpandListArgument(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS"),
+ deps);
+ if (deps.size() > 0) {
+ manifest << (ManifestKeyDepsValue("deps") << deps);
+ }
+}
+
+// Package only actual files; others are ignored (in particular,
+// intermediate subdirectories are ignored).
+static bool ignore_file(const std::string& filename)
+{
+ struct stat statbuf;
+
+ if (!((stat(filename.c_str(), &statbuf) >= 0) &&
+ ((statbuf.st_mode & S_IFMT) == S_IFREG))) {
+ return true;
+ }
+ // May be other reasons to return false
+ return false;
+}
+
+// Write the given list of @p files to the manifest stream @p s,
+// as the UCL field "files" (which is dictionary-valued, to
+// associate filenames with hashes). All the files are transformed
+// to paths relative to @p toplevel, with a leading / (since the paths
+// in FreeBSD package files are supposed to be absolute).
+void write_manifest_files(cmGeneratedFileStream& s,
+ const std::string& toplevel,
+ const std::vector<std::string>& files)
+{
+ const char* c_toplevel = toplevel.c_str();
+ std::vector<std::string>::const_iterator it;
+
+ s << "\"files\": {\n";
+ for (it = files.begin(); it != files.end(); ++it) {
+ s << " \"/" << cmSystemTools::RelativePath(c_toplevel, it->c_str())
+ << "\": \""
+ << "<sha256>"
+ << "\",\n";
+ }
+ s << " },\n";
+}
+
+static bool has_suffix(const std::string& str, const std::string& suffix)
+{
+ return str.size() >= suffix.size() &&
+ str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
+}
+
+int cmCPackFreeBSDGenerator::PackageFiles()
+{
+ if (!this->ReadListFile("CPackFreeBSD.cmake")) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error while execution CPackFreeBSD.cmake" << std::endl);
+ return 0;
+ }
+
+ std::vector<std::string>::const_iterator fileIt;
+ std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
+ cmSystemTools::ChangeDirectory(toplevel);
+
+ files.erase(std::remove_if(files.begin(), files.end(), ignore_file),
+ files.end());
+
+ std::string manifestname = toplevel + "/+MANIFEST";
+ {
+ cmGeneratedFileStream manifest(manifestname.c_str());
+ manifest << "{\n";
+ write_manifest_fields(manifest);
+ write_manifest_files(manifest, toplevel, files);
+ manifest << "}\n";
+ }
+
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " << toplevel << std::endl);
+
+ if (WantsComponentInstallation()) {
+ // CASE 1 : COMPONENT ALL-IN-ONE package
+ // If ALL COMPONENTS in ONE package has been requested
+ // then the package file is unique and should be open here.
+ if (componentPackageMethod == ONE_PACKAGE) {
+ return PackageComponentsAllInOne();
+ }
+ // CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one)
+ // There will be 1 package for each component group
+ // however one may require to ignore component group and
+ // in this case you'll get 1 package for each component.
+ return PackageComponents(componentPackageMethod ==
+ ONE_PACKAGE_PER_COMPONENT);
+ }
+
+ std::string output_dir =
+ cmSystemTools::CollapseCombinedPath(toplevel, "../");
+ pkg_create_from_manifest(output_dir.c_str(), ::TXZ, toplevel.c_str(),
+ manifestname.c_str(), NULL);
+
+ std::string broken_suffix = std::string("-") +
+ var_lookup("CPACK_TOPLEVEL_TAG") + std::string(GetOutputExtension());
+ for (std::vector<std::string>::iterator it = packageFileNames.begin();
+ it != packageFileNames.end(); ++it) {
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Packagefile " << *it << std::endl);
+ if (has_suffix(*it, broken_suffix)) {
+ it->replace(it->size() - broken_suffix.size(), std::string::npos,
+ GetOutputExtension());
+ break;
+ }
+ }
+
+ cmSystemTools::ChangeDirectory(dir);
+ return 1;
+}
diff --git a/Source/CPack/cmCPackFreeBSDGenerator.h b/Source/CPack/cmCPackFreeBSDGenerator.h
new file mode 100644
index 0000000..230f728
--- /dev/null
+++ b/Source/CPack/cmCPackFreeBSDGenerator.h
@@ -0,0 +1,37 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmCPackFreeBSDGenerator_h
+#define cmCPackFreeBSDGenerator_h
+
+#include <cmConfigure.h>
+
+#include "cmCPackArchiveGenerator.h"
+#include "cmCPackGenerator.h"
+
+class cmGeneratedFileStream;
+
+/** \class cmCPackFreeBSDGenerator
+ * \brief A generator for FreeBSD package files (TXZ with a manifest)
+ *
+ */
+class cmCPackFreeBSDGenerator : public cmCPackArchiveGenerator
+{
+public:
+ cmCPackTypeMacro(cmCPackFreeBSDGenerator, cmCPackArchiveGenerator);
+ /**
+ * Construct generator
+ */
+ cmCPackFreeBSDGenerator();
+ ~cmCPackFreeBSDGenerator() CM_OVERRIDE;
+
+ int InitializeInternal() CM_OVERRIDE;
+ int PackageFiles() CM_OVERRIDE;
+
+protected:
+ const char* GetOutputExtension() CM_OVERRIDE { return ".txz"; }
+
+ std::string var_lookup(const char* var_name);
+ void write_manifest_fields(cmGeneratedFileStream&);
+};
+
+#endif
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index d8e2753..b65eb64 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -28,14 +28,14 @@
cmCPackGenerator::cmCPackGenerator()
{
this->GeneratorVerbose = cmSystemTools::OUTPUT_NONE;
- this->MakefileMap = CM_NULLPTR;
- this->Logger = CM_NULLPTR;
+ this->MakefileMap = nullptr;
+ this->Logger = nullptr;
this->componentPackageMethod = ONE_PACKAGE_PER_GROUP;
}
cmCPackGenerator::~cmCPackGenerator()
{
- this->MakefileMap = CM_NULLPTR;
+ this->MakefileMap = nullptr;
}
void cmCPackGeneratorProgress(const char* msg, float prog, void* ptr)
@@ -156,7 +156,7 @@ int cmCPackGenerator::PrepareNames()
}
const char* algoSignature = this->GetOption("CPACK_PACKAGE_CHECKSUM");
if (algoSignature) {
- if (cmCryptoHash::New(algoSignature).get() == CM_NULLPTR) {
+ if (cmCryptoHash::New(algoSignature).get() == nullptr) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot recognize algorithm: "
<< algoSignature << std::endl);
return 0;
@@ -256,7 +256,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
int retVal = 1;
bool resB =
cmSystemTools::RunSingleCommand(it->c_str(), &output, &output, &retVal,
- CM_NULLPTR, this->GeneratorVerbose, 0);
+ nullptr, this->GeneratorVerbose, 0);
if (!resB || retVal) {
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/InstallOutput.log";
@@ -820,8 +820,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
}
}
- if (CM_NULLPTR !=
- mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) {
+ if (nullptr != mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) {
if (!absoluteDestFiles.empty()) {
absoluteDestFiles += ";";
}
@@ -835,7 +834,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string absoluteDestFileComponent =
std::string("CPACK_ABSOLUTE_DESTINATION_FILES") + "_" +
GetComponentInstallDirNameSuffix(installComponent);
- if (CM_NULLPTR != this->GetOption(absoluteDestFileComponent)) {
+ if (nullptr != this->GetOption(absoluteDestFileComponent)) {
std::string absoluteDestFilesListComponent =
this->GetOption(absoluteDestFileComponent);
absoluteDestFilesListComponent += ";";
@@ -1016,7 +1015,7 @@ int cmCPackGenerator::DoPackage()
<< packageFileName << " generated." << std::endl);
/* Generate checksum file */
- if (crypto.get() != CM_NULLPTR) {
+ if (crypto.get() != nullptr) {
std::string hashFile(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"));
hashFile +=
"/" + filename.substr(0, filename.rfind(this->GetOutputExtension()));
@@ -1225,7 +1224,7 @@ int cmCPackGenerator::PrepareGroupingKind()
std::string groupingType;
// Second way to specify grouping
- if (CM_NULLPTR != this->GetOption("CPACK_COMPONENTS_GROUPING")) {
+ if (nullptr != this->GetOption("CPACK_COMPONENTS_GROUPING")) {
groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING");
}
@@ -1407,7 +1406,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
component->Group = GetComponentGroup(projectName, groupName);
component->Group->Components.push_back(component);
} else {
- component->Group = CM_NULLPTR;
+ component->Group = nullptr;
}
const char* description = this->GetOption(macroPrefix + "_DESCRIPTION");
@@ -1475,7 +1474,7 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(
group->ParentGroup = GetComponentGroup(projectName, parentGroupName);
group->ParentGroup->Subgroups.push_back(group);
} else {
- group->ParentGroup = CM_NULLPTR;
+ group->ParentGroup = nullptr;
}
}
return group;
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index 45777fa..194d4e5 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackGenerator_h
#define cmCPackGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
#include <sstream>
@@ -105,7 +105,7 @@ protected:
cmInstalledFile const* GetInstalledFile(std::string const& name) const;
virtual const char* GetOutputExtension() { return ".cpack"; }
- virtual const char* GetOutputPostfix() { return CM_NULLPTR; }
+ virtual const char* GetOutputPostfix() { return nullptr; }
/**
* Prepare requested grouping kind from CPACK_xxx vars
diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx
index 31f48c7..4b81bbc 100644
--- a/Source/CPack/cmCPackGeneratorFactory.cxx
+++ b/Source/CPack/cmCPackGeneratorFactory.cxx
@@ -2,13 +2,16 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackGeneratorFactory.h"
-#include "cmConfigure.h"
#include <ostream>
#include <utility>
#include "IFW/cmCPackIFWGenerator.h"
#include "cmAlgorithms.h"
#include "cmCPack7zGenerator.h"
+#ifdef HAVE_FREEBSD_PKG
+#include "cmCPackFreeBSDGenerator.h"
+#endif
+#include "cmCPackDebGenerator.h"
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
#include "cmCPackNSISGenerator.h"
@@ -34,7 +37,6 @@
#if !defined(_WIN32) && !defined(__QNXNTO__) && !defined(__BEOS__) && \
!defined(__HAIKU__)
-#include "cmCPackDebGenerator.h"
#include "cmCPackRPMGenerator.h"
#endif
@@ -99,6 +101,10 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory()
this->RegisterGenerator("TZ", "Tar Compress compression",
cmCPackTarCompressGenerator::CreateGenerator);
}
+ if (cmCPackDebGenerator::CanGenerate()) {
+ this->RegisterGenerator("DEB", "Debian packages",
+ cmCPackDebGenerator::CreateGenerator);
+ }
#ifdef __APPLE__
if (cmCPackDragNDropGenerator::CanGenerate()) {
this->RegisterGenerator("DragNDrop", "Mac OSX Drag And Drop",
@@ -123,15 +129,17 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory()
#endif
#if !defined(_WIN32) && !defined(__QNXNTO__) && !defined(__BEOS__) && \
!defined(__HAIKU__)
- if (cmCPackDebGenerator::CanGenerate()) {
- this->RegisterGenerator("DEB", "Debian packages",
- cmCPackDebGenerator::CreateGenerator);
- }
if (cmCPackRPMGenerator::CanGenerate()) {
this->RegisterGenerator("RPM", "RPM packages",
cmCPackRPMGenerator::CreateGenerator);
}
#endif
+#ifdef HAVE_FREEBSD_PKG
+ if (cmCPackFreeBSDGenerator::CanGenerate()) {
+ this->RegisterGenerator("FREEBSD", "FreeBSD pkg(8) packages",
+ cmCPackFreeBSDGenerator::CreateGenerator);
+ }
+#endif
}
cmCPackGeneratorFactory::~cmCPackGeneratorFactory()
@@ -144,7 +152,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(
{
cmCPackGenerator* gen = this->NewGeneratorInternal(name);
if (!gen) {
- return CM_NULLPTR;
+ return nullptr;
}
this->Generators.push_back(gen);
gen->SetLogger(this->Logger);
@@ -157,7 +165,7 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal(
cmCPackGeneratorFactory::t_GeneratorCreatorsMap::iterator it =
this->GeneratorCreators.find(name);
if (it == this->GeneratorCreators.end()) {
- return CM_NULLPTR;
+ return nullptr;
}
return (it->second)();
}
diff --git a/Source/CPack/cmCPackLog.cxx b/Source/CPack/cmCPackLog.cxx
index 5c71239..a3ca4b5 100644
--- a/Source/CPack/cmCPackLog.cxx
+++ b/Source/CPack/cmCPackLog.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackLog.h"
-#include "cmConfigure.h"
#include <iostream>
#include "cmGeneratedFileStream.h"
@@ -19,13 +18,13 @@ cmCPackLog::cmCPackLog()
this->DefaultOutput = &std::cout;
this->DefaultError = &std::cerr;
- this->LogOutput = CM_NULLPTR;
+ this->LogOutput = nullptr;
this->LogOutputCleanup = false;
}
cmCPackLog::~cmCPackLog()
{
- this->SetLogOutputStream(CM_NULLPTR);
+ this->SetLogOutputStream(nullptr);
}
void cmCPackLog::SetLogOutputStream(std::ostream* os)
@@ -39,13 +38,13 @@ void cmCPackLog::SetLogOutputStream(std::ostream* os)
bool cmCPackLog::SetLogOutputFile(const char* fname)
{
- cmGeneratedFileStream* cg = CM_NULLPTR;
+ cmGeneratedFileStream* cg = nullptr;
if (fname) {
cg = new cmGeneratedFileStream(fname);
}
if (cg && !*cg) {
delete cg;
- cg = CM_NULLPTR;
+ cg = nullptr;
}
this->SetLogOutputStream(cg);
if (!cg) {
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 9697a38..d04ea13 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -222,7 +222,7 @@ int cmCPackNSISGenerator::PackageFiles()
std::map<std::string, cmCPackComponentGroup>::iterator groupIt;
for (groupIt = this->ComponentGroups.begin();
groupIt != this->ComponentGroups.end(); ++groupIt) {
- if (groupIt->second.ParentGroup == CM_NULLPTR) {
+ if (groupIt->second.ParentGroup == nullptr) {
componentCode +=
this->CreateComponentGroupDescription(&groupIt->second, macrosOut);
}
@@ -313,7 +313,7 @@ int cmCPackNSISGenerator::PackageFiles()
int retVal = 1;
bool res =
cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal,
- CM_NULLPTR, this->GeneratorVerbose, 0);
+ nullptr, this->GeneratorVerbose, 0);
if (!res || retVal) {
cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << nsisCmd << std::endl
@@ -337,7 +337,7 @@ int cmCPackNSISGenerator::InitializeInternal()
"NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. "
"This option will be reset to 0 (for this generator only)."
<< std::endl);
- this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", CM_NULLPTR);
+ this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", nullptr);
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackNSISGenerator::Initialize()"
@@ -412,7 +412,7 @@ int cmCPackNSISGenerator::InitializeInternal()
int retVal = 1;
bool resS =
cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal,
- CM_NULLPTR, this->GeneratorVerbose, 0);
+ nullptr, this->GeneratorVerbose, 0);
cmsys::RegularExpression versionRex("v([0-9]+.[0-9]+)");
cmsys::RegularExpression versionRexCVS("v(.*)\\.cvs");
if (!resS || retVal ||
diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h
index 77be325..bdd1955 100644
--- a/Source/CPack/cmCPackNSISGenerator.h
+++ b/Source/CPack/cmCPackNSISGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackNSISGenerator_h
#define cmCPackNSISGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCPackGenerator.h"
diff --git a/Source/CPack/cmCPackOSXX11Generator.h b/Source/CPack/cmCPackOSXX11Generator.h
index 0eebc6d..0a1f686 100644
--- a/Source/CPack/cmCPackOSXX11Generator.h
+++ b/Source/CPack/cmCPackOSXX11Generator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackOSXX11Generator_h
#define cmCPackOSXX11Generator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
@@ -23,7 +23,7 @@ public:
* Construct generator
*/
cmCPackOSXX11Generator();
- virtual ~cmCPackOSXX11Generator();
+ ~cmCPackOSXX11Generator() CM_OVERRIDE;
protected:
virtual int InitializeInternal() CM_OVERRIDE;
diff --git a/Source/CPack/cmCPackPKGGenerator.h b/Source/CPack/cmCPackPKGGenerator.h
index f873c59..aef795f 100644
--- a/Source/CPack/cmCPackPKGGenerator.h
+++ b/Source/CPack/cmCPackPKGGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackPKGGenerator_h
#define cmCPackPKGGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <set>
#include <sstream>
@@ -27,7 +27,7 @@ public:
* Construct generator
*/
cmCPackPKGGenerator();
- virtual ~cmCPackPKGGenerator();
+ ~cmCPackPKGGenerator() CM_OVERRIDE;
bool SupportsComponentInstallation() const CM_OVERRIDE;
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h
index 6274515..a2f58ff 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.h
+++ b/Source/CPack/cmCPackPackageMakerGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackPackageMakerGenerator_h
#define cmCPackPackageMakerGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCPackGenerator.h"
#include "cmCPackPKGGenerator.h"
@@ -25,7 +25,7 @@ public:
* Construct generator
*/
cmCPackPackageMakerGenerator();
- virtual ~cmCPackPackageMakerGenerator();
+ ~cmCPackPackageMakerGenerator() CM_OVERRIDE;
bool SupportsComponentInstallation() const CM_OVERRIDE;
protected:
diff --git a/Source/CPack/cmCPackProductBuildGenerator.h b/Source/CPack/cmCPackProductBuildGenerator.h
index 12093a0..984dcaa 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.h
+++ b/Source/CPack/cmCPackProductBuildGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackProductBuildGenerator_h
#define cmCPackProductBuildGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
@@ -25,7 +25,7 @@ public:
* Construct generator
*/
cmCPackProductBuildGenerator();
- virtual ~cmCPackProductBuildGenerator();
+ ~cmCPackProductBuildGenerator() CM_OVERRIDE;
protected:
int InitializeInternal() CM_OVERRIDE;
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 8ec03c2..e40b74d 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -148,7 +148,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
for (compIt = this->Components.begin();
compIt != this->Components.end(); ++compIt) {
// Does the component belong to a group?
- if (compIt->second.Group == CM_NULLPTR) {
+ if (compIt->second.Group == nullptr) {
std::string component(compIt->first);
std::transform(component.begin(), component.end(),
component.begin(), ::toupper);
@@ -214,7 +214,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
for (compIt = this->Components.begin(); compIt != this->Components.end();
++compIt) {
// Does the component belong to a group?
- if (compIt->second.Group == CM_NULLPTR) {
+ if (compIt->second.Group == nullptr) {
std::string component(compIt->first);
std::transform(component.begin(), component.end(), component.begin(),
::toupper);
@@ -299,7 +299,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
for (compIt = this->Components.begin(); compIt != this->Components.end();
++compIt) {
// Does the component belong to a group?
- if (compIt->second.Group == CM_NULLPTR) {
+ if (compIt->second.Group == nullptr) {
cmCPackLogger(
cmCPackLog::LOG_VERBOSE, "Component <"
<< compIt->second.Name
@@ -430,7 +430,7 @@ std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix(
// the current COMPONENT belongs to.
std::string groupVar =
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
- if (CM_NULLPTR != GetOption(groupVar)) {
+ if (nullptr != GetOption(groupVar)) {
return std::string(GetOption(groupVar));
}
return componentName;
diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h
index 52cfc13..bfba289 100644
--- a/Source/CPack/cmCPackRPMGenerator.h
+++ b/Source/CPack/cmCPackRPMGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackRPMGenerator_h
#define cmCPackRPMGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCPackGenerator.h"
diff --git a/Source/CPack/cmCPackSTGZGenerator.h b/Source/CPack/cmCPackSTGZGenerator.h
index 8304e80..72f525c 100644
--- a/Source/CPack/cmCPackSTGZGenerator.h
+++ b/Source/CPack/cmCPackSTGZGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackSTGZGenerator_h
#define cmCPackSTGZGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCPackGenerator.h"
#include "cmCPackTGZGenerator.h"
diff --git a/Source/CPack/cmCPackTGZGenerator.h b/Source/CPack/cmCPackTGZGenerator.h
index 9426b3a..e904ab5 100644
--- a/Source/CPack/cmCPackTGZGenerator.h
+++ b/Source/CPack/cmCPackTGZGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackTGZGenerator_h
#define cmCPackTGZGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCPackArchiveGenerator.h"
#include "cmCPackGenerator.h"
diff --git a/Source/CPack/cmCPackTXZGenerator.h b/Source/CPack/cmCPackTXZGenerator.h
index 3b96e2d..f38758d 100644
--- a/Source/CPack/cmCPackTXZGenerator.h
+++ b/Source/CPack/cmCPackTXZGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackTXZGenerator_h
#define cmCPackTXZGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCPackArchiveGenerator.h"
#include "cmCPackGenerator.h"
diff --git a/Source/CPack/cmCPackTarBZip2Generator.h b/Source/CPack/cmCPackTarBZip2Generator.h
index 9b4b8f4..f3dd953 100644
--- a/Source/CPack/cmCPackTarBZip2Generator.h
+++ b/Source/CPack/cmCPackTarBZip2Generator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackTarBZip2Generator_h
#define cmCPackTarBZip2Generator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCPackArchiveGenerator.h"
#include "cmCPackGenerator.h"
diff --git a/Source/CPack/cmCPackTarCompressGenerator.h b/Source/CPack/cmCPackTarCompressGenerator.h
index 381d6eb..8eedb24 100644
--- a/Source/CPack/cmCPackTarCompressGenerator.h
+++ b/Source/CPack/cmCPackTarCompressGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackTarCompressGenerator_h
#define cmCPackTarCompressGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCPackArchiveGenerator.h"
#include "cmCPackGenerator.h"
diff --git a/Source/CPack/cmCPackZIPGenerator.h b/Source/CPack/cmCPackZIPGenerator.h
index 00c8720..2f81c65 100644
--- a/Source/CPack/cmCPackZIPGenerator.h
+++ b/Source/CPack/cmCPackZIPGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackZIPGenerator_h
#define cmCPackZIPGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCPackArchiveGenerator.h"
#include "cmCPackGenerator.h"
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index a44bc3d..9970721 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -1,6 +1,5 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmConfigure.h"
#include "cmsys/CommandLineArguments.hxx"
#include "cmsys/Encoding.hxx"
@@ -29,13 +28,13 @@
#include "cmake.h"
static const char* cmDocumentationName[][2] = {
- { CM_NULLPTR, " cpack - Packaging driver provided by CMake." },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, " cpack - Packaging driver provided by CMake." },
+ { nullptr, nullptr }
};
static const char* cmDocumentationUsage[][2] = {
- { CM_NULLPTR, " cpack -G <generator> [options]" },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, " cpack -G <generator> [options]" },
+ { nullptr, nullptr }
};
static const char* cmDocumentationOptions[][2] = {
@@ -49,7 +48,7 @@ static const char* cmDocumentationOptions[][2] = {
{ "-R <package version>", "override/define CPACK_PACKAGE_VERSION" },
{ "-B <package directory>", "override/define CPACK_PACKAGE_DIRECTORY" },
{ "--vendor <vendor name>", "override/define CPACK_PACKAGE_VENDOR" },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, nullptr }
};
int cpackUnknownArgument(const char* /*unused*/, void* /*unused*/)
@@ -208,7 +207,7 @@ int main(int argc, char const* const* argv)
cmCPackGeneratorFactory generators;
generators.SetLogger(&log);
- cmCPackGenerator* cpackGenerator = CM_NULLPTR;
+ cmCPackGenerator* cpackGenerator = nullptr;
cmDocumentation doc;
doc.addCPackStandardDocSections();
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index 94f39c2..4c9c5ca 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -136,13 +136,13 @@ std::string cmCTestBZR::LoadInfo()
{
// Run "bzr info" to get the repository info from the work tree.
const char* bzr = this->CommandLineTool.c_str();
- const char* bzr_info[] = { bzr, "info", CM_NULLPTR };
+ const char* bzr_info[] = { bzr, "info", nullptr };
InfoParser iout(this, "info-out> ");
OutputLogger ierr(this->Log, "info-err> ");
this->RunChild(bzr_info, &iout, &ierr);
// Run "bzr revno" to get the repository revision number from the work tree.
- const char* bzr_revno[] = { bzr, "revno", CM_NULLPTR };
+ const char* bzr_revno[] = { bzr, "revno", nullptr };
std::string rev;
RevnoParser rout(this, "revno-out> ", rev);
OutputLogger rerr(this->Log, "revno-err> ");
@@ -190,7 +190,7 @@ public:
if (res) {
XML_SetUnknownEncodingHandler(static_cast<XML_Parser>(this->Parser),
cmBZRXMLParserUnknownEncodingHandler,
- CM_NULLPTR);
+ nullptr);
}
return res;
}
@@ -380,7 +380,7 @@ bool cmCTestBZR::UpdateImpl()
bzr_update.push_back(this->URL.c_str());
- bzr_update.push_back(CM_NULLPTR);
+ bzr_update.push_back(nullptr);
// For some reason bzr uses stderr to display the update status.
OutputLogger out(this->Log, "pull-out> ");
@@ -408,8 +408,7 @@ bool cmCTestBZR::LoadRevisions()
// Run "bzr log" to get all global revisions of interest.
const char* bzr = this->CommandLineTool.c_str();
const char* bzr_log[] = {
- bzr, "log", "-v", "-r", revs.c_str(), "--xml", this->URL.c_str(),
- CM_NULLPTR
+ bzr, "log", "-v", "-r", revs.c_str(), "--xml", this->URL.c_str(), nullptr
};
{
LogParser out(this, "log-out> ");
@@ -467,7 +466,7 @@ bool cmCTestBZR::LoadModifications()
{
// Run "bzr status" which reports local modifications.
const char* bzr = this->CommandLineTool.c_str();
- const char* bzr_status[] = { bzr, "status", "-SV", CM_NULLPTR };
+ const char* bzr_status[] = { bzr, "status", "-SV", nullptr };
StatusParser out(this, "status-out> ");
OutputLogger err(this->Log, "status-err> ");
this->RunChild(bzr_status, &out, &err);
diff --git a/Source/CTest/cmCTestBZR.h b/Source/CTest/cmCTestBZR.h
index 2e8e88f..b313b25 100644
--- a/Source/CTest/cmCTestBZR.h
+++ b/Source/CTest/cmCTestBZR.h
@@ -3,7 +3,7 @@
#ifndef cmCTestBZR_h
#define cmCTestBZR_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGlobalVC.h"
diff --git a/Source/CTest/cmCTestBatchTestHandler.h b/Source/CTest/cmCTestBatchTestHandler.h
index 4a5dac1..3b58b13 100644
--- a/Source/CTest/cmCTestBatchTestHandler.h
+++ b/Source/CTest/cmCTestBatchTestHandler.h
@@ -3,7 +3,7 @@
#ifndef cmCTestBatchTestHandler_h
#define cmCTestBatchTestHandler_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestMultiProcessHandler.h"
#include "cmsys/FStream.hxx"
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index cc29071..b6c25b8 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -65,7 +65,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
args.push_back(toolset);
}
- const char* config = CM_NULLPTR;
+ const char* config = nullptr;
if (!this->CTest->GetConfigType().empty()) {
config = this->CTest->GetConfigType().c_str();
}
@@ -115,21 +115,21 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
void CMakeMessageCallback(const char* m, const char* /*unused*/,
bool& /*unused*/, void* s)
{
- std::string* out = (std::string*)s;
+ std::string* out = reinterpret_cast<std::string*>(s);
*out += m;
*out += "\n";
}
void CMakeProgressCallback(const char* msg, float /*unused*/, void* s)
{
- std::string* out = (std::string*)s;
+ std::string* out = reinterpret_cast<std::string*>(s);
*out += msg;
*out += "\n";
}
void CMakeOutputCallback(const char* m, size_t len, void* s)
{
- std::string* out = (std::string*)s;
+ std::string* out = reinterpret_cast<std::string*>(s);
out->append(m, len);
}
@@ -148,10 +148,10 @@ public:
}
~cmCTestBuildAndTestCaptureRAII()
{
- this->CM.SetProgressCallback(CM_NULLPTR, CM_NULLPTR);
- cmSystemTools::SetStderrCallback(CM_NULLPTR, CM_NULLPTR);
- cmSystemTools::SetStdoutCallback(CM_NULLPTR, CM_NULLPTR);
- cmSystemTools::SetMessageCallback(CM_NULLPTR, CM_NULLPTR);
+ this->CM.SetProgressCallback(nullptr, nullptr);
+ cmSystemTools::SetStderrCallback(nullptr, nullptr);
+ cmSystemTools::SetStdoutCallback(nullptr, nullptr);
+ cmSystemTools::SetMessageCallback(nullptr, nullptr);
}
};
@@ -236,7 +236,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
}
}
std::string output;
- const char* config = CM_NULLPTR;
+ const char* config = nullptr;
if (!this->CTest->GetConfigType().empty()) {
config = this->CTest->GetConfigType().c_str();
}
@@ -308,7 +308,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
for (size_t k = 0; k < this->TestCommandArgs.size(); ++k) {
testCommand.push_back(this->TestCommandArgs[k].c_str());
}
- testCommand.push_back(CM_NULLPTR);
+ testCommand.push_back(nullptr);
std::string outs;
int retval = 0;
// run the test from the this->BuildRunDir if set
@@ -334,8 +334,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
}
}
- int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval,
- CM_NULLPTR, remainingTime, CM_NULLPTR);
+ int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, nullptr,
+ remainingTime, nullptr);
if (runTestRes != cmsysProcess_State_Exited || retval != 0) {
out << "Test command failed: " << testCommand[0] << "\n";
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h
index 2e85e9f..a0d3674 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.h
+++ b/Source/CTest/cmCTestBuildAndTestHandler.h
@@ -3,7 +3,7 @@
#ifndef cmCTestBuildAndTestHandler_h
#define cmCTestBuildAndTestHandler_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGenericHandler.h"
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index 4c82760..ce27da1 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -17,14 +17,14 @@ class cmExecutionStatus;
cmCTestBuildCommand::cmCTestBuildCommand()
{
- this->GlobalGenerator = CM_NULLPTR;
+ this->GlobalGenerator = nullptr;
this->Arguments[ctb_NUMBER_ERRORS] = "NUMBER_ERRORS";
this->Arguments[ctb_NUMBER_WARNINGS] = "NUMBER_WARNINGS";
this->Arguments[ctb_TARGET] = "TARGET";
this->Arguments[ctb_CONFIGURATION] = "CONFIGURATION";
this->Arguments[ctb_FLAGS] = "FLAGS";
this->Arguments[ctb_PROJECT_NAME] = "PROJECT_NAME";
- this->Arguments[ctb_LAST] = CM_NULLPTR;
+ this->Arguments[ctb_LAST] = nullptr;
this->Last = ctb_LAST;
}
@@ -32,7 +32,7 @@ cmCTestBuildCommand::~cmCTestBuildCommand()
{
if (this->GlobalGenerator) {
delete this->GlobalGenerator;
- this->GlobalGenerator = CM_NULLPTR;
+ this->GlobalGenerator = nullptr;
}
}
@@ -41,9 +41,9 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
cmCTestGenericHandler* handler = this->CTest->GetInitializedHandler("build");
if (!handler) {
this->SetError("internal CTest error. Cannot instantiate build handler");
- return CM_NULLPTR;
+ return nullptr;
}
- this->Handler = (cmCTestBuildHandler*)handler;
+ this->Handler = static_cast<cmCTestBuildHandler*>(handler);
const char* ctestBuildCommand =
this->Makefile->GetDefinition("CTEST_BUILD_COMMAND");
@@ -89,7 +89,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
if (this->GlobalGenerator) {
if (this->GlobalGenerator->GetName() != cmakeGeneratorName) {
delete this->GlobalGenerator;
- this->GlobalGenerator = CM_NULLPTR;
+ this->GlobalGenerator = nullptr;
}
}
if (!this->GlobalGenerator) {
@@ -102,11 +102,11 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
e += "\"";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e);
cmSystemTools::SetFatalErrorOccured();
- return CM_NULLPTR;
+ return nullptr;
}
}
if (strlen(cmakeBuildConfiguration) == 0) {
- const char* config = CM_NULLPTR;
+ const char* config = nullptr;
#ifdef CMAKE_INTDIR
config = CMAKE_INTDIR;
#endif
@@ -143,7 +143,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
"with a custom command line.";
/* clang-format on */
this->SetError(ostr.str());
- return CM_NULLPTR;
+ return nullptr;
}
}
@@ -153,6 +153,12 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
this->Quiet);
}
+ if (const char* labelsForSubprojects =
+ this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
+ this->CTest->SetCTestConfiguration("LabelsForSubprojects",
+ labelsForSubprojects, this->Quiet);
+ }
+
handler->SetQuiet(this->Quiet);
return handler;
}
diff --git a/Source/CTest/cmCTestBuildCommand.h b/Source/CTest/cmCTestBuildCommand.h
index 9cf6a96..f03bb2c 100644
--- a/Source/CTest/cmCTestBuildCommand.h
+++ b/Source/CTest/cmCTestBuildCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestBuildCommand_h
#define cmCTestBuildCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 18ef05c..3762e13 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -74,7 +74,7 @@ static const char* cmCTestErrorMatches[] = {
"^The project cannot be built\\.",
"^\\[ERROR\\]",
"^Command .* failed with exit code",
- CM_NULLPTR
+ nullptr
};
static const char* cmCTestErrorExceptions[] = {
@@ -89,7 +89,7 @@ static const char* cmCTestErrorExceptions[] = {
":[ \\t]+Where:",
"([^ :]+):([0-9]+): Warning",
"------ Build started: .* ------",
- CM_NULLPTR
+ nullptr
};
static const char* cmCTestWarningMatches[] = {
@@ -114,7 +114,7 @@ static const char* cmCTestWarningMatches[] = {
"cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*",
"^CMake Warning.*:",
"^\\[WARNING\\]",
- CM_NULLPTR
+ nullptr
};
static const char* cmCTestWarningExceptions[] = {
@@ -134,7 +134,7 @@ static const char* cmCTestWarningExceptions[] = {
"ld32: WARNING 85: definition of dataKey in",
"cc: warning 422: Unknown option \"\\+b",
"_with_warning_C",
- CM_NULLPTR
+ nullptr
};
struct cmCTestBuildCompileErrorWarningRex
@@ -152,7 +152,7 @@ static cmCTestBuildCompileErrorWarningRex cmCTestWarningErrorFileLine[] = {
{ "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
{ "\"([a-zA-Z./0-9_+ ~-]+)\", line ([0-9]+)", 1, 2 },
{ "File = ([a-zA-Z./0-9_+ ~-]+), Line = ([0-9]+)", 1, 2 },
- { CM_NULLPTR, 0, 0 }
+ { nullptr, 0, 0 }
};
cmCTestBuildHandler::cmCTestBuildHandler()
@@ -488,6 +488,7 @@ int cmCTestBuildHandler::ProcessHandler()
void cmCTestBuildHandler::GenerateXMLHeader(cmXMLWriter& xml)
{
this->CTest->StartXML(xml, this->AppendXML);
+ this->CTest->GenerateSubprojectsOutput(xml);
xml.StartElement("Build");
xml.Element("StartDateTime", this->StartBuild);
xml.Element("StartBuildTime",
@@ -503,7 +504,7 @@ public:
{
}
FragmentCompare()
- : FTC(CM_NULLPTR)
+ : FTC(nullptr)
{
}
bool operator()(std::string const& l, std::string const& r) const
@@ -780,7 +781,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
a != args.end(); ++a) {
argv.push_back(a->c_str());
}
- argv.push_back(CM_NULLPTR);
+ argv.push_back(nullptr);
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command:",
this->Quiet);
@@ -834,7 +835,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
// For every chunk of data
int res;
- while ((res = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR))) {
+ while ((res = cmsysProcess_WaitForData(cp, &data, &length, nullptr))) {
// Replace '\0' with '\n', since '\0' does not really make sense. This is
// for Visual Studio output
for (int cc = 0; cc < length; ++cc) {
@@ -865,9 +866,9 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
&this->BuildProcessingQueue);
}
- this->ProcessBuffer(CM_NULLPTR, 0, tick, tick_len, ofs,
+ this->ProcessBuffer(nullptr, 0, tick, tick_len, ofs,
&this->BuildProcessingQueue);
- this->ProcessBuffer(CM_NULLPTR, 0, tick, tick_len, ofs,
+ this->ProcessBuffer(nullptr, 0, tick, tick_len, ofs,
&this->BuildProcessingErrorQueue);
cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, " Size of output: "
<< ((this->BuildOutputLogSize + 512) / 1024) << "K"
@@ -875,7 +876,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
this->Quiet);
// Properly handle output of the build command
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
int result = cmsysProcess_GetState(cp);
if (result == cmsysProcess_State_Exited) {
diff --git a/Source/CTest/cmCTestBuildHandler.h b/Source/CTest/cmCTestBuildHandler.h
index ef3cddf..ca11143 100644
--- a/Source/CTest/cmCTestBuildHandler.h
+++ b/Source/CTest/cmCTestBuildHandler.h
@@ -3,7 +3,7 @@
#ifndef cmCTestBuildHandler_h
#define cmCTestBuildHandler_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGenericHandler.h"
diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx
index fad360b..f2a9a85 100644
--- a/Source/CTest/cmCTestCVS.cxx
+++ b/Source/CTest/cmCTestCVS.cxx
@@ -96,7 +96,7 @@ bool cmCTestCVS::UpdateImpl()
ai != args.end(); ++ai) {
cvs_update.push_back(ai->c_str());
}
- cvs_update.push_back(CM_NULLPTR);
+ cvs_update.push_back(nullptr);
UpdateParser out(this, "up-out> ");
UpdateParser err(this, "up-err> ");
@@ -221,8 +221,9 @@ void cmCTestCVS::LoadRevisions(std::string const& file, const char* branchFlag,
// Run "cvs log" to get revisions of this file on this branch.
const char* cvs = this->CommandLineTool.c_str();
- const char* cvs_log[] = { cvs, "log", "-N",
- branchFlag, file.c_str(), CM_NULLPTR };
+ const char* cvs_log[] = {
+ cvs, "log", "-N", branchFlag, file.c_str(), nullptr
+ };
LogParser out(this, "log-out> ", revisions);
OutputLogger err(this->Log, "log-err> ");
diff --git a/Source/CTest/cmCTestCVS.h b/Source/CTest/cmCTestCVS.h
index 1208cfa..171460e 100644
--- a/Source/CTest/cmCTestCVS.h
+++ b/Source/CTest/cmCTestCVS.h
@@ -3,7 +3,7 @@
#ifndef cmCTestCVS_h
#define cmCTestCVS_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestVC.h"
diff --git a/Source/CTest/cmCTestCommand.h b/Source/CTest/cmCTestCommand.h
index 6fc237a..8efb419 100644
--- a/Source/CTest/cmCTestCommand.h
+++ b/Source/CTest/cmCTestCommand.h
@@ -20,8 +20,8 @@ class cmCTestCommand : public cmCommand
public:
cmCTestCommand()
{
- this->CTest = CM_NULLPTR;
- this->CTestScriptHandler = CM_NULLPTR;
+ this->CTest = nullptr;
+ this->CTestScriptHandler = nullptr;
}
cmCTest* CTest;
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx
index 73e893d..faa75d3 100644
--- a/Source/CTest/cmCTestConfigureCommand.cxx
+++ b/Source/CTest/cmCTestConfigureCommand.cxx
@@ -16,7 +16,7 @@
cmCTestConfigureCommand::cmCTestConfigureCommand()
{
this->Arguments[ctc_OPTIONS] = "OPTIONS";
- this->Arguments[ctc_LAST] = CM_NULLPTR;
+ this->Arguments[ctc_LAST] = nullptr;
this->Last = ctc_LAST;
}
@@ -33,7 +33,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
"Build directory not specified. Either use BUILD "
"argument to CTEST_CONFIGURE command or set CTEST_BINARY_DIRECTORY "
"variable");
- return CM_NULLPTR;
+ return nullptr;
}
const char* ctestConfigureCommand =
@@ -53,7 +53,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
"Source directory not specified. Either use SOURCE "
"argument to CTEST_CONFIGURE command or set CTEST_SOURCE_DIRECTORY "
"variable");
- return CM_NULLPTR;
+ return nullptr;
}
const std::string cmakelists_file = source_dir + "/CMakeLists.txt";
@@ -61,7 +61,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
std::ostringstream e;
e << "CMakeLists.txt file does not exist [" << cmakelists_file << "]";
this->SetError(e.str());
- return CM_NULLPTR;
+ return nullptr;
}
bool multiConfig = false;
@@ -88,9 +88,8 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
cmakeConfigureCommand += option;
cmakeConfigureCommand += "\"";
- if ((CM_NULLPTR != strstr(option.c_str(), "CMAKE_BUILD_TYPE=")) ||
- (CM_NULLPTR !=
- strstr(option.c_str(), "CMAKE_BUILD_TYPE:STRING="))) {
+ if ((nullptr != strstr(option.c_str(), "CMAKE_BUILD_TYPE=")) ||
+ (nullptr != strstr(option.c_str(), "CMAKE_BUILD_TYPE:STRING="))) {
cmakeBuildTypeInOptions = true;
}
}
@@ -137,16 +136,22 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
"Configure command is not specified. If this is a "
"\"built with CMake\" project, set CTEST_CMAKE_GENERATOR. If not, "
"set CTEST_CONFIGURE_COMMAND.");
- return CM_NULLPTR;
+ return nullptr;
}
}
+ if (const char* labelsForSubprojects =
+ this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
+ this->CTest->SetCTestConfiguration("LabelsForSubprojects",
+ labelsForSubprojects, this->Quiet);
+ }
+
cmCTestGenericHandler* handler =
this->CTest->GetInitializedHandler("configure");
if (!handler) {
this->SetError(
"internal CTest error. Cannot instantiate configure handler");
- return CM_NULLPTR;
+ return nullptr;
}
handler->SetQuiet(this->Quiet);
return handler;
diff --git a/Source/CTest/cmCTestConfigureCommand.h b/Source/CTest/cmCTestConfigureCommand.h
index 917f5ab..dfb3a59 100644
--- a/Source/CTest/cmCTestConfigureCommand.h
+++ b/Source/CTest/cmCTestConfigureCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestConfigureCommand_h
#define cmCTestConfigureCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx
index 5d87f3f..56a038e 100644
--- a/Source/CTest/cmCTestConfigureHandler.cxx
+++ b/Source/CTest/cmCTestConfigureHandler.cxx
@@ -73,6 +73,7 @@ int cmCTestConfigureHandler::ProcessHandler()
if (os) {
cmXMLWriter xml(os);
this->CTest->StartXML(xml, this->AppendXML);
+ this->CTest->GenerateSubprojectsOutput(xml);
xml.StartElement("Configure");
xml.Element("StartDateTime", start_time);
xml.Element("StartConfigureTime", start_time_time);
diff --git a/Source/CTest/cmCTestConfigureHandler.h b/Source/CTest/cmCTestConfigureHandler.h
index 2b45282..32a6ba7 100644
--- a/Source/CTest/cmCTestConfigureHandler.h
+++ b/Source/CTest/cmCTestConfigureHandler.h
@@ -3,7 +3,7 @@
#ifndef cmCTestConfigureHandler_h
#define cmCTestConfigureHandler_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGenericHandler.h"
diff --git a/Source/CTest/cmCTestCoverageCommand.cxx b/Source/CTest/cmCTestCoverageCommand.cxx
index 535da58..d2003ba 100644
--- a/Source/CTest/cmCTestCoverageCommand.cxx
+++ b/Source/CTest/cmCTestCoverageCommand.cxx
@@ -23,7 +23,7 @@ cmCTestGenericHandler* cmCTestCoverageCommand::InitializeHandler()
this->CTest->GetInitializedHandler("coverage"));
if (!handler) {
this->SetError("internal CTest error. Cannot instantiate test handler");
- return CM_NULLPTR;
+ return nullptr;
}
// If a LABELS option was given, select only files with the labels.
diff --git a/Source/CTest/cmCTestCoverageCommand.h b/Source/CTest/cmCTestCoverageCommand.h
index 78c4f61..9ea0223 100644
--- a/Source/CTest/cmCTestCoverageCommand.h
+++ b/Source/CTest/cmCTestCoverageCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestCoverageCommand_h
#define cmCTestCoverageCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 877cd24..e3d68c6 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -72,7 +72,7 @@ public:
i != this->CommandLineStrings.end(); ++i) {
args.push_back(i->c_str());
}
- args.push_back(CM_NULLPTR); // null terminate
+ args.push_back(nullptr); // null terminate
cmsysProcess_SetCommand(this->Process, &*args.begin());
if (!this->WorkingDirectory.empty()) {
cmsysProcess_SetWorkingDirectory(this->Process,
@@ -97,7 +97,7 @@ public:
{
cmsysProcess_SetPipeFile(this->Process, cmsysProcess_Pipe_STDERR, fname);
}
- int WaitForExit(double* timeout = CM_NULLPTR)
+ int WaitForExit(double* timeout = nullptr)
{
this->PipeState = cmsysProcess_WaitForExit(this->Process, timeout);
return this->PipeState;
@@ -1759,7 +1759,7 @@ const char* bullseyeHelp[] = {
" condition evaluated true or false, respectively.",
" * A k indicates a constant decision or condition.",
" * The slash / means this probe is excluded from summary results. ",
- CM_NULLPTR
+ nullptr
};
}
@@ -1787,7 +1787,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"run covbr: " << std::endl, this->Quiet);
- if (!this->RunBullseyeCommand(cont, "covbr", CM_NULLPTR, outputFile)) {
+ if (!this->RunBullseyeCommand(cont, "covbr", nullptr, outputFile)) {
cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covbr for."
<< "\n");
return -1;
@@ -1860,7 +1860,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
covLogXML.StartElement("Report");
// write the bullseye header
line = 0;
- for (int k = 0; bullseyeHelp[k] != CM_NULLPTR; ++k) {
+ for (int k = 0; bullseyeHelp[k] != nullptr; ++k) {
covLogXML.StartElement("Line");
covLogXML.Attribute("Number", line);
covLogXML.Attribute("Count", -1);
diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h
index 933f606..83eb561 100644
--- a/Source/CTest/cmCTestCoverageHandler.h
+++ b/Source/CTest/cmCTestCoverageHandler.h
@@ -3,7 +3,7 @@
#ifndef cmCTestCoverageHandler_h
#define cmCTestCoverageHandler_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGenericHandler.h"
diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx
index b80ea5a..b175d44 100644
--- a/Source/CTest/cmCTestCurl.cxx
+++ b/Source/CTest/cmCTestCurl.cxx
@@ -5,7 +5,6 @@
#include "cmCTest.h"
#include "cmSystemTools.h"
-#include "cmConfigure.h"
#include <ostream>
#include <stdio.h>
@@ -42,7 +41,7 @@ namespace {
size_t curlWriteMemoryCallback(void* ptr, size_t size, size_t nmemb,
void* data)
{
- int realsize = (int)(size * nmemb);
+ int realsize = static_cast<int>(size * nmemb);
std::vector<char>* vec = static_cast<std::vector<char>*>(data);
const char* chPtr = static_cast<char*>(ptr);
@@ -145,7 +144,7 @@ bool cmCTestCurl::UploadFile(std::string const& local_file,
::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, curlDebugCallback);
// Set Content-Type to satisfy fussy modsecurity rules.
struct curl_slist* headers =
- ::curl_slist_append(CM_NULLPTR, "Content-Type: text/xml");
+ ::curl_slist_append(nullptr, "Content-Type: text/xml");
// Add any additional headers that the user specified.
for (std::vector<std::string>::const_iterator h = this->HttpHeaders.begin();
h != this->HttpHeaders.end(); ++h) {
@@ -157,8 +156,8 @@ bool cmCTestCurl::UploadFile(std::string const& local_file,
::curl_easy_setopt(this->Curl, CURLOPT_HTTPHEADER, headers);
std::vector<char> responseData;
std::vector<char> debugData;
- ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void*)&responseData);
- ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void*)&debugData);
+ ::curl_easy_setopt(this->Curl, CURLOPT_FILE, &responseData);
+ ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, &debugData);
::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1);
// Now run off and do what you've been told!
::curl_easy_perform(this->Curl);
@@ -207,12 +206,12 @@ bool cmCTestCurl::HttpRequest(std::string const& url,
::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, curlDebugCallback);
std::vector<char> responseData;
std::vector<char> debugData;
- ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void*)&responseData);
- ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void*)&debugData);
+ ::curl_easy_setopt(this->Curl, CURLOPT_FILE, &responseData);
+ ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, &debugData);
::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1);
// Add headers if any were specified.
- struct curl_slist* headers = CM_NULLPTR;
+ struct curl_slist* headers = nullptr;
if (!this->HttpHeaders.empty()) {
for (std::vector<std::string>::const_iterator h =
this->HttpHeaders.begin();
diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h
index 503ed23..9a8b735 100644
--- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h
+++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestEmptyBinaryDirectoryCommand_h
#define cmCTestEmptyBinaryDirectoryCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 230aedf..ed8d932 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -58,8 +58,8 @@ std::string cmCTestGIT::GetWorkingRevision()
{
// Run plumbing "git rev-list" to get work tree revision.
const char* git = this->CommandLineTool.c_str();
- const char* git_rev_list[] = { git, "rev-list", "-n", "1",
- "HEAD", "--", CM_NULLPTR };
+ const char* git_rev_list[] = { git, "rev-list", "-n", "1",
+ "HEAD", "--", nullptr };
std::string rev;
OneLineParser out(this, "rl-out> ", rev);
OutputLogger err(this->Log, "rl-err> ");
@@ -90,11 +90,11 @@ std::string cmCTestGIT::FindGitDir()
// Run "git rev-parse --git-dir" to locate the real .git directory.
const char* git = this->CommandLineTool.c_str();
- char const* git_rev_parse[] = { git, "rev-parse", "--git-dir", CM_NULLPTR };
+ char const* git_rev_parse[] = { git, "rev-parse", "--git-dir", nullptr };
std::string git_dir_line;
OneLineParser rev_parse_out(this, "rev-parse-out> ", git_dir_line);
OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
- if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, CM_NULLPTR,
+ if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, nullptr,
cmProcessOutput::UTF8)) {
git_dir = git_dir_line;
}
@@ -118,7 +118,7 @@ std::string cmCTestGIT::FindGitDir()
0 };
OneLineParser cygpath_out(this, "cygpath-out> ", git_dir_line);
OutputLogger cygpath_err(this->Log, "cygpath-err> ");
- if (this->RunChild(cygpath, &cygpath_out, &cygpath_err, CM_NULLPTR,
+ if (this->RunChild(cygpath, &cygpath_out, &cygpath_err, nullptr,
cmProcessOutput::UTF8)) {
git_dir = git_dir_line;
}
@@ -134,12 +134,11 @@ std::string cmCTestGIT::FindTopDir()
// Run "git rev-parse --show-cdup" to locate the top of the tree.
const char* git = this->CommandLineTool.c_str();
- char const* git_rev_parse[] = { git, "rev-parse", "--show-cdup",
- CM_NULLPTR };
+ char const* git_rev_parse[] = { git, "rev-parse", "--show-cdup", nullptr };
std::string cdup;
OneLineParser rev_parse_out(this, "rev-parse-out> ", cdup);
OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
- if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, CM_NULLPTR,
+ if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, nullptr,
cmProcessOutput::UTF8) &&
!cdup.empty()) {
top_dir += "/";
@@ -170,7 +169,7 @@ bool cmCTestGIT::UpdateByFetchAndReset()
}
// Sentinel argument.
- git_fetch.push_back(CM_NULLPTR);
+ git_fetch.push_back(nullptr);
// Fetch upstream refs.
OutputLogger fetch_out(this->Log, "fetch-out> ");
@@ -205,8 +204,7 @@ bool cmCTestGIT::UpdateByFetchAndReset()
}
// Reset the local branch to point at that tracked from upstream.
- char const* git_reset[] = { git, "reset", "--hard", sha1.c_str(),
- CM_NULLPTR };
+ char const* git_reset[] = { git, "reset", "--hard", sha1.c_str(), nullptr };
OutputLogger reset_out(this->Log, "reset-out> ");
OutputLogger reset_err(this->Log, "reset-err> ");
return this->RunChild(&git_reset[0], &reset_out, &reset_err);
@@ -221,7 +219,7 @@ bool cmCTestGIT::UpdateByCustom(std::string const& custom)
i != git_custom_command.end(); ++i) {
git_custom.push_back(i->c_str());
}
- git_custom.push_back(CM_NULLPTR);
+ git_custom.push_back(nullptr);
OutputLogger custom_out(this->Log, "custom-out> ");
OutputLogger custom_err(this->Log, "custom-err> ");
@@ -250,7 +248,7 @@ bool cmCTestGIT::UpdateImpl()
// Git < 1.6.5 did not support submodule --recursive
if (this->GetGitVersion() < cmCTestGITVersion(1, 6, 5, 0)) {
- recursive = CM_NULLPTR;
+ recursive = nullptr;
// No need to require >= 1.6.5 if there are no submodules.
if (cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) {
this->Log << "Git < 1.6.5 cannot update submodules recursively\n";
@@ -259,7 +257,7 @@ bool cmCTestGIT::UpdateImpl()
// Git < 1.8.1 did not support sync --recursive
if (this->GetGitVersion() < cmCTestGITVersion(1, 8, 1, 0)) {
- sync_recursive = CM_NULLPTR;
+ sync_recursive = nullptr;
// No need to require >= 1.8.1 if there are no submodules.
if (cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str())) {
this->Log << "Git < 1.8.1 cannot synchronize submodules recursively\n";
@@ -274,8 +272,7 @@ bool cmCTestGIT::UpdateImpl()
std::string init_submodules =
this->CTest->GetCTestConfiguration("GITInitSubmodules");
if (cmSystemTools::IsOn(init_submodules.c_str())) {
- char const* git_submodule_init[] = { git, "submodule", "init",
- CM_NULLPTR };
+ char const* git_submodule_init[] = { git, "submodule", "init", nullptr };
ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err,
top_dir.c_str());
@@ -285,7 +282,7 @@ bool cmCTestGIT::UpdateImpl()
}
char const* git_submodule_sync[] = { git, "submodule", "sync",
- sync_recursive, CM_NULLPTR };
+ sync_recursive, nullptr };
ret = this->RunChild(git_submodule_sync, &submodule_out, &submodule_err,
top_dir.c_str());
@@ -294,7 +291,7 @@ bool cmCTestGIT::UpdateImpl()
}
char const* git_submodule[] = { git, "submodule", "update", recursive,
- CM_NULLPTR };
+ nullptr };
return this->RunChild(git_submodule, &submodule_out, &submodule_err,
top_dir.c_str());
}
@@ -303,7 +300,7 @@ unsigned int cmCTestGIT::GetGitVersion()
{
if (!this->CurrentGitVersion) {
const char* git = this->CommandLineTool.c_str();
- char const* git_version[] = { git, "--version", CM_NULLPTR };
+ char const* git_version[] = { git, "--version", nullptr };
std::string version;
OneLineParser version_out(this, "version-out> ", version);
OutputLogger version_err(this->Log, "version-err> ");
@@ -513,8 +510,8 @@ private:
const char* email_last = *c ? c++ : c;
person.EMail.assign(email_first, email_last - email_first);
- person.Time = strtoul(c, (char**)&c, 10);
- person.TimeZone = strtol(c, (char**)&c, 10);
+ person.Time = strtoul(c, const_cast<char**>(&c), 10);
+ person.TimeZone = strtol(c, const_cast<char**>(&c), 10);
}
bool ProcessLine() CM_OVERRIDE
@@ -615,10 +612,10 @@ bool cmCTestGIT::LoadRevisions()
std::string range = this->OldRevision + ".." + this->NewRevision;
const char* git = this->CommandLineTool.c_str();
const char* git_rev_list[] = { git, "rev-list", "--reverse",
- range.c_str(), "--", CM_NULLPTR };
+ range.c_str(), "--", nullptr };
const char* git_diff_tree[] = {
git, "diff-tree", "--stdin", "--always", "-z",
- "-r", "--pretty=raw", "--encoding=utf-8", CM_NULLPTR
+ "-r", "--pretty=raw", "--encoding=utf-8", nullptr
};
this->Log << this->ComputeCommandLine(git_rev_list) << " | "
<< this->ComputeCommandLine(git_diff_tree) << "\n";
@@ -645,19 +642,18 @@ bool cmCTestGIT::LoadModifications()
// Use 'git update-index' to refresh the index w.r.t. the work tree.
const char* git_update_index[] = { git, "update-index", "--refresh",
- CM_NULLPTR };
+ nullptr };
OutputLogger ui_out(this->Log, "ui-out> ");
OutputLogger ui_err(this->Log, "ui-err> ");
- this->RunChild(git_update_index, &ui_out, &ui_err, CM_NULLPTR,
+ this->RunChild(git_update_index, &ui_out, &ui_err, nullptr,
cmProcessOutput::UTF8);
// Use 'git diff-index' to get modified files.
const char* git_diff_index[] = { git, "diff-index", "-z",
- "HEAD", "--", CM_NULLPTR };
+ "HEAD", "--", nullptr };
DiffParser out(this, "di-out> ");
OutputLogger err(this->Log, "di-err> ");
- this->RunChild(git_diff_index, &out, &err, CM_NULLPTR,
- cmProcessOutput::UTF8);
+ this->RunChild(git_diff_index, &out, &err, nullptr, cmProcessOutput::UTF8);
for (std::vector<Change>::const_iterator ci = out.Changes.begin();
ci != out.Changes.end(); ++ci) {
diff --git a/Source/CTest/cmCTestGIT.h b/Source/CTest/cmCTestGIT.h
index 4bf8294..222bc50 100644
--- a/Source/CTest/cmCTestGIT.h
+++ b/Source/CTest/cmCTestGIT.h
@@ -3,7 +3,7 @@
#ifndef cmCTestGIT_h
#define cmCTestGIT_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGlobalVC.h"
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index 19034c0..53a4018 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestGenericHandler.h"
-#include "cmConfigure.h"
#include <sstream>
#include <utility>
@@ -12,7 +11,7 @@
cmCTestGenericHandler::cmCTestGenericHandler()
{
this->HandlerVerbose = cmSystemTools::OUTPUT_NONE;
- this->CTest = CM_NULLPTR;
+ this->CTest = nullptr;
this->SubmitIndex = 0;
this->AppendXML = false;
this->Quiet = false;
@@ -70,7 +69,7 @@ const char* cmCTestGenericHandler::GetOption(const std::string& op)
cmCTestGenericHandler::t_StringToString::iterator remit =
this->Options.find(op);
if (remit == this->Options.end()) {
- return CM_NULLPTR;
+ return nullptr;
}
return remit->second.c_str();
}
diff --git a/Source/CTest/cmCTestGlobalVC.h b/Source/CTest/cmCTestGlobalVC.h
index a5273d3..b4bf077 100644
--- a/Source/CTest/cmCTestGlobalVC.h
+++ b/Source/CTest/cmCTestGlobalVC.h
@@ -3,7 +3,7 @@
#ifndef cmCTestGlobalVC_h
#define cmCTestGlobalVC_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestVC.h"
diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx
index 49f9a65..7bf5b67 100644
--- a/Source/CTest/cmCTestHG.cxx
+++ b/Source/CTest/cmCTestHG.cxx
@@ -96,7 +96,7 @@ std::string cmCTestHG::GetWorkingRevision()
{
// Run plumbing "hg identify" to get work tree revision.
const char* hg = this->CommandLineTool.c_str();
- const char* hg_identify[] = { hg, "identify", "-i", CM_NULLPTR };
+ const char* hg_identify[] = { hg, "identify", "-i", nullptr };
std::string rev;
IdentifyParser out(this, "rev-out> ", rev);
OutputLogger err(this->Log, "rev-err> ");
@@ -126,7 +126,7 @@ bool cmCTestHG::UpdateImpl()
// Use "hg pull" followed by "hg update" to update the working tree.
{
const char* hg = this->CommandLineTool.c_str();
- const char* hg_pull[] = { hg, "pull", "-v", CM_NULLPTR };
+ const char* hg_pull[] = { hg, "pull", "-v", nullptr };
OutputLogger out(this->Log, "pull-out> ");
OutputLogger err(this->Log, "pull-err> ");
this->RunChild(&hg_pull[0], &out, &err);
@@ -151,7 +151,7 @@ bool cmCTestHG::UpdateImpl()
}
// Sentinel argument.
- hg_update.push_back(CM_NULLPTR);
+ hg_update.push_back(nullptr);
OutputLogger out(this->Log, "update-out> ");
OutputLogger err(this->Log, "update-err> ");
@@ -286,7 +286,7 @@ bool cmCTestHG::LoadRevisions()
"</logentry>\n";
const char* hg_log[] = {
hg, "log", "--removed", "-r", range.c_str(),
- "--template", hgXMLTemplate, CM_NULLPTR
+ "--template", hgXMLTemplate, nullptr
};
LogParser out(this, "log-out> ");
@@ -302,7 +302,7 @@ bool cmCTestHG::LoadModifications()
{
// Use 'hg status' to get modified files.
const char* hg = this->CommandLineTool.c_str();
- const char* hg_status[] = { hg, "status", CM_NULLPTR };
+ const char* hg_status[] = { hg, "status", nullptr };
StatusParser out(this, "status-out> ");
OutputLogger err(this->Log, "status-err> ");
this->RunChild(hg_status, &out, &err);
diff --git a/Source/CTest/cmCTestHG.h b/Source/CTest/cmCTestHG.h
index ec9eaff..90c38dc 100644
--- a/Source/CTest/cmCTestHG.h
+++ b/Source/CTest/cmCTestHG.h
@@ -3,7 +3,7 @@
#ifndef cmCTestHG_h
#define cmCTestHG_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGlobalVC.h"
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index c99e450..9266d1f 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -20,7 +20,7 @@ cmCTestHandlerCommand::cmCTestHandlerCommand()
size_t cc;
this->Arguments.reserve(INIT_SIZE);
for (cc = 0; cc < INIT_SIZE; ++cc) {
- this->Arguments.push_back(CM_NULLPTR);
+ this->Arguments.push_back(nullptr);
}
this->Arguments[ct_RETURN_VALUE] = "RETURN_VALUE";
this->Arguments[ct_CAPTURE_CMAKE_ERROR] = "CAPTURE_CMAKE_ERROR";
@@ -89,7 +89,7 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
SaveRestoreErrorState errorState;
// Allocate space for argument values.
this->Values.clear();
- this->Values.resize(this->Last, CM_NULLPTR);
+ this->Values.resize(this->Last, nullptr);
// Process input arguments.
this->ArgumentDoing = ArgumentDoingNone;
diff --git a/Source/CTest/cmCTestHandlerCommand.h b/Source/CTest/cmCTestHandlerCommand.h
index 0ea0612..b838074 100644
--- a/Source/CTest/cmCTestHandlerCommand.h
+++ b/Source/CTest/cmCTestHandlerCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestHandlerCommand_h
#define cmCTestHandlerCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 5b21351..041cc92 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -2,8 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestLaunch.h"
-#include "cmConfigure.h"
-
#include "cmsys/FStream.hxx"
#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
@@ -31,7 +29,7 @@
cmCTestLaunch::cmCTestLaunch(int argc, const char* const* argv)
{
this->Passthru = true;
- this->Process = CM_NULLPTR;
+ this->Process = nullptr;
this->ExitCode = 1;
this->CWD = cmSystemTools::GetCurrentWorkingDirectory();
@@ -129,7 +127,7 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv)
return true;
}
this->RealArgC = 0;
- this->RealArgV = CM_NULLPTR;
+ this->RealArgV = nullptr;
std::cerr << "No launch/command separator ('--') found!\n";
return false;
}
@@ -224,11 +222,11 @@ void cmCTestLaunch::RunChild()
// Record child stdout and stderr if necessary.
if (!this->Passthru) {
- char* data = CM_NULLPTR;
+ char* data = nullptr;
int length = 0;
cmProcessOutput processOutput;
std::string strdata;
- while (int p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) {
+ while (int p = cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
if (p == cmsysProcess_Pipe_STDOUT) {
processOutput.DecodeText(data, length, strdata, 1);
fout.write(strdata.c_str(), strdata.size());
@@ -254,7 +252,7 @@ void cmCTestLaunch::RunChild()
}
// Wait for the real command to finish.
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
this->ExitCode = cmsysProcess_GetExitValue(cp);
}
@@ -396,7 +394,7 @@ void cmCTestLaunch::WriteXMLAction(cmXMLWriter& xml)
}
// OutputType
- const char* outputType = CM_NULLPTR;
+ const char* outputType = nullptr;
if (!this->OptionTargetType.empty()) {
if (this->OptionTargetType == "EXECUTABLE") {
outputType = "executable";
@@ -508,7 +506,11 @@ void cmCTestLaunch::DumpFileToXML(cmXMLWriter& xml, std::string const& fname)
if (MatchesFilterPrefix(line)) {
continue;
}
-
+ if (this->Match(line, this->RegexWarningSuppress)) {
+ line = "[CTest: warning suppressed] " + line;
+ } else if (this->Match(line, this->RegexWarning)) {
+ line = "[CTest: warning matched] " + line;
+ }
xml.Content(sep);
xml.Content(line);
sep = "\n";
diff --git a/Source/CTest/cmCTestMemCheckCommand.cxx b/Source/CTest/cmCTestMemCheckCommand.cxx
index b9cae3b..a5d5995 100644
--- a/Source/CTest/cmCTestMemCheckCommand.cxx
+++ b/Source/CTest/cmCTestMemCheckCommand.cxx
@@ -14,7 +14,7 @@
cmCTestMemCheckCommand::cmCTestMemCheckCommand()
{
this->Arguments[ctm_DEFECT_COUNT] = "DEFECT_COUNT";
- this->Arguments[ctm_LAST] = CM_NULLPTR;
+ this->Arguments[ctm_LAST] = nullptr;
this->Last = ctm_LAST;
}
diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h
index fa59559..aaa8c6b 100644
--- a/Source/CTest/cmCTestMemCheckCommand.h
+++ b/Source/CTest/cmCTestMemCheckCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestMemCheckCommand_h
#define cmCTestMemCheckCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestTestCommand.h"
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index c35f0bc..7d11550 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -28,12 +28,12 @@ static CatToErrorType cmCTestMemCheckBoundsChecker[] = {
{ "Allocation Conflict", cmCTestMemCheckHandler::FMM },
{ "Bad Pointer Use", cmCTestMemCheckHandler::FMW },
{ "Dangling Pointer", cmCTestMemCheckHandler::FMR },
- { CM_NULLPTR, 0 }
+ { nullptr, 0 }
};
static void xmlReportError(int line, const char* msg, void* data)
{
- cmCTest* ctest = (cmCTest*)data;
+ cmCTest* ctest = reinterpret_cast<cmCTest*>(data);
cmCTestLog(ctest, ERROR_MESSAGE, "Error parsing XML in stream at line "
<< line << ": " << msg << std::endl);
}
@@ -45,7 +45,7 @@ public:
cmBoundsCheckerParser(cmCTest* c)
{
this->CTest = c;
- this->SetErrorCallback(xmlReportError, (void*)c);
+ this->SetErrorCallback(xmlReportError, c);
}
void StartElement(const std::string& name, const char** atts) CM_OVERRIDE
{
@@ -58,7 +58,7 @@ public:
std::ostringstream ostr;
ostr << name << ":\n";
int i = 0;
- for (; atts[i] != CM_NULLPTR; i += 2) {
+ for (; atts[i] != nullptr; i += 2) {
ostr << " " << atts[i] << " - " << atts[i + 1] << "\n";
}
ostr << "\n";
@@ -69,12 +69,12 @@ public:
const char* GetAttribute(const char* name, const char** atts)
{
int i = 0;
- for (; atts[i] != CM_NULLPTR; ++i) {
+ for (; atts[i] != nullptr; ++i) {
if (strcmp(name, atts[i]) == 0) {
return atts[i + 1];
}
}
- return CM_NULLPTR;
+ return nullptr;
}
void ParseError(const char** atts)
{
@@ -228,9 +228,9 @@ void cmCTestMemCheckHandler::InitializeResultsVectors()
// define the standard set of errors
//----------------------------------------------------------------------
static const char* cmCTestMemCheckResultStrings[] = {
- "ABR", "ABW", "ABWL", "COR", "EXU", "FFM", "FIM", "FMM",
- "FMR", "FMW", "FUM", "IPR", "IPW", "MAF", "MLK", "MPK",
- "NPR", "ODS", "PAR", "PLK", "UMC", "UMR", CM_NULLPTR
+ "ABR", "ABW", "ABWL", "COR", "EXU", "FFM", "FIM", "FMM",
+ "FMR", "FMW", "FUM", "IPR", "IPW", "MAF", "MLK", "MPK",
+ "NPR", "ODS", "PAR", "PLK", "UMC", "UMR", nullptr
};
static const char* cmCTestMemCheckResultLongStrings[] = {
"Threading Problem",
@@ -255,10 +255,10 @@ void cmCTestMemCheckHandler::InitializeResultsVectors()
"PLK",
"Uninitialized Memory Conditional",
"Uninitialized Memory Read",
- CM_NULLPTR
+ nullptr
};
this->GlobalResults.clear();
- for (int i = 0; cmCTestMemCheckResultStrings[i] != CM_NULLPTR; ++i) {
+ for (int i = 0; cmCTestMemCheckResultStrings[i] != nullptr; ++i) {
this->ResultStrings.push_back(cmCTestMemCheckResultStrings[i]);
this->ResultStringsLong.push_back(cmCTestMemCheckResultLongStrings[i]);
this->GlobalResults.push_back(0);
@@ -291,6 +291,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml)
return;
}
this->CTest->StartXML(xml, this->AppendXML);
+ this->CTest->GenerateSubprojectsOutput(xml);
xml.StartElement("DynamicAnalysis");
switch (this->MemoryTesterStyle) {
case cmCTestMemCheckHandler::VALGRIND:
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h
index 333c2e2..1228c42 100644
--- a/Source/CTest/cmCTestMemCheckHandler.h
+++ b/Source/CTest/cmCTestMemCheckHandler.h
@@ -3,7 +3,7 @@
#ifndef cmCTestMemCheckHandler_h
#define cmCTestMemCheckHandler_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestTestHandler.h"
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index c802216..ab057ad 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -155,7 +155,7 @@ cmCTestP4::User cmCTestP4::GetUserData(const std::string& username)
p4_users.push_back("-m");
p4_users.push_back("1");
p4_users.push_back(username.c_str());
- p4_users.push_back(CM_NULLPTR);
+ p4_users.push_back(nullptr);
UserParser out(this, "users-out> ");
OutputLogger err(this->Log, "users-err> ");
@@ -350,7 +350,7 @@ std::string cmCTestP4::GetWorkingRevision()
std::string source = this->SourceDirectory + "/...#have";
p4_identify.push_back(source.c_str());
- p4_identify.push_back(CM_NULLPTR);
+ p4_identify.push_back(nullptr);
std::string rev;
IdentifyParser out(this, "p4_changes-out> ", rev);
@@ -411,7 +411,7 @@ bool cmCTestP4::LoadRevisions()
p4_changes.push_back("changes");
p4_changes.push_back(range.c_str());
- p4_changes.push_back(CM_NULLPTR);
+ p4_changes.push_back(nullptr);
ChangesParser out(this, "p4_changes-out> ");
OutputLogger err(this->Log, "p4_changes-err> ");
@@ -431,7 +431,7 @@ bool cmCTestP4::LoadRevisions()
p4_describe.push_back("describe");
p4_describe.push_back("-s");
p4_describe.push_back(i->c_str());
- p4_describe.push_back(CM_NULLPTR);
+ p4_describe.push_back(nullptr);
DescribeParser outDescribe(this, "p4_describe-out> ");
OutputLogger errDescribe(this->Log, "p4_describe-err> ");
@@ -451,7 +451,7 @@ bool cmCTestP4::LoadModifications()
p4_diff.push_back("-dn");
std::string source = this->SourceDirectory + "/...";
p4_diff.push_back(source.c_str());
- p4_diff.push_back(CM_NULLPTR);
+ p4_diff.push_back(nullptr);
DiffParser out(this, "p4_diff-out> ");
OutputLogger err(this->Log, "p4_diff-err> ");
@@ -469,7 +469,7 @@ bool cmCTestP4::UpdateCustom(const std::string& custom)
i != p4_custom_command.end(); ++i) {
p4_custom.push_back(i->c_str());
}
- p4_custom.push_back(CM_NULLPTR);
+ p4_custom.push_back(nullptr);
OutputLogger custom_out(this->Log, "p4_customsync-out> ");
OutputLogger custom_err(this->Log, "p4_customsync-err> ");
@@ -520,7 +520,7 @@ bool cmCTestP4::UpdateImpl()
}
p4_sync.push_back(source.c_str());
- p4_sync.push_back(CM_NULLPTR);
+ p4_sync.push_back(nullptr);
OutputLogger out(this->Log, "p4_sync-out> ");
OutputLogger err(this->Log, "p4_sync-err> ");
diff --git a/Source/CTest/cmCTestP4.h b/Source/CTest/cmCTestP4.h
index e234efb..faeeaf2 100644
--- a/Source/CTest/cmCTestP4.h
+++ b/Source/CTest/cmCTestP4.h
@@ -3,7 +3,7 @@
#ifndef cmCTestP4_h
#define cmCTestP4_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGlobalVC.h"
diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h
index 5989fa0..157710a 100644
--- a/Source/CTest/cmCTestReadCustomFilesCommand.h
+++ b/Source/CTest/cmCTestReadCustomFilesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestReadCustomFilesCommand_h
#define cmCTestReadCustomFilesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h
index 9bd0965..9821c2e 100644
--- a/Source/CTest/cmCTestRunScriptCommand.h
+++ b/Source/CTest/cmCTestRunScriptCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestRunScriptCommand_h
#define cmCTestRunScriptCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 0c4269e..1a339b7 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -9,7 +9,6 @@
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
-#include "cmConfigure.h"
#include "cm_curl.h"
#include "cm_zlib.h"
#include "cmsys/Base64.h"
@@ -25,12 +24,12 @@ cmCTestRunTest::cmCTestRunTest(cmCTestTestHandler* handler)
{
this->CTest = handler->CTest;
this->TestHandler = handler;
- this->TestProcess = CM_NULLPTR;
+ this->TestProcess = nullptr;
this->TestResult.ExecutionTime = 0;
this->TestResult.ReturnValue = 0;
this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
this->TestResult.TestCount = 0;
- this->TestResult.Properties = CM_NULLPTR;
+ this->TestResult.Properties = nullptr;
this->ProcessOutput = "";
this->CompressedOutput = "";
this->CompressionRatio = 2;
@@ -237,6 +236,8 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
} else if (res == cmsysProcess_State_Exception) {
outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure;
cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Exception: ");
+ this->TestResult.ExceptionStatus =
+ this->TestProcess->GetExitExceptionString();
switch (this->TestProcess->GetExitException()) {
case cmsysProcess_Exception_Fault:
cmCTestLog(this->CTest, HANDLER_OUTPUT, "SegFault");
@@ -255,7 +256,8 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
this->TestResult.Status = cmCTestTestHandler::NUMERICAL;
break;
default:
- cmCTestLog(this->CTest, HANDLER_OUTPUT, "Other");
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ this->TestResult.ExceptionStatus);
this->TestResult.Status = cmCTestTestHandler::OTHER_FAULT;
}
} else if ("Disabled" == this->TestResult.CompletionStatus) {
@@ -618,7 +620,7 @@ double cmCTestRunTest::ResolveTimeout()
return timeout;
}
struct tm* lctime;
- time_t current_time = time(CM_NULLPTR);
+ time_t current_time = time(nullptr);
lctime = gmtime(&current_time);
int gm_hour = lctime->tm_hour;
time_t gm_time = mktime(lctime);
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index f60f78c..36582a2 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -290,7 +290,7 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
args.push_back(i->c_str());
}
- args.push_back(CM_NULLPTR);
+ args.push_back(nullptr);
if (strcmp(parameters[0], "update") == 0) {
return RunUpdateCommand(&args[0], out, err);
diff --git a/Source/CTest/cmCTestSVN.h b/Source/CTest/cmCTestSVN.h
index 46b0778..94af837 100644
--- a/Source/CTest/cmCTestSVN.h
+++ b/Source/CTest/cmCTestSVN.h
@@ -3,7 +3,7 @@
#ifndef cmCTestSVN_h
#define cmCTestSVN_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGlobalVC.h"
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 1d29dfa..6fd24a5 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -75,9 +75,9 @@ cmCTestScriptHandler::cmCTestScriptHandler()
this->Backup = false;
this->EmptyBinDir = false;
this->EmptyBinDirOnce = false;
- this->Makefile = CM_NULLPTR;
- this->CMake = CM_NULLPTR;
- this->GlobalGenerator = CM_NULLPTR;
+ this->Makefile = nullptr;
+ this->CMake = nullptr;
+ this->GlobalGenerator = nullptr;
this->ScriptStartTime = 0;
@@ -114,10 +114,10 @@ void cmCTestScriptHandler::Initialize()
this->ScriptStartTime = 0;
delete this->Makefile;
- this->Makefile = CM_NULLPTR;
+ this->Makefile = nullptr;
delete this->GlobalGenerator;
- this->GlobalGenerator = CM_NULLPTR;
+ this->GlobalGenerator = nullptr;
delete this->CMake;
}
@@ -193,7 +193,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
for (size_t i = 1; i < initArgs.size(); ++i) {
argv.push_back(initArgs[i].c_str());
}
- argv.push_back(CM_NULLPTR);
+ argv.push_back(nullptr);
// Now create process object
cmsysProcess* cp = cmsysProcess_New();
@@ -219,7 +219,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
}
// Properly handle output of the build command
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
int result = cmsysProcess_GetState(cp);
int retVal = 0;
bool failed = false;
@@ -394,7 +394,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
return 0;
}
-// extract variabels from the script to set ivars
+// extract variables from the script to set ivars
int cmCTestScriptHandler::ExtractVariables()
{
// Temporary variables
@@ -852,7 +852,7 @@ bool cmCTestScriptHandler::WriteInitialCache(const char* directory,
return false;
}
- if (text != CM_NULLPTR) {
+ if (text != nullptr) {
fout.write(text, strlen(text));
}
diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h
index 6678702..c2631ce 100644
--- a/Source/CTest/cmCTestScriptHandler.h
+++ b/Source/CTest/cmCTestScriptHandler.h
@@ -3,7 +3,7 @@
#ifndef cmCTestScriptHandler_h
#define cmCTestScriptHandler_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGenericHandler.h"
diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h
index f0b5f1e..ade9c96 100644
--- a/Source/CTest/cmCTestSleepCommand.h
+++ b/Source/CTest/cmCTestSleepCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestSleepCommand_h
#define cmCTestSleepCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx
index 01a874b..4f0d87b 100644
--- a/Source/CTest/cmCTestStartCommand.cxx
+++ b/Source/CTest/cmCTestStartCommand.cxx
@@ -29,12 +29,12 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
size_t cnt = 0;
const char* smodel = args[cnt].c_str();
- const char* src_dir = CM_NULLPTR;
- const char* bld_dir = CM_NULLPTR;
+ const char* src_dir = nullptr;
+ const char* bld_dir = nullptr;
cnt++;
- this->CTest->SetSpecificTrack(CM_NULLPTR);
+ this->CTest->SetSpecificTrack(nullptr);
if (cnt < args.size() - 1) {
if (args[cnt] == "TRACK") {
cnt++;
diff --git a/Source/CTest/cmCTestStartCommand.h b/Source/CTest/cmCTestStartCommand.h
index b4943f9..2e02838 100644
--- a/Source/CTest/cmCTestStartCommand.h
+++ b/Source/CTest/cmCTestStartCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestStartCommand_h
#define cmCTestStartCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index 409eb51..1794ca6 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -86,7 +86,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
extraFiles.end());
if (!this->CTest->SubmitExtraFiles(newExtraFiles)) {
this->SetError("problem submitting extra files.");
- return CM_NULLPTR;
+ return nullptr;
}
}
@@ -94,7 +94,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
this->CTest->GetInitializedHandler("submit");
if (!handler) {
this->SetError("internal CTest error. Cannot instantiate submit handler");
- return CM_NULLPTR;
+ return nullptr;
}
// If no FILES or PARTS given, *all* PARTS are submitted by default.
diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h
index cf65cdc..44f0d68 100644
--- a/Source/CTest/cmCTestSubmitCommand.h
+++ b/Source/CTest/cmCTestSubmitCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestSubmitCommand_h
#define cmCTestSubmitCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTest.h"
#include "cmCTestHandlerCommand.h"
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 8d62fa1..b7d0d1f 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -13,6 +13,7 @@
#include "cmCTest.h"
#include "cmCTestCurl.h"
#include "cmCTestScriptHandler.h"
+#include "cmCryptoHash.h"
#include "cmCurl.h"
#include "cmGeneratedFileStream.h"
#include "cmProcessOutput.h"
@@ -99,7 +100,7 @@ private:
static size_t cmCTestSubmitHandlerWriteMemoryCallback(void* ptr, size_t size,
size_t nmemb, void* data)
{
- int realsize = (int)(size * nmemb);
+ int realsize = static_cast<int>(size * nmemb);
cmCTestSubmitHandlerVectorOfChar* vec =
static_cast<cmCTestSubmitHandlerVectorOfChar*>(data);
@@ -144,7 +145,7 @@ void cmCTestSubmitHandler::Initialize()
this->HTTPProxyAuth = "";
this->FTPProxy = "";
this->FTPProxyType = 0;
- this->LogFile = CM_NULLPTR;
+ this->LogFile = nullptr;
this->Files.clear();
}
@@ -238,8 +239,8 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
/* we pass our 'chunk' struct to the callback function */
cmCTestSubmitHandlerVectorOfChar chunk;
cmCTestSubmitHandlerVectorOfChar chunkDebug;
- ::curl_easy_setopt(curl, CURLOPT_FILE, (void*)&chunk);
- ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void*)&chunkDebug);
+ ::curl_easy_setopt(curl, CURLOPT_FILE, &chunk);
+ ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug);
// Now run off and do what you've been told!
res = ::curl_easy_perform(curl);
@@ -303,7 +304,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
char error_buffer[1024];
// Set Content-Type to satisfy fussy modsecurity rules.
struct curl_slist* headers =
- ::curl_slist_append(CM_NULLPTR, "Content-Type: text/xml");
+ ::curl_slist_append(nullptr, "Content-Type: text/xml");
// Add any additional headers that the user specified.
for (std::vector<std::string>::const_iterator h = this->HttpHeaders.begin();
@@ -412,7 +413,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
case ' ':
case '=':
case '%':
- sprintf(hexCh, "%%%02X", (int)c);
+ sprintf(hexCh, "%%%02X", static_cast<int>(c));
ofile.append(hexCh);
break;
default:
@@ -428,10 +429,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) {
upload_as += "bad_md5sum";
} else {
- char md5[33];
- cmSystemTools::ComputeFileMD5(local_file, md5);
- md5[32] = 0;
- upload_as += md5;
+ upload_as +=
+ cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5);
}
if (!cmSystemTools::FileExists(local_file.c_str())) {
@@ -472,8 +471,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
/* we pass our 'chunk' struct to the callback function */
cmCTestSubmitHandlerVectorOfChar chunk;
cmCTestSubmitHandlerVectorOfChar chunkDebug;
- ::curl_easy_setopt(curl, CURLOPT_FILE, (void*)&chunk);
- ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void*)&chunkDebug);
+ ::curl_easy_setopt(curl, CURLOPT_FILE, &chunk);
+ ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug);
// Now run off and do what you've been told!
res = ::curl_easy_perform(curl);
@@ -496,10 +495,10 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
// If curl failed for any reason, or checksum fails, wait and retry
//
if (res != CURLE_OK || this->HasErrors) {
- std::string retryDelay = this->GetOption("RetryDelay") == CM_NULLPTR
+ std::string retryDelay = this->GetOption("RetryDelay") == nullptr
? ""
: this->GetOption("RetryDelay");
- std::string retryCount = this->GetOption("RetryCount") == CM_NULLPTR
+ std::string retryCount = this->GetOption("RetryCount") == nullptr
? ""
: this->GetOption("RetryCount");
@@ -668,8 +667,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set<std::string>& files,
/* we pass our 'chunk' struct to the callback function */
cmCTestSubmitHandlerVectorOfChar chunk;
cmCTestSubmitHandlerVectorOfChar chunkDebug;
- ::curl_easy_setopt(curl, CURLOPT_FILE, (void*)&chunk);
- ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void*)&chunkDebug);
+ ::curl_easy_setopt(curl, CURLOPT_FILE, &chunk);
+ ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug);
std::string rfile = remoteprefix + cmSystemTools::GetFilenameName(*file);
std::string ofile;
@@ -687,7 +686,7 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set<std::string>& files,
case ' ':
case '=':
case '%':
- sprintf(hexCh, "%%%02X", (int)c);
+ sprintf(hexCh, "%%%02X", static_cast<int>(c));
ofile.append(hexCh);
break;
default:
@@ -765,7 +764,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command,
argv.push_back(scp_command.c_str()); // Scp command
argv.push_back(scp_command.c_str()); // Dummy string for file
argv.push_back(scp_command.c_str()); // Dummy string for remote url
- argv.push_back(CM_NULLPTR);
+ argv.push_back(nullptr);
cmsysProcess* cp = cmsysProcess_New();
cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
@@ -798,7 +797,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command,
cmProcessOutput processOutput;
std::string strdata;
- while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) {
+ while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
processOutput.DecodeText(data, length, strdata);
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
cmCTestLogWrite(strdata.c_str(), strdata.size()),
@@ -811,7 +810,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command,
this->Quiet);
}
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
int result = cmsysProcess_GetState(cp);
@@ -949,8 +948,9 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
char remoteCommand[] = "Submit.put";
char* pRealURL = const_cast<char*>(realURL.c_str());
- result = xmlrpc_client_call(&env, pRealURL, remoteCommand, "(6)",
- fileBuffer, (xmlrpc_int32)fileSize);
+ result =
+ xmlrpc_client_call(&env, pRealURL, remoteCommand, "(6)", fileBuffer,
+ static_cast<xmlrpc_int32>(fileSize));
delete[] fileBuffer;
@@ -1037,10 +1037,10 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
bool internalTest = cmSystemTools::IsOn(this->GetOption("InternalTest"));
// Get RETRY_COUNT and RETRY_DELAY values if they were set.
- std::string retryDelayString = this->GetOption("RetryDelay") == CM_NULLPTR
+ std::string retryDelayString = this->GetOption("RetryDelay") == nullptr
? ""
: this->GetOption("RetryDelay");
- std::string retryCountString = this->GetOption("RetryCount") == CM_NULLPTR
+ std::string retryCountString = this->GetOption("RetryCount") == nullptr
? ""
: this->GetOption("RetryCount");
unsigned long retryDelay = 0;
@@ -1058,9 +1058,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
}
}
- char md5sum[33];
- md5sum[32] = 0;
- cmSystemTools::ComputeFileMD5(file, md5sum);
+ std::string md5sum =
+ cmSystemTools::ComputeFileHash(file, cmCryptoHash::AlgoMD5);
// 1. request the buildid and check to see if the file
// has already been uploaded
// TODO I added support for subproject. You would need to add
@@ -1084,8 +1083,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
<< "site=" << curl.Escape(this->CTest->GetCTestConfiguration("Site"))
<< "&"
<< "track=" << curl.Escape(this->CTest->GetTestModelString()) << "&"
- << "starttime=" << (int)cmSystemTools::GetTime() << "&"
- << "endtime=" << (int)cmSystemTools::GetTime() << "&"
+ << "starttime=" << static_cast<int>(cmSystemTools::GetTime()) << "&"
+ << "endtime=" << static_cast<int>(cmSystemTools::GetTime()) << "&"
<< "datafilesmd5[0]=" << md5sum << "&"
<< "type=" << curl.Escape(typeString);
std::string fields = str.str();
diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h
index 2923f4f..7b409fb 100644
--- a/Source/CTest/cmCTestSubmitHandler.h
+++ b/Source/CTest/cmCTestSubmitHandler.h
@@ -3,7 +3,7 @@
#ifndef cmCTestSubmitHandler_h
#define cmCTestSubmitHandler_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTest.h"
#include "cmCTestGenericHandler.h"
@@ -25,7 +25,7 @@ public:
typedef cmCTestGenericHandler Superclass;
cmCTestSubmitHandler();
- ~cmCTestSubmitHandler() CM_OVERRIDE { this->LogFile = CM_NULLPTR; }
+ ~cmCTestSubmitHandler() CM_OVERRIDE { this->LogFile = nullptr; }
/*
* The main entry point for this class
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index 075b140..febd39e 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -27,7 +27,7 @@ cmCTestTestCommand::cmCTestTestCommand()
this->Arguments[ctt_SCHEDULE_RANDOM] = "SCHEDULE_RANDOM";
this->Arguments[ctt_STOP_TIME] = "STOP_TIME";
this->Arguments[ctt_TEST_LOAD] = "TEST_LOAD";
- this->Arguments[ctt_LAST] = CM_NULLPTR;
+ this->Arguments[ctt_LAST] = nullptr;
this->Last = ctt_LAST;
}
@@ -124,6 +124,12 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
}
handler->SetTestLoad(testLoad);
+ if (const char* labelsForSubprojects =
+ this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
+ this->CTest->SetCTestConfiguration("LabelsForSubprojects",
+ labelsForSubprojects, this->Quiet);
+ }
+
handler->SetQuiet(this->Quiet);
return handler;
}
diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h
index be7e783..e8c8c60 100644
--- a/Source/CTest/cmCTestTestCommand.h
+++ b/Source/CTest/cmCTestTestCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestTestCommand_h
#define cmCTestTestCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 674be60..57075c7 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1,12 +1,10 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestTestHandler.h"
-
-#include "cmsys/Base64.h"
-#include "cmsys/Directory.hxx"
-#include "cmsys/FStream.hxx"
-#include "cmsys/RegularExpression.hxx"
#include <algorithm>
+#include <cmsys/Base64.h>
+#include <cmsys/Directory.hxx>
+#include <cmsys/RegularExpression.hxx>
#include <functional>
#include <iomanip>
#include <iterator>
@@ -33,6 +31,7 @@
#include "cm_auto_ptr.hxx"
#include "cm_utf8.h"
#include "cmake.h"
+#include "cmsys/FStream.hxx"
class cmExecutionStatus;
@@ -238,6 +237,36 @@ bool cmCTestSetTestsPropertiesCommand::InitialPass(
return this->TestHandler->SetTestsProperties(args);
}
+class cmCTestSetDirectoryPropertiesCommand : public cmCommand
+{
+public:
+ /**
+ * This is a virtual constructor for the command.
+ */
+ cmCommand* Clone() CM_OVERRIDE
+ {
+ cmCTestSetDirectoryPropertiesCommand* c =
+ new cmCTestSetDirectoryPropertiesCommand;
+ c->TestHandler = this->TestHandler;
+ return c;
+ }
+
+ /**
+ * This is called when the command is first encountered in
+ * the CMakeLists.txt file.
+ */
+ bool InitialPass(std::vector<std::string> const& /*unused*/,
+ cmExecutionStatus& /*unused*/) CM_OVERRIDE;
+
+ cmCTestTestHandler* TestHandler;
+};
+
+bool cmCTestSetDirectoryPropertiesCommand::InitialPass(
+ std::vector<std::string> const& args, cmExecutionStatus&)
+{
+ return this->TestHandler->SetDirectoryProperties(args);
+}
+
// get the next number in a string with numbers separated by ,
// pos is the start of the search and pos2 is the end of the search
// pos becomes pos2 after a call to GetNextNumber.
@@ -305,7 +334,7 @@ cmCTestTestHandler::cmCTestTestHandler()
this->MemCheck = false;
- this->LogFile = CM_NULLPTR;
+ this->LogFile = nullptr;
// regex to detect <DartMeasurement>...</DartMeasurement>
this->DartStuff.compile("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)");
@@ -506,11 +535,16 @@ int cmCTestTestHandler::ProcessHandler()
<< static_cast<int>(percent + .5f) << "% tests passed, "
<< failed.size() << " tests failed out of " << total
<< std::endl);
- if (this->CTest->GetLabelSummary()) {
+
+ if (!this->CTest->GetLabelsForSubprojects().empty() &&
+ this->CTest->GetSubprojectSummary()) {
+ this->PrintSubprojectSummary();
+ } else if (this->CTest->GetLabelSummary()) {
this->PrintLabelSummary();
}
+
char realBuf[1024];
- sprintf(realBuf, "%6.2f sec", (double)(clock_finish - clock_start));
+ sprintf(realBuf, "%6.2f sec", clock_finish - clock_start);
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
"\nTotal Test time (real) = " << realBuf << "\n",
this->Quiet);
@@ -549,10 +583,10 @@ int cmCTestTestHandler::ProcessHandler()
!cmHasLiteralPrefix(ftit->CompletionStatus, "SKIP_RETURN_CODE=") &&
ftit->CompletionStatus != "Disabled") {
ofs << ftit->TestCount << ":" << ftit->Name << std::endl;
- cmCTestLog(
- this->CTest, HANDLER_OUTPUT, "\t"
- << std::setw(3) << ftit->TestCount << " - " << ftit->Name << " ("
- << this->GetTestStatus(ftit->Status) << ")" << std::endl);
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, "\t"
+ << std::setw(3) << ftit->TestCount << " - "
+ << ftit->Name << " (" << this->GetTestStatus(&*ftit)
+ << ")" << std::endl);
}
}
}
@@ -566,7 +600,7 @@ int cmCTestTestHandler::ProcessHandler()
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create "
<< (this->MemCheck ? "memory check" : "testing")
<< " XML file" << std::endl);
- this->LogFile = CM_NULLPTR;
+ this->LogFile = nullptr;
return 1;
}
cmXMLWriter xml(xmlfile);
@@ -574,15 +608,15 @@ int cmCTestTestHandler::ProcessHandler()
}
if (!this->PostProcessHandler()) {
- this->LogFile = CM_NULLPTR;
+ this->LogFile = nullptr;
return -1;
}
if (!failed.empty()) {
- this->LogFile = CM_NULLPTR;
+ this->LogFile = nullptr;
return -1;
}
- this->LogFile = CM_NULLPTR;
+ this->LogFile = nullptr;
return 0;
}
@@ -658,6 +692,84 @@ void cmCTestTestHandler::PrintLabelSummary()
}
}
+void cmCTestTestHandler::PrintSubprojectSummary()
+{
+ std::vector<std::string> subprojects =
+ this->CTest->GetLabelsForSubprojects();
+
+ cmCTestTestHandler::ListOfTests::iterator it = this->TestList.begin();
+ std::map<std::string, double> labelTimes;
+ std::map<std::string, int> labelCounts;
+ std::set<std::string> labels;
+ // initialize maps
+ std::string::size_type maxlen = 0;
+ for (; it != this->TestList.end(); ++it) {
+ cmCTestTestProperties& p = *it;
+ for (std::vector<std::string>::iterator l = p.Labels.begin();
+ l != p.Labels.end(); ++l) {
+ std::vector<std::string>::iterator subproject =
+ std::find(subprojects.begin(), subprojects.end(), *l);
+ if (subproject != subprojects.end()) {
+ if ((*l).size() > maxlen) {
+ maxlen = (*l).size();
+ }
+ labels.insert(*l);
+ labelTimes[*l] = 0;
+ labelCounts[*l] = 0;
+ }
+ }
+ }
+ cmCTestTestHandler::TestResultsVector::iterator ri =
+ this->TestResults.begin();
+ // fill maps
+ for (; ri != this->TestResults.end(); ++ri) {
+ cmCTestTestResult& result = *ri;
+ cmCTestTestProperties& p = *result.Properties;
+ for (std::vector<std::string>::iterator l = p.Labels.begin();
+ l != p.Labels.end(); ++l) {
+ std::vector<std::string>::iterator subproject =
+ std::find(subprojects.begin(), subprojects.end(), *l);
+ if (subproject != subprojects.end()) {
+ labelTimes[*l] += result.ExecutionTime;
+ ++labelCounts[*l];
+ }
+ }
+ }
+ // now print times
+ if (!labels.empty()) {
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ "\nSubproject Time Summary:", this->Quiet);
+ }
+ for (std::set<std::string>::const_iterator i = labels.begin();
+ i != labels.end(); ++i) {
+ std::string label = *i;
+ label.resize(maxlen + 3, ' ');
+
+ char buf[1024];
+ sprintf(buf, "%6.2f sec", labelTimes[*i]);
+
+ std::ostringstream labelCountStr;
+ labelCountStr << "(" << labelCounts[*i] << " test";
+ if (labelCounts[*i] > 1) {
+ labelCountStr << "s";
+ }
+ labelCountStr << ")";
+
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "\n"
+ << label << " = " << buf << " "
+ << labelCountStr.str(),
+ this->Quiet);
+ if (this->LogFile) {
+ *this->LogFile << "\n" << *i << " = " << buf << "\n";
+ }
+ }
+ if (!labels.empty()) {
+ if (this->LogFile) {
+ *this->LogFile << "\n";
+ }
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "\n", this->Quiet);
+ }
+}
void cmCTestTestHandler::CheckLabelFilterInclude(cmCTestTestProperties& it)
{
// if not using Labels to filter then return
@@ -739,7 +851,7 @@ void cmCTestTestHandler::ComputeTestList()
}
// expand the test list based on the union flag
if (this->UseUnion) {
- this->ExpandTestsToRunInformation((int)tmsize);
+ this->ExpandTestsToRunInformation(static_cast<int>(tmsize));
} else {
this->ExpandTestsToRunInformation(inREcnt);
}
@@ -1215,7 +1327,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed,
bool randomSchedule = this->CTest->GetScheduleType() == "Random";
if (randomSchedule) {
- srand((unsigned)time(CM_NULLPTR));
+ srand(static_cast<unsigned>(time(nullptr)));
}
for (ListOfTests::iterator it = this->TestList.begin();
@@ -1277,6 +1389,7 @@ void cmCTestTestHandler::GenerateDartOutput(cmXMLWriter& xml)
}
this->CTest->StartXML(xml, this->AppendXML);
+ this->CTest->GenerateSubprojectsOutput(xml);
xml.StartElement("Testing");
xml.Element("StartDateTime", this->StartTest);
xml.Element("StartTestTime", this->StartTestTime);
@@ -1299,7 +1412,7 @@ void cmCTestTestHandler::GenerateDartOutput(cmXMLWriter& xml)
xml.StartElement("NamedMeasurement");
xml.Attribute("type", "text/string");
xml.Attribute("name", "Exit Code");
- xml.Element("Value", this->GetTestStatus(result->Status));
+ xml.Element("Value", this->GetTestStatus(result));
xml.EndElement(); // NamedMeasurement
xml.StartElement("NamedMeasurement");
@@ -1328,6 +1441,12 @@ void cmCTestTestHandler::GenerateDartOutput(cmXMLWriter& xml)
}
xml.StartElement("NamedMeasurement");
+ xml.Attribute("type", "numeric/double");
+ xml.Attribute("name", "Processors");
+ xml.Element("Value", result->Properties->Processors);
+ xml.EndElement(); // NamedMeasurement
+
+ xml.StartElement("NamedMeasurement");
xml.Attribute("type", "text/string");
xml.Attribute("name", "Completion Status");
xml.Element("Value", result->CompletionStatus);
@@ -1437,8 +1556,8 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<std::string>& vec)
int retVal = 0;
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Run command: " << *it << std::endl, this->Quiet);
- if (!cmSystemTools::RunSingleCommand(it->c_str(), CM_NULLPTR, CM_NULLPTR,
- &retVal, CM_NULLPTR,
+ if (!cmSystemTools::RunSingleCommand(it->c_str(), nullptr, nullptr,
+ &retVal, nullptr,
cmSystemTools::OUTPUT_MERGE
/*this->Verbose*/) ||
retVal != 0) {
@@ -1660,6 +1779,12 @@ void cmCTestTestHandler::GetListOfTests()
newCom4->TestHandler = this;
cm.GetState()->AddBuiltinCommand("set_tests_properties", newCom4);
+ // Add handler for SET_DIRECTORY_PROPERTIES
+ cmCTestSetDirectoryPropertiesCommand* newCom5 =
+ new cmCTestSetDirectoryPropertiesCommand;
+ newCom5->TestHandler = this;
+ cm.GetState()->AddBuiltinCommand("set_directory_properties", newCom5);
+
const char* testFilename;
if (cmSystemTools::FileExists("CTestTestfile.cmake")) {
// does the CTestTestfile.cmake exist ?
@@ -1693,17 +1818,20 @@ void cmCTestTestHandler::UseExcludeRegExp()
this->UseExcludeRegExpFirst = !this->UseIncludeRegExpFlag;
}
-const char* cmCTestTestHandler::GetTestStatus(int status)
+const char* cmCTestTestHandler::GetTestStatus(const cmCTestTestResult* result)
{
static const char* statuses[] = { "Not Run", "Timeout", "SEGFAULT",
"ILLEGAL", "INTERRUPT", "NUMERICAL",
"OTHER_FAULT", "Failed", "BAD_COMMAND",
"Completed" };
-
+ int status = result->Status;
if (status < cmCTestTestHandler::NOT_RUN ||
status > cmCTestTestHandler::COMPLETED) {
return "No Status";
}
+ if (status == cmCTestTestHandler::OTHER_FAULT) {
+ return result->ExceptionStatus.c_str();
+ }
return statuses[status];
}
@@ -2171,7 +2299,16 @@ bool cmCTestTestHandler::SetTestsProperties(
cmSystemTools::ExpandListArgument(val, rtit->Environment);
}
if (key == "LABELS") {
- cmSystemTools::ExpandListArgument(val, rtit->Labels);
+ std::vector<std::string> Labels;
+ cmSystemTools::ExpandListArgument(val, Labels);
+ rtit->Labels.insert(rtit->Labels.end(), Labels.begin(),
+ Labels.end());
+ // sort the array
+ std::sort(rtit->Labels.begin(), rtit->Labels.end());
+ // remove duplicates
+ std::vector<std::string>::iterator new_end =
+ std::unique(rtit->Labels.begin(), rtit->Labels.end());
+ rtit->Labels.erase(new_end, rtit->Labels.end());
}
if (key == "MEASUREMENT") {
size_t pos = val.find_first_of('=');
@@ -2224,6 +2361,54 @@ bool cmCTestTestHandler::SetTestsProperties(
return true;
}
+bool cmCTestTestHandler::SetDirectoryProperties(
+ const std::vector<std::string>& args)
+{
+ std::vector<std::string>::const_iterator it;
+ std::vector<std::string> tests;
+ bool found = false;
+ for (it = args.begin(); it != args.end(); ++it) {
+ if (*it == "PROPERTIES") {
+ found = true;
+ break;
+ }
+ tests.push_back(*it);
+ }
+
+ if (!found) {
+ return false;
+ }
+ ++it; // skip PROPERTIES
+ for (; it != args.end(); ++it) {
+ std::string key = *it;
+ ++it;
+ if (it == args.end()) {
+ break;
+ }
+ std::string val = *it;
+ cmCTestTestHandler::ListOfTests::iterator rtit;
+ for (rtit = this->TestList.begin(); rtit != this->TestList.end(); ++rtit) {
+ std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
+ if (cwd == rtit->Directory) {
+ if (key == "LABELS") {
+ std::vector<std::string> DirectoryLabels;
+ cmSystemTools::ExpandListArgument(val, DirectoryLabels);
+ rtit->Labels.insert(rtit->Labels.end(), DirectoryLabels.begin(),
+ DirectoryLabels.end());
+
+ // sort the array
+ std::sort(rtit->Labels.begin(), rtit->Labels.end());
+ // remove duplicates
+ std::vector<std::string>::iterator new_end =
+ std::unique(rtit->Labels.begin(), rtit->Labels.end());
+ rtit->Labels.erase(new_end, rtit->Labels.end());
+ }
+ }
+ }
+ }
+ return true;
+}
+
bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
{
const std::string& testname = args[0];
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 0edcb14..d8627b1 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -3,7 +3,7 @@
#ifndef cmCTestTestHandler_h
#define cmCTestTestHandler_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGenericHandler.h"
@@ -90,6 +90,11 @@ public:
*/
bool SetTestsProperties(const std::vector<std::string>& args);
+ /**
+ * Set directory properties
+ */
+ bool SetDirectoryProperties(const std::vector<std::string>& args);
+
void Initialize() CM_OVERRIDE;
// NOTE: This struct is Saved/Restored
@@ -144,6 +149,7 @@ public:
double ExecutionTime;
int ReturnValue;
int Status;
+ std::string ExceptionStatus;
bool CompressOutput;
std::string CompletionStatus;
std::string Output;
@@ -227,6 +233,8 @@ private:
virtual void GenerateDartOutput(cmXMLWriter& xml);
void PrintLabelSummary();
+ void PrintSubprojectSummary();
+
/**
* Run the tests for a directory and any subdirectories
*/
@@ -262,7 +270,7 @@ private:
*/
std::string FindTheExecutable(const char* exe);
- const char* GetTestStatus(int status);
+ const char* GetTestStatus(const cmCTestTestResult*);
void ExpandTestsToRunInformation(size_t numPossibleTests);
void ExpandTestsToRunInformationForRerunFailed();
diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx
index 8c03754..3d800f8 100644
--- a/Source/CTest/cmCTestUpdateCommand.cxx
+++ b/Source/CTest/cmCTestUpdateCommand.cxx
@@ -78,12 +78,12 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
this->CTest->GetInitializedHandler("update");
if (!handler) {
this->SetError("internal CTest error. Cannot instantiate update handler");
- return CM_NULLPTR;
+ return nullptr;
}
handler->SetCommand(this);
if (source_dir.empty()) {
this->SetError("source directory not specified. Please use SOURCE tag");
- return CM_NULLPTR;
+ return nullptr;
}
handler->SetOption("SourceDirectory", source_dir.c_str());
handler->SetQuiet(this->Quiet);
diff --git a/Source/CTest/cmCTestUpdateCommand.h b/Source/CTest/cmCTestUpdateCommand.h
index 3b8f0a6..ac8e85c 100644
--- a/Source/CTest/cmCTestUpdateCommand.h
+++ b/Source/CTest/cmCTestUpdateCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestUpdateCommand_h
#define cmCTestUpdateCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestHandlerCommand.h"
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index e08a9b7..0504f90 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -309,7 +309,7 @@ bool cmCTestUpdateHandler::SelectVCS()
// If no update command was specified, lookup one for this VCS tool.
if (this->UpdateCommand.empty()) {
- const char* key = CM_NULLPTR;
+ const char* key = nullptr;
switch (this->UpdateType) {
case e_CVS:
key = "CVSCommand";
diff --git a/Source/CTest/cmCTestUpdateHandler.h b/Source/CTest/cmCTestUpdateHandler.h
index 0cd2844..5e7237c 100644
--- a/Source/CTest/cmCTestUpdateHandler.h
+++ b/Source/CTest/cmCTestUpdateHandler.h
@@ -3,7 +3,7 @@
#ifndef cmCTestUpdateHandler_h
#define cmCTestUpdateHandler_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestGenericHandler.h"
diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx
index 717117a..d85f35f 100644
--- a/Source/CTest/cmCTestUploadCommand.cxx
+++ b/Source/CTest/cmCTestUploadCommand.cxx
@@ -18,7 +18,7 @@ cmCTestGenericHandler* cmCTestUploadCommand::InitializeHandler()
this->CTest->GetInitializedHandler("upload");
if (!handler) {
this->SetError("internal CTest error. Cannot instantiate upload handler");
- return CM_NULLPTR;
+ return nullptr;
}
static_cast<cmCTestUploadHandler*>(handler)->SetFiles(this->Files);
diff --git a/Source/CTest/cmCTestUploadCommand.h b/Source/CTest/cmCTestUploadCommand.h
index 6e72179..e8e882f 100644
--- a/Source/CTest/cmCTestUploadCommand.h
+++ b/Source/CTest/cmCTestUploadCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCTestUploadCommand_h
#define cmCTestUploadCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTest.h"
#include "cmCTestHandlerCommand.h"
diff --git a/Source/CTest/cmCTestUploadHandler.h b/Source/CTest/cmCTestUploadHandler.h
index 1e8d3c8..3dc9c10 100644
--- a/Source/CTest/cmCTestUploadHandler.h
+++ b/Source/CTest/cmCTestUploadHandler.h
@@ -3,7 +3,7 @@
#ifndef cmCTestUploadHandler_h
#define cmCTestUploadHandler_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTest.h"
#include "cmCTestGenericHandler.h"
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index fb2742e..186d2d4 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -60,7 +60,7 @@ bool cmCTestVC::InitialCheckout(const char* command)
ai != args.end(); ++ai) {
vc_co.push_back(ai->c_str());
}
- vc_co.push_back(CM_NULLPTR);
+ vc_co.push_back(nullptr);
// Run the initial checkout command and log its output.
this->Log << "--- Begin Initial Checkout ---\n";
@@ -113,7 +113,7 @@ bool cmCTestVC::RunUpdateCommand(char const* const* cmd, OutputParser* out,
}
// Run the command.
- return this->RunChild(cmd, out, err, CM_NULLPTR, encoding);
+ return this->RunChild(cmd, out, err, nullptr, encoding);
}
std::string cmCTestVC::GetNightlyTime()
diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h
index 6400bcd..69a3bf0 100644
--- a/Source/CTest/cmCTestVC.h
+++ b/Source/CTest/cmCTestVC.h
@@ -3,7 +3,7 @@
#ifndef cmCTestVC_h
#define cmCTestVC_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <string>
@@ -100,8 +100,8 @@ protected:
Revision const* PriorRev;
File()
: Status(PathUpdated)
- , Rev(CM_NULLPTR)
- , PriorRev(CM_NULLPTR)
+ , Rev(nullptr)
+ , PriorRev(nullptr)
{
}
File(PathStatus status, Revision const* rev, Revision const* priorRev)
@@ -117,12 +117,12 @@ protected:
/** Run a command line and send output to given parsers. */
bool RunChild(char const* const* cmd, OutputParser* out, OutputParser* err,
- const char* workDir = CM_NULLPTR,
+ const char* workDir = nullptr,
Encoding encoding = cmProcessOutput::Auto);
/** Run VC update command line and send output to given parsers. */
bool RunUpdateCommand(char const* const* cmd, OutputParser* out,
- OutputParser* err = CM_NULLPTR,
+ OutputParser* err = nullptr,
Encoding encoding = cmProcessOutput::Auto);
/** Write xml element for one file. */
diff --git a/Source/CTest/cmParseCacheCoverage.h b/Source/CTest/cmParseCacheCoverage.h
index 005d272..7b0442a 100644
--- a/Source/CTest/cmParseCacheCoverage.h
+++ b/Source/CTest/cmParseCacheCoverage.h
@@ -3,7 +3,7 @@
#ifndef cmParseCacheCoverage_h
#define cmParseCacheCoverage_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmParseMumpsCoverage.h"
diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx
index ba55cd7..4a16a48 100644
--- a/Source/CTest/cmParseCoberturaCoverage.cxx
+++ b/Source/CTest/cmParseCoberturaCoverage.cxx
@@ -5,7 +5,6 @@
#include "cmSystemTools.h"
#include "cmXMLParser.h"
-#include "cmConfigure.h"
#include "cmsys/FStream.hxx"
#include <stdlib.h>
#include <string.h>
diff --git a/Source/CTest/cmParseGTMCoverage.h b/Source/CTest/cmParseGTMCoverage.h
index c4949d4..81766f9 100644
--- a/Source/CTest/cmParseGTMCoverage.h
+++ b/Source/CTest/cmParseGTMCoverage.h
@@ -3,7 +3,7 @@
#ifndef cmParseGTMCoverage_h
#define cmParseGTMCoverage_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmParseMumpsCoverage.h"
diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx
index d15864a..6d884ef 100644
--- a/Source/CTest/cmParseJacocoCoverage.cxx
+++ b/Source/CTest/cmParseJacocoCoverage.cxx
@@ -1,7 +1,5 @@
#include "cmParseJacocoCoverage.h"
-#include "cmConfigure.h"
-
#include "cmCTest.h"
#include "cmCTestCoverageHandler.h"
#include "cmSystemTools.h"
diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx
index eb29f55..8cb1170 100644
--- a/Source/CTest/cmParseMumpsCoverage.cxx
+++ b/Source/CTest/cmParseMumpsCoverage.cxx
@@ -4,7 +4,6 @@
#include "cmCTestCoverageHandler.h"
#include "cmSystemTools.h"
-#include "cmConfigure.h"
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
#include <map>
@@ -135,8 +134,8 @@ bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine,
return true;
}
// try some alternate names
- const char* tryname[] = { "GUX", "GTM", "ONT", CM_NULLPTR };
- for (int k = 0; tryname[k] != CM_NULLPTR; k++) {
+ const char* tryname[] = { "GUX", "GTM", "ONT", nullptr };
+ for (int k = 0; tryname[k] != nullptr; k++) {
std::string routine2 = routine + tryname[k];
i = this->RoutineToDirectory.find(routine2);
if (i != this->RoutineToDirectory.end()) {
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index f4ec6da..5ada25d 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -2,14 +2,13 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmProcess.h"
-#include "cmConfigure.h"
#include "cmProcessOutput.h"
#include "cmSystemTools.h"
#include <iostream>
cmProcess::cmProcess()
{
- this->Process = CM_NULLPTR;
+ this->Process = nullptr;
this->Timeout = 0;
this->TotalTime = 0;
this->ExitValue = 0;
@@ -45,7 +44,7 @@ bool cmProcess::StartProcess()
i != this->Arguments.end(); ++i) {
this->ProcessArgs.push_back(i->c_str());
}
- this->ProcessArgs.push_back(CM_NULLPTR); // null terminate the list
+ this->ProcessArgs.push_back(nullptr); // null terminate the list
this->Process = cmsysProcess_New();
cmsysProcess_SetCommand(this->Process, &*this->ProcessArgs.begin());
if (!this->WorkingDirectory.empty()) {
@@ -240,3 +239,8 @@ int cmProcess::GetExitException()
{
return cmsysProcess_GetExitException(this->Process);
}
+
+std::string cmProcess::GetExitExceptionString()
+{
+ return cmsysProcess_GetExceptionString(this->Process);
+}
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index 86e905a..dfb02fe 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -38,6 +38,7 @@ public:
int GetExitValue() { return this->ExitValue; }
double GetTotalTime() { return this->TotalTime; }
int GetExitException();
+ std::string GetExitExceptionString();
/**
* Read one line of output but block for no more than timeout.
* Returns:
diff --git a/Source/Checks/cm_cxx_attribute_fallthrough.cxx b/Source/Checks/cm_cxx_attribute_fallthrough.cxx
index df43625..50605b7 100644
--- a/Source/Checks/cm_cxx_attribute_fallthrough.cxx
+++ b/Source/Checks/cm_cxx_attribute_fallthrough.cxx
@@ -1,4 +1,4 @@
-int main(int argc, char* argv[])
+int main(int argc, char* [])
{
int i = 3;
switch (argc) {
diff --git a/Source/Checks/cm_cxx_fallthrough.cxx b/Source/Checks/cm_cxx_fallthrough.cxx
index 7b35a5f..2825bed 100644
--- a/Source/Checks/cm_cxx_fallthrough.cxx
+++ b/Source/Checks/cm_cxx_fallthrough.cxx
@@ -1,4 +1,4 @@
-int main(int argc, char* argv[])
+int main(int argc, char* [])
{
int i = 3;
switch (argc) {
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 3b08025..7f2b8a0 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -51,8 +51,5 @@ cm_check_cxx_feature(make_unique)
if(CMake_HAVE_CXX_MAKE_UNIQUE)
set(CMake_HAVE_CXX_UNIQUE_PTR 1)
endif()
-cm_check_cxx_feature(nullptr)
cm_check_cxx_feature(override)
cm_check_cxx_feature(unique_ptr)
-cm_check_cxx_feature(unordered_map)
-cm_check_cxx_feature(unordered_set)
diff --git a/Source/Checks/cm_cxx_gnu_fallthrough.cxx b/Source/Checks/cm_cxx_gnu_fallthrough.cxx
index 6021094..ebc15f4 100644
--- a/Source/Checks/cm_cxx_gnu_fallthrough.cxx
+++ b/Source/Checks/cm_cxx_gnu_fallthrough.cxx
@@ -1,4 +1,4 @@
-int main(int argc, char* argv[])
+int main(int argc, char* [])
{
int i = 3;
switch (argc) {
diff --git a/Source/Checks/cm_cxx_nullptr.cxx b/Source/Checks/cm_cxx_nullptr.cxx
deleted file mode 100644
index 500684a..0000000
--- a/Source/Checks/cm_cxx_nullptr.cxx
+++ /dev/null
@@ -1,14 +0,0 @@
-int test(int)
-{
- return -1;
-}
-
-int test(int*)
-{
- return 0;
-}
-
-int main()
-{
- return test(nullptr);
-}
diff --git a/Source/Checks/cm_cxx_unordered_map.cxx b/Source/Checks/cm_cxx_unordered_map.cxx
deleted file mode 100644
index be3de25..0000000
--- a/Source/Checks/cm_cxx_unordered_map.cxx
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <unordered_map>
-int main()
-{
- std::unordered_map<int, int> map;
- map[0] = 0;
- return 0;
-}
diff --git a/Source/Checks/cm_cxx_unordered_set.cxx b/Source/Checks/cm_cxx_unordered_set.cxx
deleted file mode 100644
index de4bb77..0000000
--- a/Source/Checks/cm_cxx_unordered_set.cxx
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <unordered_set>
-int main()
-{
- std::unordered_set<int> set;
- set.insert(0);
- return 0;
-}
diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt
index c5ac1f1..6023c83 100644
--- a/Source/CursesDialog/CMakeLists.txt
+++ b/Source/CursesDialog/CMakeLists.txt
@@ -17,10 +17,6 @@ set( CURSES_SRCS
CursesDialog/ccmake
)
-if( NOT CMAKE_USE_SYSTEM_FORM )
- include_directories(${CMake_SOURCE_DIR}/Source/CursesDialog/form
- ${CMake_BINARY_DIR}/Source/CursesDialog/form)
-endif()
include_directories(${CURSES_INCLUDE_PATH})
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index 28a0e95..97d5579 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -1,6 +1,5 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmConfigure.h"
#include "cmCursesForm.h"
#include "cmCursesMainForm.h"
@@ -18,30 +17,29 @@
#include <vector>
static const char* cmDocumentationName[][2] = {
- { CM_NULLPTR, " ccmake - Curses Interface for CMake." },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, " ccmake - Curses Interface for CMake." },
+ { nullptr, nullptr }
};
static const char* cmDocumentationUsage[][2] = {
- { CM_NULLPTR, " ccmake <path-to-source>\n"
- " ccmake <path-to-existing-build>" },
- { CM_NULLPTR,
- "Specify a source directory to (re-)generate a build system for "
- "it in the current working directory. Specify an existing build "
- "directory to re-generate its build system." },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, " ccmake <path-to-source>\n"
+ " ccmake <path-to-existing-build>" },
+ { nullptr, "Specify a source directory to (re-)generate a build system for "
+ "it in the current working directory. Specify an existing build "
+ "directory to re-generate its build system." },
+ { nullptr, nullptr }
};
static const char* cmDocumentationUsageNote[][2] = {
- { CM_NULLPTR, "Run 'ccmake --help' for more information." },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, "Run 'ccmake --help' for more information." },
+ { nullptr, nullptr }
};
static const char* cmDocumentationOptions[]
[2] = { CMAKE_STANDARD_OPTIONS_TABLE,
- { CM_NULLPTR, CM_NULLPTR } };
+ { nullptr, nullptr } };
-cmCursesForm* cmCursesForm::CurrentForm = CM_NULLPTR;
+cmCursesForm* cmCursesForm::CurrentForm = nullptr;
extern "C" {
@@ -169,7 +167,7 @@ int main(int argc, char const* const* argv)
touchwin(stdscr);
endwin();
delete cmCursesForm::CurrentForm;
- cmCursesForm::CurrentForm = CM_NULLPTR;
+ cmCursesForm::CurrentForm = nullptr;
std::cout << std::endl << std::endl;
diff --git a/Source/CursesDialog/cmCursesBoolWidget.h b/Source/CursesDialog/cmCursesBoolWidget.h
index 90bcc22..bd565cd 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.h
+++ b/Source/CursesDialog/cmCursesBoolWidget.h
@@ -3,7 +3,7 @@
#ifndef cmCursesBoolWidget_h
#define cmCursesBoolWidget_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCursesStandardIncludes.h"
#include "cmCursesWidget.h"
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index d071c91..8596281 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -25,7 +25,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
{
this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " ");
- this->Entry = CM_NULLPTR;
+ this->Entry = nullptr;
this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1);
}
@@ -43,7 +43,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " ");
}
- this->Entry = CM_NULLPTR;
+ this->Entry = nullptr;
const char* value = cm->GetState()->GetCacheEntryValue(key);
assert(value);
switch (cm->GetState()->GetCacheEntryType(key)) {
@@ -104,5 +104,5 @@ const char* cmCursesCacheEntryComposite::GetValue()
if (this->Label) {
return this->Label->GetValue();
}
- return CM_NULLPTR;
+ return nullptr;
}
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h
index 3c50078..54b2f1f 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.h
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h
@@ -3,7 +3,7 @@
#ifndef cmCursesCacheEntryComposite_h
#define cmCursesCacheEntryComposite_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
diff --git a/Source/CursesDialog/cmCursesDummyWidget.h b/Source/CursesDialog/cmCursesDummyWidget.h
index d9bb6ba..b0c270c 100644
--- a/Source/CursesDialog/cmCursesDummyWidget.h
+++ b/Source/CursesDialog/cmCursesDummyWidget.h
@@ -3,7 +3,7 @@
#ifndef cmCursesDummyWidget_h
#define cmCursesDummyWidget_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCursesStandardIncludes.h"
#include "cmCursesWidget.h"
diff --git a/Source/CursesDialog/cmCursesFilePathWidget.h b/Source/CursesDialog/cmCursesFilePathWidget.h
index 6ad535b..0a30402 100644
--- a/Source/CursesDialog/cmCursesFilePathWidget.h
+++ b/Source/CursesDialog/cmCursesFilePathWidget.h
@@ -3,7 +3,7 @@
#ifndef cmCursesFilePathWidget_h
#define cmCursesFilePathWidget_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCursesPathWidget.h"
diff --git a/Source/CursesDialog/cmCursesForm.cxx b/Source/CursesDialog/cmCursesForm.cxx
index 06c1e9c..bd65c4a 100644
--- a/Source/CursesDialog/cmCursesForm.cxx
+++ b/Source/CursesDialog/cmCursesForm.cxx
@@ -7,7 +7,7 @@ bool cmCursesForm::Debug = false;
cmCursesForm::cmCursesForm()
{
- this->Form = CM_NULLPTR;
+ this->Form = nullptr;
}
cmCursesForm::~cmCursesForm()
@@ -15,7 +15,7 @@ cmCursesForm::~cmCursesForm()
if (this->Form) {
unpost_form(this->Form);
free_form(this->Form);
- this->Form = CM_NULLPTR;
+ this->Form = nullptr;
}
}
diff --git a/Source/CursesDialog/cmCursesForm.h b/Source/CursesDialog/cmCursesForm.h
index 553105c..249b349 100644
--- a/Source/CursesDialog/cmCursesForm.h
+++ b/Source/CursesDialog/cmCursesForm.h
@@ -3,7 +3,7 @@
#ifndef cmCursesForm_h
#define cmCursesForm_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCursesStandardIncludes.h"
diff --git a/Source/CursesDialog/cmCursesLabelWidget.h b/Source/CursesDialog/cmCursesLabelWidget.h
index 267de7c..79ae241 100644
--- a/Source/CursesDialog/cmCursesLabelWidget.h
+++ b/Source/CursesDialog/cmCursesLabelWidget.h
@@ -3,7 +3,7 @@
#ifndef cmCursesLabelWidget_h
#define cmCursesLabelWidget_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCursesStandardIncludes.h"
#include "cmCursesWidget.h"
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index 7fb065d..9bd1c11 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -26,8 +26,8 @@ cmCursesLongMessageForm::cmCursesLongMessageForm(
this->Messages += "\n\n";
}
this->Title = title;
- this->Fields[0] = CM_NULLPTR;
- this->Fields[1] = CM_NULLPTR;
+ this->Fields[0] = nullptr;
+ this->Fields[1] = nullptr;
}
cmCursesLongMessageForm::~cmCursesLongMessageForm()
@@ -105,7 +105,7 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/,
if (this->Form) {
unpost_form(this->Form);
free_form(this->Form);
- this->Form = CM_NULLPTR;
+ this->Form = nullptr;
}
const char* msg = this->Messages.c_str();
@@ -114,7 +114,7 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/,
if (this->Fields[0]) {
free_field(this->Fields[0]);
- this->Fields[0] = CM_NULLPTR;
+ this->Fields[0] = nullptr;
}
this->Fields[0] = new_field(y - 6, x - 2, 1, 1, 0, 0);
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h
index cd8e095..099c722 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.h
+++ b/Source/CursesDialog/cmCursesLongMessageForm.h
@@ -3,7 +3,7 @@
#ifndef cmCursesLongMessageForm_h
#define cmCursesLongMessageForm_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCursesForm.h"
#include "cmCursesStandardIncludes.h"
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 026320a..f79e72a 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -31,8 +31,8 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args,
, InitialWidth(initWidth)
{
this->NumberOfPages = 0;
- this->Fields = CM_NULLPTR;
- this->Entries = CM_NULLPTR;
+ this->Fields = nullptr;
+ this->Entries = nullptr;
this->AdvancedMode = false;
this->NumberOfVisibleEntries = 0;
this->OkToGenerate = false;
@@ -59,7 +59,7 @@ cmCursesMainForm::~cmCursesMainForm()
if (this->Form) {
unpost_form(this->Form);
free_form(this->Form);
- this->Form = CM_NULLPTR;
+ this->Form = nullptr;
}
delete[] this->Fields;
@@ -70,7 +70,7 @@ cmCursesMainForm::~cmCursesMainForm()
delete this->Entries;
if (this->CMakeInstance) {
delete this->CMakeInstance;
- this->CMakeInstance = CM_NULLPTR;
+ this->CMakeInstance = nullptr;
}
}
@@ -180,7 +180,7 @@ void cmCursesMainForm::RePost()
if (this->Form) {
unpost_form(this->Form);
free_form(this->Form);
- this->Form = CM_NULLPTR;
+ this->Form = nullptr;
}
delete[] this->Fields;
if (this->AdvancedMode) {
@@ -210,7 +210,7 @@ void cmCursesMainForm::RePost()
this->Fields = new FIELD*[3 * this->NumberOfVisibleEntries + 1];
size_t cc;
for (cc = 0; cc < 3 * this->NumberOfVisibleEntries + 1; cc++) {
- this->Fields[cc] = CM_NULLPTR;
+ this->Fields[cc] = nullptr;
}
// Assign fields
@@ -239,7 +239,7 @@ void cmCursesMainForm::RePost()
this->NumberOfVisibleEntries = 1;
}
// Has to be null terminated.
- this->Fields[3 * this->NumberOfVisibleEntries] = CM_NULLPTR;
+ this->Fields[3 * this->NumberOfVisibleEntries] = nullptr;
}
void cmCursesMainForm::Render(int left, int top, int width, int height)
@@ -259,7 +259,7 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
// Delete the previous form
unpost_form(this->Form);
free_form(this->Form);
- this->Form = CM_NULLPTR;
+ this->Form = nullptr;
}
// Wrong window size
@@ -341,14 +341,14 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
}
// Give the current widget (if it exists), a chance to print keys
- cmCursesWidget* cw = CM_NULLPTR;
+ cmCursesWidget* cw = nullptr;
if (this->Form) {
FIELD* currentField = current_field(this->Form);
cw = reinterpret_cast<cmCursesWidget*>(field_userptr(currentField));
}
char fmt_s[] = "%s";
- if (cw == CM_NULLPTR || !cw->PrintKeys()) {
+ if (cw == nullptr || !cw->PrintKeys()) {
char firstLine[512] = "";
char secondLine[512] = "";
char thirdLine[512] = "";
@@ -425,7 +425,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
// Get the key of the current entry
FIELD* cur = current_field(this->Form);
int findex = field_index(cur);
- cmCursesWidget* lbl = CM_NULLPTR;
+ cmCursesWidget* lbl = nullptr;
if (findex >= 0) {
lbl = reinterpret_cast<cmCursesWidget*>(
field_userptr(this->Fields[findex - 2]));
@@ -529,7 +529,7 @@ void cmCursesMainForm::UpdateProgress(const char* msg, float prog, void* vp)
char tmp[1024];
const char* cmsg = tmp;
if (prog >= 0) {
- sprintf(tmp, "%s %i%%", msg, (int)(100 * prog));
+ sprintf(tmp, "%s %i%%", msg, static_cast<int>(100 * prog));
} else {
cmsg = msg;
}
@@ -557,7 +557,7 @@ int cmCursesMainForm::Configure(int noconfigure)
this->FillCacheManagerFromUI();
this->CMakeInstance->SaveCache(
this->CMakeInstance->GetHomeOutputDirectory());
- this->LoadCache(CM_NULLPTR);
+ this->LoadCache(nullptr);
// Get rid of previous errors
this->Errors = std::vector<std::string>();
@@ -574,7 +574,7 @@ int cmCursesMainForm::Configure(int noconfigure)
} else {
retVal = this->CMakeInstance->Configure();
}
- this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR);
+ this->CMakeInstance->SetProgressCallback(nullptr, nullptr);
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
@@ -628,7 +628,7 @@ int cmCursesMainForm::Generate()
// run the generate process
int retVal = this->CMakeInstance->Generate();
- this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR);
+ this->CMakeInstance->SetProgressCallback(nullptr, nullptr);
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
if (retVal != 0 || !this->Errors.empty()) {
@@ -877,7 +877,7 @@ void cmCursesMainForm::HandleInput()
cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(
field_userptr(this->Fields[findex - 2]));
const char* curField = lbl->GetValue();
- const char* helpString = CM_NULLPTR;
+ const char* helpString = nullptr;
const char* existingValue =
this->CMakeInstance->GetState()->GetCacheEntryValue(curField);
@@ -962,7 +962,7 @@ void cmCursesMainForm::HandleInput()
// (findex always corresponds to the value field)
FIELD* nextCur;
if (findex == 2) {
- nextCur = CM_NULLPTR;
+ nextCur = nullptr;
} else if (findex == 3 * this->NumberOfVisibleEntries - 1) {
nextCur = this->Fields[findex - 5];
} else {
@@ -992,7 +992,7 @@ void cmCursesMainForm::HandleInput()
if (nextCur) {
// make the next or prev. current field after deletion
- nextCur = CM_NULLPTR;
+ nextCur = nullptr;
std::vector<cmCursesCacheEntryComposite*>::iterator it;
for (it = this->Entries->begin(); it != this->Entries->end();
++it) {
@@ -1041,7 +1041,7 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr)
int findex = start_index;
for (;;) {
if (!str.empty()) {
- cmCursesWidget* lbl = CM_NULLPTR;
+ cmCursesWidget* lbl = nullptr;
if (findex >= 0) {
lbl = reinterpret_cast<cmCursesWidget*>(
field_userptr(this->Fields[findex - 2]));
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index e35cf3e..96dd5c0 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -3,7 +3,7 @@
#ifndef cmCursesMainForm_h
#define cmCursesMainForm_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCursesForm.h"
#include "cmCursesStandardIncludes.h"
@@ -64,7 +64,7 @@ public:
* exception is during a resize. The optional argument specifies the
* string to be displayed in the status bar.
*/
- void UpdateStatusBar() CM_OVERRIDE { this->UpdateStatusBar(CM_NULLPTR); }
+ void UpdateStatusBar() CM_OVERRIDE { this->UpdateStatusBar(nullptr); }
virtual void UpdateStatusBar(const char* message);
/**
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.h b/Source/CursesDialog/cmCursesOptionsWidget.h
index 7f4416f..86a6946 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.h
+++ b/Source/CursesDialog/cmCursesOptionsWidget.h
@@ -3,7 +3,7 @@
#ifndef cmCursesOptionsWidget_h
#define cmCursesOptionsWidget_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCursesStandardIncludes.h"
#include "cmCursesWidget.h"
diff --git a/Source/CursesDialog/cmCursesPathWidget.h b/Source/CursesDialog/cmCursesPathWidget.h
index ae6c16d..6a72402 100644
--- a/Source/CursesDialog/cmCursesPathWidget.h
+++ b/Source/CursesDialog/cmCursesPathWidget.h
@@ -3,7 +3,7 @@
#ifndef cmCursesPathWidget_h
#define cmCursesPathWidget_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCursesStandardIncludes.h"
#include "cmCursesStringWidget.h"
diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h
index 5c59504..332d2af 100644
--- a/Source/CursesDialog/cmCursesStandardIncludes.h
+++ b/Source/CursesDialog/cmCursesStandardIncludes.h
@@ -3,7 +3,7 @@
#ifndef cmCursesStandardIncludes_h
#define cmCursesStandardIncludes_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#if defined(__hpux)
#define _BOOL_DEFINED
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index ff189f0..8cb9c1f 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -74,7 +74,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
return false;
}
- this->OriginalString = CM_NULLPTR;
+ this->OriginalString = nullptr;
this->Done = false;
char debugMessage[128];
diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h
index 5eb3366..5787098 100644
--- a/Source/CursesDialog/cmCursesStringWidget.h
+++ b/Source/CursesDialog/cmCursesStringWidget.h
@@ -3,7 +3,7 @@
#ifndef cmCursesStringWidget_h
#define cmCursesStringWidget_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCursesStandardIncludes.h"
#include "cmCursesWidget.h"
diff --git a/Source/CursesDialog/cmCursesWidget.cxx b/Source/CursesDialog/cmCursesWidget.cxx
index 054f27e..cc07411 100644
--- a/Source/CursesDialog/cmCursesWidget.cxx
+++ b/Source/CursesDialog/cmCursesWidget.cxx
@@ -14,7 +14,7 @@ cmCursesWidget::~cmCursesWidget()
{
if (this->Field) {
free_field(this->Field);
- this->Field = CM_NULLPTR;
+ this->Field = nullptr;
}
}
diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h
index 3470d70..a44c5e6 100644
--- a/Source/CursesDialog/cmCursesWidget.h
+++ b/Source/CursesDialog/cmCursesWidget.h
@@ -3,7 +3,7 @@
#ifndef cmCursesWidget_h
#define cmCursesWidget_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCursesStandardIncludes.h"
#include "cmStateTypes.h"
diff --git a/Source/CursesDialog/form/CMakeLists.txt b/Source/CursesDialog/form/CMakeLists.txt
index 0677043..b468f5b 100644
--- a/Source/CursesDialog/form/CMakeLists.txt
+++ b/Source/CursesDialog/form/CMakeLists.txt
@@ -3,12 +3,9 @@
project(CMAKE_FORM)
-include_regular_expression("^.*$")
-include_directories(${CURSES_INCLUDE_PATH} "${CMAKE_CURRENT_BINARY_DIR}")
-
configure_file(cmFormConfigure.h.in "${CMAKE_CURRENT_BINARY_DIR}/cmFormConfigure.h")
-set( FORM_SRCS
+add_library(cmForm
fld_arg.c
fld_attr.c
fld_current.c
@@ -49,10 +46,16 @@ set( FORM_SRCS
fty_num.c
fty_regex.c
)
-
-include_directories(${CMAKE_FORM_SOURCE_DIR})
-add_library(cmForm ${FORM_SRCS} )
+
+target_include_directories(cmForm
+ PUBLIC
+ ${CURSES_INCLUDE_PATH}
+ ${CMAKE_FORM_BINARY_DIR}
+ ${CMAKE_FORM_SOURCE_DIR}
+ )
+
target_link_libraries(cmForm ${CURSES_LIBRARY})
+
if(CURSES_EXTRA_LIBRARY)
target_link_libraries(cmForm ${CURSES_EXTRA_LIBRARY})
endif()
diff --git a/Source/LexerParser/cmCommandArgumentLexer.cxx b/Source/LexerParser/cmCommandArgumentLexer.cxx
index 12dce37..bf6bc2f 100644
--- a/Source/LexerParser/cmCommandArgumentLexer.cxx
+++ b/Source/LexerParser/cmCommandArgumentLexer.cxx
@@ -1,7 +1,4 @@
#include "cmStandardLexer.h"
-#line 2 "cmCommandArgumentLexer.cxx"
-
-#line 4 "cmCommandArgumentLexer.cxx"
#define FLEXINT_H 1
#define YY_INT_ALIGNED short int
@@ -11,11 +8,221 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define cmCommandArgument_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer cmCommandArgument_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define cmCommandArgument_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer cmCommandArgument_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define cmCommandArgument_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer cmCommandArgument_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define cmCommandArgument_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string cmCommandArgument_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define cmCommandArgument_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes cmCommandArgument_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define cmCommandArgument_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer cmCommandArgument_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define cmCommandArgument_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer cmCommandArgument_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define cmCommandArgument_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state cmCommandArgument_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define cmCommandArgument_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer cmCommandArgument_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define cmCommandArgument_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state cmCommandArgument_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define cmCommandArgument_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state cmCommandArgument_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define cmCommandArgument_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack cmCommandArgument_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define cmCommandArgument_yylex_ALREADY_DEFINED
+#else
+#define yylex cmCommandArgument_yylex
+#endif
+
+#ifdef yyrestart
+#define cmCommandArgument_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart cmCommandArgument_yyrestart
+#endif
+
+#ifdef yylex_init
+#define cmCommandArgument_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init cmCommandArgument_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define cmCommandArgument_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra cmCommandArgument_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define cmCommandArgument_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy cmCommandArgument_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define cmCommandArgument_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug cmCommandArgument_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define cmCommandArgument_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug cmCommandArgument_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define cmCommandArgument_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra cmCommandArgument_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define cmCommandArgument_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra cmCommandArgument_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define cmCommandArgument_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in cmCommandArgument_yyget_in
+#endif
+
+#ifdef yyset_in
+#define cmCommandArgument_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in cmCommandArgument_yyset_in
+#endif
+
+#ifdef yyget_out
+#define cmCommandArgument_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out cmCommandArgument_yyget_out
+#endif
+
+#ifdef yyset_out
+#define cmCommandArgument_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out cmCommandArgument_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define cmCommandArgument_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng cmCommandArgument_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define cmCommandArgument_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text cmCommandArgument_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define cmCommandArgument_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno cmCommandArgument_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define cmCommandArgument_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno cmCommandArgument_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define cmCommandArgument_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column cmCommandArgument_yyget_column
+#endif
+
+#ifdef yyset_column
+#define cmCommandArgument_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column cmCommandArgument_yyset_column
+#endif
+
+#ifdef yywrap
+#define cmCommandArgument_yywrap_ALREADY_DEFINED
+#else
+#define yywrap cmCommandArgument_yywrap
+#endif
+
+#ifdef yyalloc
+#define cmCommandArgument_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc cmCommandArgument_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define cmCommandArgument_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc cmCommandArgument_yyrealloc
+#endif
+
+#ifdef yyfree
+#define cmCommandArgument_yyfree_ALREADY_DEFINED
+#else
+#define yyfree cmCommandArgument_yyfree
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -86,10 +293,16 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */
+
/* TODO: this is always defined, so inline it */
#define yyconst const
@@ -102,12 +315,10 @@ typedef unsigned int flex_uint32_t;
/* Returned upon end-of-file. */
#define YY_NULL 0
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -131,20 +342,16 @@ typedef void* yyscan_t;
* definition of BEGIN.
*/
#define BEGIN yyg->yy_start = 1 + 2 *
-
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yyg->yy_start - 1) / 2)
#define YYSTATE YY_START
-
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE cmCommandArgument_yyrestart(yyin ,yyscanner )
-
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
@@ -194,7 +401,6 @@ typedef size_t yy_size_t;
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -254,7 +460,7 @@ struct yy_buffer_state
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via cmCommandArgument_yyrestart()), so that the user can continue scanning by
+ * (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
@@ -271,73 +477,67 @@ struct yy_buffer_state
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
: NULL)
-
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-void cmCommandArgument_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner );
-
-static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner );
-static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner );
-static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
-#define YY_FLUSH_BUFFER cmCommandArgument_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
-YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
-void *cmCommandArgument_yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *cmCommandArgument_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void cmCommandArgument_yyfree (void * ,yyscan_t yyscanner );
-
-#define yy_new_buffer cmCommandArgument_yy_create_buffer
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- cmCommandArgument_yyensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
-
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- cmCommandArgument_yyensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
#define cmCommandArgument_yywrap(yyscanner) (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
+typedef flex_uint8_t YY_CHAR;
typedef int yy_state_type;
#define yytext_ptr yytext_r
-static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
-static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
@@ -348,7 +548,6 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-
#define YY_NUM_RULES 14
#define YY_END_OF_BUFFER 15
/* This struct is not used in this scanner,
@@ -358,14 +557,14 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[30] =
+static const flex_int16_t yy_accept[30] =
{ 0,
0, 0, 0, 0, 0, 0, 15, 9, 10, 7,
6, 14, 11, 5, 12, 13, 9, 0, 0, 4,
7, 0, 8, 2, 0, 3, 0, 1, 0
} ;
-static yyconst YY_CHAR yy_ec[256] =
+static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -397,13 +596,13 @@ static yyconst YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst YY_CHAR yy_meta[12] =
+static const YY_CHAR yy_meta[12] =
{ 0,
1, 2, 3, 4, 3, 4, 4, 4, 3, 5,
3
} ;
-static yyconst flex_uint16_t yy_base[35] =
+static const flex_int16_t yy_base[35] =
{ 0,
0, 0, 31, 30, 29, 28, 36, 0, 6, 16,
0, 41, 41, 41, 0, 41, 0, 22, 22, 41,
@@ -411,7 +610,7 @@ static yyconst flex_uint16_t yy_base[35] =
21, 26, 9, 30
} ;
-static yyconst flex_int16_t yy_def[35] =
+static const flex_int16_t yy_def[35] =
{ 0,
29, 1, 1, 1, 1, 1, 29, 30, 31, 32,
33, 29, 29, 29, 34, 29, 30, 31, 18, 29,
@@ -419,7 +618,7 @@ static yyconst flex_int16_t yy_def[35] =
29, 29, 29, 29
} ;
-static yyconst flex_uint16_t yy_nxt[53] =
+static const flex_int16_t yy_nxt[53] =
{ 0,
8, 8, 9, 10, 11, 10, 10, 10, 12, 13,
14, 19, 22, 28, 27, 20, 17, 17, 17, 17,
@@ -429,7 +628,7 @@ static yyconst flex_uint16_t yy_nxt[53] =
29, 29
} ;
-static yyconst flex_int16_t yy_chk[53] =
+static const flex_int16_t yy_chk[53] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 9, 33, 27, 25, 9, 10, 10, 21, 21,
@@ -446,8 +645,6 @@ static yyconst flex_int16_t yy_chk[53] =
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-#line 1 "cmCommandArgumentLexer.in.l"
-#line 2 "cmCommandArgumentLexer.in.l"
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
/*
@@ -456,13 +653,12 @@ This file must be translated to C++ and modified to build everywhere.
Run flex >= 2.6 like this:
- flex --nounistd -DFLEXINT_H --prefix=cmCommandArgument_yy --header-file=cmCommandArgumentLexer.h -ocmCommandArgumentLexer.cxx cmCommandArgumentLexer.in.l
+ flex --nounistd -DFLEXINT_H --noline --header-file=cmCommandArgumentLexer.h -ocmCommandArgumentLexer.cxx cmCommandArgumentLexer.in.l
Modify cmCommandArgumentLexer.cxx:
- - remove trailing whitespace: sed -i 's/\s*$//' cmCommandArgumentLexer.h cmCommandArgumentLexer.cxx
- - remove blank lines at end of file
- - #include "cmStandardLexer.h" at the top
- - add cast in cmCommandArgument_yy_scan_bytes for loop condition of _yybytes_len to size_t
+ - remove trailing whitespace: sed -i 's/\s*$//' cmCommandArgumentLexer.h cmCommandArgumentLexer.cxx
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmCommandArgumentLexer.h cmCommandArgumentLexer.cxx
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmCommandArgumentLexer.cxx
*/
@@ -480,9 +676,6 @@ Modify cmCommandArgumentLexer.cxx:
/*--------------------------------------------------------------------------*/
-
-#line 484 "cmCommandArgumentLexer.cxx"
-
#define INITIAL 0
#define ESCAPES 1
#define NOESCAPES 2
@@ -525,44 +718,44 @@ struct yyguts_t
}; /* end struct yyguts_t */
-static int yy_init_globals (yyscan_t yyscanner );
+static int yy_init_globals ( yyscan_t yyscanner );
-int cmCommandArgument_yylex_init (yyscan_t* scanner);
+int yylex_init (yyscan_t* scanner);
-int cmCommandArgument_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int cmCommandArgument_yylex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
-int cmCommandArgument_yyget_debug (yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-YY_EXTRA_TYPE cmCommandArgument_yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_in (FILE * _in_str ,yyscan_t yyscanner );
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
-FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_out (FILE * _out_str ,yyscan_t yyscanner );
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
- int cmCommandArgument_yyget_leng (yyscan_t yyscanner );
+ int yyget_leng ( yyscan_t yyscanner );
-char *cmCommandArgument_yyget_text (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
-int cmCommandArgument_yyget_lineno (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_lineno (int _line_number ,yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
-int cmCommandArgument_yyget_column (yyscan_t yyscanner );
+int yyget_column ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_column (int _column_no ,yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -570,9 +763,9 @@ void cmCommandArgument_yyset_column (int _column_no ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int cmCommandArgument_yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int cmCommandArgument_yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
@@ -581,19 +774,18 @@ extern int cmCommandArgument_yywrap (yyscan_t yyscanner );
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
-
#ifdef __cplusplus
-static int yyinput (yyscan_t yyscanner );
+static int yyinput ( yyscan_t yyscanner );
#else
-static int input (yyscan_t yyscanner );
+static int input ( yyscan_t yyscanner );
#endif
#endif
@@ -624,7 +816,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -637,7 +829,7 @@ static int input (yyscan_t yyscanner );
else \
{ \
errno=0; \
- while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
@@ -678,9 +870,9 @@ static int input (yyscan_t yyscanner );
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int cmCommandArgument_yylex (yyscan_t yyscanner);
+extern int yylex (yyscan_t yyscanner);
-#define YY_DECL int cmCommandArgument_yylex (yyscan_t yyscanner)
+#define YY_DECL int yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after yytext and yyleng
@@ -725,19 +917,15 @@ YY_DECL
yyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
- cmCommandArgument_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- cmCommandArgument_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
{
-#line 42 "cmCommandArgumentLexer.in.l"
-
-
-#line 740 "cmCommandArgumentLexer.cxx"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -765,9 +953,9 @@ yy_match:
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 30 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 41 );
@@ -796,7 +984,6 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 44 "cmCommandArgumentLexer.in.l"
{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
@@ -805,7 +992,6 @@ YY_RULE_SETUP
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 50 "cmCommandArgumentLexer.in.l"
{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
@@ -814,7 +1000,6 @@ YY_RULE_SETUP
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 56 "cmCommandArgumentLexer.in.l"
{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
@@ -823,7 +1008,6 @@ YY_RULE_SETUP
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 62 "cmCommandArgumentLexer.in.l"
{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
//yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
@@ -833,7 +1017,6 @@ YY_RULE_SETUP
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 69 "cmCommandArgumentLexer.in.l"
{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
//yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
@@ -843,7 +1026,6 @@ YY_RULE_SETUP
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 76 "cmCommandArgumentLexer.in.l"
{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
//yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
@@ -853,7 +1035,6 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 83 "cmCommandArgumentLexer.in.l"
{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
@@ -862,7 +1043,6 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 89 "cmCommandArgumentLexer.in.l"
{
if ( !yyextra->HandleEscapeSymbol(yylvalp, *(yytext+1)) )
{
@@ -874,7 +1054,6 @@ YY_RULE_SETUP
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
-#line 97 "cmCommandArgumentLexer.in.l"
{
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
@@ -883,7 +1062,6 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 103 "cmCommandArgumentLexer.in.l"
{
//yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->DOLLARVariable;
@@ -892,7 +1070,6 @@ YY_RULE_SETUP
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 109 "cmCommandArgumentLexer.in.l"
{
//yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->LCURLYVariable;
@@ -901,7 +1078,6 @@ YY_RULE_SETUP
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 115 "cmCommandArgumentLexer.in.l"
{
//yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->BSLASHVariable;
@@ -910,7 +1086,6 @@ YY_RULE_SETUP
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 121 "cmCommandArgumentLexer.in.l"
{
//yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->BSLASHVariable;
@@ -919,10 +1094,8 @@ YY_RULE_SETUP
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 127 "cmCommandArgumentLexer.in.l"
ECHO;
YY_BREAK
-#line 925 "cmCommandArgumentLexer.cxx"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(ESCAPES):
case YY_STATE_EOF(NOESCAPES):
@@ -942,7 +1115,7 @@ case YY_STATE_EOF(NOESCAPES):
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
- * cmCommandArgument_yylex(). If so, then we have to assure
+ * yylex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
@@ -1002,7 +1175,7 @@ case YY_STATE_EOF(NOESCAPES):
{
yyg->yy_did_buffer_switch_on_eof = 0;
- if ( cmCommandArgument_yywrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
@@ -1056,7 +1229,7 @@ case YY_STATE_EOF(NOESCAPES):
} /* end of action switch */
} /* end of scanning one token */
} /* end of user's declarations */
-} /* end of cmCommandArgument_yylex */
+} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -1070,7 +1243,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = yyg->yytext_ptr;
- yy_size_t number_to_move, i;
+ int number_to_move, i;
int ret_val;
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
@@ -1099,7 +1272,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -1135,7 +1308,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- cmCommandArgument_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
}
else
/* Can't grow it, we don't own it. */
@@ -1167,7 +1341,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- cmCommandArgument_yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
}
else
@@ -1181,12 +1355,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cmCommandArgument_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
yyg->yy_n_chars += number_to_move;
@@ -1220,9 +1397,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 30 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return yy_current_state;
@@ -1249,9 +1426,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 30 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 29);
(void)yyg;
@@ -1287,7 +1464,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{ /* need more input */
- int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
@@ -1304,13 +1481,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*/
/* Reset buffer status. */
- cmCommandArgument_yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( cmCommandArgument_yywrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
return 0;
if ( ! yyg->yy_did_buffer_switch_on_eof )
@@ -1342,34 +1519,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @note This function does not reset the start condition to @c INITIAL .
*/
- void cmCommandArgument_yyrestart (FILE * input_file , yyscan_t yyscanner)
+ void yyrestart (FILE * input_file , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! YY_CURRENT_BUFFER ){
- cmCommandArgument_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- cmCommandArgument_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
- cmCommandArgument_yy_load_buffer_state(yyscanner );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
+ yy_load_buffer_state( yyscanner );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
* @param yyscanner The scanner object.
*/
- void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* TODO. We should be able to replace this entire function body
* with
- * cmCommandArgument_yypop_buffer_state();
- * cmCommandArgument_yypush_buffer_state(new_buffer);
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
*/
- cmCommandArgument_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
if ( YY_CURRENT_BUFFER == new_buffer )
return;
@@ -1382,17 +1559,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- cmCommandArgument_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
/* We don't actually know whether we did this switch during
- * EOF (cmCommandArgument_yywrap()) processing, but the only time this flag
- * is looked at is after cmCommandArgument_yywrap() is called, so it's safe
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yyg->yy_did_buffer_switch_on_eof = 1;
}
-static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner)
+static void yy_load_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
@@ -1407,35 +1584,35 @@ static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the allocated buffer state.
*/
- YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) cmCommandArgument_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_buf_size = (yy_size_t)size;
+ b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) cmCommandArgument_yyalloc(b->yy_buf_size + 2 ,yyscanner );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- cmCommandArgument_yy_init_buffer(b,file ,yyscanner);
+ yy_init_buffer( b, file , yyscanner);
return b;
}
/** Destroy the buffer.
- * @param b a buffer created with cmCommandArgument_yy_create_buffer()
+ * @param b a buffer created with yy_create_buffer()
* @param yyscanner The scanner object.
*/
- void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -1446,28 +1623,28 @@ static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner)
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- cmCommandArgument_yyfree((void *) b->yy_ch_buf ,yyscanner );
+ yyfree( (void *) b->yy_ch_buf , yyscanner );
- cmCommandArgument_yyfree((void *) b ,yyscanner );
+ yyfree( (void *) b , yyscanner );
}
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
- * such as during a cmCommandArgument_yyrestart() or at EOF.
+ * such as during a yyrestart() or at EOF.
*/
- static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
{
int oerrno = errno;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- cmCommandArgument_yy_flush_buffer(b ,yyscanner);
+ yy_flush_buffer( b , yyscanner);
b->yy_input_file = file;
b->yy_fill_buffer = 1;
- /* If b is the current buffer, then cmCommandArgument_yy_init_buffer was _probably_
- * called from cmCommandArgument_yyrestart() or through yy_get_next_buffer.
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
@@ -1484,7 +1661,7 @@ static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner)
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
* @param yyscanner The scanner object.
*/
- void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! b )
@@ -1505,7 +1682,7 @@ static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner)
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- cmCommandArgument_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -1514,15 +1691,15 @@ static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner)
* @param new_buffer The new state.
* @param yyscanner The scanner object.
*/
-void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (new_buffer == NULL)
return;
- cmCommandArgument_yyensure_buffer_stack(yyscanner);
+ yyensure_buffer_stack(yyscanner);
- /* This block is copied from cmCommandArgument_yy_switch_to_buffer. */
+ /* This block is copied from yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
@@ -1536,8 +1713,8 @@ void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_
yyg->yy_buffer_stack_top++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from cmCommandArgument_yy_switch_to_buffer. */
- cmCommandArgument_yy_load_buffer_state(yyscanner );
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
@@ -1545,19 +1722,19 @@ void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_
* The next element becomes the new top.
* @param yyscanner The scanner object.
*/
-void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner)
+void yypop_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!YY_CURRENT_BUFFER)
return;
- cmCommandArgument_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+ yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
YY_CURRENT_BUFFER_LVALUE = NULL;
if (yyg->yy_buffer_stack_top > 0)
--yyg->yy_buffer_stack_top;
if (YY_CURRENT_BUFFER) {
- cmCommandArgument_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
}
@@ -1565,9 +1742,9 @@ void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner)
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
-static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner)
+static void yyensure_buffer_stack (yyscan_t yyscanner)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!yyg->yy_buffer_stack) {
@@ -1577,11 +1754,11 @@ static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner)
* immediate realloc on the next call.
*/
num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmCommandArgument_yyalloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
@@ -1596,12 +1773,12 @@ static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner)
yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmCommandArgument_yyrealloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -1615,7 +1792,7 @@ static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
@@ -1625,11 +1802,11 @@ YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char * base, yy_size_t size
/* They forgot to leave room for the EOB's. */
return NULL;
- b = (YY_BUFFER_STATE) cmCommandArgument_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = NULL;
@@ -1639,53 +1816,53 @@ YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char * base, yy_size_t size
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- cmCommandArgument_yy_switch_to_buffer(b ,yyscanner );
+ yy_switch_to_buffer( b , yyscanner );
return b;
}
-/** Setup the input buffer state to scan a string. The next call to cmCommandArgument_yylex() will
+/** Setup the input buffer state to scan a string. The next call to yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
- * cmCommandArgument_yy_scan_bytes() instead.
+ * yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
{
- return cmCommandArgument_yy_scan_bytes(yystr,(int) strlen(yystr) ,yyscanner);
+ return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
}
-/** Setup the input buffer state to scan the given bytes. The next call to cmCommandArgument_yylex() will
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- yy_size_t i;
+ int i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = (yy_size_t) _yybytes_len + 2;
- buf = (char *) cmCommandArgument_yyalloc(n ,yyscanner );
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n , yyscanner );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
- for ( i = 0; i < (size_t)_yybytes_len; ++i )
+ for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = cmCommandArgument_yy_scan_buffer(buf,n ,yyscanner);
+ b = yy_scan_buffer( buf, n , yyscanner);
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in cmCommandArgument_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -1699,11 +1876,11 @@ YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes (yyconst char * yybytes, int _
#define YY_EXIT_FAILURE 2
#endif
-static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- (void) fprintf( stderr, "%s\n", msg );
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -1729,7 +1906,7 @@ static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
/** Get the user-defined data for this scanner.
* @param yyscanner The scanner object.
*/
-YY_EXTRA_TYPE cmCommandArgument_yyget_extra (yyscan_t yyscanner)
+YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyextra;
@@ -1738,7 +1915,7 @@ YY_EXTRA_TYPE cmCommandArgument_yyget_extra (yyscan_t yyscanner)
/** Get the current line number.
* @param yyscanner The scanner object.
*/
-int cmCommandArgument_yyget_lineno (yyscan_t yyscanner)
+int yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -1751,7 +1928,7 @@ int cmCommandArgument_yyget_lineno (yyscan_t yyscanner)
/** Get the current column number.
* @param yyscanner The scanner object.
*/
-int cmCommandArgument_yyget_column (yyscan_t yyscanner)
+int yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -1764,7 +1941,7 @@ int cmCommandArgument_yyget_column (yyscan_t yyscanner)
/** Get the input stream.
* @param yyscanner The scanner object.
*/
-FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner)
+FILE *yyget_in (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyin;
@@ -1773,7 +1950,7 @@ FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner)
/** Get the output stream.
* @param yyscanner The scanner object.
*/
-FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner)
+FILE *yyget_out (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyout;
@@ -1782,7 +1959,7 @@ FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-int cmCommandArgument_yyget_leng (yyscan_t yyscanner)
+int yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
@@ -1792,7 +1969,7 @@ int cmCommandArgument_yyget_leng (yyscan_t yyscanner)
* @param yyscanner The scanner object.
*/
-char *cmCommandArgument_yyget_text (yyscan_t yyscanner)
+char *yyget_text (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yytext;
@@ -1802,7 +1979,7 @@ char *cmCommandArgument_yyget_text (yyscan_t yyscanner)
* @param user_defined The data to be associated with this scanner.
* @param yyscanner The scanner object.
*/
-void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyextra = user_defined ;
@@ -1812,13 +1989,13 @@ void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yysca
* @param _line_number line number
* @param yyscanner The scanner object.
*/
-void cmCommandArgument_yyset_lineno (int _line_number , yyscan_t yyscanner)
+void yyset_lineno (int _line_number , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "cmCommandArgument_yyset_lineno called with no buffer" );
+ YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
yylineno = _line_number;
}
@@ -1827,13 +2004,13 @@ void cmCommandArgument_yyset_lineno (int _line_number , yyscan_t yyscanner)
* @param _column_no column number
* @param yyscanner The scanner object.
*/
-void cmCommandArgument_yyset_column (int _column_no , yyscan_t yyscanner)
+void yyset_column (int _column_no , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "cmCommandArgument_yyset_column called with no buffer" );
+ YY_FATAL_ERROR( "yyset_column called with no buffer" );
yycolumn = _column_no;
}
@@ -1842,27 +2019,27 @@ void cmCommandArgument_yyset_column (int _column_no , yyscan_t yyscanner)
* input buffer.
* @param _in_str A readable stream.
* @param yyscanner The scanner object.
- * @see cmCommandArgument_yy_switch_to_buffer
+ * @see yy_switch_to_buffer
*/
-void cmCommandArgument_yyset_in (FILE * _in_str , yyscan_t yyscanner)
+void yyset_in (FILE * _in_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyin = _in_str ;
}
-void cmCommandArgument_yyset_out (FILE * _out_str , yyscan_t yyscanner)
+void yyset_out (FILE * _out_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyout = _out_str ;
}
-int cmCommandArgument_yyget_debug (yyscan_t yyscanner)
+int yyget_debug (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yy_flex_debug;
}
-void cmCommandArgument_yyset_debug (int _bdebug , yyscan_t yyscanner)
+void yyset_debug (int _bdebug , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_flex_debug = _bdebug ;
@@ -1872,20 +2049,18 @@ void cmCommandArgument_yyset_debug (int _bdebug , yyscan_t yyscanner)
/* User-visible API */
-/* cmCommandArgument_yylex_init is special because it creates the scanner itself, so it is
+/* yylex_init is special because it creates the scanner itself, so it is
* the ONLY reentrant function that doesn't take the scanner as the last argument.
* That's why we explicitly handle the declaration, instead of using our macros.
*/
-
-int cmCommandArgument_yylex_init(yyscan_t* ptr_yy_globals)
-
+int yylex_init(yyscan_t* ptr_yy_globals)
{
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmCommandArgument_yyalloc ( sizeof( struct yyguts_t ), NULL );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -1898,27 +2073,25 @@ int cmCommandArgument_yylex_init(yyscan_t* ptr_yy_globals)
return yy_init_globals ( *ptr_yy_globals );
}
-/* cmCommandArgument_yylex_init_extra has the same functionality as cmCommandArgument_yylex_init, but follows the
+/* yylex_init_extra has the same functionality as yylex_init, but follows the
* convention of taking the scanner as the last argument. Note however, that
* this is a *pointer* to a scanner, as it will be allocated by this call (and
* is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to cmCommandArgument_yyalloc in
+ * The user defined value in the first argument will be available to yyalloc in
* the yyextra field.
*/
-
-int cmCommandArgument_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
+int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
{
struct yyguts_t dummy_yyguts;
- cmCommandArgument_yyset_extra (yy_user_defined, &dummy_yyguts);
+ yyset_extra (yy_user_defined, &dummy_yyguts);
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmCommandArgument_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -1929,7 +2102,7 @@ int cmCommandArgument_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* p
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
- cmCommandArgument_yyset_extra (yy_user_defined, *ptr_yy_globals);
+ yyset_extra (yy_user_defined, *ptr_yy_globals);
return yy_init_globals ( *ptr_yy_globals );
}
@@ -1938,7 +2111,7 @@ static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Initialization is the same as for the non-reentrant scanner.
- * This function is called from cmCommandArgument_yylex_destroy(), so don't allocate here.
+ * This function is called from yylex_destroy(), so don't allocate here.
*/
yyg->yy_buffer_stack = NULL;
@@ -1962,37 +2135,37 @@ static int yy_init_globals (yyscan_t yyscanner)
#endif
/* For future reference: Set errno on error, since we are called by
- * cmCommandArgument_yylex_init()
+ * yylex_init()
*/
return 0;
}
-/* cmCommandArgument_yylex_destroy is for both reentrant and non-reentrant scanners. */
-int cmCommandArgument_yylex_destroy (yyscan_t yyscanner)
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- cmCommandArgument_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
YY_CURRENT_BUFFER_LVALUE = NULL;
- cmCommandArgument_yypop_buffer_state(yyscanner);
+ yypop_buffer_state(yyscanner);
}
/* Destroy the stack itself. */
- cmCommandArgument_yyfree(yyg->yy_buffer_stack ,yyscanner);
+ yyfree(yyg->yy_buffer_stack , yyscanner);
yyg->yy_buffer_stack = NULL;
/* Destroy the start condition stack. */
- cmCommandArgument_yyfree(yyg->yy_start_stack ,yyscanner );
+ yyfree( yyg->yy_start_stack , yyscanner );
yyg->yy_start_stack = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
- * cmCommandArgument_yylex() is called, initialization will occur. */
+ * yylex() is called, initialization will occur. */
yy_init_globals( yyscanner);
/* Destroy the main struct (reentrant only). */
- cmCommandArgument_yyfree ( yyscanner , yyscanner );
+ yyfree ( yyscanner , yyscanner );
yyscanner = NULL;
return 0;
}
@@ -2002,7 +2175,7 @@ int cmCommandArgument_yylex_destroy (yyscan_t yyscanner)
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -2014,7 +2187,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
{
int n;
for ( n = 0; s[n]; ++n )
@@ -2024,14 +2197,14 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
}
#endif
-void *cmCommandArgument_yyalloc (yy_size_t size , yyscan_t yyscanner)
+void *yyalloc (yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
return malloc(size);
}
-void *cmCommandArgument_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
+void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -2046,19 +2219,15 @@ void *cmCommandArgument_yyrealloc (void * ptr, yy_size_t size , yyscan_t yysca
return realloc(ptr, size);
}
-void cmCommandArgument_yyfree (void * ptr , yyscan_t yyscanner)
+void yyfree (void * ptr , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- free( (char *) ptr ); /* see cmCommandArgument_yyrealloc() for (char *) cast */
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
-#line 127 "cmCommandArgumentLexer.in.l"
-
-
-
/*--------------------------------------------------------------------------*/
void cmCommandArgument_SetupEscapes(yyscan_t yyscanner, bool noEscapes)
{
diff --git a/Source/LexerParser/cmCommandArgumentLexer.h b/Source/LexerParser/cmCommandArgumentLexer.h
index 82e87b5..5677513 100644
--- a/Source/LexerParser/cmCommandArgumentLexer.h
+++ b/Source/LexerParser/cmCommandArgumentLexer.h
@@ -2,10 +2,6 @@
#define cmCommandArgument_yyHEADER_H 1
#define cmCommandArgument_yyIN_HEADER 1
-#line 6 "cmCommandArgumentLexer.h"
-
-#line 8 "cmCommandArgumentLexer.h"
-
#define FLEXINT_H 1
#define YY_INT_ALIGNED short int
@@ -14,11 +10,221 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define cmCommandArgument_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer cmCommandArgument_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define cmCommandArgument_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer cmCommandArgument_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define cmCommandArgument_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer cmCommandArgument_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define cmCommandArgument_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string cmCommandArgument_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define cmCommandArgument_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes cmCommandArgument_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define cmCommandArgument_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer cmCommandArgument_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define cmCommandArgument_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer cmCommandArgument_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define cmCommandArgument_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state cmCommandArgument_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define cmCommandArgument_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer cmCommandArgument_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define cmCommandArgument_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state cmCommandArgument_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define cmCommandArgument_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state cmCommandArgument_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define cmCommandArgument_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack cmCommandArgument_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define cmCommandArgument_yylex_ALREADY_DEFINED
+#else
+#define yylex cmCommandArgument_yylex
+#endif
+
+#ifdef yyrestart
+#define cmCommandArgument_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart cmCommandArgument_yyrestart
+#endif
+
+#ifdef yylex_init
+#define cmCommandArgument_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init cmCommandArgument_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define cmCommandArgument_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra cmCommandArgument_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define cmCommandArgument_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy cmCommandArgument_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define cmCommandArgument_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug cmCommandArgument_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define cmCommandArgument_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug cmCommandArgument_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define cmCommandArgument_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra cmCommandArgument_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define cmCommandArgument_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra cmCommandArgument_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define cmCommandArgument_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in cmCommandArgument_yyget_in
+#endif
+
+#ifdef yyset_in
+#define cmCommandArgument_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in cmCommandArgument_yyset_in
+#endif
+
+#ifdef yyget_out
+#define cmCommandArgument_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out cmCommandArgument_yyget_out
+#endif
+
+#ifdef yyset_out
+#define cmCommandArgument_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out cmCommandArgument_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define cmCommandArgument_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng cmCommandArgument_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define cmCommandArgument_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text cmCommandArgument_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define cmCommandArgument_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno cmCommandArgument_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define cmCommandArgument_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno cmCommandArgument_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define cmCommandArgument_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column cmCommandArgument_yyget_column
+#endif
+
+#ifdef yyset_column
+#define cmCommandArgument_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column cmCommandArgument_yyset_column
+#endif
+
+#ifdef yywrap
+#define cmCommandArgument_yywrap_ALREADY_DEFINED
+#else
+#define yywrap cmCommandArgument_yywrap
+#endif
+
+#ifdef yyalloc
+#define cmCommandArgument_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc cmCommandArgument_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define cmCommandArgument_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc cmCommandArgument_yyrealloc
+#endif
+
+#ifdef yyfree
+#define cmCommandArgument_yyfree_ALREADY_DEFINED
+#else
+#define yyfree cmCommandArgument_yyfree
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -89,10 +295,16 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */
+
/* TODO: this is always defined, so inline it */
#define yyconst const
@@ -193,21 +405,21 @@ struct yy_buffer_state
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-void cmCommandArgument_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner );
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
-YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
-void *cmCommandArgument_yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *cmCommandArgument_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void cmCommandArgument_yyfree (void * ,yyscan_t yyscanner );
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
/* Begin user sect3 */
@@ -227,42 +439,42 @@ void cmCommandArgument_yyfree (void * ,yyscan_t yyscanner );
#define YY_EXTRA_TYPE void *
#endif
-int cmCommandArgument_yylex_init (yyscan_t* scanner);
+int yylex_init (yyscan_t* scanner);
-int cmCommandArgument_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int cmCommandArgument_yylex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
-int cmCommandArgument_yyget_debug (yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-YY_EXTRA_TYPE cmCommandArgument_yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_in (FILE * _in_str ,yyscan_t yyscanner );
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
-FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_out (FILE * _out_str ,yyscan_t yyscanner );
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
- int cmCommandArgument_yyget_leng (yyscan_t yyscanner );
+ int yyget_leng ( yyscan_t yyscanner );
-char *cmCommandArgument_yyget_text (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
-int cmCommandArgument_yyget_lineno (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_lineno (int _line_number ,yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
-int cmCommandArgument_yyget_column (yyscan_t yyscanner );
+int yyget_column ( yyscan_t yyscanner );
-void cmCommandArgument_yyset_column (int _column_no ,yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -270,18 +482,18 @@ void cmCommandArgument_yyset_column (int _column_no ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int cmCommandArgument_yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int cmCommandArgument_yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
@@ -309,9 +521,9 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int cmCommandArgument_yylex (yyscan_t yyscanner);
+extern int yylex (yyscan_t yyscanner);
-#define YY_DECL int cmCommandArgument_yylex (yyscan_t yyscanner)
+#define YY_DECL int yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* yy_get_previous_state - get the state just before the EOB char was reached */
@@ -328,9 +540,150 @@ extern int cmCommandArgument_yylex (yyscan_t yyscanner);
#undef YY_DECL
#endif
-#line 127 "cmCommandArgumentLexer.in.l"
-
+#ifndef cmCommandArgument_yy_create_buffer_ALREADY_DEFINED
+#undef yy_create_buffer
+#endif
+#ifndef cmCommandArgument_yy_delete_buffer_ALREADY_DEFINED
+#undef yy_delete_buffer
+#endif
+#ifndef cmCommandArgument_yy_scan_buffer_ALREADY_DEFINED
+#undef yy_scan_buffer
+#endif
+#ifndef cmCommandArgument_yy_scan_string_ALREADY_DEFINED
+#undef yy_scan_string
+#endif
+#ifndef cmCommandArgument_yy_scan_bytes_ALREADY_DEFINED
+#undef yy_scan_bytes
+#endif
+#ifndef cmCommandArgument_yy_init_buffer_ALREADY_DEFINED
+#undef yy_init_buffer
+#endif
+#ifndef cmCommandArgument_yy_flush_buffer_ALREADY_DEFINED
+#undef yy_flush_buffer
+#endif
+#ifndef cmCommandArgument_yy_load_buffer_state_ALREADY_DEFINED
+#undef yy_load_buffer_state
+#endif
+#ifndef cmCommandArgument_yy_switch_to_buffer_ALREADY_DEFINED
+#undef yy_switch_to_buffer
+#endif
+#ifndef cmCommandArgument_yypush_buffer_state_ALREADY_DEFINED
+#undef yypush_buffer_state
+#endif
+#ifndef cmCommandArgument_yypop_buffer_state_ALREADY_DEFINED
+#undef yypop_buffer_state
+#endif
+#ifndef cmCommandArgument_yyensure_buffer_stack_ALREADY_DEFINED
+#undef yyensure_buffer_stack
+#endif
+#ifndef cmCommandArgument_yylex_ALREADY_DEFINED
+#undef yylex
+#endif
+#ifndef cmCommandArgument_yyrestart_ALREADY_DEFINED
+#undef yyrestart
+#endif
+#ifndef cmCommandArgument_yylex_init_ALREADY_DEFINED
+#undef yylex_init
+#endif
+#ifndef cmCommandArgument_yylex_init_extra_ALREADY_DEFINED
+#undef yylex_init_extra
+#endif
+#ifndef cmCommandArgument_yylex_destroy_ALREADY_DEFINED
+#undef yylex_destroy
+#endif
+#ifndef cmCommandArgument_yyget_debug_ALREADY_DEFINED
+#undef yyget_debug
+#endif
+#ifndef cmCommandArgument_yyset_debug_ALREADY_DEFINED
+#undef yyset_debug
+#endif
+#ifndef cmCommandArgument_yyget_extra_ALREADY_DEFINED
+#undef yyget_extra
+#endif
+#ifndef cmCommandArgument_yyset_extra_ALREADY_DEFINED
+#undef yyset_extra
+#endif
+#ifndef cmCommandArgument_yyget_in_ALREADY_DEFINED
+#undef yyget_in
+#endif
+#ifndef cmCommandArgument_yyset_in_ALREADY_DEFINED
+#undef yyset_in
+#endif
+#ifndef cmCommandArgument_yyget_out_ALREADY_DEFINED
+#undef yyget_out
+#endif
+#ifndef cmCommandArgument_yyset_out_ALREADY_DEFINED
+#undef yyset_out
+#endif
+#ifndef cmCommandArgument_yyget_leng_ALREADY_DEFINED
+#undef yyget_leng
+#endif
+#ifndef cmCommandArgument_yyget_text_ALREADY_DEFINED
+#undef yyget_text
+#endif
+#ifndef cmCommandArgument_yyget_lineno_ALREADY_DEFINED
+#undef yyget_lineno
+#endif
+#ifndef cmCommandArgument_yyset_lineno_ALREADY_DEFINED
+#undef yyset_lineno
+#endif
+#ifndef cmCommandArgument_yyget_column_ALREADY_DEFINED
+#undef yyget_column
+#endif
+#ifndef cmCommandArgument_yyset_column_ALREADY_DEFINED
+#undef yyset_column
+#endif
+#ifndef cmCommandArgument_yywrap_ALREADY_DEFINED
+#undef yywrap
+#endif
+#ifndef cmCommandArgument_yyget_lval_ALREADY_DEFINED
+#undef yyget_lval
+#endif
+#ifndef cmCommandArgument_yyset_lval_ALREADY_DEFINED
+#undef yyset_lval
+#endif
+#ifndef cmCommandArgument_yyget_lloc_ALREADY_DEFINED
+#undef yyget_lloc
+#endif
+#ifndef cmCommandArgument_yyset_lloc_ALREADY_DEFINED
+#undef yyset_lloc
+#endif
+#ifndef cmCommandArgument_yyalloc_ALREADY_DEFINED
+#undef yyalloc
+#endif
+#ifndef cmCommandArgument_yyrealloc_ALREADY_DEFINED
+#undef yyrealloc
+#endif
+#ifndef cmCommandArgument_yyfree_ALREADY_DEFINED
+#undef yyfree
+#endif
+#ifndef cmCommandArgument_yytext_ALREADY_DEFINED
+#undef yytext
+#endif
+#ifndef cmCommandArgument_yyleng_ALREADY_DEFINED
+#undef yyleng
+#endif
+#ifndef cmCommandArgument_yyin_ALREADY_DEFINED
+#undef yyin
+#endif
+#ifndef cmCommandArgument_yyout_ALREADY_DEFINED
+#undef yyout
+#endif
+#ifndef cmCommandArgument_yy_flex_debug_ALREADY_DEFINED
+#undef yy_flex_debug
+#endif
+#ifndef cmCommandArgument_yylineno_ALREADY_DEFINED
+#undef yylineno
+#endif
+#ifndef cmCommandArgument_yytables_fload_ALREADY_DEFINED
+#undef yytables_fload
+#endif
+#ifndef cmCommandArgument_yytables_destroy_ALREADY_DEFINED
+#undef yytables_destroy
+#endif
+#ifndef cmCommandArgument_yyTABLES_NAME_ALREADY_DEFINED
+#undef yyTABLES_NAME
+#endif
-#line 335 "cmCommandArgumentLexer.h"
#undef cmCommandArgument_yyIN_HEADER
#endif /* cmCommandArgument_yyHEADER_H */
diff --git a/Source/LexerParser/cmCommandArgumentLexer.in.l b/Source/LexerParser/cmCommandArgumentLexer.in.l
index e3a8094..acf18f3 100644
--- a/Source/LexerParser/cmCommandArgumentLexer.in.l
+++ b/Source/LexerParser/cmCommandArgumentLexer.in.l
@@ -7,13 +7,12 @@ This file must be translated to C++ and modified to build everywhere.
Run flex >= 2.6 like this:
- flex --nounistd -DFLEXINT_H --prefix=cmCommandArgument_yy --header-file=cmCommandArgumentLexer.h -ocmCommandArgumentLexer.cxx cmCommandArgumentLexer.in.l
+ flex --nounistd -DFLEXINT_H --noline --header-file=cmCommandArgumentLexer.h -ocmCommandArgumentLexer.cxx cmCommandArgumentLexer.in.l
Modify cmCommandArgumentLexer.cxx:
- - remove trailing whitespace: sed -i 's/\s*$//' cmCommandArgumentLexer.h cmCommandArgumentLexer.cxx
- - remove blank lines at end of file
- - #include "cmStandardLexer.h" at the top
- - add cast in yy_scan_bytes for loop condition of _yybytes_len to size_t
+ - remove trailing whitespace: sed -i 's/\s*$//' cmCommandArgumentLexer.h cmCommandArgumentLexer.cxx
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmCommandArgumentLexer.h cmCommandArgumentLexer.cxx
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmCommandArgumentLexer.cxx
*/
@@ -32,6 +31,8 @@ Modify cmCommandArgumentLexer.cxx:
/*--------------------------------------------------------------------------*/
%}
+%option prefix="cmCommandArgument_yy"
+
%option reentrant
%option noyywrap
%option nounput
diff --git a/Source/LexerParser/cmDependsJavaLexer.cxx b/Source/LexerParser/cmDependsJavaLexer.cxx
index 8159f47..36cac61 100644
--- a/Source/LexerParser/cmDependsJavaLexer.cxx
+++ b/Source/LexerParser/cmDependsJavaLexer.cxx
@@ -1,7 +1,4 @@
#include "cmStandardLexer.h"
-#line 2 "cmDependsJavaLexer.cxx"
-
-#line 4 "cmDependsJavaLexer.cxx"
#define FLEXINT_H 1
#define YY_INT_ALIGNED short int
@@ -11,11 +8,221 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define cmDependsJava_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer cmDependsJava_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define cmDependsJava_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer cmDependsJava_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define cmDependsJava_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer cmDependsJava_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define cmDependsJava_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string cmDependsJava_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define cmDependsJava_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes cmDependsJava_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define cmDependsJava_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer cmDependsJava_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define cmDependsJava_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer cmDependsJava_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define cmDependsJava_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state cmDependsJava_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define cmDependsJava_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer cmDependsJava_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define cmDependsJava_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state cmDependsJava_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define cmDependsJava_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state cmDependsJava_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define cmDependsJava_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack cmDependsJava_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define cmDependsJava_yylex_ALREADY_DEFINED
+#else
+#define yylex cmDependsJava_yylex
+#endif
+
+#ifdef yyrestart
+#define cmDependsJava_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart cmDependsJava_yyrestart
+#endif
+
+#ifdef yylex_init
+#define cmDependsJava_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init cmDependsJava_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define cmDependsJava_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra cmDependsJava_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define cmDependsJava_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy cmDependsJava_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define cmDependsJava_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug cmDependsJava_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define cmDependsJava_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug cmDependsJava_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define cmDependsJava_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra cmDependsJava_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define cmDependsJava_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra cmDependsJava_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define cmDependsJava_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in cmDependsJava_yyget_in
+#endif
+
+#ifdef yyset_in
+#define cmDependsJava_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in cmDependsJava_yyset_in
+#endif
+
+#ifdef yyget_out
+#define cmDependsJava_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out cmDependsJava_yyget_out
+#endif
+
+#ifdef yyset_out
+#define cmDependsJava_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out cmDependsJava_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define cmDependsJava_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng cmDependsJava_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define cmDependsJava_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text cmDependsJava_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define cmDependsJava_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno cmDependsJava_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define cmDependsJava_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno cmDependsJava_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define cmDependsJava_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column cmDependsJava_yyget_column
+#endif
+
+#ifdef yyset_column
+#define cmDependsJava_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column cmDependsJava_yyset_column
+#endif
+
+#ifdef yywrap
+#define cmDependsJava_yywrap_ALREADY_DEFINED
+#else
+#define yywrap cmDependsJava_yywrap
+#endif
+
+#ifdef yyalloc
+#define cmDependsJava_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc cmDependsJava_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define cmDependsJava_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc cmDependsJava_yyrealloc
+#endif
+
+#ifdef yyfree
+#define cmDependsJava_yyfree_ALREADY_DEFINED
+#else
+#define yyfree cmDependsJava_yyfree
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -86,10 +293,16 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */
+
/* TODO: this is always defined, so inline it */
#define yyconst const
@@ -102,12 +315,10 @@ typedef unsigned int flex_uint32_t;
/* Returned upon end-of-file. */
#define YY_NULL 0
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -131,20 +342,16 @@ typedef void* yyscan_t;
* definition of BEGIN.
*/
#define BEGIN yyg->yy_start = 1 + 2 *
-
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yyg->yy_start - 1) / 2)
#define YYSTATE YY_START
-
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE cmDependsJava_yyrestart(yyin ,yyscanner )
-
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
@@ -194,7 +401,6 @@ typedef size_t yy_size_t;
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -254,7 +460,7 @@ struct yy_buffer_state
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via cmDependsJava_yyrestart()), so that the user can continue scanning by
+ * (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
@@ -271,73 +477,67 @@ struct yy_buffer_state
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
: NULL)
-
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-void cmDependsJava_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmDependsJava_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsJava_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void cmDependsJava_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmDependsJava_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmDependsJava_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void cmDependsJava_yypop_buffer_state (yyscan_t yyscanner );
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
-static void cmDependsJava_yyensure_buffer_stack (yyscan_t yyscanner );
-static void cmDependsJava_yy_load_buffer_state (yyscan_t yyscanner );
-static void cmDependsJava_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
-#define YY_FLUSH_BUFFER cmDependsJava_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsJava_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsJava_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsJava_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-
-void *cmDependsJava_yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *cmDependsJava_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void cmDependsJava_yyfree (void * ,yyscan_t yyscanner );
-
-#define yy_new_buffer cmDependsJava_yy_create_buffer
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- cmDependsJava_yyensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmDependsJava_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
-
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- cmDependsJava_yyensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmDependsJava_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
#define cmDependsJava_yywrap(yyscanner) (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
+typedef flex_uint8_t YY_CHAR;
typedef int yy_state_type;
#define yytext_ptr yytext_r
-static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
-static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
@@ -348,7 +548,6 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-
#define YY_NUM_RULES 111
#define YY_END_OF_BUFFER 112
/* This struct is not used in this scanner,
@@ -358,7 +557,7 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[327] =
+static const flex_int16_t yy_accept[327] =
{ 0,
0, 0, 0, 0, 0, 0, 112, 110, 109, 109,
77, 4, 73, 94, 60, 110, 93, 92, 105, 99,
@@ -398,7 +597,7 @@ static yyconst flex_int16_t yy_accept[327] =
27, 29, 107, 107, 45, 0
} ;
-static yyconst YY_CHAR yy_ec[256] =
+static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
@@ -430,7 +629,7 @@ static yyconst YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst YY_CHAR yy_meta[65] =
+static const YY_CHAR yy_meta[65] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
1, 1, 1, 1, 1, 1, 1, 3, 3, 3,
@@ -441,7 +640,7 @@ static yyconst YY_CHAR yy_meta[65] =
1, 1, 1, 1
} ;
-static yyconst flex_uint16_t yy_base[334] =
+static const flex_int16_t yy_base[334] =
{ 0,
0, 0, 401, 400, 62, 63, 411, 414, 414, 414,
386, 414, 414, 385, 61, 374, 414, 414, 383, 57,
@@ -482,7 +681,7 @@ static yyconst flex_uint16_t yy_base[334] =
232, 96, 235
} ;
-static yyconst flex_int16_t yy_def[334] =
+static const flex_int16_t yy_def[334] =
{ 0,
326, 1, 327, 327, 328, 328, 326, 326, 326, 326,
326, 326, 326, 326, 326, 329, 326, 326, 326, 326,
@@ -523,7 +722,7 @@ static yyconst flex_int16_t yy_def[334] =
326, 326, 326
} ;
-static yyconst flex_uint16_t yy_nxt[479] =
+static const flex_int16_t yy_nxt[479] =
{ 0,
8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 26,
@@ -579,7 +778,7 @@ static yyconst flex_uint16_t yy_nxt[479] =
326, 326, 326, 326, 326, 326, 326, 326
} ;
-static yyconst flex_int16_t yy_chk[479] =
+static const flex_int16_t yy_chk[479] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -642,8 +841,6 @@ static yyconst flex_int16_t yy_chk[479] =
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-#line 1 "cmDependsJavaLexer.in.l"
-#line 2 "cmDependsJavaLexer.in.l"
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
/*
@@ -652,13 +849,12 @@ This file must be translated to C++ and modified to build everywhere.
Run flex >= 2.6 like this:
- flex --nounistd -DFLEXINT_H --prefix=cmDependsJava_yy --header-file=cmDependsJavaLexer.h -ocmDependsJavaLexer.cxx cmDependsJavaLexer.in.l
+ flex --nounistd -DFLEXINT_H --noline --header-file=cmDependsJavaLexer.h -ocmDependsJavaLexer.cxx cmDependsJavaLexer.in.l
Modify cmDependsJavaLexer.cxx:
- - remove trailing whitespace: sed -i 's/\s*$//' cmDependsJavaLexer.h cmDependsJavaLexer.cxx
- - remove blank lines at end of file
- - #include "cmStandardLexer.h" at the top
- - add cast in cmDependsJava_yy_scan_bytes for loop condition of _yybytes_len to size_t
+ - remove trailing whitespace: sed -i 's/\s*$//' cmDependsJavaLexer.h cmDependsJavaLexer.cxx
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmDependsJavaLexer.h cmDependsJavaLexer.cxx
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmDependsJavaLexer.cxx
*/
@@ -682,9 +878,6 @@ Modify cmDependsJavaLexer.cxx:
/*--------------------------------------------------------------------------*/
-
-#line 686 "cmDependsJavaLexer.cxx"
-
#define INITIAL 0
#define comment 1
#define string 2
@@ -727,44 +920,44 @@ struct yyguts_t
}; /* end struct yyguts_t */
-static int yy_init_globals (yyscan_t yyscanner );
+static int yy_init_globals ( yyscan_t yyscanner );
-int cmDependsJava_yylex_init (yyscan_t* scanner);
+int yylex_init (yyscan_t* scanner);
-int cmDependsJava_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int cmDependsJava_yylex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
-int cmDependsJava_yyget_debug (yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
-void cmDependsJava_yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-YY_EXTRA_TYPE cmDependsJava_yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-void cmDependsJava_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-FILE *cmDependsJava_yyget_in (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
-void cmDependsJava_yyset_in (FILE * _in_str ,yyscan_t yyscanner );
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
-FILE *cmDependsJava_yyget_out (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
-void cmDependsJava_yyset_out (FILE * _out_str ,yyscan_t yyscanner );
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
- int cmDependsJava_yyget_leng (yyscan_t yyscanner );
+ int yyget_leng ( yyscan_t yyscanner );
-char *cmDependsJava_yyget_text (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
-int cmDependsJava_yyget_lineno (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
-void cmDependsJava_yyset_lineno (int _line_number ,yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
-int cmDependsJava_yyget_column (yyscan_t yyscanner );
+int yyget_column ( yyscan_t yyscanner );
-void cmDependsJava_yyset_column (int _column_no ,yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -772,32 +965,31 @@ void cmDependsJava_yyset_column (int _column_no ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int cmDependsJava_yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int cmDependsJava_yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
#ifndef YY_NO_UNPUT
- static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
+ static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
-
#ifdef __cplusplus
-static int yyinput (yyscan_t yyscanner );
+static int yyinput ( yyscan_t yyscanner );
#else
-static int input (yyscan_t yyscanner );
+static int input ( yyscan_t yyscanner );
#endif
#endif
@@ -828,7 +1020,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -841,7 +1033,7 @@ static int input (yyscan_t yyscanner );
else \
{ \
errno=0; \
- while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
@@ -882,9 +1074,9 @@ static int input (yyscan_t yyscanner );
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int cmDependsJava_yylex (yyscan_t yyscanner);
+extern int yylex (yyscan_t yyscanner);
-#define YY_DECL int cmDependsJava_yylex (yyscan_t yyscanner)
+#define YY_DECL int yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after yytext and yyleng
@@ -929,18 +1121,15 @@ YY_DECL
yyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
- cmDependsJava_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmDependsJava_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- cmDependsJava_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
{
-#line 48 "cmDependsJavaLexer.in.l"
-
-#line 943 "cmDependsJavaLexer.cxx"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -968,9 +1157,9 @@ yy_match:
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 327 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 414 );
@@ -999,539 +1188,432 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 49 "cmDependsJavaLexer.in.l"
{ BEGIN(comment); }
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 50 "cmDependsJavaLexer.in.l"
{ BEGIN(INITIAL); }
YY_BREAK
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
-#line 51 "cmDependsJavaLexer.in.l"
{}
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 53 "cmDependsJavaLexer.in.l"
{ BEGIN(string); }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 54 "cmDependsJavaLexer.in.l"
{ BEGIN(INITIAL); return jp_STRINGLITERAL; }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 55 "cmDependsJavaLexer.in.l"
{}
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 57 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_ABSTRACT; }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 58 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_ASSERT; }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 59 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_BOOLEAN_TYPE; }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 60 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_BREAK; }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 61 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_BYTE_TYPE; }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 62 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_CASE; }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 63 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_CATCH; }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 64 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_CHAR_TYPE; }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 65 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_CLASS; }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 66 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_CONTINUE; }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 67 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_DEFAULT; }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 68 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_DO; }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 69 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_DOUBLE_TYPE; }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 70 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_ELSE; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 71 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_EXTENDS; }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 72 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_FINAL; }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 73 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_FINALLY; }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 74 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_FLOAT_TYPE; }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 75 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_FOR; }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 76 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_IF; }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 77 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_IMPLEMENTS; }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 78 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_IMPORT; }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 79 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_INSTANCEOF; }
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 80 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_INT_TYPE; }
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 81 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_INTERFACE; }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 82 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_LONG_TYPE; }
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 83 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_NATIVE; }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 84 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_NEW; }
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 85 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_PACKAGE; }
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 86 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_PRIVATE; }
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 87 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_PROTECTED; }
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 88 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_PUBLIC; }
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 89 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_RETURN; }
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 90 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_SHORT_TYPE; }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 91 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_STATIC; }
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 92 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_STRICTFP; }
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 93 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_SUPER; }
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 94 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_SWITCH; }
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 95 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_SYNCHRONIZED; }
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 96 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_THIS; }
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 97 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_THROW; }
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 98 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_THROWS; }
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 99 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_TRANSIENT; }
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 100 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_TRY; }
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 101 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_VOID; }
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 102 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_VOLATILE; }
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 103 "cmDependsJavaLexer.in.l"
{ KEYWORD; return jp_WHILE; }
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 105 "cmDependsJavaLexer.in.l"
{ PRIMITIVE; return jp_BOOLEANLITERAL; }
YY_BREAK
case 55:
/* rule 55 can match eol */
YY_RULE_SETUP
-#line 106 "cmDependsJavaLexer.in.l"
{ PRIMITIVE; return jp_CHARACTERLITERAL; }
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 107 "cmDependsJavaLexer.in.l"
{ PRIMITIVE; return jp_DECIMALINTEGERLITERAL; }
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 108 "cmDependsJavaLexer.in.l"
{ PRIMITIVE; return jp_FLOATINGPOINTLITERAL; }
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 109 "cmDependsJavaLexer.in.l"
{ PRIMITIVE; return jp_HEXINTEGERLITERAL; }
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 110 "cmDependsJavaLexer.in.l"
{ PRIMITIVE; return jp_NULLLITERAL; }
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 112 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_AND; }
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 113 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_ANDAND; }
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 114 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_ANDEQUALS; }
YY_BREAK
case 63:
YY_RULE_SETUP
-#line 115 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_BRACKETEND; }
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 116 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_BRACKETSTART; }
YY_BREAK
case 65:
YY_RULE_SETUP
-#line 117 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_CARROT; }
YY_BREAK
case 66:
YY_RULE_SETUP
-#line 118 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_CARROTEQUALS; }
YY_BREAK
case 67:
YY_RULE_SETUP
-#line 119 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_COLON; }
YY_BREAK
case 68:
YY_RULE_SETUP
-#line 120 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_COMMA; }
YY_BREAK
case 69:
YY_RULE_SETUP
-#line 121 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_CURLYEND; }
YY_BREAK
case 70:
YY_RULE_SETUP
-#line 122 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_CURLYSTART; }
YY_BREAK
case 71:
YY_RULE_SETUP
-#line 123 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_DIVIDE; }
YY_BREAK
case 72:
YY_RULE_SETUP
-#line 124 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_DIVIDEEQUALS; }
YY_BREAK
case 73:
YY_RULE_SETUP
-#line 125 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_DOLLAR; }
YY_BREAK
case 74:
YY_RULE_SETUP
-#line 126 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_DOT; }
YY_BREAK
case 75:
YY_RULE_SETUP
-#line 127 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_EQUALS; }
YY_BREAK
case 76:
YY_RULE_SETUP
-#line 128 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_EQUALSEQUALS; }
YY_BREAK
case 77:
YY_RULE_SETUP
-#line 129 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_EXCLAMATION; }
YY_BREAK
case 78:
YY_RULE_SETUP
-#line 130 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_EXCLAMATIONEQUALS; }
YY_BREAK
case 79:
YY_RULE_SETUP
-#line 131 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_GREATER; }
YY_BREAK
case 80:
YY_RULE_SETUP
-#line 132 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_GTEQUALS; }
YY_BREAK
case 81:
YY_RULE_SETUP
-#line 133 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_GTGT; }
YY_BREAK
case 82:
YY_RULE_SETUP
-#line 134 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_GTGTEQUALS; }
YY_BREAK
case 83:
YY_RULE_SETUP
-#line 135 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_GTGTGT; }
YY_BREAK
case 84:
YY_RULE_SETUP
-#line 136 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_GTGTGTEQUALS; }
YY_BREAK
case 85:
YY_RULE_SETUP
-#line 137 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_LESLESEQUALS; }
YY_BREAK
case 86:
YY_RULE_SETUP
-#line 138 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_LESSTHAN; }
YY_BREAK
case 87:
YY_RULE_SETUP
-#line 139 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_LTEQUALS; }
YY_BREAK
case 88:
YY_RULE_SETUP
-#line 140 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_LTLT; }
YY_BREAK
case 89:
YY_RULE_SETUP
-#line 141 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_MINUS; }
YY_BREAK
case 90:
YY_RULE_SETUP
-#line 142 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_MINUSEQUALS; }
YY_BREAK
case 91:
YY_RULE_SETUP
-#line 143 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_MINUSMINUS; }
YY_BREAK
case 92:
YY_RULE_SETUP
-#line 144 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_PAREEND; }
YY_BREAK
case 93:
YY_RULE_SETUP
-#line 145 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_PARESTART; }
YY_BREAK
case 94:
YY_RULE_SETUP
-#line 146 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_PERCENT; }
YY_BREAK
case 95:
YY_RULE_SETUP
-#line 147 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_PERCENTEQUALS; }
YY_BREAK
case 96:
YY_RULE_SETUP
-#line 148 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_PIPE; }
YY_BREAK
case 97:
YY_RULE_SETUP
-#line 149 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_PIPEEQUALS; }
YY_BREAK
case 98:
YY_RULE_SETUP
-#line 150 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_PIPEPIPE; }
YY_BREAK
case 99:
YY_RULE_SETUP
-#line 151 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_PLUS; }
YY_BREAK
case 100:
YY_RULE_SETUP
-#line 152 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_PLUSEQUALS; }
YY_BREAK
case 101:
YY_RULE_SETUP
-#line 153 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_PLUSPLUS; }
YY_BREAK
case 102:
YY_RULE_SETUP
-#line 154 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_QUESTION; }
YY_BREAK
case 103:
YY_RULE_SETUP
-#line 155 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_SEMICOL; }
YY_BREAK
case 104:
YY_RULE_SETUP
-#line 156 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_TILDE; }
YY_BREAK
case 105:
YY_RULE_SETUP
-#line 157 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_TIMES; }
YY_BREAK
case 106:
YY_RULE_SETUP
-#line 158 "cmDependsJavaLexer.in.l"
{ SYMBOL; return jp_TIMESEQUALS; }
YY_BREAK
case 107:
YY_RULE_SETUP
-#line 160 "cmDependsJavaLexer.in.l"
{
yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
return jp_NAME;
@@ -1540,18 +1622,15 @@ YY_RULE_SETUP
case 108:
/* rule 108 can match eol */
YY_RULE_SETUP
-#line 165 "cmDependsJavaLexer.in.l"
{ }
YY_BREAK
case 109:
/* rule 109 can match eol */
YY_RULE_SETUP
-#line 166 "cmDependsJavaLexer.in.l"
{ }
YY_BREAK
case 110:
YY_RULE_SETUP
-#line 167 "cmDependsJavaLexer.in.l"
{
std::cerr << "Unknown character: " << yytext[0]
<< " (" << (int)yytext[0] << ")" << std::endl;
@@ -1561,10 +1640,8 @@ YY_RULE_SETUP
YY_BREAK
case 111:
YY_RULE_SETUP
-#line 174 "cmDependsJavaLexer.in.l"
ECHO;
YY_BREAK
-#line 1567 "cmDependsJavaLexer.cxx"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(comment):
case YY_STATE_EOF(string):
@@ -1584,7 +1661,7 @@ case YY_STATE_EOF(string):
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
- * cmDependsJava_yylex(). If so, then we have to assure
+ * yylex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
@@ -1644,7 +1721,7 @@ case YY_STATE_EOF(string):
{
yyg->yy_did_buffer_switch_on_eof = 0;
- if ( cmDependsJava_yywrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
@@ -1698,7 +1775,7 @@ case YY_STATE_EOF(string):
} /* end of action switch */
} /* end of scanning one token */
} /* end of user's declarations */
-} /* end of cmDependsJava_yylex */
+} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -1712,7 +1789,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = yyg->yytext_ptr;
- yy_size_t number_to_move, i;
+ int number_to_move, i;
int ret_val;
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
@@ -1741,7 +1818,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -1777,7 +1854,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- cmDependsJava_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
}
else
/* Can't grow it, we don't own it. */
@@ -1809,7 +1887,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- cmDependsJava_yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
}
else
@@ -1823,12 +1901,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cmDependsJava_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
yyg->yy_n_chars += number_to_move;
@@ -1862,9 +1943,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 327 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return yy_current_state;
@@ -1891,9 +1972,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 327 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 326);
(void)yyg;
@@ -1967,7 +2048,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{ /* need more input */
- int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
@@ -1984,13 +2065,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*/
/* Reset buffer status. */
- cmDependsJava_yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( cmDependsJava_yywrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
return 0;
if ( ! yyg->yy_did_buffer_switch_on_eof )
@@ -2022,34 +2103,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @note This function does not reset the start condition to @c INITIAL .
*/
- void cmDependsJava_yyrestart (FILE * input_file , yyscan_t yyscanner)
+ void yyrestart (FILE * input_file , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! YY_CURRENT_BUFFER ){
- cmDependsJava_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmDependsJava_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- cmDependsJava_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
- cmDependsJava_yy_load_buffer_state(yyscanner );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
+ yy_load_buffer_state( yyscanner );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
* @param yyscanner The scanner object.
*/
- void cmDependsJava_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* TODO. We should be able to replace this entire function body
* with
- * cmDependsJava_yypop_buffer_state();
- * cmDependsJava_yypush_buffer_state(new_buffer);
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
*/
- cmDependsJava_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
if ( YY_CURRENT_BUFFER == new_buffer )
return;
@@ -2062,17 +2143,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- cmDependsJava_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
/* We don't actually know whether we did this switch during
- * EOF (cmDependsJava_yywrap()) processing, but the only time this flag
- * is looked at is after cmDependsJava_yywrap() is called, so it's safe
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yyg->yy_did_buffer_switch_on_eof = 1;
}
-static void cmDependsJava_yy_load_buffer_state (yyscan_t yyscanner)
+static void yy_load_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
@@ -2087,35 +2168,35 @@ static void cmDependsJava_yy_load_buffer_state (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the allocated buffer state.
*/
- YY_BUFFER_STATE cmDependsJava_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) cmDependsJava_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsJava_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_buf_size = (yy_size_t)size;
+ b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) cmDependsJava_yyalloc(b->yy_buf_size + 2 ,yyscanner );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsJava_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- cmDependsJava_yy_init_buffer(b,file ,yyscanner);
+ yy_init_buffer( b, file , yyscanner);
return b;
}
/** Destroy the buffer.
- * @param b a buffer created with cmDependsJava_yy_create_buffer()
+ * @param b a buffer created with yy_create_buffer()
* @param yyscanner The scanner object.
*/
- void cmDependsJava_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2126,28 +2207,28 @@ static void cmDependsJava_yy_load_buffer_state (yyscan_t yyscanner)
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- cmDependsJava_yyfree((void *) b->yy_ch_buf ,yyscanner );
+ yyfree( (void *) b->yy_ch_buf , yyscanner );
- cmDependsJava_yyfree((void *) b ,yyscanner );
+ yyfree( (void *) b , yyscanner );
}
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
- * such as during a cmDependsJava_yyrestart() or at EOF.
+ * such as during a yyrestart() or at EOF.
*/
- static void cmDependsJava_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
{
int oerrno = errno;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- cmDependsJava_yy_flush_buffer(b ,yyscanner);
+ yy_flush_buffer( b , yyscanner);
b->yy_input_file = file;
b->yy_fill_buffer = 1;
- /* If b is the current buffer, then cmDependsJava_yy_init_buffer was _probably_
- * called from cmDependsJava_yyrestart() or through yy_get_next_buffer.
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
@@ -2164,7 +2245,7 @@ static void cmDependsJava_yy_load_buffer_state (yyscan_t yyscanner)
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
* @param yyscanner The scanner object.
*/
- void cmDependsJava_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! b )
@@ -2185,7 +2266,7 @@ static void cmDependsJava_yy_load_buffer_state (yyscan_t yyscanner)
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- cmDependsJava_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -2194,15 +2275,15 @@ static void cmDependsJava_yy_load_buffer_state (yyscan_t yyscanner)
* @param new_buffer The new state.
* @param yyscanner The scanner object.
*/
-void cmDependsJava_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (new_buffer == NULL)
return;
- cmDependsJava_yyensure_buffer_stack(yyscanner);
+ yyensure_buffer_stack(yyscanner);
- /* This block is copied from cmDependsJava_yy_switch_to_buffer. */
+ /* This block is copied from yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
@@ -2216,8 +2297,8 @@ void cmDependsJava_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yy
yyg->yy_buffer_stack_top++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from cmDependsJava_yy_switch_to_buffer. */
- cmDependsJava_yy_load_buffer_state(yyscanner );
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
@@ -2225,19 +2306,19 @@ void cmDependsJava_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yy
* The next element becomes the new top.
* @param yyscanner The scanner object.
*/
-void cmDependsJava_yypop_buffer_state (yyscan_t yyscanner)
+void yypop_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!YY_CURRENT_BUFFER)
return;
- cmDependsJava_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+ yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
YY_CURRENT_BUFFER_LVALUE = NULL;
if (yyg->yy_buffer_stack_top > 0)
--yyg->yy_buffer_stack_top;
if (YY_CURRENT_BUFFER) {
- cmDependsJava_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
}
@@ -2245,9 +2326,9 @@ void cmDependsJava_yypop_buffer_state (yyscan_t yyscanner)
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
-static void cmDependsJava_yyensure_buffer_stack (yyscan_t yyscanner)
+static void yyensure_buffer_stack (yyscan_t yyscanner)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!yyg->yy_buffer_stack) {
@@ -2257,11 +2338,11 @@ static void cmDependsJava_yyensure_buffer_stack (yyscan_t yyscanner)
* immediate realloc on the next call.
*/
num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmDependsJava_yyalloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsJava_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
@@ -2276,12 +2357,12 @@ static void cmDependsJava_yyensure_buffer_stack (yyscan_t yyscanner)
yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmDependsJava_yyrealloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsJava_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -2295,7 +2376,7 @@ static void cmDependsJava_yyensure_buffer_stack (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmDependsJava_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
@@ -2305,11 +2386,11 @@ YY_BUFFER_STATE cmDependsJava_yy_scan_buffer (char * base, yy_size_t size , yy
/* They forgot to leave room for the EOB's. */
return NULL;
- b = (YY_BUFFER_STATE) cmDependsJava_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsJava_yy_scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = NULL;
@@ -2319,53 +2400,53 @@ YY_BUFFER_STATE cmDependsJava_yy_scan_buffer (char * base, yy_size_t size , yy
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- cmDependsJava_yy_switch_to_buffer(b ,yyscanner );
+ yy_switch_to_buffer( b , yyscanner );
return b;
}
-/** Setup the input buffer state to scan a string. The next call to cmDependsJava_yylex() will
+/** Setup the input buffer state to scan a string. The next call to yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
- * cmDependsJava_yy_scan_bytes() instead.
+ * yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE cmDependsJava_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
{
- return cmDependsJava_yy_scan_bytes(yystr,(int) strlen(yystr) ,yyscanner);
+ return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
}
-/** Setup the input buffer state to scan the given bytes. The next call to cmDependsJava_yylex() will
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmDependsJava_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- yy_size_t i;
+ int i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = (yy_size_t) _yybytes_len + 2;
- buf = (char *) cmDependsJava_yyalloc(n ,yyscanner );
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n , yyscanner );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmDependsJava_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
- for ( i = 0; i < (size_t)_yybytes_len; ++i )
+ for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = cmDependsJava_yy_scan_buffer(buf,n ,yyscanner);
+ b = yy_scan_buffer( buf, n , yyscanner);
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in cmDependsJava_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -2379,11 +2460,11 @@ YY_BUFFER_STATE cmDependsJava_yy_scan_bytes (yyconst char * yybytes, int _yyby
#define YY_EXIT_FAILURE 2
#endif
-static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- (void) fprintf( stderr, "%s\n", msg );
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -2409,7 +2490,7 @@ static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
/** Get the user-defined data for this scanner.
* @param yyscanner The scanner object.
*/
-YY_EXTRA_TYPE cmDependsJava_yyget_extra (yyscan_t yyscanner)
+YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyextra;
@@ -2418,7 +2499,7 @@ YY_EXTRA_TYPE cmDependsJava_yyget_extra (yyscan_t yyscanner)
/** Get the current line number.
* @param yyscanner The scanner object.
*/
-int cmDependsJava_yyget_lineno (yyscan_t yyscanner)
+int yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2431,7 +2512,7 @@ int cmDependsJava_yyget_lineno (yyscan_t yyscanner)
/** Get the current column number.
* @param yyscanner The scanner object.
*/
-int cmDependsJava_yyget_column (yyscan_t yyscanner)
+int yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2444,7 +2525,7 @@ int cmDependsJava_yyget_column (yyscan_t yyscanner)
/** Get the input stream.
* @param yyscanner The scanner object.
*/
-FILE *cmDependsJava_yyget_in (yyscan_t yyscanner)
+FILE *yyget_in (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyin;
@@ -2453,7 +2534,7 @@ FILE *cmDependsJava_yyget_in (yyscan_t yyscanner)
/** Get the output stream.
* @param yyscanner The scanner object.
*/
-FILE *cmDependsJava_yyget_out (yyscan_t yyscanner)
+FILE *yyget_out (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyout;
@@ -2462,7 +2543,7 @@ FILE *cmDependsJava_yyget_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-int cmDependsJava_yyget_leng (yyscan_t yyscanner)
+int yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
@@ -2472,7 +2553,7 @@ int cmDependsJava_yyget_leng (yyscan_t yyscanner)
* @param yyscanner The scanner object.
*/
-char *cmDependsJava_yyget_text (yyscan_t yyscanner)
+char *yyget_text (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yytext;
@@ -2482,7 +2563,7 @@ char *cmDependsJava_yyget_text (yyscan_t yyscanner)
* @param user_defined The data to be associated with this scanner.
* @param yyscanner The scanner object.
*/
-void cmDependsJava_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyextra = user_defined ;
@@ -2492,13 +2573,13 @@ void cmDependsJava_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner
* @param _line_number line number
* @param yyscanner The scanner object.
*/
-void cmDependsJava_yyset_lineno (int _line_number , yyscan_t yyscanner)
+void yyset_lineno (int _line_number , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "cmDependsJava_yyset_lineno called with no buffer" );
+ YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
yylineno = _line_number;
}
@@ -2507,13 +2588,13 @@ void cmDependsJava_yyset_lineno (int _line_number , yyscan_t yyscanner)
* @param _column_no column number
* @param yyscanner The scanner object.
*/
-void cmDependsJava_yyset_column (int _column_no , yyscan_t yyscanner)
+void yyset_column (int _column_no , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "cmDependsJava_yyset_column called with no buffer" );
+ YY_FATAL_ERROR( "yyset_column called with no buffer" );
yycolumn = _column_no;
}
@@ -2522,27 +2603,27 @@ void cmDependsJava_yyset_column (int _column_no , yyscan_t yyscanner)
* input buffer.
* @param _in_str A readable stream.
* @param yyscanner The scanner object.
- * @see cmDependsJava_yy_switch_to_buffer
+ * @see yy_switch_to_buffer
*/
-void cmDependsJava_yyset_in (FILE * _in_str , yyscan_t yyscanner)
+void yyset_in (FILE * _in_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyin = _in_str ;
}
-void cmDependsJava_yyset_out (FILE * _out_str , yyscan_t yyscanner)
+void yyset_out (FILE * _out_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyout = _out_str ;
}
-int cmDependsJava_yyget_debug (yyscan_t yyscanner)
+int yyget_debug (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yy_flex_debug;
}
-void cmDependsJava_yyset_debug (int _bdebug , yyscan_t yyscanner)
+void yyset_debug (int _bdebug , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_flex_debug = _bdebug ;
@@ -2552,20 +2633,18 @@ void cmDependsJava_yyset_debug (int _bdebug , yyscan_t yyscanner)
/* User-visible API */
-/* cmDependsJava_yylex_init is special because it creates the scanner itself, so it is
+/* yylex_init is special because it creates the scanner itself, so it is
* the ONLY reentrant function that doesn't take the scanner as the last argument.
* That's why we explicitly handle the declaration, instead of using our macros.
*/
-
-int cmDependsJava_yylex_init(yyscan_t* ptr_yy_globals)
-
+int yylex_init(yyscan_t* ptr_yy_globals)
{
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmDependsJava_yyalloc ( sizeof( struct yyguts_t ), NULL );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -2578,27 +2657,25 @@ int cmDependsJava_yylex_init(yyscan_t* ptr_yy_globals)
return yy_init_globals ( *ptr_yy_globals );
}
-/* cmDependsJava_yylex_init_extra has the same functionality as cmDependsJava_yylex_init, but follows the
+/* yylex_init_extra has the same functionality as yylex_init, but follows the
* convention of taking the scanner as the last argument. Note however, that
* this is a *pointer* to a scanner, as it will be allocated by this call (and
* is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to cmDependsJava_yyalloc in
+ * The user defined value in the first argument will be available to yyalloc in
* the yyextra field.
*/
-
-int cmDependsJava_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
+int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
{
struct yyguts_t dummy_yyguts;
- cmDependsJava_yyset_extra (yy_user_defined, &dummy_yyguts);
+ yyset_extra (yy_user_defined, &dummy_yyguts);
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmDependsJava_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -2609,7 +2686,7 @@ int cmDependsJava_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_y
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
- cmDependsJava_yyset_extra (yy_user_defined, *ptr_yy_globals);
+ yyset_extra (yy_user_defined, *ptr_yy_globals);
return yy_init_globals ( *ptr_yy_globals );
}
@@ -2618,7 +2695,7 @@ static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Initialization is the same as for the non-reentrant scanner.
- * This function is called from cmDependsJava_yylex_destroy(), so don't allocate here.
+ * This function is called from yylex_destroy(), so don't allocate here.
*/
yyg->yy_buffer_stack = NULL;
@@ -2642,37 +2719,37 @@ static int yy_init_globals (yyscan_t yyscanner)
#endif
/* For future reference: Set errno on error, since we are called by
- * cmDependsJava_yylex_init()
+ * yylex_init()
*/
return 0;
}
-/* cmDependsJava_yylex_destroy is for both reentrant and non-reentrant scanners. */
-int cmDependsJava_yylex_destroy (yyscan_t yyscanner)
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- cmDependsJava_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
YY_CURRENT_BUFFER_LVALUE = NULL;
- cmDependsJava_yypop_buffer_state(yyscanner);
+ yypop_buffer_state(yyscanner);
}
/* Destroy the stack itself. */
- cmDependsJava_yyfree(yyg->yy_buffer_stack ,yyscanner);
+ yyfree(yyg->yy_buffer_stack , yyscanner);
yyg->yy_buffer_stack = NULL;
/* Destroy the start condition stack. */
- cmDependsJava_yyfree(yyg->yy_start_stack ,yyscanner );
+ yyfree( yyg->yy_start_stack , yyscanner );
yyg->yy_start_stack = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
- * cmDependsJava_yylex() is called, initialization will occur. */
+ * yylex() is called, initialization will occur. */
yy_init_globals( yyscanner);
/* Destroy the main struct (reentrant only). */
- cmDependsJava_yyfree ( yyscanner , yyscanner );
+ yyfree ( yyscanner , yyscanner );
yyscanner = NULL;
return 0;
}
@@ -2682,7 +2759,7 @@ int cmDependsJava_yylex_destroy (yyscan_t yyscanner)
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -2694,7 +2771,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
{
int n;
for ( n = 0; s[n]; ++n )
@@ -2704,14 +2781,14 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
}
#endif
-void *cmDependsJava_yyalloc (yy_size_t size , yyscan_t yyscanner)
+void *yyalloc (yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
return malloc(size);
}
-void *cmDependsJava_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
+void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -2726,13 +2803,11 @@ void *cmDependsJava_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner
return realloc(ptr, size);
}
-void cmDependsJava_yyfree (void * ptr , yyscan_t yyscanner)
+void yyfree (void * ptr , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- free( (char *) ptr ); /* see cmDependsJava_yyrealloc() for (char *) cast */
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
-
-#line 174 "cmDependsJavaLexer.in.l"
diff --git a/Source/LexerParser/cmDependsJavaLexer.h b/Source/LexerParser/cmDependsJavaLexer.h
index ccadd70..f1e87d2 100644
--- a/Source/LexerParser/cmDependsJavaLexer.h
+++ b/Source/LexerParser/cmDependsJavaLexer.h
@@ -2,10 +2,6 @@
#define cmDependsJava_yyHEADER_H 1
#define cmDependsJava_yyIN_HEADER 1
-#line 6 "cmDependsJavaLexer.h"
-
-#line 8 "cmDependsJavaLexer.h"
-
#define FLEXINT_H 1
#define YY_INT_ALIGNED short int
@@ -14,11 +10,221 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define cmDependsJava_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer cmDependsJava_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define cmDependsJava_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer cmDependsJava_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define cmDependsJava_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer cmDependsJava_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define cmDependsJava_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string cmDependsJava_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define cmDependsJava_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes cmDependsJava_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define cmDependsJava_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer cmDependsJava_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define cmDependsJava_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer cmDependsJava_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define cmDependsJava_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state cmDependsJava_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define cmDependsJava_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer cmDependsJava_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define cmDependsJava_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state cmDependsJava_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define cmDependsJava_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state cmDependsJava_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define cmDependsJava_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack cmDependsJava_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define cmDependsJava_yylex_ALREADY_DEFINED
+#else
+#define yylex cmDependsJava_yylex
+#endif
+
+#ifdef yyrestart
+#define cmDependsJava_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart cmDependsJava_yyrestart
+#endif
+
+#ifdef yylex_init
+#define cmDependsJava_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init cmDependsJava_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define cmDependsJava_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra cmDependsJava_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define cmDependsJava_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy cmDependsJava_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define cmDependsJava_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug cmDependsJava_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define cmDependsJava_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug cmDependsJava_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define cmDependsJava_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra cmDependsJava_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define cmDependsJava_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra cmDependsJava_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define cmDependsJava_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in cmDependsJava_yyget_in
+#endif
+
+#ifdef yyset_in
+#define cmDependsJava_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in cmDependsJava_yyset_in
+#endif
+
+#ifdef yyget_out
+#define cmDependsJava_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out cmDependsJava_yyget_out
+#endif
+
+#ifdef yyset_out
+#define cmDependsJava_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out cmDependsJava_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define cmDependsJava_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng cmDependsJava_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define cmDependsJava_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text cmDependsJava_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define cmDependsJava_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno cmDependsJava_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define cmDependsJava_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno cmDependsJava_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define cmDependsJava_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column cmDependsJava_yyget_column
+#endif
+
+#ifdef yyset_column
+#define cmDependsJava_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column cmDependsJava_yyset_column
+#endif
+
+#ifdef yywrap
+#define cmDependsJava_yywrap_ALREADY_DEFINED
+#else
+#define yywrap cmDependsJava_yywrap
+#endif
+
+#ifdef yyalloc
+#define cmDependsJava_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc cmDependsJava_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define cmDependsJava_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc cmDependsJava_yyrealloc
+#endif
+
+#ifdef yyfree
+#define cmDependsJava_yyfree_ALREADY_DEFINED
+#else
+#define yyfree cmDependsJava_yyfree
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -89,10 +295,16 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */
+
/* TODO: this is always defined, so inline it */
#define yyconst const
@@ -193,21 +405,21 @@ struct yy_buffer_state
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-void cmDependsJava_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmDependsJava_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsJava_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void cmDependsJava_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmDependsJava_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmDependsJava_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void cmDependsJava_yypop_buffer_state (yyscan_t yyscanner );
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsJava_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsJava_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmDependsJava_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
-void *cmDependsJava_yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *cmDependsJava_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void cmDependsJava_yyfree (void * ,yyscan_t yyscanner );
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
/* Begin user sect3 */
@@ -227,42 +439,42 @@ void cmDependsJava_yyfree (void * ,yyscan_t yyscanner );
#define YY_EXTRA_TYPE void *
#endif
-int cmDependsJava_yylex_init (yyscan_t* scanner);
+int yylex_init (yyscan_t* scanner);
-int cmDependsJava_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int cmDependsJava_yylex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
-int cmDependsJava_yyget_debug (yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
-void cmDependsJava_yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-YY_EXTRA_TYPE cmDependsJava_yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-void cmDependsJava_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-FILE *cmDependsJava_yyget_in (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
-void cmDependsJava_yyset_in (FILE * _in_str ,yyscan_t yyscanner );
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
-FILE *cmDependsJava_yyget_out (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
-void cmDependsJava_yyset_out (FILE * _out_str ,yyscan_t yyscanner );
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
- int cmDependsJava_yyget_leng (yyscan_t yyscanner );
+ int yyget_leng ( yyscan_t yyscanner );
-char *cmDependsJava_yyget_text (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
-int cmDependsJava_yyget_lineno (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
-void cmDependsJava_yyset_lineno (int _line_number ,yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
-int cmDependsJava_yyget_column (yyscan_t yyscanner );
+int yyget_column ( yyscan_t yyscanner );
-void cmDependsJava_yyset_column (int _column_no ,yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -270,18 +482,18 @@ void cmDependsJava_yyset_column (int _column_no ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int cmDependsJava_yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int cmDependsJava_yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
@@ -309,9 +521,9 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int cmDependsJava_yylex (yyscan_t yyscanner);
+extern int yylex (yyscan_t yyscanner);
-#define YY_DECL int cmDependsJava_yylex (yyscan_t yyscanner)
+#define YY_DECL int yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* yy_get_previous_state - get the state just before the EOB char was reached */
@@ -328,9 +540,150 @@ extern int cmDependsJava_yylex (yyscan_t yyscanner);
#undef YY_DECL
#endif
-#line 174 "cmDependsJavaLexer.in.l"
-
+#ifndef cmDependsJava_yy_create_buffer_ALREADY_DEFINED
+#undef yy_create_buffer
+#endif
+#ifndef cmDependsJava_yy_delete_buffer_ALREADY_DEFINED
+#undef yy_delete_buffer
+#endif
+#ifndef cmDependsJava_yy_scan_buffer_ALREADY_DEFINED
+#undef yy_scan_buffer
+#endif
+#ifndef cmDependsJava_yy_scan_string_ALREADY_DEFINED
+#undef yy_scan_string
+#endif
+#ifndef cmDependsJava_yy_scan_bytes_ALREADY_DEFINED
+#undef yy_scan_bytes
+#endif
+#ifndef cmDependsJava_yy_init_buffer_ALREADY_DEFINED
+#undef yy_init_buffer
+#endif
+#ifndef cmDependsJava_yy_flush_buffer_ALREADY_DEFINED
+#undef yy_flush_buffer
+#endif
+#ifndef cmDependsJava_yy_load_buffer_state_ALREADY_DEFINED
+#undef yy_load_buffer_state
+#endif
+#ifndef cmDependsJava_yy_switch_to_buffer_ALREADY_DEFINED
+#undef yy_switch_to_buffer
+#endif
+#ifndef cmDependsJava_yypush_buffer_state_ALREADY_DEFINED
+#undef yypush_buffer_state
+#endif
+#ifndef cmDependsJava_yypop_buffer_state_ALREADY_DEFINED
+#undef yypop_buffer_state
+#endif
+#ifndef cmDependsJava_yyensure_buffer_stack_ALREADY_DEFINED
+#undef yyensure_buffer_stack
+#endif
+#ifndef cmDependsJava_yylex_ALREADY_DEFINED
+#undef yylex
+#endif
+#ifndef cmDependsJava_yyrestart_ALREADY_DEFINED
+#undef yyrestart
+#endif
+#ifndef cmDependsJava_yylex_init_ALREADY_DEFINED
+#undef yylex_init
+#endif
+#ifndef cmDependsJava_yylex_init_extra_ALREADY_DEFINED
+#undef yylex_init_extra
+#endif
+#ifndef cmDependsJava_yylex_destroy_ALREADY_DEFINED
+#undef yylex_destroy
+#endif
+#ifndef cmDependsJava_yyget_debug_ALREADY_DEFINED
+#undef yyget_debug
+#endif
+#ifndef cmDependsJava_yyset_debug_ALREADY_DEFINED
+#undef yyset_debug
+#endif
+#ifndef cmDependsJava_yyget_extra_ALREADY_DEFINED
+#undef yyget_extra
+#endif
+#ifndef cmDependsJava_yyset_extra_ALREADY_DEFINED
+#undef yyset_extra
+#endif
+#ifndef cmDependsJava_yyget_in_ALREADY_DEFINED
+#undef yyget_in
+#endif
+#ifndef cmDependsJava_yyset_in_ALREADY_DEFINED
+#undef yyset_in
+#endif
+#ifndef cmDependsJava_yyget_out_ALREADY_DEFINED
+#undef yyget_out
+#endif
+#ifndef cmDependsJava_yyset_out_ALREADY_DEFINED
+#undef yyset_out
+#endif
+#ifndef cmDependsJava_yyget_leng_ALREADY_DEFINED
+#undef yyget_leng
+#endif
+#ifndef cmDependsJava_yyget_text_ALREADY_DEFINED
+#undef yyget_text
+#endif
+#ifndef cmDependsJava_yyget_lineno_ALREADY_DEFINED
+#undef yyget_lineno
+#endif
+#ifndef cmDependsJava_yyset_lineno_ALREADY_DEFINED
+#undef yyset_lineno
+#endif
+#ifndef cmDependsJava_yyget_column_ALREADY_DEFINED
+#undef yyget_column
+#endif
+#ifndef cmDependsJava_yyset_column_ALREADY_DEFINED
+#undef yyset_column
+#endif
+#ifndef cmDependsJava_yywrap_ALREADY_DEFINED
+#undef yywrap
+#endif
+#ifndef cmDependsJava_yyget_lval_ALREADY_DEFINED
+#undef yyget_lval
+#endif
+#ifndef cmDependsJava_yyset_lval_ALREADY_DEFINED
+#undef yyset_lval
+#endif
+#ifndef cmDependsJava_yyget_lloc_ALREADY_DEFINED
+#undef yyget_lloc
+#endif
+#ifndef cmDependsJava_yyset_lloc_ALREADY_DEFINED
+#undef yyset_lloc
+#endif
+#ifndef cmDependsJava_yyalloc_ALREADY_DEFINED
+#undef yyalloc
+#endif
+#ifndef cmDependsJava_yyrealloc_ALREADY_DEFINED
+#undef yyrealloc
+#endif
+#ifndef cmDependsJava_yyfree_ALREADY_DEFINED
+#undef yyfree
+#endif
+#ifndef cmDependsJava_yytext_ALREADY_DEFINED
+#undef yytext
+#endif
+#ifndef cmDependsJava_yyleng_ALREADY_DEFINED
+#undef yyleng
+#endif
+#ifndef cmDependsJava_yyin_ALREADY_DEFINED
+#undef yyin
+#endif
+#ifndef cmDependsJava_yyout_ALREADY_DEFINED
+#undef yyout
+#endif
+#ifndef cmDependsJava_yy_flex_debug_ALREADY_DEFINED
+#undef yy_flex_debug
+#endif
+#ifndef cmDependsJava_yylineno_ALREADY_DEFINED
+#undef yylineno
+#endif
+#ifndef cmDependsJava_yytables_fload_ALREADY_DEFINED
+#undef yytables_fload
+#endif
+#ifndef cmDependsJava_yytables_destroy_ALREADY_DEFINED
+#undef yytables_destroy
+#endif
+#ifndef cmDependsJava_yyTABLES_NAME_ALREADY_DEFINED
+#undef yyTABLES_NAME
+#endif
-#line 335 "cmDependsJavaLexer.h"
#undef cmDependsJava_yyIN_HEADER
#endif /* cmDependsJava_yyHEADER_H */
diff --git a/Source/LexerParser/cmDependsJavaLexer.in.l b/Source/LexerParser/cmDependsJavaLexer.in.l
index 8cb42b1..01a0fa3 100644
--- a/Source/LexerParser/cmDependsJavaLexer.in.l
+++ b/Source/LexerParser/cmDependsJavaLexer.in.l
@@ -7,13 +7,12 @@ This file must be translated to C++ and modified to build everywhere.
Run flex >= 2.6 like this:
- flex --nounistd -DFLEXINT_H --prefix=cmDependsJava_yy --header-file=cmDependsJavaLexer.h -ocmDependsJavaLexer.cxx cmDependsJavaLexer.in.l
+ flex --nounistd -DFLEXINT_H --noline --header-file=cmDependsJavaLexer.h -ocmDependsJavaLexer.cxx cmDependsJavaLexer.in.l
Modify cmDependsJavaLexer.cxx:
- - remove trailing whitespace: sed -i 's/\s*$//' cmDependsJavaLexer.h cmDependsJavaLexer.cxx
- - remove blank lines at end of file
- - #include "cmStandardLexer.h" at the top
- - add cast in yy_scan_bytes for loop condition of _yybytes_len to size_t
+ - remove trailing whitespace: sed -i 's/\s*$//' cmDependsJavaLexer.h cmDependsJavaLexer.cxx
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmDependsJavaLexer.h cmDependsJavaLexer.cxx
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmDependsJavaLexer.cxx
*/
@@ -38,6 +37,8 @@ Modify cmDependsJavaLexer.cxx:
/*--------------------------------------------------------------------------*/
%}
+%option prefix="cmDependsJava_yy"
+
%option reentrant
%option noyywrap
%pointer
diff --git a/Source/LexerParser/cmExprLexer.cxx b/Source/LexerParser/cmExprLexer.cxx
index fb6f0db..81a1ec5 100644
--- a/Source/LexerParser/cmExprLexer.cxx
+++ b/Source/LexerParser/cmExprLexer.cxx
@@ -1,7 +1,4 @@
#include "cmStandardLexer.h"
-#line 2 "cmExprLexer.cxx"
-
-#line 4 "cmExprLexer.cxx"
#define FLEXINT_H 1
#define YY_INT_ALIGNED short int
@@ -11,11 +8,221 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define cmExpr_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer cmExpr_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define cmExpr_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer cmExpr_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define cmExpr_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer cmExpr_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define cmExpr_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string cmExpr_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define cmExpr_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes cmExpr_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define cmExpr_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer cmExpr_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define cmExpr_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer cmExpr_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define cmExpr_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state cmExpr_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define cmExpr_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer cmExpr_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define cmExpr_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state cmExpr_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define cmExpr_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state cmExpr_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define cmExpr_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack cmExpr_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define cmExpr_yylex_ALREADY_DEFINED
+#else
+#define yylex cmExpr_yylex
+#endif
+
+#ifdef yyrestart
+#define cmExpr_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart cmExpr_yyrestart
+#endif
+
+#ifdef yylex_init
+#define cmExpr_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init cmExpr_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define cmExpr_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra cmExpr_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define cmExpr_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy cmExpr_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define cmExpr_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug cmExpr_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define cmExpr_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug cmExpr_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define cmExpr_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra cmExpr_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define cmExpr_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra cmExpr_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define cmExpr_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in cmExpr_yyget_in
+#endif
+
+#ifdef yyset_in
+#define cmExpr_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in cmExpr_yyset_in
+#endif
+
+#ifdef yyget_out
+#define cmExpr_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out cmExpr_yyget_out
+#endif
+
+#ifdef yyset_out
+#define cmExpr_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out cmExpr_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define cmExpr_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng cmExpr_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define cmExpr_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text cmExpr_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define cmExpr_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno cmExpr_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define cmExpr_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno cmExpr_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define cmExpr_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column cmExpr_yyget_column
+#endif
+
+#ifdef yyset_column
+#define cmExpr_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column cmExpr_yyset_column
+#endif
+
+#ifdef yywrap
+#define cmExpr_yywrap_ALREADY_DEFINED
+#else
+#define yywrap cmExpr_yywrap
+#endif
+
+#ifdef yyalloc
+#define cmExpr_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc cmExpr_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define cmExpr_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc cmExpr_yyrealloc
+#endif
+
+#ifdef yyfree
+#define cmExpr_yyfree_ALREADY_DEFINED
+#else
+#define yyfree cmExpr_yyfree
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -86,10 +293,16 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */
+
/* TODO: this is always defined, so inline it */
#define yyconst const
@@ -102,12 +315,10 @@ typedef unsigned int flex_uint32_t;
/* Returned upon end-of-file. */
#define YY_NULL 0
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -131,20 +342,16 @@ typedef void* yyscan_t;
* definition of BEGIN.
*/
#define BEGIN yyg->yy_start = 1 + 2 *
-
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yyg->yy_start - 1) / 2)
#define YYSTATE YY_START
-
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE cmExpr_yyrestart(yyin ,yyscanner )
-
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
@@ -194,7 +401,6 @@ typedef size_t yy_size_t;
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -254,7 +460,7 @@ struct yy_buffer_state
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via cmExpr_yyrestart()), so that the user can continue scanning by
+ * (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
@@ -271,73 +477,67 @@ struct yy_buffer_state
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
: NULL)
-
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-void cmExpr_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmExpr_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmExpr_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void cmExpr_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmExpr_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmExpr_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void cmExpr_yypop_buffer_state (yyscan_t yyscanner );
-
-static void cmExpr_yyensure_buffer_stack (yyscan_t yyscanner );
-static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner );
-static void cmExpr_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
-#define YY_FLUSH_BUFFER cmExpr_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
-YY_BUFFER_STATE cmExpr_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmExpr_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmExpr_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
-void *cmExpr_yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *cmExpr_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void cmExpr_yyfree (void * ,yyscan_t yyscanner );
-
-#define yy_new_buffer cmExpr_yy_create_buffer
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- cmExpr_yyensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmExpr_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
-
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- cmExpr_yyensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmExpr_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
#define cmExpr_yywrap(yyscanner) (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
+typedef flex_uint8_t YY_CHAR;
typedef int yy_state_type;
#define yytext_ptr yytext_r
-static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
-static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
@@ -348,7 +548,6 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-
#define YY_NUM_RULES 15
#define YY_END_OF_BUFFER 16
/* This struct is not used in this scanner,
@@ -358,14 +557,14 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[23] =
+static const flex_int16_t yy_accept[23] =
{ 0,
0, 0, 16, 15, 6, 8, 13, 14, 4, 2,
3, 5, 1, 15, 15, 9, 7, 10, 1, 11,
12, 0
} ;
-static yyconst YY_CHAR yy_ec[256] =
+static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -397,27 +596,27 @@ static yyconst YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst YY_CHAR yy_meta[16] =
+static const YY_CHAR yy_meta[16] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
-static yyconst flex_uint16_t yy_base[23] =
+static const flex_int16_t yy_base[23] =
{ 0,
0, 0, 20, 21, 21, 21, 21, 21, 21, 21,
21, 21, 9, 7, 5, 21, 21, 21, 6, 21,
21, 21
} ;
-static yyconst flex_int16_t yy_def[23] =
+static const flex_int16_t yy_def[23] =
{ 0,
22, 1, 22, 22, 22, 22, 22, 22, 22, 22,
22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
22, 0
} ;
-static yyconst flex_uint16_t yy_nxt[37] =
+static const flex_int16_t yy_nxt[37] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 21, 20, 19, 22,
@@ -425,7 +624,7 @@ static yyconst flex_uint16_t yy_nxt[37] =
22, 22, 22, 22, 22, 22
} ;
-static yyconst flex_int16_t yy_chk[37] =
+static const flex_int16_t yy_chk[37] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 19, 15, 14, 13, 3,
@@ -440,8 +639,6 @@ static yyconst flex_int16_t yy_chk[37] =
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-#line 1 "cmExprLexer.in.l"
-#line 2 "cmExprLexer.in.l"
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
/*
@@ -450,13 +647,12 @@ This file must be translated to C++ and modified to build everywhere.
Run flex >= 2.6 like this:
- flex --nounistd -DFLEXINT_H --prefix=cmExpr_yy --header-file=cmExprLexer.h -ocmExprLexer.cxx cmExprLexer.in.l
+ flex --nounistd -DFLEXINT_H --noline --header-file=cmExprLexer.h -ocmExprLexer.cxx cmExprLexer.in.l
Modify cmExprLexer.cxx:
- - remove trailing whitespace: sed -i 's/\s*$//' cmExprLexer.h cmExprLexer.cxx
- - remove blank lines at end of file
- - #include "cmStandardLexer.h" at the top
- - add cast in cmExpr_yy_scan_bytes for loop condition of _yybytes_len to size_t
+ - remove trailing whitespace: sed -i 's/\s*$//' cmExprLexer.h cmExprLexer.cxx
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmExprLexer.h cmExprLexer.cxx
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmExprLexer.cxx
*/
@@ -473,7 +669,6 @@ Modify cmExprLexer.cxx:
#include "cmExprParserTokens.h"
/*--------------------------------------------------------------------------*/
-#line 476 "cmExprLexer.cxx"
#define INITIAL 0
@@ -515,44 +710,44 @@ struct yyguts_t
}; /* end struct yyguts_t */
-static int yy_init_globals (yyscan_t yyscanner );
+static int yy_init_globals ( yyscan_t yyscanner );
-int cmExpr_yylex_init (yyscan_t* scanner);
+int yylex_init (yyscan_t* scanner);
-int cmExpr_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int cmExpr_yylex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
-int cmExpr_yyget_debug (yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
-void cmExpr_yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-YY_EXTRA_TYPE cmExpr_yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-void cmExpr_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-FILE *cmExpr_yyget_in (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
-void cmExpr_yyset_in (FILE * _in_str ,yyscan_t yyscanner );
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
-FILE *cmExpr_yyget_out (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
-void cmExpr_yyset_out (FILE * _out_str ,yyscan_t yyscanner );
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
- int cmExpr_yyget_leng (yyscan_t yyscanner );
+ int yyget_leng ( yyscan_t yyscanner );
-char *cmExpr_yyget_text (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
-int cmExpr_yyget_lineno (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
-void cmExpr_yyset_lineno (int _line_number ,yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
-int cmExpr_yyget_column (yyscan_t yyscanner );
+int yyget_column ( yyscan_t yyscanner );
-void cmExpr_yyset_column (int _column_no ,yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -560,32 +755,31 @@ void cmExpr_yyset_column (int _column_no ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int cmExpr_yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int cmExpr_yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
#ifndef YY_NO_UNPUT
- static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
+ static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
-
#ifdef __cplusplus
-static int yyinput (yyscan_t yyscanner );
+static int yyinput ( yyscan_t yyscanner );
#else
-static int input (yyscan_t yyscanner );
+static int input ( yyscan_t yyscanner );
#endif
#endif
@@ -616,7 +810,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -629,7 +823,7 @@ static int input (yyscan_t yyscanner );
else \
{ \
errno=0; \
- while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
@@ -670,9 +864,9 @@ static int input (yyscan_t yyscanner );
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int cmExpr_yylex (yyscan_t yyscanner);
+extern int yylex (yyscan_t yyscanner);
-#define YY_DECL int cmExpr_yylex (yyscan_t yyscanner)
+#define YY_DECL int yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after yytext and yyleng
@@ -717,19 +911,15 @@ YY_DECL
yyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
- cmExpr_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmExpr_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- cmExpr_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
{
-#line 39 "cmExprLexer.in.l"
-
-
-#line 732 "cmExprLexer.cxx"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -757,9 +947,9 @@ yy_match:
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 23 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 21 );
@@ -788,80 +978,64 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 41 "cmExprLexer.in.l"
{ yylvalp->Number = atoi(yytext); return exp_NUMBER; }
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 43 "cmExprLexer.in.l"
{ return exp_PLUS; }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 44 "cmExprLexer.in.l"
{ return exp_MINUS; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 45 "cmExprLexer.in.l"
{ return exp_TIMES; }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 46 "cmExprLexer.in.l"
{ return exp_DIVIDE; }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 47 "cmExprLexer.in.l"
{ return exp_MOD; }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 48 "cmExprLexer.in.l"
{ return exp_OR; }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 49 "cmExprLexer.in.l"
{ return exp_AND; }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 50 "cmExprLexer.in.l"
{ return exp_XOR; }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 51 "cmExprLexer.in.l"
{ return exp_NOT; }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 52 "cmExprLexer.in.l"
{ return exp_SHIFTLEFT; }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 53 "cmExprLexer.in.l"
{ return exp_SHIFTRIGHT; }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 54 "cmExprLexer.in.l"
{ return exp_OPENPARENT; }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 55 "cmExprLexer.in.l"
{ return exp_CLOSEPARENT; }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 57 "cmExprLexer.in.l"
ECHO;
YY_BREAK
-#line 864 "cmExprLexer.cxx"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -879,7 +1053,7 @@ case YY_STATE_EOF(INITIAL):
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
- * cmExpr_yylex(). If so, then we have to assure
+ * yylex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
@@ -939,7 +1113,7 @@ case YY_STATE_EOF(INITIAL):
{
yyg->yy_did_buffer_switch_on_eof = 0;
- if ( cmExpr_yywrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
@@ -993,7 +1167,7 @@ case YY_STATE_EOF(INITIAL):
} /* end of action switch */
} /* end of scanning one token */
} /* end of user's declarations */
-} /* end of cmExpr_yylex */
+} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -1007,7 +1181,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = yyg->yytext_ptr;
- yy_size_t number_to_move, i;
+ int number_to_move, i;
int ret_val;
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
@@ -1036,7 +1210,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -1072,7 +1246,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- cmExpr_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
}
else
/* Can't grow it, we don't own it. */
@@ -1104,7 +1279,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- cmExpr_yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
}
else
@@ -1118,12 +1293,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cmExpr_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
yyg->yy_n_chars += number_to_move;
@@ -1157,9 +1335,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 23 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return yy_current_state;
@@ -1186,9 +1364,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 23 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 22);
(void)yyg;
@@ -1262,7 +1440,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{ /* need more input */
- int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
@@ -1279,13 +1457,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*/
/* Reset buffer status. */
- cmExpr_yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( cmExpr_yywrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
return 0;
if ( ! yyg->yy_did_buffer_switch_on_eof )
@@ -1317,34 +1495,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @note This function does not reset the start condition to @c INITIAL .
*/
- void cmExpr_yyrestart (FILE * input_file , yyscan_t yyscanner)
+ void yyrestart (FILE * input_file , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! YY_CURRENT_BUFFER ){
- cmExpr_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmExpr_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- cmExpr_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
- cmExpr_yy_load_buffer_state(yyscanner );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
+ yy_load_buffer_state( yyscanner );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
* @param yyscanner The scanner object.
*/
- void cmExpr_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* TODO. We should be able to replace this entire function body
* with
- * cmExpr_yypop_buffer_state();
- * cmExpr_yypush_buffer_state(new_buffer);
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
*/
- cmExpr_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
if ( YY_CURRENT_BUFFER == new_buffer )
return;
@@ -1357,17 +1535,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- cmExpr_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
/* We don't actually know whether we did this switch during
- * EOF (cmExpr_yywrap()) processing, but the only time this flag
- * is looked at is after cmExpr_yywrap() is called, so it's safe
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yyg->yy_did_buffer_switch_on_eof = 1;
}
-static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner)
+static void yy_load_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
@@ -1382,35 +1560,35 @@ static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the allocated buffer state.
*/
- YY_BUFFER_STATE cmExpr_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) cmExpr_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_buf_size = (yy_size_t)size;
+ b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) cmExpr_yyalloc(b->yy_buf_size + 2 ,yyscanner );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- cmExpr_yy_init_buffer(b,file ,yyscanner);
+ yy_init_buffer( b, file , yyscanner);
return b;
}
/** Destroy the buffer.
- * @param b a buffer created with cmExpr_yy_create_buffer()
+ * @param b a buffer created with yy_create_buffer()
* @param yyscanner The scanner object.
*/
- void cmExpr_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -1421,28 +1599,28 @@ static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner)
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- cmExpr_yyfree((void *) b->yy_ch_buf ,yyscanner );
+ yyfree( (void *) b->yy_ch_buf , yyscanner );
- cmExpr_yyfree((void *) b ,yyscanner );
+ yyfree( (void *) b , yyscanner );
}
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
- * such as during a cmExpr_yyrestart() or at EOF.
+ * such as during a yyrestart() or at EOF.
*/
- static void cmExpr_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
{
int oerrno = errno;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- cmExpr_yy_flush_buffer(b ,yyscanner);
+ yy_flush_buffer( b , yyscanner);
b->yy_input_file = file;
b->yy_fill_buffer = 1;
- /* If b is the current buffer, then cmExpr_yy_init_buffer was _probably_
- * called from cmExpr_yyrestart() or through yy_get_next_buffer.
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
@@ -1459,7 +1637,7 @@ static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner)
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
* @param yyscanner The scanner object.
*/
- void cmExpr_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! b )
@@ -1480,7 +1658,7 @@ static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner)
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- cmExpr_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -1489,15 +1667,15 @@ static void cmExpr_yy_load_buffer_state (yyscan_t yyscanner)
* @param new_buffer The new state.
* @param yyscanner The scanner object.
*/
-void cmExpr_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (new_buffer == NULL)
return;
- cmExpr_yyensure_buffer_stack(yyscanner);
+ yyensure_buffer_stack(yyscanner);
- /* This block is copied from cmExpr_yy_switch_to_buffer. */
+ /* This block is copied from yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
@@ -1511,8 +1689,8 @@ void cmExpr_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner
yyg->yy_buffer_stack_top++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from cmExpr_yy_switch_to_buffer. */
- cmExpr_yy_load_buffer_state(yyscanner );
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
@@ -1520,19 +1698,19 @@ void cmExpr_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner
* The next element becomes the new top.
* @param yyscanner The scanner object.
*/
-void cmExpr_yypop_buffer_state (yyscan_t yyscanner)
+void yypop_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!YY_CURRENT_BUFFER)
return;
- cmExpr_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+ yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
YY_CURRENT_BUFFER_LVALUE = NULL;
if (yyg->yy_buffer_stack_top > 0)
--yyg->yy_buffer_stack_top;
if (YY_CURRENT_BUFFER) {
- cmExpr_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
}
@@ -1540,9 +1718,9 @@ void cmExpr_yypop_buffer_state (yyscan_t yyscanner)
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
-static void cmExpr_yyensure_buffer_stack (yyscan_t yyscanner)
+static void yyensure_buffer_stack (yyscan_t yyscanner)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!yyg->yy_buffer_stack) {
@@ -1552,11 +1730,11 @@ static void cmExpr_yyensure_buffer_stack (yyscan_t yyscanner)
* immediate realloc on the next call.
*/
num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmExpr_yyalloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
@@ -1571,12 +1749,12 @@ static void cmExpr_yyensure_buffer_stack (yyscan_t yyscanner)
yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmExpr_yyrealloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -1590,7 +1768,7 @@ static void cmExpr_yyensure_buffer_stack (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmExpr_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
@@ -1600,11 +1778,11 @@ YY_BUFFER_STATE cmExpr_yy_scan_buffer (char * base, yy_size_t size , yyscan_t
/* They forgot to leave room for the EOB's. */
return NULL;
- b = (YY_BUFFER_STATE) cmExpr_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = NULL;
@@ -1614,53 +1792,53 @@ YY_BUFFER_STATE cmExpr_yy_scan_buffer (char * base, yy_size_t size , yyscan_t
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- cmExpr_yy_switch_to_buffer(b ,yyscanner );
+ yy_switch_to_buffer( b , yyscanner );
return b;
}
-/** Setup the input buffer state to scan a string. The next call to cmExpr_yylex() will
+/** Setup the input buffer state to scan a string. The next call to yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
- * cmExpr_yy_scan_bytes() instead.
+ * yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE cmExpr_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
{
- return cmExpr_yy_scan_bytes(yystr,(int) strlen(yystr) ,yyscanner);
+ return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
}
-/** Setup the input buffer state to scan the given bytes. The next call to cmExpr_yylex() will
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmExpr_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- yy_size_t i;
+ int i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = (yy_size_t) _yybytes_len + 2;
- buf = (char *) cmExpr_yyalloc(n ,yyscanner );
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n , yyscanner );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmExpr_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
- for ( i = 0; i < (size_t)_yybytes_len; ++i )
+ for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = cmExpr_yy_scan_buffer(buf,n ,yyscanner);
+ b = yy_scan_buffer( buf, n , yyscanner);
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in cmExpr_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -1674,11 +1852,11 @@ YY_BUFFER_STATE cmExpr_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len
#define YY_EXIT_FAILURE 2
#endif
-static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- (void) fprintf( stderr, "%s\n", msg );
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -1704,7 +1882,7 @@ static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
/** Get the user-defined data for this scanner.
* @param yyscanner The scanner object.
*/
-YY_EXTRA_TYPE cmExpr_yyget_extra (yyscan_t yyscanner)
+YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyextra;
@@ -1713,7 +1891,7 @@ YY_EXTRA_TYPE cmExpr_yyget_extra (yyscan_t yyscanner)
/** Get the current line number.
* @param yyscanner The scanner object.
*/
-int cmExpr_yyget_lineno (yyscan_t yyscanner)
+int yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -1726,7 +1904,7 @@ int cmExpr_yyget_lineno (yyscan_t yyscanner)
/** Get the current column number.
* @param yyscanner The scanner object.
*/
-int cmExpr_yyget_column (yyscan_t yyscanner)
+int yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -1739,7 +1917,7 @@ int cmExpr_yyget_column (yyscan_t yyscanner)
/** Get the input stream.
* @param yyscanner The scanner object.
*/
-FILE *cmExpr_yyget_in (yyscan_t yyscanner)
+FILE *yyget_in (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyin;
@@ -1748,7 +1926,7 @@ FILE *cmExpr_yyget_in (yyscan_t yyscanner)
/** Get the output stream.
* @param yyscanner The scanner object.
*/
-FILE *cmExpr_yyget_out (yyscan_t yyscanner)
+FILE *yyget_out (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyout;
@@ -1757,7 +1935,7 @@ FILE *cmExpr_yyget_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-int cmExpr_yyget_leng (yyscan_t yyscanner)
+int yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
@@ -1767,7 +1945,7 @@ int cmExpr_yyget_leng (yyscan_t yyscanner)
* @param yyscanner The scanner object.
*/
-char *cmExpr_yyget_text (yyscan_t yyscanner)
+char *yyget_text (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yytext;
@@ -1777,7 +1955,7 @@ char *cmExpr_yyget_text (yyscan_t yyscanner)
* @param user_defined The data to be associated with this scanner.
* @param yyscanner The scanner object.
*/
-void cmExpr_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyextra = user_defined ;
@@ -1787,13 +1965,13 @@ void cmExpr_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
* @param _line_number line number
* @param yyscanner The scanner object.
*/
-void cmExpr_yyset_lineno (int _line_number , yyscan_t yyscanner)
+void yyset_lineno (int _line_number , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "cmExpr_yyset_lineno called with no buffer" );
+ YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
yylineno = _line_number;
}
@@ -1802,13 +1980,13 @@ void cmExpr_yyset_lineno (int _line_number , yyscan_t yyscanner)
* @param _column_no column number
* @param yyscanner The scanner object.
*/
-void cmExpr_yyset_column (int _column_no , yyscan_t yyscanner)
+void yyset_column (int _column_no , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "cmExpr_yyset_column called with no buffer" );
+ YY_FATAL_ERROR( "yyset_column called with no buffer" );
yycolumn = _column_no;
}
@@ -1817,27 +1995,27 @@ void cmExpr_yyset_column (int _column_no , yyscan_t yyscanner)
* input buffer.
* @param _in_str A readable stream.
* @param yyscanner The scanner object.
- * @see cmExpr_yy_switch_to_buffer
+ * @see yy_switch_to_buffer
*/
-void cmExpr_yyset_in (FILE * _in_str , yyscan_t yyscanner)
+void yyset_in (FILE * _in_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyin = _in_str ;
}
-void cmExpr_yyset_out (FILE * _out_str , yyscan_t yyscanner)
+void yyset_out (FILE * _out_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyout = _out_str ;
}
-int cmExpr_yyget_debug (yyscan_t yyscanner)
+int yyget_debug (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yy_flex_debug;
}
-void cmExpr_yyset_debug (int _bdebug , yyscan_t yyscanner)
+void yyset_debug (int _bdebug , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_flex_debug = _bdebug ;
@@ -1847,20 +2025,18 @@ void cmExpr_yyset_debug (int _bdebug , yyscan_t yyscanner)
/* User-visible API */
-/* cmExpr_yylex_init is special because it creates the scanner itself, so it is
+/* yylex_init is special because it creates the scanner itself, so it is
* the ONLY reentrant function that doesn't take the scanner as the last argument.
* That's why we explicitly handle the declaration, instead of using our macros.
*/
-
-int cmExpr_yylex_init(yyscan_t* ptr_yy_globals)
-
+int yylex_init(yyscan_t* ptr_yy_globals)
{
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmExpr_yyalloc ( sizeof( struct yyguts_t ), NULL );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -1873,27 +2049,25 @@ int cmExpr_yylex_init(yyscan_t* ptr_yy_globals)
return yy_init_globals ( *ptr_yy_globals );
}
-/* cmExpr_yylex_init_extra has the same functionality as cmExpr_yylex_init, but follows the
+/* yylex_init_extra has the same functionality as yylex_init, but follows the
* convention of taking the scanner as the last argument. Note however, that
* this is a *pointer* to a scanner, as it will be allocated by this call (and
* is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to cmExpr_yyalloc in
+ * The user defined value in the first argument will be available to yyalloc in
* the yyextra field.
*/
-
-int cmExpr_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
+int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
{
struct yyguts_t dummy_yyguts;
- cmExpr_yyset_extra (yy_user_defined, &dummy_yyguts);
+ yyset_extra (yy_user_defined, &dummy_yyguts);
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmExpr_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -1904,7 +2078,7 @@ int cmExpr_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globa
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
- cmExpr_yyset_extra (yy_user_defined, *ptr_yy_globals);
+ yyset_extra (yy_user_defined, *ptr_yy_globals);
return yy_init_globals ( *ptr_yy_globals );
}
@@ -1913,7 +2087,7 @@ static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Initialization is the same as for the non-reentrant scanner.
- * This function is called from cmExpr_yylex_destroy(), so don't allocate here.
+ * This function is called from yylex_destroy(), so don't allocate here.
*/
yyg->yy_buffer_stack = NULL;
@@ -1937,37 +2111,37 @@ static int yy_init_globals (yyscan_t yyscanner)
#endif
/* For future reference: Set errno on error, since we are called by
- * cmExpr_yylex_init()
+ * yylex_init()
*/
return 0;
}
-/* cmExpr_yylex_destroy is for both reentrant and non-reentrant scanners. */
-int cmExpr_yylex_destroy (yyscan_t yyscanner)
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- cmExpr_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
YY_CURRENT_BUFFER_LVALUE = NULL;
- cmExpr_yypop_buffer_state(yyscanner);
+ yypop_buffer_state(yyscanner);
}
/* Destroy the stack itself. */
- cmExpr_yyfree(yyg->yy_buffer_stack ,yyscanner);
+ yyfree(yyg->yy_buffer_stack , yyscanner);
yyg->yy_buffer_stack = NULL;
/* Destroy the start condition stack. */
- cmExpr_yyfree(yyg->yy_start_stack ,yyscanner );
+ yyfree( yyg->yy_start_stack , yyscanner );
yyg->yy_start_stack = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
- * cmExpr_yylex() is called, initialization will occur. */
+ * yylex() is called, initialization will occur. */
yy_init_globals( yyscanner);
/* Destroy the main struct (reentrant only). */
- cmExpr_yyfree ( yyscanner , yyscanner );
+ yyfree ( yyscanner , yyscanner );
yyscanner = NULL;
return 0;
}
@@ -1977,7 +2151,7 @@ int cmExpr_yylex_destroy (yyscan_t yyscanner)
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -1989,7 +2163,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
{
int n;
for ( n = 0; s[n]; ++n )
@@ -1999,14 +2173,14 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
}
#endif
-void *cmExpr_yyalloc (yy_size_t size , yyscan_t yyscanner)
+void *yyalloc (yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
return malloc(size);
}
-void *cmExpr_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
+void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -2021,13 +2195,11 @@ void *cmExpr_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
return realloc(ptr, size);
}
-void cmExpr_yyfree (void * ptr , yyscan_t yyscanner)
+void yyfree (void * ptr , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- free( (char *) ptr ); /* see cmExpr_yyrealloc() for (char *) cast */
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
-
-#line 57 "cmExprLexer.in.l"
diff --git a/Source/LexerParser/cmExprLexer.h b/Source/LexerParser/cmExprLexer.h
index 835a7a3..b55ee92 100644
--- a/Source/LexerParser/cmExprLexer.h
+++ b/Source/LexerParser/cmExprLexer.h
@@ -2,10 +2,6 @@
#define cmExpr_yyHEADER_H 1
#define cmExpr_yyIN_HEADER 1
-#line 6 "cmExprLexer.h"
-
-#line 8 "cmExprLexer.h"
-
#define FLEXINT_H 1
#define YY_INT_ALIGNED short int
@@ -14,11 +10,221 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define cmExpr_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer cmExpr_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define cmExpr_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer cmExpr_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define cmExpr_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer cmExpr_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define cmExpr_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string cmExpr_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define cmExpr_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes cmExpr_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define cmExpr_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer cmExpr_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define cmExpr_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer cmExpr_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define cmExpr_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state cmExpr_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define cmExpr_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer cmExpr_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define cmExpr_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state cmExpr_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define cmExpr_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state cmExpr_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define cmExpr_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack cmExpr_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define cmExpr_yylex_ALREADY_DEFINED
+#else
+#define yylex cmExpr_yylex
+#endif
+
+#ifdef yyrestart
+#define cmExpr_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart cmExpr_yyrestart
+#endif
+
+#ifdef yylex_init
+#define cmExpr_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init cmExpr_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define cmExpr_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra cmExpr_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define cmExpr_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy cmExpr_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define cmExpr_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug cmExpr_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define cmExpr_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug cmExpr_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define cmExpr_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra cmExpr_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define cmExpr_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra cmExpr_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define cmExpr_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in cmExpr_yyget_in
+#endif
+
+#ifdef yyset_in
+#define cmExpr_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in cmExpr_yyset_in
+#endif
+
+#ifdef yyget_out
+#define cmExpr_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out cmExpr_yyget_out
+#endif
+
+#ifdef yyset_out
+#define cmExpr_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out cmExpr_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define cmExpr_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng cmExpr_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define cmExpr_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text cmExpr_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define cmExpr_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno cmExpr_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define cmExpr_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno cmExpr_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define cmExpr_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column cmExpr_yyget_column
+#endif
+
+#ifdef yyset_column
+#define cmExpr_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column cmExpr_yyset_column
+#endif
+
+#ifdef yywrap
+#define cmExpr_yywrap_ALREADY_DEFINED
+#else
+#define yywrap cmExpr_yywrap
+#endif
+
+#ifdef yyalloc
+#define cmExpr_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc cmExpr_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define cmExpr_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc cmExpr_yyrealloc
+#endif
+
+#ifdef yyfree
+#define cmExpr_yyfree_ALREADY_DEFINED
+#else
+#define yyfree cmExpr_yyfree
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -89,10 +295,16 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */
+
/* TODO: this is always defined, so inline it */
#define yyconst const
@@ -193,21 +405,21 @@ struct yy_buffer_state
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-void cmExpr_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmExpr_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmExpr_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void cmExpr_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmExpr_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmExpr_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void cmExpr_yypop_buffer_state (yyscan_t yyscanner );
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
-YY_BUFFER_STATE cmExpr_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmExpr_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmExpr_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
-void *cmExpr_yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *cmExpr_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void cmExpr_yyfree (void * ,yyscan_t yyscanner );
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
/* Begin user sect3 */
@@ -225,42 +437,42 @@ void cmExpr_yyfree (void * ,yyscan_t yyscanner );
#define YY_EXTRA_TYPE void *
#endif
-int cmExpr_yylex_init (yyscan_t* scanner);
+int yylex_init (yyscan_t* scanner);
-int cmExpr_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int cmExpr_yylex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
-int cmExpr_yyget_debug (yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
-void cmExpr_yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-YY_EXTRA_TYPE cmExpr_yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-void cmExpr_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-FILE *cmExpr_yyget_in (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
-void cmExpr_yyset_in (FILE * _in_str ,yyscan_t yyscanner );
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
-FILE *cmExpr_yyget_out (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
-void cmExpr_yyset_out (FILE * _out_str ,yyscan_t yyscanner );
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
- int cmExpr_yyget_leng (yyscan_t yyscanner );
+ int yyget_leng ( yyscan_t yyscanner );
-char *cmExpr_yyget_text (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
-int cmExpr_yyget_lineno (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
-void cmExpr_yyset_lineno (int _line_number ,yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
-int cmExpr_yyget_column (yyscan_t yyscanner );
+int yyget_column ( yyscan_t yyscanner );
-void cmExpr_yyset_column (int _column_no ,yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -268,18 +480,18 @@ void cmExpr_yyset_column (int _column_no ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int cmExpr_yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int cmExpr_yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
@@ -307,9 +519,9 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int cmExpr_yylex (yyscan_t yyscanner);
+extern int yylex (yyscan_t yyscanner);
-#define YY_DECL int cmExpr_yylex (yyscan_t yyscanner)
+#define YY_DECL int yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* yy_get_previous_state - get the state just before the EOB char was reached */
@@ -326,9 +538,150 @@ extern int cmExpr_yylex (yyscan_t yyscanner);
#undef YY_DECL
#endif
-#line 57 "cmExprLexer.in.l"
-
+#ifndef cmExpr_yy_create_buffer_ALREADY_DEFINED
+#undef yy_create_buffer
+#endif
+#ifndef cmExpr_yy_delete_buffer_ALREADY_DEFINED
+#undef yy_delete_buffer
+#endif
+#ifndef cmExpr_yy_scan_buffer_ALREADY_DEFINED
+#undef yy_scan_buffer
+#endif
+#ifndef cmExpr_yy_scan_string_ALREADY_DEFINED
+#undef yy_scan_string
+#endif
+#ifndef cmExpr_yy_scan_bytes_ALREADY_DEFINED
+#undef yy_scan_bytes
+#endif
+#ifndef cmExpr_yy_init_buffer_ALREADY_DEFINED
+#undef yy_init_buffer
+#endif
+#ifndef cmExpr_yy_flush_buffer_ALREADY_DEFINED
+#undef yy_flush_buffer
+#endif
+#ifndef cmExpr_yy_load_buffer_state_ALREADY_DEFINED
+#undef yy_load_buffer_state
+#endif
+#ifndef cmExpr_yy_switch_to_buffer_ALREADY_DEFINED
+#undef yy_switch_to_buffer
+#endif
+#ifndef cmExpr_yypush_buffer_state_ALREADY_DEFINED
+#undef yypush_buffer_state
+#endif
+#ifndef cmExpr_yypop_buffer_state_ALREADY_DEFINED
+#undef yypop_buffer_state
+#endif
+#ifndef cmExpr_yyensure_buffer_stack_ALREADY_DEFINED
+#undef yyensure_buffer_stack
+#endif
+#ifndef cmExpr_yylex_ALREADY_DEFINED
+#undef yylex
+#endif
+#ifndef cmExpr_yyrestart_ALREADY_DEFINED
+#undef yyrestart
+#endif
+#ifndef cmExpr_yylex_init_ALREADY_DEFINED
+#undef yylex_init
+#endif
+#ifndef cmExpr_yylex_init_extra_ALREADY_DEFINED
+#undef yylex_init_extra
+#endif
+#ifndef cmExpr_yylex_destroy_ALREADY_DEFINED
+#undef yylex_destroy
+#endif
+#ifndef cmExpr_yyget_debug_ALREADY_DEFINED
+#undef yyget_debug
+#endif
+#ifndef cmExpr_yyset_debug_ALREADY_DEFINED
+#undef yyset_debug
+#endif
+#ifndef cmExpr_yyget_extra_ALREADY_DEFINED
+#undef yyget_extra
+#endif
+#ifndef cmExpr_yyset_extra_ALREADY_DEFINED
+#undef yyset_extra
+#endif
+#ifndef cmExpr_yyget_in_ALREADY_DEFINED
+#undef yyget_in
+#endif
+#ifndef cmExpr_yyset_in_ALREADY_DEFINED
+#undef yyset_in
+#endif
+#ifndef cmExpr_yyget_out_ALREADY_DEFINED
+#undef yyget_out
+#endif
+#ifndef cmExpr_yyset_out_ALREADY_DEFINED
+#undef yyset_out
+#endif
+#ifndef cmExpr_yyget_leng_ALREADY_DEFINED
+#undef yyget_leng
+#endif
+#ifndef cmExpr_yyget_text_ALREADY_DEFINED
+#undef yyget_text
+#endif
+#ifndef cmExpr_yyget_lineno_ALREADY_DEFINED
+#undef yyget_lineno
+#endif
+#ifndef cmExpr_yyset_lineno_ALREADY_DEFINED
+#undef yyset_lineno
+#endif
+#ifndef cmExpr_yyget_column_ALREADY_DEFINED
+#undef yyget_column
+#endif
+#ifndef cmExpr_yyset_column_ALREADY_DEFINED
+#undef yyset_column
+#endif
+#ifndef cmExpr_yywrap_ALREADY_DEFINED
+#undef yywrap
+#endif
+#ifndef cmExpr_yyget_lval_ALREADY_DEFINED
+#undef yyget_lval
+#endif
+#ifndef cmExpr_yyset_lval_ALREADY_DEFINED
+#undef yyset_lval
+#endif
+#ifndef cmExpr_yyget_lloc_ALREADY_DEFINED
+#undef yyget_lloc
+#endif
+#ifndef cmExpr_yyset_lloc_ALREADY_DEFINED
+#undef yyset_lloc
+#endif
+#ifndef cmExpr_yyalloc_ALREADY_DEFINED
+#undef yyalloc
+#endif
+#ifndef cmExpr_yyrealloc_ALREADY_DEFINED
+#undef yyrealloc
+#endif
+#ifndef cmExpr_yyfree_ALREADY_DEFINED
+#undef yyfree
+#endif
+#ifndef cmExpr_yytext_ALREADY_DEFINED
+#undef yytext
+#endif
+#ifndef cmExpr_yyleng_ALREADY_DEFINED
+#undef yyleng
+#endif
+#ifndef cmExpr_yyin_ALREADY_DEFINED
+#undef yyin
+#endif
+#ifndef cmExpr_yyout_ALREADY_DEFINED
+#undef yyout
+#endif
+#ifndef cmExpr_yy_flex_debug_ALREADY_DEFINED
+#undef yy_flex_debug
+#endif
+#ifndef cmExpr_yylineno_ALREADY_DEFINED
+#undef yylineno
+#endif
+#ifndef cmExpr_yytables_fload_ALREADY_DEFINED
+#undef yytables_fload
+#endif
+#ifndef cmExpr_yytables_destroy_ALREADY_DEFINED
+#undef yytables_destroy
+#endif
+#ifndef cmExpr_yyTABLES_NAME_ALREADY_DEFINED
+#undef yyTABLES_NAME
+#endif
-#line 333 "cmExprLexer.h"
#undef cmExpr_yyIN_HEADER
#endif /* cmExpr_yyHEADER_H */
diff --git a/Source/LexerParser/cmExprLexer.in.l b/Source/LexerParser/cmExprLexer.in.l
index 25ddba4..e5f177a 100644
--- a/Source/LexerParser/cmExprLexer.in.l
+++ b/Source/LexerParser/cmExprLexer.in.l
@@ -7,13 +7,12 @@ This file must be translated to C++ and modified to build everywhere.
Run flex >= 2.6 like this:
- flex --nounistd -DFLEXINT_H --prefix=cmExpr_yy --header-file=cmExprLexer.h -ocmExprLexer.cxx cmExprLexer.in.l
+ flex --nounistd -DFLEXINT_H --noline --header-file=cmExprLexer.h -ocmExprLexer.cxx cmExprLexer.in.l
Modify cmExprLexer.cxx:
- - remove trailing whitespace: sed -i 's/\s*$//' cmExprLexer.h cmExprLexer.cxx
- - remove blank lines at end of file
- - #include "cmStandardLexer.h" at the top
- - add cast in yy_scan_bytes for loop condition of _yybytes_len to size_t
+ - remove trailing whitespace: sed -i 's/\s*$//' cmExprLexer.h cmExprLexer.cxx
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmExprLexer.h cmExprLexer.cxx
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmExprLexer.cxx
*/
@@ -32,6 +31,8 @@ Modify cmExprLexer.cxx:
/*--------------------------------------------------------------------------*/
%}
+%option prefix="cmExpr_yy"
+
%option reentrant
%option noyywrap
%pointer
diff --git a/Source/LexerParser/cmFortranLexer.cxx b/Source/LexerParser/cmFortranLexer.cxx
index 01c09ac..dec0f5e 100644
--- a/Source/LexerParser/cmFortranLexer.cxx
+++ b/Source/LexerParser/cmFortranLexer.cxx
@@ -1,7 +1,4 @@
#include "cmStandardLexer.h"
-#line 2 "cmFortranLexer.cxx"
-
-#line 4 "cmFortranLexer.cxx"
#define FLEXINT_H 1
#define YY_INT_ALIGNED short int
@@ -11,11 +8,221 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define cmFortran_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer cmFortran_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define cmFortran_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer cmFortran_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define cmFortran_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer cmFortran_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define cmFortran_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string cmFortran_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define cmFortran_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes cmFortran_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define cmFortran_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer cmFortran_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define cmFortran_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer cmFortran_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define cmFortran_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state cmFortran_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define cmFortran_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer cmFortran_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define cmFortran_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state cmFortran_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define cmFortran_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state cmFortran_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define cmFortran_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack cmFortran_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define cmFortran_yylex_ALREADY_DEFINED
+#else
+#define yylex cmFortran_yylex
+#endif
+
+#ifdef yyrestart
+#define cmFortran_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart cmFortran_yyrestart
+#endif
+
+#ifdef yylex_init
+#define cmFortran_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init cmFortran_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define cmFortran_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra cmFortran_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define cmFortran_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy cmFortran_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define cmFortran_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug cmFortran_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define cmFortran_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug cmFortran_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define cmFortran_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra cmFortran_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define cmFortran_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra cmFortran_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define cmFortran_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in cmFortran_yyget_in
+#endif
+
+#ifdef yyset_in
+#define cmFortran_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in cmFortran_yyset_in
+#endif
+
+#ifdef yyget_out
+#define cmFortran_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out cmFortran_yyget_out
+#endif
+
+#ifdef yyset_out
+#define cmFortran_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out cmFortran_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define cmFortran_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng cmFortran_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define cmFortran_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text cmFortran_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define cmFortran_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno cmFortran_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define cmFortran_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno cmFortran_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define cmFortran_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column cmFortran_yyget_column
+#endif
+
+#ifdef yyset_column
+#define cmFortran_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column cmFortran_yyset_column
+#endif
+
+#ifdef yywrap
+#define cmFortran_yywrap_ALREADY_DEFINED
+#else
+#define yywrap cmFortran_yywrap
+#endif
+
+#ifdef yyalloc
+#define cmFortran_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc cmFortran_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define cmFortran_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc cmFortran_yyrealloc
+#endif
+
+#ifdef yyfree
+#define cmFortran_yyfree_ALREADY_DEFINED
+#else
+#define yyfree cmFortran_yyfree
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -86,10 +293,16 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */
+
/* TODO: this is always defined, so inline it */
#define yyconst const
@@ -102,12 +315,10 @@ typedef unsigned int flex_uint32_t;
/* Returned upon end-of-file. */
#define YY_NULL 0
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -131,20 +342,16 @@ typedef void* yyscan_t;
* definition of BEGIN.
*/
#define BEGIN yyg->yy_start = 1 + 2 *
-
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yyg->yy_start - 1) / 2)
#define YYSTATE YY_START
-
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE cmFortran_yyrestart(yyin ,yyscanner )
-
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
@@ -194,7 +401,6 @@ typedef size_t yy_size_t;
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -254,7 +460,7 @@ struct yy_buffer_state
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via cmFortran_yyrestart()), so that the user can continue scanning by
+ * (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
@@ -271,73 +477,67 @@ struct yy_buffer_state
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
: NULL)
-
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-void cmFortran_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmFortran_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmFortran_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void cmFortran_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmFortran_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void cmFortran_yypop_buffer_state (yyscan_t yyscanner );
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
-static void cmFortran_yyensure_buffer_stack (yyscan_t yyscanner );
-static void cmFortran_yy_load_buffer_state (yyscan_t yyscanner );
-static void cmFortran_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
-#define YY_FLUSH_BUFFER cmFortran_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
-YY_BUFFER_STATE cmFortran_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmFortran_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmFortran_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-
-void *cmFortran_yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *cmFortran_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void cmFortran_yyfree (void * ,yyscan_t yyscanner );
-
-#define yy_new_buffer cmFortran_yy_create_buffer
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- cmFortran_yyensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
-
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- cmFortran_yyensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
#define cmFortran_yywrap(yyscanner) (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
+typedef flex_uint8_t YY_CHAR;
typedef int yy_state_type;
#define yytext_ptr yytext_r
-static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
-static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
@@ -348,7 +548,6 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-
#define YY_NUM_RULES 54
#define YY_END_OF_BUFFER 55
/* This struct is not used in this scanner,
@@ -358,7 +557,7 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[210] =
+static const flex_int16_t yy_accept[210] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
55, 49, 51, 50, 53, 1, 49, 33, 2, 47,
@@ -368,16 +567,16 @@ static yyconst flex_int16_t yy_accept[210] =
0, 0, 33, 33, 34, 36, 39, 49, 46, 46,
46, 46, 46, 46, 0, 52, 46, 0, 0, 0,
12, 0, 0, 0, 0, 0, 0, 49, 0, 11,
- 46, 0, 0, 5, 0, 0, 0, 29, 0, 0,
+ 46, 0, 0, 5, 0, 0, 0, 0, 29, 0,
33, 33, 33, 33, 0, 0, 40, 46, 46, 46,
46, 45, 12, 12, 0, 0, 0, 23, 0, 0,
0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
0, 0, 0, 0, 46, 46, 46, 46, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 30, 31, 0, 0, 0, 0, 0, 0, 46, 46,
+ 0, 30, 31, 0, 0, 0, 0, 0, 46, 46,
46, 46, 0, 24, 25, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 32, 27, 0, 0, 20, 0,
+ 0, 0, 0, 0, 20, 32, 27, 0, 0, 0,
46, 46, 43, 46, 0, 26, 21, 0, 0, 0,
19, 0, 0, 18, 28, 0, 0, 41, 46, 46,
17, 22, 0, 7, 38, 7, 15, 0, 46, 46,
@@ -385,7 +584,7 @@ static yyconst flex_int16_t yy_accept[210] =
14, 16, 42, 44, 0, 0, 0, 13, 0
} ;
-static yyconst YY_CHAR yy_ec[256] =
+static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
@@ -394,13 +593,13 @@ static yyconst YY_CHAR yy_ec[256] =
13, 14, 1, 15, 1, 1, 1, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 17, 18, 19,
20, 21, 22, 1, 23, 24, 25, 26, 27, 28,
- 29, 29, 30, 29, 29, 31, 32, 33, 34, 29,
- 29, 35, 36, 37, 38, 29, 29, 29, 29, 29,
- 1, 39, 1, 1, 40, 1, 23, 24, 41, 42,
+ 24, 24, 29, 24, 24, 30, 31, 32, 33, 24,
+ 24, 34, 35, 36, 37, 24, 24, 24, 24, 24,
+ 1, 38, 1, 1, 39, 1, 23, 40, 41, 42,
- 43, 44, 29, 29, 45, 29, 29, 46, 32, 47,
- 34, 29, 29, 35, 48, 37, 49, 29, 29, 29,
- 29, 29, 1, 1, 1, 1, 1, 1, 1, 1,
+ 43, 44, 24, 24, 45, 24, 24, 46, 31, 47,
+ 33, 24, 24, 34, 48, 36, 49, 24, 24, 24,
+ 24, 24, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -417,49 +616,49 @@ static yyconst YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst YY_CHAR yy_meta[50] =
+static const YY_CHAR yy_meta[50] =
{ 0,
1, 2, 2, 3, 4, 3, 3, 1, 1, 3,
3, 3, 3, 1, 3, 5, 3, 3, 1, 3,
6, 1, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 1, 5,
+ 7, 7, 7, 7, 7, 7, 7, 1, 5, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7
} ;
-static yyconst flex_uint16_t yy_base[219] =
+static const flex_int16_t yy_base[219] =
{ 0,
- 0, 48, 0, 49, 513, 56, 52, 57, 62, 68,
- 515, 0, 583, 583, 509, 583, 97, 74, 583, 583,
- 583, 583, 491, 583, 423, 421, 0, 19, 40, 392,
- 36, 47, 86, 146, 88, 186, 413, 235, 275, 583,
- 407, 98, 583, 583, 0, 386, 583, 323, 65, 73,
- 81, 74, 127, 146, 583, 583, 583, 108, 0, 89,
- 120, 92, 362, 116, 161, 583, 0, 167, 371, 0,
- 168, 131, 146, 171, 81, 89, 352, 420, 353, 583,
- 0, 349, 178, 196, 175, 197, 188, 208, 196, 197,
- 256, 262, 324, 330, 337, 143, 0, 151, 220, 56,
-
- 305, 0, 336, 139, 225, 315, 305, 322, 318, 163,
- 320, 268, 266, 369, 583, 340, 347, 350, 350, 351,
- 357, 350, 357, 363, 140, 235, 359, 218, 362, 375,
- 379, 380, 381, 385, 384, 404, 405, 243, 235, 213,
- 583, 583, 405, 407, 410, 171, 410, 409, 419, 418,
- 423, 426, 311, 583, 583, 428, 429, 431, 173, 462,
- 435, 166, 145, 438, 583, 583, 441, 444, 583, 433,
- 448, 89, 0, 438, 450, 583, 583, 452, 457, 487,
- 583, 114, 0, 583, 583, 457, 462, 0, 465, 463,
- 583, 583, 468, 583, 583, 583, 583, 470, 471, 474,
-
- 500, 583, 0, 0, 505, 0, 65, 583, 583, 524,
- 531, 537, 540, 547, 554, 561, 568, 575
+ 0, 48, 0, 49, 464, 56, 52, 57, 62, 68,
+ 466, 0, 468, 468, 462, 468, 74, 81, 468, 468,
+ 468, 468, 447, 468, 442, 440, 0, 41, 42, 428,
+ 43, 42, 91, 119, 97, 157, 455, 206, 245, 468,
+ 454, 101, 468, 468, 0, 455, 468, 105, 430, 424,
+ 62, 68, 119, 141, 468, 468, 468, 111, 0, 59,
+ 98, 88, 415, 109, 158, 468, 0, 162, 293, 0,
+ 163, 411, 107, 122, 408, 405, 446, 342, 447, 468,
+ 0, 444, 169, 173, 420, 421, 132, 404, 90, 404,
+ 179, 185, 191, 227, 295, 397, 0, 146, 178, 149,
+
+ 412, 0, 208, 206, 398, 171, 399, 170, 399, 391,
+ 387, 422, 417, 221, 468, 374, 365, 347, 347, 334,
+ 335, 335, 330, 334, 259, 340, 188, 340, 327, 327,
+ 327, 324, 325, 325, 320, 322, 319, 355, 354, 325,
+ 327, 468, 468, 310, 309, 309, 300, 301, 273, 273,
+ 275, 277, 297, 468, 468, 293, 289, 283, 275, 305,
+ 261, 238, 237, 214, 468, 468, 468, 196, 197, 189,
+ 277, 181, 0, 274, 112, 468, 468, 105, 103, 311,
+ 468, 233, 0, 468, 468, 83, 76, 0, 281, 282,
+ 468, 468, 52, 468, 468, 468, 468, 23, 287, 298,
+
+ 327, 468, 0, 0, 329, 0, 31, 468, 468, 381,
+ 388, 394, 397, 404, 411, 418, 425, 432
} ;
-static yyconst flex_int16_t yy_def[219] =
+static const flex_int16_t yy_def[219] =
{ 0,
209, 1, 1, 1, 1, 1, 210, 210, 210, 210,
209, 211, 209, 209, 212, 209, 211, 209, 209, 209,
209, 209, 209, 209, 209, 211, 213, 213, 213, 213,
- 213, 213, 211, 213, 209, 209, 209, 214, 209, 209,
+ 213, 213, 211, 213, 209, 211, 209, 214, 209, 209,
209, 209, 209, 209, 211, 212, 209, 209, 209, 209,
209, 209, 209, 215, 209, 209, 209, 211, 213, 213,
213, 213, 213, 213, 209, 209, 34, 209, 209, 69,
@@ -482,152 +681,126 @@ static yyconst flex_int16_t yy_def[219] =
209, 209, 209, 209, 209, 209, 209, 209
} ;
-static yyconst flex_uint16_t yy_nxt[633] =
+static const flex_int16_t yy_nxt[518] =
{ 0,
12, 13, 14, 13, 13, 15, 16, 12, 17, 18,
19, 20, 21, 12, 22, 12, 23, 24, 12, 25,
- 12, 26, 27, 27, 27, 27, 28, 27, 27, 29,
- 27, 30, 27, 27, 27, 31, 27, 32, 33, 34,
+ 12, 26, 27, 27, 27, 27, 28, 27, 29, 27,
+ 30, 27, 27, 27, 31, 27, 32, 33, 34, 27,
27, 27, 28, 27, 29, 27, 27, 31, 32, 35,
- 35, 60, 35, 35, 41, 36, 36, 35, 37, 41,
- 35, 42, 43, 36, 41, 60, 42, 43, 44, 38,
- 41, 42, 61, 63, 44, 53, 53, 42, 53, 54,
- 39, 39, 64, 55, 63, 208, 61, 65, 66, 68,
- 65, 85, 68, 127, 64, 69, 39, 39, 48, 83,
-
- 84, 48, 83, 86, 127, 87, 90, 85, 88, 95,
- 110, 189, 95, 89, 97, 195, 195, 100, 86, 87,
- 90, 111, 49, 50, 88, 110, 51, 89, 53, 53,
- 97, 53, 54, 100, 52, 111, 55, 96, 49, 50,
- 104, 51, 102, 104, 98, 52, 45, 92, 53, 183,
- 92, 93, 96, 45, 45, 94, 99, 105, 102, 45,
- 98, 67, 65, 66, 45, 65, 45, 45, 68, 104,
- 182, 68, 104, 105, 69, 124, 106, 149, 107, 83,
- 84, 125, 83, 71, 45, 67, 45, 70, 149, 124,
- 70, 106, 107, 45, 45, 136, 125, 114, 108, 45,
-
- 114, 71, 116, 109, 45, 115, 45, 45, 168, 136,
- 179, 72, 73, 119, 108, 74, 75, 109, 116, 168,
- 122, 179, 123, 76, 45, 45, 117, 72, 73, 119,
- 74, 75, 118, 120, 76, 78, 122, 80, 123, 163,
- 121, 117, 78, 78, 118, 164, 126, 162, 78, 120,
- 78, 152, 129, 78, 121, 78, 78, 92, 53, 164,
- 92, 93, 126, 92, 53, 94, 92, 93, 129, 150,
- 139, 94, 138, 78, 78, 79, 79, 80, 79, 79,
+ 35, 208, 35, 35, 41, 36, 36, 35, 37, 41,
+ 35, 42, 43, 36, 41, 202, 42, 43, 44, 38,
+ 41, 42, 60, 61, 44, 48, 64, 42, 48, 63,
+ 39, 39, 53, 53, 97, 53, 54, 60, 61, 64,
+ 55, 63, 65, 66, 201, 65, 39, 39, 68, 49,
+
+ 97, 68, 83, 84, 69, 83, 48, 87, 88, 48,
+ 50, 89, 95, 100, 90, 95, 51, 198, 52, 45,
+ 53, 53, 98, 53, 54, 197, 45, 45, 55, 100,
+ 49, 121, 45, 99, 67, 102, 122, 45, 98, 45,
+ 45, 50, 92, 53, 193, 92, 93, 51, 192, 52,
+ 94, 102, 106, 107, 191, 96, 45, 67, 70, 65,
+ 66, 70, 65, 68, 104, 108, 68, 104, 109, 69,
+ 83, 84, 71, 83, 114, 125, 118, 114, 71, 119,
+ 92, 53, 115, 92, 93, 127, 92, 53, 94, 92,
+ 93, 125, 92, 53, 94, 92, 93, 127, 72, 73,
+
+ 94, 74, 75, 189, 126, 76, 78, 104, 80, 104,
+ 104, 133, 104, 78, 78, 130, 134, 151, 131, 78,
+ 126, 78, 114, 103, 78, 114, 78, 78, 92, 53,
+ 115, 92, 93, 151, 195, 195, 94, 187, 186, 185,
+ 184, 183, 182, 78, 78, 79, 79, 80, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
81, 79, 79, 79, 79, 79, 79, 81, 81, 81,
-
81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 79, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 81, 48, 92, 53, 48, 92, 93,
- 132, 92, 53, 94, 92, 93, 128, 104, 95, 94,
- 104, 95, 135, 175, 130, 137, 132, 133, 49, 50,
- 131, 103, 51, 113, 134, 80, 112, 175, 135, 130,
- 52, 137, 131, 133, 49, 50, 96, 51, 134, 140,
- 114, 52, 70, 114, 141, 70, 142, 144, 115, 143,
- 146, 96, 145, 147, 140, 101, 103, 148, 47, 151,
- 141, 153, 142, 144, 143, 146, 72, 73, 145, 147,
-
- 74, 75, 154, 148, 151, 155, 153, 157, 76, 156,
- 158, 82, 72, 73, 159, 74, 75, 77, 154, 76,
- 78, 155, 80, 157, 156, 62, 158, 78, 78, 159,
- 160, 161, 165, 78, 166, 78, 167, 169, 78, 170,
- 78, 78, 58, 57, 171, 172, 160, 161, 165, 173,
- 166, 174, 167, 169, 170, 176, 177, 178, 78, 78,
- 171, 172, 181, 180, 184, 173, 180, 174, 185, 186,
- 187, 176, 177, 178, 188, 190, 191, 103, 181, 192,
- 184, 187, 193, 197, 185, 186, 190, 198, 180, 199,
- 188, 180, 191, 200, 201, 192, 202, 203, 193, 197,
-
- 204, 205, 103, 198, 205, 199, 205, 56, 200, 205,
- 201, 47, 202, 203, 209, 37, 204, 209, 206, 209,
- 209, 209, 209, 206, 40, 40, 40, 40, 40, 40,
- 40, 45, 209, 209, 209, 45, 45, 46, 46, 46,
- 46, 46, 46, 46, 59, 209, 59, 79, 79, 79,
- 79, 79, 79, 79, 91, 91, 91, 91, 91, 91,
- 91, 194, 194, 194, 209, 194, 194, 194, 196, 209,
- 196, 209, 196, 196, 196, 207, 207, 207, 207, 207,
- 209, 207, 11, 209, 209, 209, 209, 209, 209, 209,
+ 81, 81, 79, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 70, 149, 95, 70, 171, 95,
+
+ 172, 173, 174, 188, 181, 199, 180, 149, 103, 180,
+ 190, 200, 180, 203, 171, 180, 172, 173, 174, 188,
+ 103, 199, 190, 179, 204, 178, 103, 200, 205, 203,
+ 205, 205, 177, 205, 72, 73, 176, 74, 75, 96,
+ 204, 76, 78, 175, 80, 206, 170, 206, 169, 78,
+ 78, 168, 167, 166, 165, 78, 164, 78, 163, 162,
+ 78, 161, 78, 78, 160, 159, 158, 157, 156, 155,
+ 154, 153, 152, 150, 148, 147, 146, 145, 144, 78,
+ 78, 40, 40, 40, 40, 40, 40, 40, 45, 143,
+ 142, 141, 45, 45, 46, 46, 46, 46, 46, 46,
+
+ 46, 59, 140, 59, 79, 79, 79, 79, 79, 79,
+ 79, 91, 91, 91, 91, 91, 91, 91, 194, 194,
+ 194, 139, 194, 194, 194, 196, 138, 196, 137, 196,
+ 196, 196, 207, 207, 207, 207, 207, 136, 207, 135,
+ 132, 129, 128, 124, 123, 120, 117, 116, 113, 80,
+ 112, 111, 110, 105, 101, 86, 85, 47, 82, 77,
+ 62, 58, 57, 56, 47, 209, 37, 11, 209, 209,
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
-
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
+
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
- 209, 209
+ 209, 209, 209, 209, 209, 209, 209
} ;
-static yyconst flex_int16_t yy_chk[633] =
+static const flex_int16_t yy_chk[518] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
- 4, 28, 2, 4, 7, 2, 4, 6, 6, 8,
- 6, 7, 7, 6, 9, 28, 8, 8, 9, 6,
- 10, 9, 29, 31, 10, 18, 18, 10, 18, 18,
- 6, 6, 32, 18, 31, 207, 29, 33, 33, 35,
- 33, 49, 35, 100, 32, 35, 6, 6, 17, 42,
-
- 42, 17, 42, 50, 100, 50, 52, 49, 51, 58,
- 75, 172, 58, 51, 60, 182, 182, 62, 50, 50,
- 52, 76, 17, 17, 51, 75, 17, 51, 53, 53,
- 60, 53, 53, 62, 17, 76, 53, 58, 17, 17,
- 104, 17, 64, 104, 61, 17, 34, 54, 54, 163,
- 54, 54, 58, 34, 34, 54, 61, 72, 64, 34,
- 61, 34, 65, 65, 34, 65, 34, 34, 68, 71,
- 162, 68, 71, 72, 68, 96, 73, 125, 73, 83,
- 83, 98, 83, 71, 34, 34, 36, 36, 125, 96,
- 36, 73, 73, 36, 36, 110, 98, 84, 74, 36,
-
- 84, 36, 85, 74, 36, 84, 36, 36, 146, 110,
- 159, 36, 36, 87, 74, 36, 36, 74, 85, 146,
- 89, 159, 90, 36, 36, 36, 86, 36, 36, 87,
- 36, 36, 86, 88, 36, 38, 89, 38, 90, 139,
- 88, 86, 38, 38, 86, 140, 99, 138, 38, 88,
- 38, 128, 105, 38, 88, 38, 38, 91, 91, 140,
- 91, 91, 99, 92, 92, 91, 92, 92, 105, 126,
- 113, 92, 112, 38, 38, 39, 39, 39, 39, 39,
+ 4, 207, 2, 4, 7, 2, 4, 6, 6, 8,
+ 6, 7, 7, 6, 9, 198, 8, 8, 9, 6,
+ 10, 9, 28, 29, 10, 17, 32, 10, 17, 31,
+ 6, 6, 18, 18, 60, 18, 18, 28, 29, 32,
+ 18, 31, 33, 33, 193, 33, 6, 6, 35, 17,
+
+ 60, 35, 42, 42, 35, 42, 48, 51, 51, 48,
+ 17, 52, 58, 62, 52, 58, 17, 187, 17, 34,
+ 53, 53, 61, 53, 53, 186, 34, 34, 53, 62,
+ 48, 89, 34, 61, 34, 64, 89, 34, 61, 34,
+ 34, 48, 54, 54, 179, 54, 54, 48, 178, 48,
+ 54, 64, 73, 73, 175, 58, 34, 34, 36, 65,
+ 65, 36, 65, 68, 71, 74, 68, 71, 74, 68,
+ 83, 83, 36, 83, 84, 98, 87, 84, 71, 87,
+ 91, 91, 84, 91, 91, 100, 92, 92, 91, 92,
+ 92, 98, 93, 93, 92, 93, 93, 100, 36, 36,
+
+ 93, 36, 36, 172, 99, 36, 38, 104, 38, 103,
+ 104, 108, 103, 38, 38, 106, 108, 127, 106, 38,
+ 99, 38, 114, 103, 38, 114, 38, 38, 94, 94,
+ 114, 94, 94, 127, 182, 182, 94, 170, 169, 168,
+ 164, 163, 162, 38, 38, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
-
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 48, 93, 93, 48, 93, 93,
- 107, 94, 94, 93, 94, 94, 101, 103, 95, 94,
- 103, 95, 109, 153, 106, 111, 107, 108, 48, 48,
- 106, 103, 48, 82, 108, 79, 77, 153, 109, 106,
- 48, 111, 106, 108, 48, 48, 95, 48, 108, 116,
- 114, 48, 69, 114, 117, 69, 118, 120, 114, 119,
- 122, 95, 121, 123, 116, 63, 69, 124, 46, 127,
- 117, 129, 118, 120, 119, 122, 69, 69, 121, 123,
-
- 69, 69, 130, 124, 127, 131, 129, 133, 69, 132,
- 134, 41, 69, 69, 135, 69, 69, 37, 130, 69,
- 78, 131, 78, 133, 132, 30, 134, 78, 78, 135,
- 136, 137, 143, 78, 144, 78, 145, 147, 78, 148,
- 78, 78, 26, 25, 149, 150, 136, 137, 143, 151,
- 144, 152, 145, 147, 148, 156, 157, 158, 78, 78,
- 149, 150, 161, 160, 164, 151, 160, 152, 167, 168,
- 170, 156, 157, 158, 171, 174, 175, 160, 161, 178,
- 164, 170, 179, 186, 167, 168, 174, 187, 180, 189,
- 171, 180, 175, 190, 193, 178, 198, 199, 179, 186,
-
- 200, 201, 180, 187, 201, 189, 205, 23, 190, 205,
- 193, 15, 198, 199, 11, 5, 200, 0, 201, 0,
- 0, 0, 0, 205, 210, 210, 210, 210, 210, 210,
- 210, 211, 0, 0, 0, 211, 211, 212, 212, 212,
- 212, 212, 212, 212, 213, 0, 213, 214, 214, 214,
- 214, 214, 214, 214, 215, 215, 215, 215, 215, 215,
- 215, 216, 216, 216, 0, 216, 216, 216, 217, 0,
- 217, 0, 217, 217, 217, 218, 218, 218, 218, 218,
- 0, 218, 209, 209, 209, 209, 209, 209, 209, 209,
+ 39, 39, 39, 39, 69, 125, 95, 69, 149, 95,
+
+ 150, 151, 152, 171, 161, 189, 160, 125, 69, 160,
+ 174, 190, 180, 199, 149, 180, 150, 151, 152, 171,
+ 160, 189, 174, 159, 200, 158, 180, 190, 201, 199,
+ 205, 201, 157, 205, 69, 69, 156, 69, 69, 95,
+ 200, 69, 78, 153, 78, 201, 148, 205, 147, 78,
+ 78, 146, 145, 144, 141, 78, 140, 78, 139, 138,
+ 78, 137, 78, 78, 136, 135, 134, 133, 132, 131,
+ 130, 129, 128, 126, 124, 123, 122, 121, 120, 78,
+ 78, 210, 210, 210, 210, 210, 210, 210, 211, 119,
+ 118, 117, 211, 211, 212, 212, 212, 212, 212, 212,
+
+ 212, 213, 116, 213, 214, 214, 214, 214, 214, 214,
+ 214, 215, 215, 215, 215, 215, 215, 215, 216, 216,
+ 216, 113, 216, 216, 216, 217, 112, 217, 111, 217,
+ 217, 217, 218, 218, 218, 218, 218, 110, 218, 109,
+ 107, 105, 101, 96, 90, 88, 86, 85, 82, 79,
+ 77, 76, 75, 72, 63, 50, 49, 46, 41, 37,
+ 30, 26, 25, 23, 15, 11, 5, 209, 209, 209,
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
-
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
+
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
- 209, 209
+ 209, 209, 209, 209, 209, 209, 209
} ;
/* The intent behind this definition is that it'll catch
@@ -637,8 +810,6 @@ static yyconst flex_int16_t yy_chk[633] =
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-#line 1 "cmFortranLexer.in.l"
-#line 2 "cmFortranLexer.in.l"
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
/*-------------------------------------------------------------------------
@@ -657,14 +828,12 @@ This file must be translated to C++ and modified to build everywhere.
Run flex >= 2.6 like this:
- flex -i --nounistd -DFLEXINT_H --prefix=cmFortran_yy --header-file=cmFortranLexer.h -ocmFortranLexer.cxx cmFortranLexer.in.l
+ flex -i --nounistd -DFLEXINT_H --noline --header-file=cmFortranLexer.h -ocmFortranLexer.cxx cmFortranLexer.in.l
Modify cmFortranLexer.cxx:
- - remove trailing whitespace: sed -i 's/\s*$//' cmFortranLexer.h cmFortranLexer.cxx
- - remove blank lines at end of file
- - #include "cmStandardLexer.h" at the top
- - add cast in cmFortran_yy_scan_bytes for loop condition of _yybytes_len to size_t
-
+ - remove trailing whitespace: sed -i 's/\s*$//' cmFortranLexer.h cmFortranLexer.cxx
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmFortranLexer.h cmFortranLexer.cxx
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmFortranLexer.cxx
*/
/* IWYU pragma: no_forward_declare yyguts_t */
@@ -684,9 +853,6 @@ Modify cmFortranLexer.cxx:
/*--------------------------------------------------------------------------*/
-
-#line 688 "cmFortranLexer.cxx"
-
#define INITIAL 0
#define free_fmt 1
#define fixed_fmt 2
@@ -731,44 +897,44 @@ struct yyguts_t
}; /* end struct yyguts_t */
-static int yy_init_globals (yyscan_t yyscanner );
+static int yy_init_globals ( yyscan_t yyscanner );
-int cmFortran_yylex_init (yyscan_t* scanner);
+int yylex_init (yyscan_t* scanner);
-int cmFortran_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int cmFortran_yylex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
-int cmFortran_yyget_debug (yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
-void cmFortran_yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-YY_EXTRA_TYPE cmFortran_yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-void cmFortran_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-FILE *cmFortran_yyget_in (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
-void cmFortran_yyset_in (FILE * _in_str ,yyscan_t yyscanner );
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
-FILE *cmFortran_yyget_out (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
-void cmFortran_yyset_out (FILE * _out_str ,yyscan_t yyscanner );
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
- int cmFortran_yyget_leng (yyscan_t yyscanner );
+ int yyget_leng ( yyscan_t yyscanner );
-char *cmFortran_yyget_text (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
-int cmFortran_yyget_lineno (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
-void cmFortran_yyset_lineno (int _line_number ,yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
-int cmFortran_yyget_column (yyscan_t yyscanner );
+int yyget_column ( yyscan_t yyscanner );
-void cmFortran_yyset_column (int _column_no ,yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -776,32 +942,31 @@ void cmFortran_yyset_column (int _column_no ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int cmFortran_yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int cmFortran_yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
#ifndef YY_NO_UNPUT
- static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
+ static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
-
#ifdef __cplusplus
-static int yyinput (yyscan_t yyscanner );
+static int yyinput ( yyscan_t yyscanner );
#else
-static int input (yyscan_t yyscanner );
+static int input ( yyscan_t yyscanner );
#endif
#endif
@@ -832,7 +997,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -845,7 +1010,7 @@ static int input (yyscan_t yyscanner );
else \
{ \
errno=0; \
- while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
@@ -886,9 +1051,9 @@ static int input (yyscan_t yyscanner );
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int cmFortran_yylex (yyscan_t yyscanner);
+extern int yylex (yyscan_t yyscanner);
-#define YY_DECL int cmFortran_yylex (yyscan_t yyscanner)
+#define YY_DECL int yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after yytext and yyleng
@@ -936,19 +1101,15 @@ YY_DECL
yyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
- cmFortran_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- cmFortran_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
{
-#line 56 "cmFortranLexer.in.l"
-
-
-#line 951 "cmFortranLexer.cxx"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -977,12 +1138,12 @@ yy_match:
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 210 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 583 );
+ while ( yy_base[yy_current_state] != 468 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -1008,7 +1169,6 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 58 "cmFortranLexer.in.l"
{
cmFortranParser_StringStart(yyextra);
cmFortranParser_SetOldStartcond(yyextra, YY_START);
@@ -1017,7 +1177,6 @@ YY_RULE_SETUP
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 64 "cmFortranLexer.in.l"
{
cmFortranParser_StringStart(yyextra);
cmFortranParser_SetOldStartcond(yyextra, YY_START);
@@ -1025,10 +1184,8 @@ YY_RULE_SETUP
}
YY_BREAK
case 3:
-#line 71 "cmFortranLexer.in.l"
case 4:
YY_RULE_SETUP
-#line 71 "cmFortranLexer.in.l"
{
BEGIN(cmFortranParser_GetOldStartcond(yyextra) );
yylvalp->string = strdup(cmFortranParser_StringEnd(yyextra));
@@ -1037,17 +1194,14 @@ YY_RULE_SETUP
YY_BREAK
case 5:
/* rule 5 can match eol */
-#line 78 "cmFortranLexer.in.l"
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
-#line 78 "cmFortranLexer.in.l"
/* Ignore (continued strings, free fmt) */
YY_BREAK
case 7:
/* rule 7 can match eol */
YY_RULE_SETUP
-#line 80 "cmFortranLexer.in.l"
{
if (cmFortranParser_GetOldStartcond(yyextra) == fixed_fmt)
; /* Ignore (cont. strings, fixed fmt) */
@@ -1060,7 +1214,6 @@ YY_RULE_SETUP
case 8:
/* rule 8 can match eol */
YY_RULE_SETUP
-#line 90 "cmFortranLexer.in.l"
{
unput ('\n');
BEGIN(INITIAL);
@@ -1069,7 +1222,6 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 96 "cmFortranLexer.in.l"
{
cmFortranParser_StringAppend(yyextra, yytext[0]);
}
@@ -1077,24 +1229,20 @@ YY_RULE_SETUP
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
-#line 100 "cmFortranLexer.in.l"
{ return EOSTMT; } /* Treat comments like */
YY_BREAK
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
-#line 101 "cmFortranLexer.in.l"
{ return EOSTMT; } /* empty lines */
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 103 "cmFortranLexer.in.l"
{ return CPP_LINE_DIRECTIVE; }
YY_BREAK
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
-#line 104 "cmFortranLexer.in.l"
{
yytext[yyleng-1] = 0;
yylvalp->string = strdup(strchr(yytext, '<')+1);
@@ -1103,171 +1251,138 @@ YY_RULE_SETUP
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 109 "cmFortranLexer.in.l"
{ return CPP_INCLUDE; }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 110 "cmFortranLexer.in.l"
{ return F90PPR_INCLUDE; }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 111 "cmFortranLexer.in.l"
{ return COCO_INCLUDE; }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 113 "cmFortranLexer.in.l"
{ return CPP_DEFINE; }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 114 "cmFortranLexer.in.l"
{ return F90PPR_DEFINE; }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 116 "cmFortranLexer.in.l"
{ return CPP_UNDEF; }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 117 "cmFortranLexer.in.l"
{ return F90PPR_UNDEF; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 119 "cmFortranLexer.in.l"
{ return CPP_IFDEF; }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 120 "cmFortranLexer.in.l"
{ return CPP_IFNDEF; }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 121 "cmFortranLexer.in.l"
{ return CPP_IF; }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 122 "cmFortranLexer.in.l"
{ return CPP_ELIF; }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 123 "cmFortranLexer.in.l"
{ return CPP_ELSE; }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 124 "cmFortranLexer.in.l"
{ return CPP_ENDIF; }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 126 "cmFortranLexer.in.l"
{ return F90PPR_IFDEF; }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 127 "cmFortranLexer.in.l"
{ return F90PPR_IFNDEF; }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 128 "cmFortranLexer.in.l"
{ return F90PPR_IF; }
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 129 "cmFortranLexer.in.l"
{ return F90PPR_ELIF; }
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 130 "cmFortranLexer.in.l"
{ return F90PPR_ELSE; }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 131 "cmFortranLexer.in.l"
{ return F90PPR_ENDIF; }
YY_BREAK
/* Line continuations, possible involving comments. */
case 33:
/* rule 33 can match eol */
YY_RULE_SETUP
-#line 134 "cmFortranLexer.in.l"
YY_BREAK
case 34:
/* rule 34 can match eol */
YY_RULE_SETUP
-#line 135 "cmFortranLexer.in.l"
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 137 "cmFortranLexer.in.l"
{ return COMMA; }
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 139 "cmFortranLexer.in.l"
{ return DCOLON; }
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 140 "cmFortranLexer.in.l"
{ return COLON; }
YY_BREAK
case 38:
/* rule 38 can match eol */
YY_RULE_SETUP
-#line 142 "cmFortranLexer.in.l"
{ return GARBAGE; }
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 144 "cmFortranLexer.in.l"
{ return ASSIGNMENT_OP; }
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 146 "cmFortranLexer.in.l"
{ return END; }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 147 "cmFortranLexer.in.l"
{ return INCLUDE; }
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 148 "cmFortranLexer.in.l"
{ return INTERFACE; }
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 149 "cmFortranLexer.in.l"
{ return MODULE; }
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 150 "cmFortranLexer.in.l"
{ return SUBMODULE; }
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 151 "cmFortranLexer.in.l"
{ return USE; }
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 153 "cmFortranLexer.in.l"
{
yylvalp->string = strdup(yytext);
return WORD;
@@ -1275,39 +1390,32 @@ YY_RULE_SETUP
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 158 "cmFortranLexer.in.l"
{ return LPAREN; }
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 159 "cmFortranLexer.in.l"
{ return RPAREN; }
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 161 "cmFortranLexer.in.l"
{ return GARBAGE; }
YY_BREAK
case 50:
/* rule 50 can match eol */
YY_RULE_SETUP
-#line 163 "cmFortranLexer.in.l"
{ return EOSTMT; }
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 166 "cmFortranLexer.in.l"
/* Ignore */
YY_BREAK
case 52:
/* rule 52 can match eol */
YY_RULE_SETUP
-#line 167 "cmFortranLexer.in.l"
/* Ignore line-endings preceded by \ */
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 169 "cmFortranLexer.in.l"
{ return *yytext; }
YY_BREAK
case YY_STATE_EOF(INITIAL):
@@ -1315,7 +1423,6 @@ case YY_STATE_EOF(free_fmt):
case YY_STATE_EOF(fixed_fmt):
case YY_STATE_EOF(str_sq):
case YY_STATE_EOF(str_dq):
-#line 171 "cmFortranLexer.in.l"
{
if(!cmFortranParser_FilePop(yyextra) )
{
@@ -1325,10 +1432,8 @@ case YY_STATE_EOF(str_dq):
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 178 "cmFortranLexer.in.l"
ECHO;
YY_BREAK
-#line 1331 "cmFortranLexer.cxx"
case YY_END_OF_BUFFER:
{
@@ -1344,7 +1449,7 @@ ECHO;
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
- * cmFortran_yylex(). If so, then we have to assure
+ * yylex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
@@ -1404,7 +1509,7 @@ ECHO;
{
yyg->yy_did_buffer_switch_on_eof = 0;
- if ( cmFortran_yywrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
@@ -1458,7 +1563,7 @@ ECHO;
} /* end of action switch */
} /* end of scanning one token */
} /* end of user's declarations */
-} /* end of cmFortran_yylex */
+} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -1472,7 +1577,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = yyg->yytext_ptr;
- yy_size_t number_to_move, i;
+ int number_to_move, i;
int ret_val;
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
@@ -1501,7 +1606,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -1537,7 +1642,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- cmFortran_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
}
else
/* Can't grow it, we don't own it. */
@@ -1569,7 +1675,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- cmFortran_yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
}
else
@@ -1583,12 +1689,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cmFortran_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
yyg->yy_n_chars += number_to_move;
@@ -1623,9 +1732,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 210 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return yy_current_state;
@@ -1652,9 +1761,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 210 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 209);
(void)yyg;
@@ -1728,7 +1837,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{ /* need more input */
- int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
@@ -1745,13 +1854,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*/
/* Reset buffer status. */
- cmFortran_yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( cmFortran_yywrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
return 0;
if ( ! yyg->yy_did_buffer_switch_on_eof )
@@ -1785,34 +1894,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @note This function does not reset the start condition to @c INITIAL .
*/
- void cmFortran_yyrestart (FILE * input_file , yyscan_t yyscanner)
+ void yyrestart (FILE * input_file , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! YY_CURRENT_BUFFER ){
- cmFortran_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmFortran_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- cmFortran_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
- cmFortran_yy_load_buffer_state(yyscanner );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
+ yy_load_buffer_state( yyscanner );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
* @param yyscanner The scanner object.
*/
- void cmFortran_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* TODO. We should be able to replace this entire function body
* with
- * cmFortran_yypop_buffer_state();
- * cmFortran_yypush_buffer_state(new_buffer);
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
*/
- cmFortran_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
if ( YY_CURRENT_BUFFER == new_buffer )
return;
@@ -1825,17 +1934,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- cmFortran_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
/* We don't actually know whether we did this switch during
- * EOF (cmFortran_yywrap()) processing, but the only time this flag
- * is looked at is after cmFortran_yywrap() is called, so it's safe
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yyg->yy_did_buffer_switch_on_eof = 1;
}
-static void cmFortran_yy_load_buffer_state (yyscan_t yyscanner)
+static void yy_load_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
@@ -1850,35 +1959,35 @@ static void cmFortran_yy_load_buffer_state (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the allocated buffer state.
*/
- YY_BUFFER_STATE cmFortran_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) cmFortran_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_buf_size = (yy_size_t)size;
+ b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) cmFortran_yyalloc(b->yy_buf_size + 2 ,yyscanner );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- cmFortran_yy_init_buffer(b,file ,yyscanner);
+ yy_init_buffer( b, file , yyscanner);
return b;
}
/** Destroy the buffer.
- * @param b a buffer created with cmFortran_yy_create_buffer()
+ * @param b a buffer created with yy_create_buffer()
* @param yyscanner The scanner object.
*/
- void cmFortran_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -1889,28 +1998,28 @@ static void cmFortran_yy_load_buffer_state (yyscan_t yyscanner)
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- cmFortran_yyfree((void *) b->yy_ch_buf ,yyscanner );
+ yyfree( (void *) b->yy_ch_buf , yyscanner );
- cmFortran_yyfree((void *) b ,yyscanner );
+ yyfree( (void *) b , yyscanner );
}
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
- * such as during a cmFortran_yyrestart() or at EOF.
+ * such as during a yyrestart() or at EOF.
*/
- static void cmFortran_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
{
int oerrno = errno;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- cmFortran_yy_flush_buffer(b ,yyscanner);
+ yy_flush_buffer( b , yyscanner);
b->yy_input_file = file;
b->yy_fill_buffer = 1;
- /* If b is the current buffer, then cmFortran_yy_init_buffer was _probably_
- * called from cmFortran_yyrestart() or through yy_get_next_buffer.
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
@@ -1927,7 +2036,7 @@ static void cmFortran_yy_load_buffer_state (yyscan_t yyscanner)
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
* @param yyscanner The scanner object.
*/
- void cmFortran_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! b )
@@ -1948,7 +2057,7 @@ static void cmFortran_yy_load_buffer_state (yyscan_t yyscanner)
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- cmFortran_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -1957,15 +2066,15 @@ static void cmFortran_yy_load_buffer_state (yyscan_t yyscanner)
* @param new_buffer The new state.
* @param yyscanner The scanner object.
*/
-void cmFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (new_buffer == NULL)
return;
- cmFortran_yyensure_buffer_stack(yyscanner);
+ yyensure_buffer_stack(yyscanner);
- /* This block is copied from cmFortran_yy_switch_to_buffer. */
+ /* This block is copied from yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
@@ -1979,8 +2088,8 @@ void cmFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscan
yyg->yy_buffer_stack_top++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from cmFortran_yy_switch_to_buffer. */
- cmFortran_yy_load_buffer_state(yyscanner );
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
@@ -1988,19 +2097,19 @@ void cmFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscan
* The next element becomes the new top.
* @param yyscanner The scanner object.
*/
-void cmFortran_yypop_buffer_state (yyscan_t yyscanner)
+void yypop_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!YY_CURRENT_BUFFER)
return;
- cmFortran_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+ yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
YY_CURRENT_BUFFER_LVALUE = NULL;
if (yyg->yy_buffer_stack_top > 0)
--yyg->yy_buffer_stack_top;
if (YY_CURRENT_BUFFER) {
- cmFortran_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
}
@@ -2008,9 +2117,9 @@ void cmFortran_yypop_buffer_state (yyscan_t yyscanner)
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
-static void cmFortran_yyensure_buffer_stack (yyscan_t yyscanner)
+static void yyensure_buffer_stack (yyscan_t yyscanner)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!yyg->yy_buffer_stack) {
@@ -2020,11 +2129,11 @@ static void cmFortran_yyensure_buffer_stack (yyscan_t yyscanner)
* immediate realloc on the next call.
*/
num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmFortran_yyalloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
@@ -2039,12 +2148,12 @@ static void cmFortran_yyensure_buffer_stack (yyscan_t yyscanner)
yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmFortran_yyrealloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -2058,7 +2167,7 @@ static void cmFortran_yyensure_buffer_stack (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmFortran_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
@@ -2068,11 +2177,11 @@ YY_BUFFER_STATE cmFortran_yy_scan_buffer (char * base, yy_size_t size , yyscan
/* They forgot to leave room for the EOB's. */
return NULL;
- b = (YY_BUFFER_STATE) cmFortran_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yy_scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = NULL;
@@ -2082,53 +2191,53 @@ YY_BUFFER_STATE cmFortran_yy_scan_buffer (char * base, yy_size_t size , yyscan
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- cmFortran_yy_switch_to_buffer(b ,yyscanner );
+ yy_switch_to_buffer( b , yyscanner );
return b;
}
-/** Setup the input buffer state to scan a string. The next call to cmFortran_yylex() will
+/** Setup the input buffer state to scan a string. The next call to yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
- * cmFortran_yy_scan_bytes() instead.
+ * yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE cmFortran_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
{
- return cmFortran_yy_scan_bytes(yystr,(int) strlen(yystr) ,yyscanner);
+ return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
}
-/** Setup the input buffer state to scan the given bytes. The next call to cmFortran_yylex() will
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmFortran_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- yy_size_t i;
+ int i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = (yy_size_t) _yybytes_len + 2;
- buf = (char *) cmFortran_yyalloc(n ,yyscanner );
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n , yyscanner );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmFortran_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
- for ( i = 0; i < (size_t)_yybytes_len; ++i )
+ for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = cmFortran_yy_scan_buffer(buf,n ,yyscanner);
+ b = yy_scan_buffer( buf, n , yyscanner);
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in cmFortran_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -2142,11 +2251,11 @@ YY_BUFFER_STATE cmFortran_yy_scan_bytes (yyconst char * yybytes, int _yybytes_
#define YY_EXIT_FAILURE 2
#endif
-static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- (void) fprintf( stderr, "%s\n", msg );
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -2172,7 +2281,7 @@ static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
/** Get the user-defined data for this scanner.
* @param yyscanner The scanner object.
*/
-YY_EXTRA_TYPE cmFortran_yyget_extra (yyscan_t yyscanner)
+YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyextra;
@@ -2181,7 +2290,7 @@ YY_EXTRA_TYPE cmFortran_yyget_extra (yyscan_t yyscanner)
/** Get the current line number.
* @param yyscanner The scanner object.
*/
-int cmFortran_yyget_lineno (yyscan_t yyscanner)
+int yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2194,7 +2303,7 @@ int cmFortran_yyget_lineno (yyscan_t yyscanner)
/** Get the current column number.
* @param yyscanner The scanner object.
*/
-int cmFortran_yyget_column (yyscan_t yyscanner)
+int yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2207,7 +2316,7 @@ int cmFortran_yyget_column (yyscan_t yyscanner)
/** Get the input stream.
* @param yyscanner The scanner object.
*/
-FILE *cmFortran_yyget_in (yyscan_t yyscanner)
+FILE *yyget_in (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyin;
@@ -2216,7 +2325,7 @@ FILE *cmFortran_yyget_in (yyscan_t yyscanner)
/** Get the output stream.
* @param yyscanner The scanner object.
*/
-FILE *cmFortran_yyget_out (yyscan_t yyscanner)
+FILE *yyget_out (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyout;
@@ -2225,7 +2334,7 @@ FILE *cmFortran_yyget_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-int cmFortran_yyget_leng (yyscan_t yyscanner)
+int yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
@@ -2235,7 +2344,7 @@ int cmFortran_yyget_leng (yyscan_t yyscanner)
* @param yyscanner The scanner object.
*/
-char *cmFortran_yyget_text (yyscan_t yyscanner)
+char *yyget_text (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yytext;
@@ -2245,7 +2354,7 @@ char *cmFortran_yyget_text (yyscan_t yyscanner)
* @param user_defined The data to be associated with this scanner.
* @param yyscanner The scanner object.
*/
-void cmFortran_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyextra = user_defined ;
@@ -2255,13 +2364,13 @@ void cmFortran_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
* @param _line_number line number
* @param yyscanner The scanner object.
*/
-void cmFortran_yyset_lineno (int _line_number , yyscan_t yyscanner)
+void yyset_lineno (int _line_number , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "cmFortran_yyset_lineno called with no buffer" );
+ YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
yylineno = _line_number;
}
@@ -2270,13 +2379,13 @@ void cmFortran_yyset_lineno (int _line_number , yyscan_t yyscanner)
* @param _column_no column number
* @param yyscanner The scanner object.
*/
-void cmFortran_yyset_column (int _column_no , yyscan_t yyscanner)
+void yyset_column (int _column_no , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "cmFortran_yyset_column called with no buffer" );
+ YY_FATAL_ERROR( "yyset_column called with no buffer" );
yycolumn = _column_no;
}
@@ -2285,27 +2394,27 @@ void cmFortran_yyset_column (int _column_no , yyscan_t yyscanner)
* input buffer.
* @param _in_str A readable stream.
* @param yyscanner The scanner object.
- * @see cmFortran_yy_switch_to_buffer
+ * @see yy_switch_to_buffer
*/
-void cmFortran_yyset_in (FILE * _in_str , yyscan_t yyscanner)
+void yyset_in (FILE * _in_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyin = _in_str ;
}
-void cmFortran_yyset_out (FILE * _out_str , yyscan_t yyscanner)
+void yyset_out (FILE * _out_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyout = _out_str ;
}
-int cmFortran_yyget_debug (yyscan_t yyscanner)
+int yyget_debug (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yy_flex_debug;
}
-void cmFortran_yyset_debug (int _bdebug , yyscan_t yyscanner)
+void yyset_debug (int _bdebug , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_flex_debug = _bdebug ;
@@ -2315,20 +2424,18 @@ void cmFortran_yyset_debug (int _bdebug , yyscan_t yyscanner)
/* User-visible API */
-/* cmFortran_yylex_init is special because it creates the scanner itself, so it is
+/* yylex_init is special because it creates the scanner itself, so it is
* the ONLY reentrant function that doesn't take the scanner as the last argument.
* That's why we explicitly handle the declaration, instead of using our macros.
*/
-
-int cmFortran_yylex_init(yyscan_t* ptr_yy_globals)
-
+int yylex_init(yyscan_t* ptr_yy_globals)
{
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmFortran_yyalloc ( sizeof( struct yyguts_t ), NULL );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -2341,27 +2448,25 @@ int cmFortran_yylex_init(yyscan_t* ptr_yy_globals)
return yy_init_globals ( *ptr_yy_globals );
}
-/* cmFortran_yylex_init_extra has the same functionality as cmFortran_yylex_init, but follows the
+/* yylex_init_extra has the same functionality as yylex_init, but follows the
* convention of taking the scanner as the last argument. Note however, that
* this is a *pointer* to a scanner, as it will be allocated by this call (and
* is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to cmFortran_yyalloc in
+ * The user defined value in the first argument will be available to yyalloc in
* the yyextra field.
*/
-
-int cmFortran_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
+int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
{
struct yyguts_t dummy_yyguts;
- cmFortran_yyset_extra (yy_user_defined, &dummy_yyguts);
+ yyset_extra (yy_user_defined, &dummy_yyguts);
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmFortran_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -2372,7 +2477,7 @@ int cmFortran_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_gl
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
- cmFortran_yyset_extra (yy_user_defined, *ptr_yy_globals);
+ yyset_extra (yy_user_defined, *ptr_yy_globals);
return yy_init_globals ( *ptr_yy_globals );
}
@@ -2381,7 +2486,7 @@ static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Initialization is the same as for the non-reentrant scanner.
- * This function is called from cmFortran_yylex_destroy(), so don't allocate here.
+ * This function is called from yylex_destroy(), so don't allocate here.
*/
yyg->yy_buffer_stack = NULL;
@@ -2405,37 +2510,37 @@ static int yy_init_globals (yyscan_t yyscanner)
#endif
/* For future reference: Set errno on error, since we are called by
- * cmFortran_yylex_init()
+ * yylex_init()
*/
return 0;
}
-/* cmFortran_yylex_destroy is for both reentrant and non-reentrant scanners. */
-int cmFortran_yylex_destroy (yyscan_t yyscanner)
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- cmFortran_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
YY_CURRENT_BUFFER_LVALUE = NULL;
- cmFortran_yypop_buffer_state(yyscanner);
+ yypop_buffer_state(yyscanner);
}
/* Destroy the stack itself. */
- cmFortran_yyfree(yyg->yy_buffer_stack ,yyscanner);
+ yyfree(yyg->yy_buffer_stack , yyscanner);
yyg->yy_buffer_stack = NULL;
/* Destroy the start condition stack. */
- cmFortran_yyfree(yyg->yy_start_stack ,yyscanner );
+ yyfree( yyg->yy_start_stack , yyscanner );
yyg->yy_start_stack = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
- * cmFortran_yylex() is called, initialization will occur. */
+ * yylex() is called, initialization will occur. */
yy_init_globals( yyscanner);
/* Destroy the main struct (reentrant only). */
- cmFortran_yyfree ( yyscanner , yyscanner );
+ yyfree ( yyscanner , yyscanner );
yyscanner = NULL;
return 0;
}
@@ -2445,7 +2550,7 @@ int cmFortran_yylex_destroy (yyscan_t yyscanner)
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -2457,7 +2562,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
{
int n;
for ( n = 0; s[n]; ++n )
@@ -2467,14 +2572,14 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
}
#endif
-void *cmFortran_yyalloc (yy_size_t size , yyscan_t yyscanner)
+void *yyalloc (yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
return malloc(size);
}
-void *cmFortran_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
+void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -2489,19 +2594,15 @@ void *cmFortran_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
return realloc(ptr, size);
}
-void cmFortran_yyfree (void * ptr , yyscan_t yyscanner)
+void yyfree (void * ptr , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- free( (char *) ptr ); /* see cmFortran_yyrealloc() for (char *) cast */
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
-#line 178 "cmFortranLexer.in.l"
-
-
-
/*--------------------------------------------------------------------------*/
YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
{
diff --git a/Source/LexerParser/cmFortranLexer.h b/Source/LexerParser/cmFortranLexer.h
index ddda919..7bb9b44 100644
--- a/Source/LexerParser/cmFortranLexer.h
+++ b/Source/LexerParser/cmFortranLexer.h
@@ -2,10 +2,6 @@
#define cmFortran_yyHEADER_H 1
#define cmFortran_yyIN_HEADER 1
-#line 6 "cmFortranLexer.h"
-
-#line 8 "cmFortranLexer.h"
-
#define FLEXINT_H 1
#define YY_INT_ALIGNED short int
@@ -14,11 +10,221 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define cmFortran_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer cmFortran_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define cmFortran_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer cmFortran_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define cmFortran_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer cmFortran_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define cmFortran_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string cmFortran_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define cmFortran_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes cmFortran_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define cmFortran_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer cmFortran_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define cmFortran_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer cmFortran_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define cmFortran_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state cmFortran_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define cmFortran_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer cmFortran_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define cmFortran_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state cmFortran_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define cmFortran_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state cmFortran_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define cmFortran_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack cmFortran_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define cmFortran_yylex_ALREADY_DEFINED
+#else
+#define yylex cmFortran_yylex
+#endif
+
+#ifdef yyrestart
+#define cmFortran_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart cmFortran_yyrestart
+#endif
+
+#ifdef yylex_init
+#define cmFortran_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init cmFortran_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define cmFortran_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra cmFortran_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define cmFortran_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy cmFortran_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define cmFortran_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug cmFortran_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define cmFortran_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug cmFortran_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define cmFortran_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra cmFortran_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define cmFortran_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra cmFortran_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define cmFortran_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in cmFortran_yyget_in
+#endif
+
+#ifdef yyset_in
+#define cmFortran_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in cmFortran_yyset_in
+#endif
+
+#ifdef yyget_out
+#define cmFortran_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out cmFortran_yyget_out
+#endif
+
+#ifdef yyset_out
+#define cmFortran_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out cmFortran_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define cmFortran_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng cmFortran_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define cmFortran_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text cmFortran_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define cmFortran_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno cmFortran_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define cmFortran_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno cmFortran_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define cmFortran_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column cmFortran_yyget_column
+#endif
+
+#ifdef yyset_column
+#define cmFortran_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column cmFortran_yyset_column
+#endif
+
+#ifdef yywrap
+#define cmFortran_yywrap_ALREADY_DEFINED
+#else
+#define yywrap cmFortran_yywrap
+#endif
+
+#ifdef yyalloc
+#define cmFortran_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc cmFortran_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define cmFortran_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc cmFortran_yyrealloc
+#endif
+
+#ifdef yyfree
+#define cmFortran_yyfree_ALREADY_DEFINED
+#else
+#define yyfree cmFortran_yyfree
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -89,10 +295,16 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */
+
/* TODO: this is always defined, so inline it */
#define yyconst const
@@ -193,21 +405,21 @@ struct yy_buffer_state
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-void cmFortran_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmFortran_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmFortran_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void cmFortran_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmFortran_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmFortran_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void cmFortran_yypop_buffer_state (yyscan_t yyscanner );
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
-YY_BUFFER_STATE cmFortran_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmFortran_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmFortran_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
-void *cmFortran_yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *cmFortran_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void cmFortran_yyfree (void * ,yyscan_t yyscanner );
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
/* Begin user sect3 */
@@ -229,42 +441,42 @@ void cmFortran_yyfree (void * ,yyscan_t yyscanner );
#define YY_EXTRA_TYPE void *
#endif
-int cmFortran_yylex_init (yyscan_t* scanner);
+int yylex_init (yyscan_t* scanner);
-int cmFortran_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int cmFortran_yylex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
-int cmFortran_yyget_debug (yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
-void cmFortran_yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-YY_EXTRA_TYPE cmFortran_yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-void cmFortran_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-FILE *cmFortran_yyget_in (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
-void cmFortran_yyset_in (FILE * _in_str ,yyscan_t yyscanner );
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
-FILE *cmFortran_yyget_out (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
-void cmFortran_yyset_out (FILE * _out_str ,yyscan_t yyscanner );
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
- int cmFortran_yyget_leng (yyscan_t yyscanner );
+ int yyget_leng ( yyscan_t yyscanner );
-char *cmFortran_yyget_text (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
-int cmFortran_yyget_lineno (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
-void cmFortran_yyset_lineno (int _line_number ,yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
-int cmFortran_yyget_column (yyscan_t yyscanner );
+int yyget_column ( yyscan_t yyscanner );
-void cmFortran_yyset_column (int _column_no ,yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -272,18 +484,18 @@ void cmFortran_yyset_column (int _column_no ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int cmFortran_yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int cmFortran_yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
@@ -311,9 +523,9 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int cmFortran_yylex (yyscan_t yyscanner);
+extern int yylex (yyscan_t yyscanner);
-#define YY_DECL int cmFortran_yylex (yyscan_t yyscanner)
+#define YY_DECL int yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* yy_get_previous_state - get the state just before the EOB char was reached */
@@ -330,9 +542,150 @@ extern int cmFortran_yylex (yyscan_t yyscanner);
#undef YY_DECL
#endif
-#line 178 "cmFortranLexer.in.l"
-
+#ifndef cmFortran_yy_create_buffer_ALREADY_DEFINED
+#undef yy_create_buffer
+#endif
+#ifndef cmFortran_yy_delete_buffer_ALREADY_DEFINED
+#undef yy_delete_buffer
+#endif
+#ifndef cmFortran_yy_scan_buffer_ALREADY_DEFINED
+#undef yy_scan_buffer
+#endif
+#ifndef cmFortran_yy_scan_string_ALREADY_DEFINED
+#undef yy_scan_string
+#endif
+#ifndef cmFortran_yy_scan_bytes_ALREADY_DEFINED
+#undef yy_scan_bytes
+#endif
+#ifndef cmFortran_yy_init_buffer_ALREADY_DEFINED
+#undef yy_init_buffer
+#endif
+#ifndef cmFortran_yy_flush_buffer_ALREADY_DEFINED
+#undef yy_flush_buffer
+#endif
+#ifndef cmFortran_yy_load_buffer_state_ALREADY_DEFINED
+#undef yy_load_buffer_state
+#endif
+#ifndef cmFortran_yy_switch_to_buffer_ALREADY_DEFINED
+#undef yy_switch_to_buffer
+#endif
+#ifndef cmFortran_yypush_buffer_state_ALREADY_DEFINED
+#undef yypush_buffer_state
+#endif
+#ifndef cmFortran_yypop_buffer_state_ALREADY_DEFINED
+#undef yypop_buffer_state
+#endif
+#ifndef cmFortran_yyensure_buffer_stack_ALREADY_DEFINED
+#undef yyensure_buffer_stack
+#endif
+#ifndef cmFortran_yylex_ALREADY_DEFINED
+#undef yylex
+#endif
+#ifndef cmFortran_yyrestart_ALREADY_DEFINED
+#undef yyrestart
+#endif
+#ifndef cmFortran_yylex_init_ALREADY_DEFINED
+#undef yylex_init
+#endif
+#ifndef cmFortran_yylex_init_extra_ALREADY_DEFINED
+#undef yylex_init_extra
+#endif
+#ifndef cmFortran_yylex_destroy_ALREADY_DEFINED
+#undef yylex_destroy
+#endif
+#ifndef cmFortran_yyget_debug_ALREADY_DEFINED
+#undef yyget_debug
+#endif
+#ifndef cmFortran_yyset_debug_ALREADY_DEFINED
+#undef yyset_debug
+#endif
+#ifndef cmFortran_yyget_extra_ALREADY_DEFINED
+#undef yyget_extra
+#endif
+#ifndef cmFortran_yyset_extra_ALREADY_DEFINED
+#undef yyset_extra
+#endif
+#ifndef cmFortran_yyget_in_ALREADY_DEFINED
+#undef yyget_in
+#endif
+#ifndef cmFortran_yyset_in_ALREADY_DEFINED
+#undef yyset_in
+#endif
+#ifndef cmFortran_yyget_out_ALREADY_DEFINED
+#undef yyget_out
+#endif
+#ifndef cmFortran_yyset_out_ALREADY_DEFINED
+#undef yyset_out
+#endif
+#ifndef cmFortran_yyget_leng_ALREADY_DEFINED
+#undef yyget_leng
+#endif
+#ifndef cmFortran_yyget_text_ALREADY_DEFINED
+#undef yyget_text
+#endif
+#ifndef cmFortran_yyget_lineno_ALREADY_DEFINED
+#undef yyget_lineno
+#endif
+#ifndef cmFortran_yyset_lineno_ALREADY_DEFINED
+#undef yyset_lineno
+#endif
+#ifndef cmFortran_yyget_column_ALREADY_DEFINED
+#undef yyget_column
+#endif
+#ifndef cmFortran_yyset_column_ALREADY_DEFINED
+#undef yyset_column
+#endif
+#ifndef cmFortran_yywrap_ALREADY_DEFINED
+#undef yywrap
+#endif
+#ifndef cmFortran_yyget_lval_ALREADY_DEFINED
+#undef yyget_lval
+#endif
+#ifndef cmFortran_yyset_lval_ALREADY_DEFINED
+#undef yyset_lval
+#endif
+#ifndef cmFortran_yyget_lloc_ALREADY_DEFINED
+#undef yyget_lloc
+#endif
+#ifndef cmFortran_yyset_lloc_ALREADY_DEFINED
+#undef yyset_lloc
+#endif
+#ifndef cmFortran_yyalloc_ALREADY_DEFINED
+#undef yyalloc
+#endif
+#ifndef cmFortran_yyrealloc_ALREADY_DEFINED
+#undef yyrealloc
+#endif
+#ifndef cmFortran_yyfree_ALREADY_DEFINED
+#undef yyfree
+#endif
+#ifndef cmFortran_yytext_ALREADY_DEFINED
+#undef yytext
+#endif
+#ifndef cmFortran_yyleng_ALREADY_DEFINED
+#undef yyleng
+#endif
+#ifndef cmFortran_yyin_ALREADY_DEFINED
+#undef yyin
+#endif
+#ifndef cmFortran_yyout_ALREADY_DEFINED
+#undef yyout
+#endif
+#ifndef cmFortran_yy_flex_debug_ALREADY_DEFINED
+#undef yy_flex_debug
+#endif
+#ifndef cmFortran_yylineno_ALREADY_DEFINED
+#undef yylineno
+#endif
+#ifndef cmFortran_yytables_fload_ALREADY_DEFINED
+#undef yytables_fload
+#endif
+#ifndef cmFortran_yytables_destroy_ALREADY_DEFINED
+#undef yytables_destroy
+#endif
+#ifndef cmFortran_yyTABLES_NAME_ALREADY_DEFINED
+#undef yyTABLES_NAME
+#endif
-#line 337 "cmFortranLexer.h"
#undef cmFortran_yyIN_HEADER
#endif /* cmFortran_yyHEADER_H */
diff --git a/Source/LexerParser/cmFortranLexer.in.l b/Source/LexerParser/cmFortranLexer.in.l
index 1121210..9acba4c 100644
--- a/Source/LexerParser/cmFortranLexer.in.l
+++ b/Source/LexerParser/cmFortranLexer.in.l
@@ -17,14 +17,12 @@ This file must be translated to C++ and modified to build everywhere.
Run flex >= 2.6 like this:
- flex -i --nounistd -DFLEXINT_H --prefix=cmFortran_yy --header-file=cmFortranLexer.h -ocmFortranLexer.cxx cmFortranLexer.in.l
+ flex -i --nounistd -DFLEXINT_H --noline --header-file=cmFortranLexer.h -ocmFortranLexer.cxx cmFortranLexer.in.l
Modify cmFortranLexer.cxx:
- - remove trailing whitespace: sed -i 's/\s*$//' cmFortranLexer.h cmFortranLexer.cxx
- - remove blank lines at end of file
- - #include "cmStandardLexer.h" at the top
- - add cast in yy_scan_bytes for loop condition of _yybytes_len to size_t
-
+ - remove trailing whitespace: sed -i 's/\s*$//' cmFortranLexer.h cmFortranLexer.cxx
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmFortranLexer.h cmFortranLexer.cxx
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmFortranLexer.cxx
*/
/* IWYU pragma: no_forward_declare yyguts_t */
@@ -45,6 +43,7 @@ Modify cmFortranLexer.cxx:
/*--------------------------------------------------------------------------*/
%}
+%option prefix="cmFortran_yy"
%option reentrant
%option noyywrap
diff --git a/Source/LexerParser/cmListFileLexer.c b/Source/LexerParser/cmListFileLexer.c
index 3dd3b85..636a6fb 100644
--- a/Source/LexerParser/cmListFileLexer.c
+++ b/Source/LexerParser/cmListFileLexer.c
@@ -1,7 +1,4 @@
#include "cmStandardLexer.h"
-#line 2 "cmListFileLexer.c"
-
-#line 4 "cmListFileLexer.c"
#define FLEXINT_H 1
#define YY_INT_ALIGNED short int
@@ -11,11 +8,221 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define cmListFileLexer_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer cmListFileLexer_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define cmListFileLexer_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer cmListFileLexer_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define cmListFileLexer_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer cmListFileLexer_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define cmListFileLexer_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string cmListFileLexer_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define cmListFileLexer_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes cmListFileLexer_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define cmListFileLexer_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer cmListFileLexer_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define cmListFileLexer_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer cmListFileLexer_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define cmListFileLexer_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state cmListFileLexer_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define cmListFileLexer_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer cmListFileLexer_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define cmListFileLexer_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state cmListFileLexer_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define cmListFileLexer_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state cmListFileLexer_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define cmListFileLexer_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack cmListFileLexer_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define cmListFileLexer_yylex_ALREADY_DEFINED
+#else
+#define yylex cmListFileLexer_yylex
+#endif
+
+#ifdef yyrestart
+#define cmListFileLexer_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart cmListFileLexer_yyrestart
+#endif
+
+#ifdef yylex_init
+#define cmListFileLexer_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init cmListFileLexer_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define cmListFileLexer_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra cmListFileLexer_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define cmListFileLexer_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy cmListFileLexer_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define cmListFileLexer_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug cmListFileLexer_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define cmListFileLexer_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug cmListFileLexer_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define cmListFileLexer_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra cmListFileLexer_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define cmListFileLexer_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra cmListFileLexer_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define cmListFileLexer_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in cmListFileLexer_yyget_in
+#endif
+
+#ifdef yyset_in
+#define cmListFileLexer_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in cmListFileLexer_yyset_in
+#endif
+
+#ifdef yyget_out
+#define cmListFileLexer_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out cmListFileLexer_yyget_out
+#endif
+
+#ifdef yyset_out
+#define cmListFileLexer_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out cmListFileLexer_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define cmListFileLexer_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng cmListFileLexer_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define cmListFileLexer_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text cmListFileLexer_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define cmListFileLexer_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno cmListFileLexer_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define cmListFileLexer_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno cmListFileLexer_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define cmListFileLexer_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column cmListFileLexer_yyget_column
+#endif
+
+#ifdef yyset_column
+#define cmListFileLexer_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column cmListFileLexer_yyset_column
+#endif
+
+#ifdef yywrap
+#define cmListFileLexer_yywrap_ALREADY_DEFINED
+#else
+#define yywrap cmListFileLexer_yywrap
+#endif
+
+#ifdef yyalloc
+#define cmListFileLexer_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc cmListFileLexer_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define cmListFileLexer_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc cmListFileLexer_yyrealloc
+#endif
+
+#ifdef yyfree
+#define cmListFileLexer_yyfree_ALREADY_DEFINED
+#else
+#define yyfree cmListFileLexer_yyfree
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -86,10 +293,16 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */
+
/* TODO: this is always defined, so inline it */
#define yyconst const
@@ -102,12 +315,10 @@ typedef unsigned int flex_uint32_t;
/* Returned upon end-of-file. */
#define YY_NULL 0
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -131,20 +342,16 @@ typedef void* yyscan_t;
* definition of BEGIN.
*/
#define BEGIN yyg->yy_start = 1 + 2 *
-
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yyg->yy_start - 1) / 2)
#define YYSTATE YY_START
-
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE cmListFileLexer_yyrestart(yyin ,yyscanner )
-
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
@@ -180,7 +387,7 @@ typedef size_t yy_size_t;
/* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
* access to the local variable yy_act. Since yyless() is a macro, it would break
- * existing scanners that call yyless() from OUTSIDE cmListFileLexer_yylex.
+ * existing scanners that call yyless() from OUTSIDE yylex.
* One obvious solution it to make yy_act a global. I tried that, and saw
* a 5% performance hit in a non-yylineno scanner, because yy_act is
* normally declared as a register variable-- so it is not worth it.
@@ -213,7 +420,6 @@ typedef size_t yy_size_t;
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -273,7 +479,7 @@ struct yy_buffer_state
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via cmListFileLexer_yyrestart()), so that the user can continue scanning by
+ * (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
@@ -290,73 +496,67 @@ struct yy_buffer_state
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
: NULL)
-
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-void cmListFileLexer_yyrestart (FILE *input_file ,yyscan_t yyscanner );
-void cmListFileLexer_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmListFileLexer_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void cmListFileLexer_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmListFileLexer_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void cmListFileLexer_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void cmListFileLexer_yypop_buffer_state (yyscan_t yyscanner );
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
-static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner );
-static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner );
-static void cmListFileLexer_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
-#define YY_FLUSH_BUFFER cmListFileLexer_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
-YY_BUFFER_STATE cmListFileLexer_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmListFileLexer_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE cmListFileLexer_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-
-void *cmListFileLexer_yyalloc (yy_size_t ,yyscan_t yyscanner );
-void *cmListFileLexer_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void cmListFileLexer_yyfree (void * ,yyscan_t yyscanner );
-
-#define yy_new_buffer cmListFileLexer_yy_create_buffer
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- cmListFileLexer_yyensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmListFileLexer_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
-
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- cmListFileLexer_yyensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- cmListFileLexer_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
#define cmListFileLexer_yywrap(yyscanner) (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
+typedef flex_uint8_t YY_CHAR;
typedef int yy_state_type;
#define yytext_ptr yytext_r
-static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
-static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
@@ -367,7 +567,6 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-
#define YY_NUM_RULES 24
#define YY_END_OF_BUFFER 25
/* This struct is not used in this scanner,
@@ -377,7 +576,7 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[77] =
+static const flex_int16_t yy_accept[77] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 4, 4,
25, 13, 22, 1, 16, 3, 13, 5, 6, 7,
@@ -389,7 +588,7 @@ static yyconst flex_int16_t yy_accept[77] =
0, 0, 0, 0, 0, 0
} ;
-static yyconst YY_CHAR yy_ec[256] =
+static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
@@ -421,13 +620,13 @@ static yyconst YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst YY_CHAR yy_meta[16] =
+static const YY_CHAR yy_meta[16] =
{ 0,
1, 1, 2, 3, 4, 3, 1, 3, 5, 6,
1, 6, 1, 1, 7
} ;
-static yyconst flex_uint16_t yy_base[95] =
+static const flex_int16_t yy_base[95] =
{ 0,
0, 0, 13, 25, 14, 16, 17, 18, 90, 88,
88, 39, 20, 237, 237, 74, 78, 237, 237, 13,
@@ -442,7 +641,7 @@ static yyconst flex_uint16_t yy_base[95] =
} ;
-static yyconst flex_int16_t yy_def[95] =
+static const flex_int16_t yy_def[95] =
{ 0,
76, 1, 77, 77, 78, 78, 79, 79, 80, 80,
76, 76, 76, 76, 76, 76, 12, 76, 76, 12,
@@ -457,7 +656,7 @@ static yyconst flex_int16_t yy_def[95] =
} ;
-static yyconst flex_uint16_t yy_nxt[253] =
+static const flex_int16_t yy_nxt[253] =
{ 0,
12, 13, 14, 13, 15, 16, 17, 18, 19, 12,
12, 20, 21, 22, 12, 24, 28, 25, 28, 28,
@@ -489,7 +688,7 @@ static yyconst flex_uint16_t yy_nxt[253] =
76, 76
} ;
-static yyconst flex_int16_t yy_chk[253] =
+static const flex_int16_t yy_chk[253] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 3, 5, 3, 6, 7,
@@ -522,7 +721,7 @@ static yyconst flex_int16_t yy_chk[253] =
} ;
/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[25] =
+static const flex_int32_t yy_rule_can_match_eol[25] =
{ 0,
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1,
0, 0, 0, 0, 0, };
@@ -534,8 +733,6 @@ static yyconst flex_int32_t yy_rule_can_match_eol[25] =
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-#line 1 "cmListFileLexer.in.l"
-#line 2 "cmListFileLexer.in.l"
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
/*
@@ -544,14 +741,12 @@ This file must be translated to C and modified to build everywhere.
Run flex >= 2.6 like this:
- flex --nounistd -DFLEXINT_H --prefix=cmListFileLexer_yy -ocmListFileLexer.c cmListFileLexer.in.l
+ flex --nounistd -DFLEXINT_H --noline -ocmListFileLexer.c cmListFileLexer.in.l
Modify cmListFileLexer.c:
- - remove trailing whitespace: sed -i 's/\s*$//' cmListFileLexer.c
- - remove blank lines at end of file
- - #include "cmStandardLexer.h" at the top
- - add cast in cmListFileLexer_yy_scan_bytes for loop condition of _yybytes_len to size_t
- - change type of variable yyl under yy_find_action from yy_size_t to int
+ - remove trailing whitespace: sed -i 's/\s*$//' cmListFileLexer.c
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmListFileLexer.c
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmListFileLexer.c
*/
@@ -600,11 +795,6 @@ static void cmListFileLexerDestroy(cmListFileLexer* lexer);
/*--------------------------------------------------------------------------*/
-
-
-
-#line 606 "cmListFileLexer.c"
-
#define INITIAL 0
#define STRING 1
#define BRACKET 2
@@ -649,44 +839,44 @@ struct yyguts_t
}; /* end struct yyguts_t */
-static int yy_init_globals (yyscan_t yyscanner );
+static int yy_init_globals ( yyscan_t yyscanner );
-int cmListFileLexer_yylex_init (yyscan_t* scanner);
+int yylex_init (yyscan_t* scanner);
-int cmListFileLexer_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int cmListFileLexer_yylex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
-int cmListFileLexer_yyget_debug (yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
-void cmListFileLexer_yyset_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-YY_EXTRA_TYPE cmListFileLexer_yyget_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-void cmListFileLexer_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-FILE *cmListFileLexer_yyget_in (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
-void cmListFileLexer_yyset_in (FILE * _in_str ,yyscan_t yyscanner );
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
-FILE *cmListFileLexer_yyget_out (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
-void cmListFileLexer_yyset_out (FILE * _out_str ,yyscan_t yyscanner );
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
- int cmListFileLexer_yyget_leng (yyscan_t yyscanner );
+ int yyget_leng ( yyscan_t yyscanner );
-char *cmListFileLexer_yyget_text (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
-int cmListFileLexer_yyget_lineno (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
-void cmListFileLexer_yyset_lineno (int _line_number ,yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
-int cmListFileLexer_yyget_column (yyscan_t yyscanner );
+int yyget_column ( yyscan_t yyscanner );
-void cmListFileLexer_yyset_column (int _column_no ,yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -694,32 +884,31 @@ void cmListFileLexer_yyset_column (int _column_no ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int cmListFileLexer_yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int cmListFileLexer_yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
#ifndef YY_NO_UNPUT
- static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
+ static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
-
#ifdef __cplusplus
-static int yyinput (yyscan_t yyscanner );
+static int yyinput ( yyscan_t yyscanner );
#else
-static int input (yyscan_t yyscanner );
+static int input ( yyscan_t yyscanner );
#endif
#endif
@@ -750,7 +939,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -763,7 +952,7 @@ static int input (yyscan_t yyscanner );
else \
{ \
errno=0; \
- while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
@@ -804,9 +993,9 @@ static int input (yyscan_t yyscanner );
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int cmListFileLexer_yylex (yyscan_t yyscanner);
+extern int yylex (yyscan_t yyscanner);
-#define YY_DECL int cmListFileLexer_yylex (yyscan_t yyscanner)
+#define YY_DECL int yylex (yyscan_t yyscanner)
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after yytext and yyleng
@@ -851,19 +1040,15 @@ YY_DECL
yyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
- cmListFileLexer_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmListFileLexer_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- cmListFileLexer_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
{
-#line 80 "cmListFileLexer.in.l"
-
-
-#line 866 "cmListFileLexer.c"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -891,9 +1076,9 @@ yy_match:
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 77 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 237 );
@@ -935,7 +1120,6 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
-#line 82 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_Newline;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -948,7 +1132,6 @@ YY_RULE_SETUP
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
-#line 91 "cmListFileLexer.in.l"
{
const char* bracket = yytext;
lexer->comment = yytext[0] == '#';
@@ -971,7 +1154,6 @@ YY_RULE_SETUP
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 111 "cmListFileLexer.in.l"
{
lexer->column += yyleng;
BEGIN(COMMENT);
@@ -979,14 +1161,12 @@ YY_RULE_SETUP
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 116 "cmListFileLexer.in.l"
{
lexer->column += yyleng;
}
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 120 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ParenLeft;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -996,7 +1176,6 @@ YY_RULE_SETUP
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 127 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ParenRight;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -1006,7 +1185,6 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 134 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_Identifier;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -1016,7 +1194,6 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 141 "cmListFileLexer.in.l"
{
/* Handle ]]====]=======]*/
cmListFileLexerAppend(lexer, yytext, yyleng);
@@ -1028,7 +1205,6 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 150 "cmListFileLexer.in.l"
{
lexer->column += yyleng;
/* Erase the partial bracket from the token. */
@@ -1040,7 +1216,6 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 159 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
lexer->column += yyleng;
@@ -1049,7 +1224,6 @@ YY_RULE_SETUP
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
-#line 164 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
++lexer->line;
@@ -1059,7 +1233,6 @@ YY_RULE_SETUP
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 171 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
lexer->column += yyleng;
@@ -1068,7 +1241,6 @@ YY_RULE_SETUP
YY_BREAK
case YY_STATE_EOF(BRACKET):
case YY_STATE_EOF(BRACKETEND):
-#line 177 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_BadBracket;
BEGIN(INITIAL);
@@ -1077,7 +1249,6 @@ case YY_STATE_EOF(BRACKETEND):
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 183 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -1087,7 +1258,6 @@ YY_RULE_SETUP
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 190 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -1097,7 +1267,6 @@ YY_RULE_SETUP
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 197 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -1107,7 +1276,6 @@ YY_RULE_SETUP
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 204 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_ArgumentQuoted;
cmListFileLexerSetToken(lexer, "", 0);
@@ -1117,7 +1285,6 @@ YY_RULE_SETUP
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 211 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
lexer->column += yyleng;
@@ -1126,7 +1293,6 @@ YY_RULE_SETUP
case 18:
/* rule 18 can match eol */
YY_RULE_SETUP
-#line 216 "cmListFileLexer.in.l"
{
/* Continuation: text is not part of string */
++lexer->line;
@@ -1136,7 +1302,6 @@ YY_RULE_SETUP
case 19:
/* rule 19 can match eol */
YY_RULE_SETUP
-#line 222 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
++lexer->line;
@@ -1145,7 +1310,6 @@ YY_RULE_SETUP
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 228 "cmListFileLexer.in.l"
{
lexer->column += yyleng;
BEGIN(INITIAL);
@@ -1154,14 +1318,12 @@ YY_RULE_SETUP
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 234 "cmListFileLexer.in.l"
{
cmListFileLexerAppend(lexer, yytext, yyleng);
lexer->column += yyleng;
}
YY_BREAK
case YY_STATE_EOF(STRING):
-#line 239 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_BadString;
BEGIN(INITIAL);
@@ -1170,7 +1332,6 @@ case YY_STATE_EOF(STRING):
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 245 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_Space;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -1180,7 +1341,6 @@ YY_RULE_SETUP
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 252 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_BadCharacter;
cmListFileLexerSetToken(lexer, yytext, yyleng);
@@ -1190,7 +1350,6 @@ YY_RULE_SETUP
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(COMMENT):
-#line 259 "cmListFileLexer.in.l"
{
lexer->token.type = cmListFileLexer_Token_None;
cmListFileLexerSetToken(lexer, 0, 0);
@@ -1199,10 +1358,8 @@ case YY_STATE_EOF(COMMENT):
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 265 "cmListFileLexer.in.l"
ECHO;
YY_BREAK
-#line 1205 "cmListFileLexer.c"
case YY_END_OF_BUFFER:
{
@@ -1218,7 +1375,7 @@ ECHO;
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
- * cmListFileLexer_yylex(). If so, then we have to assure
+ * yylex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
@@ -1278,7 +1435,7 @@ ECHO;
{
yyg->yy_did_buffer_switch_on_eof = 0;
- if ( cmListFileLexer_yywrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
@@ -1332,7 +1489,7 @@ ECHO;
} /* end of action switch */
} /* end of scanning one token */
} /* end of user's declarations */
-} /* end of cmListFileLexer_yylex */
+} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -1346,7 +1503,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = yyg->yytext_ptr;
- yy_size_t number_to_move, i;
+ int number_to_move, i;
int ret_val;
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
@@ -1375,7 +1532,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -1411,7 +1568,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- cmListFileLexer_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
}
else
/* Can't grow it, we don't own it. */
@@ -1443,7 +1601,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- cmListFileLexer_yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
}
else
@@ -1457,12 +1615,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cmListFileLexer_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
yyg->yy_n_chars += number_to_move;
@@ -1496,9 +1657,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 77 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return yy_current_state;
@@ -1525,9 +1686,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 77 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 76);
(void)yyg;
@@ -1605,7 +1766,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{ /* need more input */
- int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
@@ -1622,13 +1783,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*/
/* Reset buffer status. */
- cmListFileLexer_yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( cmListFileLexer_yywrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
return 0;
if ( ! yyg->yy_did_buffer_switch_on_eof )
@@ -1667,34 +1828,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @note This function does not reset the start condition to @c INITIAL .
*/
- void cmListFileLexer_yyrestart (FILE * input_file , yyscan_t yyscanner)
+ void yyrestart (FILE * input_file , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! YY_CURRENT_BUFFER ){
- cmListFileLexer_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- cmListFileLexer_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- cmListFileLexer_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
- cmListFileLexer_yy_load_buffer_state(yyscanner );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
+ yy_load_buffer_state( yyscanner );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
* @param yyscanner The scanner object.
*/
- void cmListFileLexer_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* TODO. We should be able to replace this entire function body
* with
- * cmListFileLexer_yypop_buffer_state();
- * cmListFileLexer_yypush_buffer_state(new_buffer);
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
*/
- cmListFileLexer_yyensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
if ( YY_CURRENT_BUFFER == new_buffer )
return;
@@ -1707,17 +1868,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- cmListFileLexer_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
/* We don't actually know whether we did this switch during
- * EOF (cmListFileLexer_yywrap()) processing, but the only time this flag
- * is looked at is after cmListFileLexer_yywrap() is called, so it's safe
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yyg->yy_did_buffer_switch_on_eof = 1;
}
-static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner)
+static void yy_load_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
@@ -1732,35 +1893,35 @@ static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the allocated buffer state.
*/
- YY_BUFFER_STATE cmListFileLexer_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) cmListFileLexer_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_buf_size = (yy_size_t)size;
+ b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) cmListFileLexer_yyalloc(b->yy_buf_size + 2 ,yyscanner );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- cmListFileLexer_yy_init_buffer(b,file ,yyscanner);
+ yy_init_buffer( b, file , yyscanner);
return b;
}
/** Destroy the buffer.
- * @param b a buffer created with cmListFileLexer_yy_create_buffer()
+ * @param b a buffer created with yy_create_buffer()
* @param yyscanner The scanner object.
*/
- void cmListFileLexer_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -1771,28 +1932,28 @@ static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner)
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- cmListFileLexer_yyfree((void *) b->yy_ch_buf ,yyscanner );
+ yyfree( (void *) b->yy_ch_buf , yyscanner );
- cmListFileLexer_yyfree((void *) b ,yyscanner );
+ yyfree( (void *) b , yyscanner );
}
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
- * such as during a cmListFileLexer_yyrestart() or at EOF.
+ * such as during a yyrestart() or at EOF.
*/
- static void cmListFileLexer_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
{
int oerrno = errno;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- cmListFileLexer_yy_flush_buffer(b ,yyscanner);
+ yy_flush_buffer( b , yyscanner);
b->yy_input_file = file;
b->yy_fill_buffer = 1;
- /* If b is the current buffer, then cmListFileLexer_yy_init_buffer was _probably_
- * called from cmListFileLexer_yyrestart() or through yy_get_next_buffer.
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
@@ -1809,7 +1970,7 @@ static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner)
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
* @param yyscanner The scanner object.
*/
- void cmListFileLexer_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! b )
@@ -1830,7 +1991,7 @@ static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner)
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- cmListFileLexer_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -1839,15 +2000,15 @@ static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner)
* @param new_buffer The new state.
* @param yyscanner The scanner object.
*/
-void cmListFileLexer_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (new_buffer == NULL)
return;
- cmListFileLexer_yyensure_buffer_stack(yyscanner);
+ yyensure_buffer_stack(yyscanner);
- /* This block is copied from cmListFileLexer_yy_switch_to_buffer. */
+ /* This block is copied from yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
@@ -1861,8 +2022,8 @@ void cmListFileLexer_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t
yyg->yy_buffer_stack_top++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from cmListFileLexer_yy_switch_to_buffer. */
- cmListFileLexer_yy_load_buffer_state(yyscanner );
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
@@ -1870,19 +2031,19 @@ void cmListFileLexer_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t
* The next element becomes the new top.
* @param yyscanner The scanner object.
*/
-void cmListFileLexer_yypop_buffer_state (yyscan_t yyscanner)
+void yypop_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!YY_CURRENT_BUFFER)
return;
- cmListFileLexer_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+ yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
YY_CURRENT_BUFFER_LVALUE = NULL;
if (yyg->yy_buffer_stack_top > 0)
--yyg->yy_buffer_stack_top;
if (YY_CURRENT_BUFFER) {
- cmListFileLexer_yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
}
@@ -1890,9 +2051,9 @@ void cmListFileLexer_yypop_buffer_state (yyscan_t yyscanner)
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
-static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner)
+static void yyensure_buffer_stack (yyscan_t yyscanner)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!yyg->yy_buffer_stack) {
@@ -1902,11 +2063,11 @@ static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner)
* immediate realloc on the next call.
*/
num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmListFileLexer_yyalloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
@@ -1921,12 +2082,12 @@ static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner)
yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)cmListFileLexer_yyrealloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -1940,7 +2101,7 @@ static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmListFileLexer_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
@@ -1950,11 +2111,11 @@ YY_BUFFER_STATE cmListFileLexer_yy_scan_buffer (char * base, yy_size_t size ,
/* They forgot to leave room for the EOB's. */
return NULL;
- b = (YY_BUFFER_STATE) cmListFileLexer_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = NULL;
@@ -1964,53 +2125,53 @@ YY_BUFFER_STATE cmListFileLexer_yy_scan_buffer (char * base, yy_size_t size ,
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- cmListFileLexer_yy_switch_to_buffer(b ,yyscanner );
+ yy_switch_to_buffer( b , yyscanner );
return b;
}
-/** Setup the input buffer state to scan a string. The next call to cmListFileLexer_yylex() will
+/** Setup the input buffer state to scan a string. The next call to yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
- * cmListFileLexer_yy_scan_bytes() instead.
+ * yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE cmListFileLexer_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
{
- return cmListFileLexer_yy_scan_bytes(yystr,(int) strlen(yystr) ,yyscanner);
+ return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
}
-/** Setup the input buffer state to scan the given bytes. The next call to cmListFileLexer_yylex() will
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE cmListFileLexer_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- yy_size_t i;
+ int i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = (yy_size_t) _yybytes_len + 2;
- buf = (char *) cmListFileLexer_yyalloc(n ,yyscanner );
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n , yyscanner );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
- for ( i = 0; i < (size_t)_yybytes_len; ++i )
+ for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = cmListFileLexer_yy_scan_buffer(buf,n ,yyscanner);
+ b = yy_scan_buffer( buf, n , yyscanner);
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in cmListFileLexer_yy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -2024,11 +2185,11 @@ YY_BUFFER_STATE cmListFileLexer_yy_scan_bytes (yyconst char * yybytes, int _yy
#define YY_EXIT_FAILURE 2
#endif
-static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- (void) fprintf( stderr, "%s\n", msg );
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -2054,7 +2215,7 @@ static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
/** Get the user-defined data for this scanner.
* @param yyscanner The scanner object.
*/
-YY_EXTRA_TYPE cmListFileLexer_yyget_extra (yyscan_t yyscanner)
+YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyextra;
@@ -2063,7 +2224,7 @@ YY_EXTRA_TYPE cmListFileLexer_yyget_extra (yyscan_t yyscanner)
/** Get the current line number.
* @param yyscanner The scanner object.
*/
-int cmListFileLexer_yyget_lineno (yyscan_t yyscanner)
+int yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2076,7 +2237,7 @@ int cmListFileLexer_yyget_lineno (yyscan_t yyscanner)
/** Get the current column number.
* @param yyscanner The scanner object.
*/
-int cmListFileLexer_yyget_column (yyscan_t yyscanner)
+int yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2089,7 +2250,7 @@ int cmListFileLexer_yyget_column (yyscan_t yyscanner)
/** Get the input stream.
* @param yyscanner The scanner object.
*/
-FILE *cmListFileLexer_yyget_in (yyscan_t yyscanner)
+FILE *yyget_in (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyin;
@@ -2098,7 +2259,7 @@ FILE *cmListFileLexer_yyget_in (yyscan_t yyscanner)
/** Get the output stream.
* @param yyscanner The scanner object.
*/
-FILE *cmListFileLexer_yyget_out (yyscan_t yyscanner)
+FILE *yyget_out (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyout;
@@ -2107,7 +2268,7 @@ FILE *cmListFileLexer_yyget_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-int cmListFileLexer_yyget_leng (yyscan_t yyscanner)
+int yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
@@ -2117,7 +2278,7 @@ int cmListFileLexer_yyget_leng (yyscan_t yyscanner)
* @param yyscanner The scanner object.
*/
-char *cmListFileLexer_yyget_text (yyscan_t yyscanner)
+char *yyget_text (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yytext;
@@ -2127,7 +2288,7 @@ char *cmListFileLexer_yyget_text (yyscan_t yyscanner)
* @param user_defined The data to be associated with this scanner.
* @param yyscanner The scanner object.
*/
-void cmListFileLexer_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyextra = user_defined ;
@@ -2137,13 +2298,13 @@ void cmListFileLexer_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscann
* @param _line_number line number
* @param yyscanner The scanner object.
*/
-void cmListFileLexer_yyset_lineno (int _line_number , yyscan_t yyscanner)
+void yyset_lineno (int _line_number , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "cmListFileLexer_yyset_lineno called with no buffer" );
+ YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
yylineno = _line_number;
}
@@ -2152,13 +2313,13 @@ void cmListFileLexer_yyset_lineno (int _line_number , yyscan_t yyscanner)
* @param _column_no column number
* @param yyscanner The scanner object.
*/
-void cmListFileLexer_yyset_column (int _column_no , yyscan_t yyscanner)
+void yyset_column (int _column_no , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "cmListFileLexer_yyset_column called with no buffer" );
+ YY_FATAL_ERROR( "yyset_column called with no buffer" );
yycolumn = _column_no;
}
@@ -2167,27 +2328,27 @@ void cmListFileLexer_yyset_column (int _column_no , yyscan_t yyscanner)
* input buffer.
* @param _in_str A readable stream.
* @param yyscanner The scanner object.
- * @see cmListFileLexer_yy_switch_to_buffer
+ * @see yy_switch_to_buffer
*/
-void cmListFileLexer_yyset_in (FILE * _in_str , yyscan_t yyscanner)
+void yyset_in (FILE * _in_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyin = _in_str ;
}
-void cmListFileLexer_yyset_out (FILE * _out_str , yyscan_t yyscanner)
+void yyset_out (FILE * _out_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyout = _out_str ;
}
-int cmListFileLexer_yyget_debug (yyscan_t yyscanner)
+int yyget_debug (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yy_flex_debug;
}
-void cmListFileLexer_yyset_debug (int _bdebug , yyscan_t yyscanner)
+void yyset_debug (int _bdebug , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_flex_debug = _bdebug ;
@@ -2197,20 +2358,18 @@ void cmListFileLexer_yyset_debug (int _bdebug , yyscan_t yyscanner)
/* User-visible API */
-/* cmListFileLexer_yylex_init is special because it creates the scanner itself, so it is
+/* yylex_init is special because it creates the scanner itself, so it is
* the ONLY reentrant function that doesn't take the scanner as the last argument.
* That's why we explicitly handle the declaration, instead of using our macros.
*/
-
-int cmListFileLexer_yylex_init(yyscan_t* ptr_yy_globals)
-
+int yylex_init(yyscan_t* ptr_yy_globals)
{
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmListFileLexer_yyalloc ( sizeof( struct yyguts_t ), NULL );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -2223,27 +2382,25 @@ int cmListFileLexer_yylex_init(yyscan_t* ptr_yy_globals)
return yy_init_globals ( *ptr_yy_globals );
}
-/* cmListFileLexer_yylex_init_extra has the same functionality as cmListFileLexer_yylex_init, but follows the
+/* yylex_init_extra has the same functionality as yylex_init, but follows the
* convention of taking the scanner as the last argument. Note however, that
* this is a *pointer* to a scanner, as it will be allocated by this call (and
* is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to cmListFileLexer_yyalloc in
+ * The user defined value in the first argument will be available to yyalloc in
* the yyextra field.
*/
-
-int cmListFileLexer_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
+int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
{
struct yyguts_t dummy_yyguts;
- cmListFileLexer_yyset_extra (yy_user_defined, &dummy_yyguts);
+ yyset_extra (yy_user_defined, &dummy_yyguts);
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) cmListFileLexer_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -2254,7 +2411,7 @@ int cmListFileLexer_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
- cmListFileLexer_yyset_extra (yy_user_defined, *ptr_yy_globals);
+ yyset_extra (yy_user_defined, *ptr_yy_globals);
return yy_init_globals ( *ptr_yy_globals );
}
@@ -2263,7 +2420,7 @@ static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Initialization is the same as for the non-reentrant scanner.
- * This function is called from cmListFileLexer_yylex_destroy(), so don't allocate here.
+ * This function is called from yylex_destroy(), so don't allocate here.
*/
yyg->yy_buffer_stack = NULL;
@@ -2287,37 +2444,37 @@ static int yy_init_globals (yyscan_t yyscanner)
#endif
/* For future reference: Set errno on error, since we are called by
- * cmListFileLexer_yylex_init()
+ * yylex_init()
*/
return 0;
}
-/* cmListFileLexer_yylex_destroy is for both reentrant and non-reentrant scanners. */
-int cmListFileLexer_yylex_destroy (yyscan_t yyscanner)
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- cmListFileLexer_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
YY_CURRENT_BUFFER_LVALUE = NULL;
- cmListFileLexer_yypop_buffer_state(yyscanner);
+ yypop_buffer_state(yyscanner);
}
/* Destroy the stack itself. */
- cmListFileLexer_yyfree(yyg->yy_buffer_stack ,yyscanner);
+ yyfree(yyg->yy_buffer_stack , yyscanner);
yyg->yy_buffer_stack = NULL;
/* Destroy the start condition stack. */
- cmListFileLexer_yyfree(yyg->yy_start_stack ,yyscanner );
+ yyfree( yyg->yy_start_stack , yyscanner );
yyg->yy_start_stack = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
- * cmListFileLexer_yylex() is called, initialization will occur. */
+ * yylex() is called, initialization will occur. */
yy_init_globals( yyscanner);
/* Destroy the main struct (reentrant only). */
- cmListFileLexer_yyfree ( yyscanner , yyscanner );
+ yyfree ( yyscanner , yyscanner );
yyscanner = NULL;
return 0;
}
@@ -2327,7 +2484,7 @@ int cmListFileLexer_yylex_destroy (yyscan_t yyscanner)
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -2339,7 +2496,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
{
int n;
for ( n = 0; s[n]; ++n )
@@ -2349,14 +2506,14 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
}
#endif
-void *cmListFileLexer_yyalloc (yy_size_t size , yyscan_t yyscanner)
+void *yyalloc (yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
return malloc(size);
}
-void *cmListFileLexer_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
+void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -2371,19 +2528,15 @@ void *cmListFileLexer_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscann
return realloc(ptr, size);
}
-void cmListFileLexer_yyfree (void * ptr , yyscan_t yyscanner)
+void yyfree (void * ptr , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- free( (char *) ptr ); /* see cmListFileLexer_yyrealloc() for (char *) cast */
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
-#line 265 "cmListFileLexer.in.l"
-
-
-
/*--------------------------------------------------------------------------*/
static void cmListFileLexerSetToken(cmListFileLexer* lexer, const char* text,
int length)
diff --git a/Source/LexerParser/cmListFileLexer.in.l b/Source/LexerParser/cmListFileLexer.in.l
index 5152dbf..6ec8da4 100644
--- a/Source/LexerParser/cmListFileLexer.in.l
+++ b/Source/LexerParser/cmListFileLexer.in.l
@@ -7,14 +7,12 @@ This file must be translated to C and modified to build everywhere.
Run flex >= 2.6 like this:
- flex --nounistd -DFLEXINT_H --prefix=cmListFileLexer_yy -ocmListFileLexer.c cmListFileLexer.in.l
+ flex --nounistd -DFLEXINT_H --noline -ocmListFileLexer.c cmListFileLexer.in.l
Modify cmListFileLexer.c:
- - remove trailing whitespace: sed -i 's/\s*$//' cmListFileLexer.c
- - remove blank lines at end of file
- - #include "cmStandardLexer.h" at the top
- - add cast in yy_scan_bytes for loop condition of _yybytes_len to size_t
- - change type of variable yyl under yy_find_action from yy_size_t to int
+ - remove trailing whitespace: sed -i 's/\s*$//' cmListFileLexer.c
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmListFileLexer.c
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmListFileLexer.c
*/
@@ -64,6 +62,8 @@ static void cmListFileLexerDestroy(cmListFileLexer* lexer);
/*--------------------------------------------------------------------------*/
%}
+%option prefix="cmListFileLexer_yy"
+
%option reentrant
%option yylineno
%option noyywrap
@@ -439,11 +439,15 @@ static cmListFileLexer_BOM cmListFileLexer_ReadBOM(FILE* f)
if (fread(b, 1, 2, f) == 2 && b[0] == 0 && b[1] == 0) {
return cmListFileLexer_BOM_UTF32LE;
}
- fsetpos(f, &p);
+ if (fsetpos(f, &p) != 0) {
+ return cmListFileLexer_BOM_Broken;
+ }
return cmListFileLexer_BOM_UTF16LE;
}
}
- rewind(f);
+ if (fseek(f, 0, SEEK_SET) != 0) {
+ return cmListFileLexer_BOM_Broken;
+ }
return cmListFileLexer_BOM_None;
}
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 7fa2ac6..9f881e2 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -22,19 +22,18 @@
#include "cmSystemTools.h" // IWYU pragma: keep
-static const char* cmDocumentationName[][2] = { { CM_NULLPTR,
+static const char* cmDocumentationName[][2] = { { nullptr,
" cmake-gui - CMake GUI." },
- { CM_NULLPTR, CM_NULLPTR } };
+ { nullptr, nullptr } };
static const char* cmDocumentationUsage[][2] = {
- { CM_NULLPTR, " cmake-gui [options]\n"
- " cmake-gui [options] <path-to-source>\n"
- " cmake-gui [options] <path-to-existing-build>" },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, " cmake-gui [options]\n"
+ " cmake-gui [options] <path-to-source>\n"
+ " cmake-gui [options] <path-to-existing-build>" },
+ { nullptr, nullptr }
};
-static const char* cmDocumentationOptions[]
- [2] = { { CM_NULLPTR, CM_NULLPTR } };
+static const char* cmDocumentationOptions[][2] = { { nullptr, nullptr } };
#if defined(Q_OS_MAC)
static int cmOSXInstall(std::string dir);
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 57f8e10..bbb2395 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -32,7 +32,7 @@
QCMakeThread::QCMakeThread(QObject* p)
: QThread(p)
- , CMakeInstance(CM_NULLPTR)
+ , CMakeInstance(nullptr)
{
}
@@ -48,7 +48,7 @@ void QCMakeThread::run()
emit this->cmakeInitialized();
this->exec();
delete this->CMakeInstance;
- this->CMakeInstance = CM_NULLPTR;
+ this->CMakeInstance = nullptr;
}
CMakeSetupDialog::CMakeSetupDialog()
@@ -1195,7 +1195,7 @@ void CMakeSetupDialog::setSearchFilter(const QString& str)
this->CacheValues->setSearchFilter(str);
}
-void CMakeSetupDialog::doOutputContextMenu(const QPoint& pt)
+void CMakeSetupDialog::doOutputContextMenu(QPoint pt)
{
QMenu* menu = this->Output->createStandardContextMenu();
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 1abdb46..0da28d8 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -70,7 +70,7 @@ protected slots:
bool doConfigureInternal();
bool doGenerateInternal();
void exitLoop(int);
- void doOutputContextMenu(const QPoint&);
+ void doOutputContextMenu(QPoint pt);
void doOutputFindDialog();
void doOutputFindNext(bool directionForward = true);
void doOutputFindPrev();
diff --git a/Source/QtDialog/Compilers.h b/Source/QtDialog/Compilers.h
index 6c8c8f5..746266c 100644
--- a/Source/QtDialog/Compilers.h
+++ b/Source/QtDialog/Compilers.h
@@ -3,7 +3,7 @@
#ifndef COMPILERS_HPP
#define COMPILERS_HPP
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <QWidget>
@@ -13,7 +13,7 @@ class Compilers : public QWidget, public Ui::Compilers
{
Q_OBJECT
public:
- Compilers(QWidget* p = CM_NULLPTR)
+ Compilers(QWidget* p = nullptr)
: QWidget(p)
{
this->setupUi(this);
diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx
index b193a27..88ce7cb 100644
--- a/Source/QtDialog/FirstConfigure.cxx
+++ b/Source/QtDialog/FirstConfigure.cxx
@@ -301,7 +301,7 @@ QString CrossCompilerSetup::getFindRoot() const
void CrossCompilerSetup::setFindRoot(const QString& t)
{
- return this->crossFindRoot->setText(t);
+ this->crossFindRoot->setText(t);
}
int CrossCompilerSetup::getProgramMode() const
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index e14cdf2..3b8cea7 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -3,7 +3,7 @@
#ifndef QCMake_h
#define QCMake_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmake.h"
@@ -63,7 +63,7 @@ class QCMake : public QObject
{
Q_OBJECT
public:
- QCMake(QObject* p = CM_NULLPTR);
+ QCMake(QObject* p = nullptr);
~QCMake();
public slots:
/// load the cache file in a directory
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 08c2d58..c6b007d 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -539,7 +539,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(
QModelIndex var = idx.sibling(idx.row(), 0);
int type = var.data(QCMakeCacheModel::TypeRole).toInt();
if (type == QCMakeProperty::BOOL) {
- return CM_NULLPTR;
+ return nullptr;
}
if (type == QCMakeProperty::PATH) {
QCMakePathEditor* editor =
@@ -642,7 +642,7 @@ QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option,
QStyleOptionButton opt;
opt.QStyleOption::operator=(option);
sz = sz.expandedTo(
- style->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt, CM_NULLPTR)
+ style->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt, nullptr)
.size());
return sz;
diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx
index 7f0cafa..b544b86 100644
--- a/Source/QtDialog/QCMakeWidgets.cxx
+++ b/Source/QtDialog/QCMakeWidgets.cxx
@@ -57,7 +57,7 @@ void QCMakeFilePathEditor::chooseFile()
emit this->fileDialogExists(true);
path =
QFileDialog::getOpenFileName(this, title, info.absolutePath(), QString(),
- CM_NULLPTR, QFileDialog::DontResolveSymlinks);
+ nullptr, QFileDialog::DontResolveSymlinks);
emit this->fileDialogExists(false);
if (!path.isEmpty()) {
@@ -89,7 +89,7 @@ void QCMakePathEditor::chooseFile()
// use same QDirModel for all completers
static QDirModel* fileDirModel()
{
- static QDirModel* m = CM_NULLPTR;
+ static QDirModel* m = nullptr;
if (!m) {
m = new QDirModel();
}
@@ -97,7 +97,7 @@ static QDirModel* fileDirModel()
}
static QDirModel* pathDirModel()
{
- static QDirModel* m = CM_NULLPTR;
+ static QDirModel* m = nullptr;
if (!m) {
m = new QDirModel();
m->setFilter(QDir::AllDirs | QDir::Drives | QDir::NoDotAndDotDot);
diff --git a/Source/QtDialog/QCMakeWidgets.h b/Source/QtDialog/QCMakeWidgets.h
index 1ec666f..e63c197 100644
--- a/Source/QtDialog/QCMakeWidgets.h
+++ b/Source/QtDialog/QCMakeWidgets.h
@@ -3,7 +3,7 @@
#ifndef QCMakeWidgets_h
#define QCMakeWidgets_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <QComboBox>
#include <QCompleter>
@@ -35,7 +35,7 @@ class QCMakePathEditor : public QCMakeFileEditor
{
Q_OBJECT
public:
- QCMakePathEditor(QWidget* p = CM_NULLPTR, const QString& var = QString());
+ QCMakePathEditor(QWidget* p = nullptr, const QString& var = QString());
void chooseFile();
};
@@ -44,8 +44,7 @@ class QCMakeFilePathEditor : public QCMakeFileEditor
{
Q_OBJECT
public:
- QCMakeFilePathEditor(QWidget* p = CM_NULLPTR,
- const QString& var = QString());
+ QCMakeFilePathEditor(QWidget* p = nullptr, const QString& var = QString());
void chooseFile();
};
diff --git a/Source/bindexplib.h b/Source/bindexplib.h
index bc904e9..3e22ac7 100644
--- a/Source/bindexplib.h
+++ b/Source/bindexplib.h
@@ -3,7 +3,7 @@
#ifndef bindexplib_h
#define bindexplib_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <set>
#include <stdio.h>
diff --git a/Source/cmAddCompileOptionsCommand.h b/Source/cmAddCompileOptionsCommand.h
index 297f901..7eac314 100644
--- a/Source/cmAddCompileOptionsCommand.h
+++ b/Source/cmAddCompileOptionsCommand.h
@@ -3,7 +3,7 @@
#ifndef cmAddCompileOptionsCommand_h
#define cmAddCompileOptionsCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index b5e7c9e..bd054e8 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -31,7 +31,7 @@ bool cmAddCustomCommandCommand::InitialPass(
std::string source, target, main_dependency, working, depfile;
std::string comment_buffer;
- const char* comment = CM_NULLPTR;
+ const char* comment = nullptr;
std::vector<std::string> depends, outputs, output, byproducts;
bool verbatim = false;
bool append = false;
diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h
index c3a91b2..95c58d9 100644
--- a/Source/cmAddCustomCommandCommand.h
+++ b/Source/cmAddCustomCommandCommand.h
@@ -3,7 +3,7 @@
#ifndef cmAddCustomCommandCommand_h
#define cmAddCustomCommandCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index 87e1147..a8d5b2e 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -49,7 +49,7 @@ bool cmAddCustomTargetCommand::InitialPass(
bool uses_terminal = false;
bool command_expand_lists = false;
std::string comment_buffer;
- const char* comment = CM_NULLPTR;
+ const char* comment = nullptr;
std::vector<std::string> sources;
// Keep track of parser state.
diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h
index 7229c27..8d9d09f 100644
--- a/Source/cmAddCustomTargetCommand.h
+++ b/Source/cmAddCustomTargetCommand.h
@@ -3,7 +3,7 @@
#ifndef cmAddCustomTargetCommand_h
#define cmAddCustomTargetCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmAddDefinitionsCommand.h b/Source/cmAddDefinitionsCommand.h
index abf5a59..a58d430 100644
--- a/Source/cmAddDefinitionsCommand.h
+++ b/Source/cmAddDefinitionsCommand.h
@@ -3,7 +3,7 @@
#ifndef cmAddDefinitionsCommand_h
#define cmAddDefinitionsCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h
index c7328d6..10f3c57 100644
--- a/Source/cmAddDependenciesCommand.h
+++ b/Source/cmAddDependenciesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmDependenciessCommand_h
#define cmDependenciessCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmAddExecutableCommand.h b/Source/cmAddExecutableCommand.h
index 8100da1..570b35f 100644
--- a/Source/cmAddExecutableCommand.h
+++ b/Source/cmAddExecutableCommand.h
@@ -3,7 +3,7 @@
#ifndef cmExecutablesCommand_h
#define cmExecutablesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h
index df49fae..1656312 100644
--- a/Source/cmAddLibraryCommand.h
+++ b/Source/cmAddLibraryCommand.h
@@ -3,7 +3,7 @@
#ifndef cmLibrarysCommand_h
#define cmLibrarysCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h
index 0e71ffd..a6c92a8 100644
--- a/Source/cmAddSubDirectoryCommand.h
+++ b/Source/cmAddSubDirectoryCommand.h
@@ -3,7 +3,7 @@
#ifndef cmAddSubDirectoryCommand_h
#define cmAddSubDirectoryCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h
index a098a03..a296904 100644
--- a/Source/cmAddTestCommand.h
+++ b/Source/cmAddTestCommand.h
@@ -3,7 +3,7 @@
#ifndef cmAddTestCommand_h
#define cmAddTestCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 4adfe23..a4f66a9 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -9,6 +9,7 @@
#include <algorithm>
#include <functional>
#include <iterator>
+#include <memory>
#include <sstream>
#include <string.h>
#include <string>
@@ -402,4 +403,22 @@ inline void cmStripSuffixIfExists(std::string& str, const std::string& suffix)
}
}
+namespace cm {
+
+#if defined(CMake_HAVE_CXX_MAKE_UNIQUE)
+
+using std::make_unique;
+
+#else
+
+template <typename T, typename... Args>
+std::unique_ptr<T> make_unique(Args&&... args)
+{
+ return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+}
+
+#endif
+
+} // namespace cm
+
#endif
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 0f13b11..02408a1 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -146,9 +146,9 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c,
}
if (archive_write_open(
- this->Archive, this, CM_NULLPTR,
+ this->Archive, this, nullptr,
reinterpret_cast<archive_write_callback*>(&Callback::Write),
- CM_NULLPTR) != ARCHIVE_OK) {
+ nullptr) != ARCHIVE_OK) {
this->Error = "archive_write_open: ";
this->Error += cm_archive_error_string(this->Archive);
return;
@@ -224,7 +224,7 @@ bool cmArchiveWrite::AddFile(const char* file, size_t skip, const char* prefix)
Entry e;
cm_archive_entry_copy_sourcepath(e, file);
cm_archive_entry_copy_pathname(e, dest);
- if (archive_read_disk_entry_from_file(this->Disk, e, -1, CM_NULLPTR) !=
+ if (archive_read_disk_entry_from_file(this->Disk, e, -1, nullptr) !=
ARCHIVE_OK) {
this->Error = "archive_read_disk_entry_from_file '";
this->Error += file;
diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h
index 4c85c0d..56dce2a 100644
--- a/Source/cmArchiveWrite.h
+++ b/Source/cmArchiveWrite.h
@@ -67,13 +67,13 @@ public:
* skip. The remaining part of the input path is appended to the
* "prefix" value to construct the final name in the archive.
*/
- bool Add(std::string path, size_t skip = 0, const char* prefix = CM_NULLPTR,
+ bool Add(std::string path, size_t skip = 0, const char* prefix = nullptr,
bool recursive = true);
/** Returns true if there has been no error. */
operator safe_bool() const
{
- return this->Okay() ? &cmArchiveWrite::safe_bool_true : CM_NULLPTR;
+ return this->Okay() ? &cmArchiveWrite::safe_bool_true : nullptr;
}
/** Returns true if there has been an error. */
diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h
index e49e861..ea22855 100644
--- a/Source/cmAuxSourceDirectoryCommand.h
+++ b/Source/cmAuxSourceDirectoryCommand.h
@@ -3,7 +3,7 @@
#ifndef cmAuxSourceDirectoryCommand_h
#define cmAuxSourceDirectoryCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmBreakCommand.h b/Source/cmBreakCommand.h
index fcca45c..c0a5e11 100644
--- a/Source/cmBreakCommand.h
+++ b/Source/cmBreakCommand.h
@@ -3,7 +3,7 @@
#ifndef cmBreakCommand_h
#define cmBreakCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h
index 1f357a9..17e9636 100644
--- a/Source/cmBuildCommand.h
+++ b/Source/cmBuildCommand.h
@@ -3,7 +3,7 @@
#ifndef cmBuildCommand_h
#define cmBuildCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h
index ff26c55..e3d2f2a 100644
--- a/Source/cmBuildNameCommand.h
+++ b/Source/cmBuildNameCommand.h
@@ -3,7 +3,7 @@
#ifndef cmBuildNameCommand_h
#define cmBuildNameCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h
index e956cb2..ec81cb9 100644
--- a/Source/cmCLocaleEnvironmentScope.h
+++ b/Source/cmCLocaleEnvironmentScope.h
@@ -3,7 +3,7 @@
#ifndef cmCLocaleEnvironmentScope_h
#define cmCLocaleEnvironmentScope_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
#include <string>
diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx
index 4475c5a..5106f52 100644
--- a/Source/cmCMakeHostSystemInformationCommand.cxx
+++ b/Source/cmCMakeHostSystemInformationCommand.cxx
@@ -76,6 +76,55 @@ bool cmCMakeHostSystemInformationCommand::GetValue(
value = this->ValueToString(info.GetTotalPhysicalMemory());
} else if (key == "AVAILABLE_PHYSICAL_MEMORY") {
value = this->ValueToString(info.GetAvailablePhysicalMemory());
+ } else if (key == "IS_64BIT") {
+ value = this->ValueToString(info.Is64Bits());
+ } else if (key == "HAS_FPU") {
+ value = this->ValueToString(
+ info.DoesCPUSupportFeature(cmsys::SystemInformation::CPU_FEATURE_FPU));
+ } else if (key == "HAS_MMX") {
+ value = this->ValueToString(
+ info.DoesCPUSupportFeature(cmsys::SystemInformation::CPU_FEATURE_MMX));
+ } else if (key == "HAS_MMX_PLUS") {
+ value = this->ValueToString(info.DoesCPUSupportFeature(
+ cmsys::SystemInformation::CPU_FEATURE_MMX_PLUS));
+ } else if (key == "HAS_SSE") {
+ value = this->ValueToString(
+ info.DoesCPUSupportFeature(cmsys::SystemInformation::CPU_FEATURE_SSE));
+ } else if (key == "HAS_SSE2") {
+ value = this->ValueToString(
+ info.DoesCPUSupportFeature(cmsys::SystemInformation::CPU_FEATURE_SSE2));
+ } else if (key == "HAS_SSE_FP") {
+ value = this->ValueToString(info.DoesCPUSupportFeature(
+ cmsys::SystemInformation::CPU_FEATURE_SSE_FP));
+ } else if (key == "HAS_SSE_MMX") {
+ value = this->ValueToString(info.DoesCPUSupportFeature(
+ cmsys::SystemInformation::CPU_FEATURE_SSE_MMX));
+ } else if (key == "HAS_AMD_3DNOW") {
+ value = this->ValueToString(info.DoesCPUSupportFeature(
+ cmsys::SystemInformation::CPU_FEATURE_AMD_3DNOW));
+ } else if (key == "HAS_AMD_3DNOW_PLUS") {
+ value = this->ValueToString(info.DoesCPUSupportFeature(
+ cmsys::SystemInformation::CPU_FEATURE_AMD_3DNOW_PLUS));
+ } else if (key == "HAS_IA64") {
+ value = this->ValueToString(
+ info.DoesCPUSupportFeature(cmsys::SystemInformation::CPU_FEATURE_IA64));
+ } else if (key == "HAS_SERIAL_NUMBER") {
+ value = this->ValueToString(info.DoesCPUSupportFeature(
+ cmsys::SystemInformation::CPU_FEATURE_SERIALNUMBER));
+ } else if (key == "PROCESSOR_NAME") {
+ value = this->ValueToString(info.GetExtendedProcessorName());
+ } else if (key == "PROCESSOR_DESCRIPTION") {
+ value = info.GetCPUDescription();
+ } else if (key == "PROCESSOR_SERIAL_NUMBER") {
+ value = this->ValueToString(info.GetProcessorSerialNumber());
+ } else if (key == "OS_NAME") {
+ value = this->ValueToString(info.GetOSName());
+ } else if (key == "OS_RELEASE") {
+ value = this->ValueToString(info.GetOSRelease());
+ } else if (key == "OS_VERSION") {
+ value = this->ValueToString(info.GetOSVersion());
+ } else if (key == "OS_PLATFORM") {
+ value = this->ValueToString(info.GetOSPlatform());
#ifdef HAVE_VS_SETUP_HELPER
} else if (key == "VS_15_DIR") {
cmVSSetupAPIHelper vsSetupAPIHelper;
diff --git a/Source/cmCMakeHostSystemInformationCommand.h b/Source/cmCMakeHostSystemInformationCommand.h
index ef6ca37..b3c05d4 100644
--- a/Source/cmCMakeHostSystemInformationCommand.h
+++ b/Source/cmCMakeHostSystemInformationCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCMakeHostSystemInformationCommand_h
#define cmCMakeHostSystemInformationCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <stddef.h>
#include <string>
diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h
index 45b6b78..4a979de 100644
--- a/Source/cmCMakeMinimumRequired.h
+++ b/Source/cmCMakeMinimumRequired.h
@@ -3,7 +3,7 @@
#ifndef cmCMakeMinimumRequired_h
#define cmCMakeMinimumRequired_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h
index 0e88243..f9c51c3 100644
--- a/Source/cmCMakePolicyCommand.h
+++ b/Source/cmCMakePolicyCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCMakePolicyCommand_h
#define cmCMakePolicyCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmCPackPropertiesGenerator.h b/Source/cmCPackPropertiesGenerator.h
index 48f4c10..c5885f2 100644
--- a/Source/cmCPackPropertiesGenerator.h
+++ b/Source/cmCPackPropertiesGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmCPackPropertiesGenerator_h
#define cmCPackPropertiesGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmScriptGenerator.h"
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index e78f5fe..e0b1711 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -218,8 +218,8 @@ void CCONV cmAddUtilityCommand(void* arg, const char* utilityName,
}
// Pass the call to the makefile instance.
- mf->AddUtilityCommand(utilityName, (all ? false : true), CM_NULLPTR,
- depends2, commandLines);
+ mf->AddUtilityCommand(utilityName, (all ? false : true), nullptr, depends2,
+ commandLines);
}
void CCONV cmAddCustomCommand(void* arg, const char* source,
const char* command, int numArgs,
@@ -257,7 +257,7 @@ void CCONV cmAddCustomCommand(void* arg, const char* source,
}
// Pass the call to the makefile instance.
- const char* no_comment = CM_NULLPTR;
+ const char* no_comment = nullptr;
mf->AddCustomCommandOldStyle(target, outputs2, depends2, source,
commandLines, no_comment);
}
@@ -291,8 +291,8 @@ void CCONV cmAddCustomCommandToOutput(void* arg, const char* output,
}
// Pass the call to the makefile instance.
- const char* no_comment = CM_NULLPTR;
- const char* no_working_dir = CM_NULLPTR;
+ const char* no_comment = nullptr;
+ const char* no_working_dir = nullptr;
mf->AddCustomCommandToOutput(output, depends2, main_dependency, commandLines,
no_comment, no_working_dir);
}
@@ -333,8 +333,8 @@ void CCONV cmAddCustomCommandToTarget(void* arg, const char* target,
// Pass the call to the makefile instance.
std::vector<std::string> no_byproducts;
std::vector<std::string> no_depends;
- const char* no_comment = CM_NULLPTR;
- const char* no_working_dir = CM_NULLPTR;
+ const char* no_comment = nullptr;
+ const char* no_working_dir = nullptr;
mf->AddCustomCommandToTarget(target, no_byproducts, no_depends, commandLines,
cctype, no_comment, no_working_dir);
}
@@ -443,7 +443,7 @@ void CCONV cmExpandSourceListArguments(void* arg, int numArgs,
result.push_back(args[i]);
}
int resargc = static_cast<int>(result.size());
- char** resargv = CM_NULLPTR;
+ char** resargv = nullptr;
if (resargc) {
resargv = (char**)malloc(resargc * sizeof(char*));
}
@@ -482,7 +482,7 @@ int CCONV cmGetTotalArgumentSize(int argc, char** argv)
struct cmCPluginAPISourceFile
{
cmCPluginAPISourceFile()
- : RealSourceFile(CM_NULLPTR)
+ : RealSourceFile(nullptr)
{
}
cmSourceFile* RealSourceFile;
@@ -554,7 +554,7 @@ void CCONV* cmGetSource(void* arg, const char* name)
}
return (void*)i->second;
}
- return CM_NULLPTR;
+ return nullptr;
}
void* CCONV cmAddSource(void* arg, void* arg2)
@@ -562,7 +562,7 @@ void* CCONV cmAddSource(void* arg, void* arg2)
cmMakefile* mf = static_cast<cmMakefile*>(arg);
cmCPluginAPISourceFile* osf = static_cast<cmCPluginAPISourceFile*>(arg2);
if (osf->FullPath.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
// Create the real cmSourceFile instance and copy over saved information.
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index e260556..66b8f07 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -11,6 +11,7 @@
#include "cmsys/Process.h"
#include "cmsys/String.hxx"
#include "cmsys/SystemInformation.hxx"
+#include <algorithm>
#include <ctype.h>
#include <iostream>
#include <map>
@@ -66,7 +67,7 @@
struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag)
{
struct tm* lctime;
- time_t tctime = time(CM_NULLPTR);
+ time_t tctime = time(nullptr);
lctime = gmtime(&tctime);
char buf[1024];
// add todays year day and month to the time in str because
@@ -84,7 +85,7 @@ struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag)
// As such, this time may be in the past or in the future.
time_t ntime = curl_getdate(buf, &tctime);
cmCTestLog(this, DEBUG, " Get curl time: " << ntime << std::endl);
- tctime = time(CM_NULLPTR);
+ tctime = time(nullptr);
cmCTestLog(this, DEBUG, " Get the current time: " << tctime << std::endl);
const int dayLength = 24 * 60 * 60;
@@ -130,7 +131,7 @@ std::string cmCTest::CleanString(const std::string& str)
std::string cmCTest::CurrentTime()
{
- time_t currenttime = time(CM_NULLPTR);
+ time_t currenttime = time(nullptr);
struct tm* t = localtime(&currenttime);
// return ::CleanString(ctime(&currenttime));
char current_time[1024];
@@ -156,7 +157,7 @@ std::string cmCTest::GetCostDataFile()
static size_t HTTPResponseCallback(void* ptr, size_t size, size_t nmemb,
void* data)
{
- int realsize = (int)(size * nmemb);
+ int realsize = static_cast<int>(size * nmemb);
std::string* response = static_cast<std::string*>(data);
const char* chPtr = static_cast<char*>(ptr);
@@ -190,7 +191,8 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method,
::curl_easy_setopt(curl, CURLOPT_PUT, 1);
file = cmsys::SystemTools::Fopen(putFile, "rb");
::curl_easy_setopt(curl, CURLOPT_INFILE, file);
- // fall through to append GET fields
+ // fall through to append GET fields
+ CM_FALLTHROUGH;
case cmCTest::HTTP_GET:
if (!fields.empty()) {
url += "?" + fields;
@@ -204,7 +206,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method,
// set response options
::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HTTPResponseCallback);
- ::curl_easy_setopt(curl, CURLOPT_FILE, (void*)&response);
+ ::curl_easy_setopt(curl, CURLOPT_FILE, &response);
::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
CURLcode res = ::curl_easy_perform(curl);
@@ -225,7 +227,7 @@ std::string cmCTest::MakeURLSafe(const std::string& str)
if ((ch > 126 || ch < 32 || ch == '&' || ch == '%' || ch == '+' ||
ch == '=' || ch == '@') &&
ch != 9) {
- sprintf(buffer, "%02x;", (unsigned int)ch);
+ sprintf(buffer, "%02x;", static_cast<unsigned int>(ch));
ost << buffer;
} else {
ost << ch;
@@ -240,7 +242,7 @@ std::string cmCTest::DecodeURL(const std::string& in)
for (const char* c = in.c_str(); *c; ++c) {
if (*c == '%' && isxdigit(*(c + 1)) && isxdigit(*(c + 2))) {
char buf[3] = { *(c + 1), *(c + 2), 0 };
- out.append(1, char(strtoul(buf, CM_NULLPTR, 16)));
+ out.append(1, char(strtoul(buf, nullptr, 16)));
c += 2;
} else {
out.append(1, *c);
@@ -252,6 +254,7 @@ std::string cmCTest::DecodeURL(const std::string& in)
cmCTest::cmCTest()
{
this->LabelSummary = true;
+ this->SubprojectSummary = true;
this->ParallelLevel = 1;
this->ParallelLevelSetInCli = false;
this->TestLoad = 0;
@@ -283,7 +286,7 @@ cmCTest::cmCTest()
this->ScheduleType = "";
this->StopTime = "";
this->NextDayStopTime = false;
- this->OutputLogFile = CM_NULLPTR;
+ this->OutputLogFile = nullptr;
this->OutputLogFileLastTag = -1;
this->SuppressUpdatingCTestConfiguration = false;
this->DartVersion = 1;
@@ -341,7 +344,7 @@ cmCTest::cmCTest()
cmCTest::~cmCTest()
{
cmDeleteAll(this->TestingHandlers);
- this->SetOutputLogFileName(CM_NULLPTR);
+ this->SetOutputLogFileName(nullptr);
}
void cmCTest::SetParallelLevel(int level)
@@ -462,7 +465,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
std::string tag;
if (createNewTag) {
- time_t tctime = time(CM_NULLPTR);
+ time_t tctime = time(nullptr);
if (this->TomorrowTag) {
tctime += (24 * 60 * 60);
}
@@ -487,7 +490,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
}
tfin.close();
}
- if (tag.empty() || (CM_NULLPTR != command) || this->Parts[PartStart]) {
+ if (tag.empty() || (nullptr != command) || this->Parts[PartStart]) {
cmCTestOptionalLog(
this, DEBUG,
"TestModel: " << this->GetTestModelString() << std::endl, quiet);
@@ -509,7 +512,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
ofs << this->GetTestModelString() << std::endl;
}
ofs.close();
- if (CM_NULLPTR == command) {
+ if (nullptr == command) {
cmCTestOptionalLog(this, OUTPUT, "Create new tag: "
<< tag << " - " << this->GetTestModelString()
<< std::endl,
@@ -805,7 +808,7 @@ cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler)
cmCTest::t_TestingHandlers::iterator it =
this->TestingHandlers.find(handler);
if (it == this->TestingHandlers.end()) {
- return CM_NULLPTR;
+ return nullptr;
}
it->second->Initialize();
return it->second;
@@ -816,7 +819,7 @@ cmCTestGenericHandler* cmCTest::GetHandler(const char* handler)
cmCTest::t_TestingHandlers::iterator it =
this->TestingHandlers.find(handler);
if (it == this->TestingHandlers.end()) {
- return CM_NULLPTR;
+ return nullptr;
}
return it->second;
}
@@ -974,7 +977,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
a != args.end(); ++a) {
argv.push_back(a->c_str());
}
- argv.push_back(CM_NULLPTR);
+ argv.push_back(nullptr);
output = "";
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:");
@@ -1004,7 +1007,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Each . represents "
<< tick_len << " bytes of output" << std::endl
<< " " << std::flush);
- while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) {
+ while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
processOutput.DecodeText(data, length, strdata);
for (size_t cc = 0; cc < strdata.size(); ++cc) {
if (strdata[cc] == 0) {
@@ -1040,7 +1043,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Size of output: "
<< int(double(output.size()) / 1024.0) << "K" << std::endl);
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
int result = cmsysProcess_GetState(cp);
@@ -1169,7 +1172,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
int length;
cmProcessOutput processOutput(encoding);
std::string strdata;
- while (cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) {
+ while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
processOutput.DecodeText(data, length, strdata);
if (output) {
tempOutput.insert(tempOutput.end(), data, data + length);
@@ -1189,7 +1192,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
}
}
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
processOutput.DecodeText(tempOutput, tempOutput);
if (output && tempOutput.begin() != tempOutput.end()) {
output->append(&*tempOutput.begin(), tempOutput.size());
@@ -1363,6 +1366,35 @@ void cmCTest::AddSiteProperties(cmXMLWriter& xml)
}
}
+void cmCTest::GenerateSubprojectsOutput(cmXMLWriter& xml)
+{
+ std::vector<std::string> subprojects = this->GetLabelsForSubprojects();
+ std::vector<std::string>::const_iterator i;
+ for (i = subprojects.begin(); i != subprojects.end(); ++i) {
+ xml.StartElement("Subproject");
+ xml.Attribute("name", *i);
+ xml.Element("Label", *i);
+ xml.EndElement(); // Subproject
+ }
+}
+
+std::vector<std::string> cmCTest::GetLabelsForSubprojects()
+{
+ std::string labelsForSubprojects =
+ this->GetCTestConfiguration("LabelsForSubprojects");
+ std::vector<std::string> subprojects;
+ cmSystemTools::ExpandListArgument(labelsForSubprojects, subprojects);
+
+ // sort the array
+ std::sort(subprojects.begin(), subprojects.end());
+ // remove duplicates
+ std::vector<std::string>::iterator new_end =
+ std::unique(subprojects.begin(), subprojects.end());
+ subprojects.erase(new_end, subprojects.end());
+
+ return subprojects;
+}
+
void cmCTest::EndXML(cmXMLWriter& xml)
{
xml.EndElement(); // Site
@@ -1735,7 +1767,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
if (this->CheckArgument(arg, "--timeout") && i < args.size() - 1) {
i++;
- double timeout = (double)atof(args[i].c_str());
+ double timeout = atof(args[i].c_str());
this->GlobalTimeout = timeout;
}
@@ -1764,6 +1796,9 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
if (this->CheckArgument(arg, "--no-label-summary")) {
this->LabelSummary = false;
}
+ if (this->CheckArgument(arg, "--no-subproject-summary")) {
+ this->SubprojectSummary = false;
+ }
if (this->CheckArgument(arg, "-Q", "--quiet")) {
this->Quiet = true;
}
@@ -2194,7 +2229,7 @@ int cmCTest::ExecuteTests()
it->second->SetSubmitIndex(this->SubmitIndex);
}
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
- if (!this->Initialize(cwd.c_str(), CM_NULLPTR)) {
+ if (!this->Initialize(cwd.c_str(), nullptr)) {
res = 12;
cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard."
<< std::endl);
@@ -2352,7 +2387,7 @@ std::string cmCTest::GetShortPathToFile(const char* cfname)
bool inBld = bldRelpath.find("..") == std::string::npos;
// TODO: Handle files with .. in their name
- std::string* res = CM_NULLPTR;
+ std::string* res = nullptr;
if (inSrc && inBld) {
// If both have relative path with no dots, pick the shorter one
@@ -2402,7 +2437,7 @@ void cmCTest::EmptyCTestConfiguration()
void cmCTest::DetermineNextDayStop()
{
struct tm* lctime;
- time_t current_time = time(CM_NULLPTR);
+ time_t current_time = time(nullptr);
lctime = gmtime(&current_time);
int gm_hour = lctime->tm_hour;
time_t gm_time = mktime(lctime);
@@ -2486,7 +2521,7 @@ bool cmCTest::GetProduceXML()
const char* cmCTest::GetSpecificTrack()
{
if (this->SpecificTrack.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
return this->SpecificTrack.c_str();
}
@@ -2561,7 +2596,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut,
a != args.end(); ++a) {
argv.push_back(a->c_str());
}
- argv.push_back(CM_NULLPTR);
+ argv.push_back(nullptr);
*stdOut = "";
*stdErr = "";
@@ -2584,7 +2619,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut,
int res;
bool done = false;
while (!done) {
- res = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR);
+ res = cmsysProcess_WaitForData(cp, &data, &length, nullptr);
switch (res) {
case cmsysProcess_Pipe_STDOUT:
tempOutput.insert(tempOutput.end(), data, data + length);
@@ -2608,7 +2643,7 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut,
}
}
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
if (!tempOutput.empty()) {
processOutput.DecodeText(tempOutput, tempOutput);
stdOut->append(&*tempOutput.begin(), tempOutput.size());
@@ -2652,7 +2687,7 @@ void cmCTest::SetOutputLogFileName(const char* name)
{
if (this->OutputLogFile) {
delete this->OutputLogFile;
- this->OutputLogFile = CM_NULLPTR;
+ this->OutputLogFile = nullptr;
}
if (name) {
this->OutputLogFile = new cmGeneratedFileStream(name);
@@ -2666,7 +2701,7 @@ static const char* cmCTestStringLogType[] = { "DEBUG",
"HANDLER_VERBOSE_OUTPUT",
"WARNING",
"ERROR_MESSAGE",
- CM_NULLPTR };
+ nullptr };
#define cmCTestLogOutputFileLine(stream) \
if (this->ShowLineNumbers) { \
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 60f3295..66e6a26 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -3,7 +3,7 @@
#ifndef cmCTest_h
#define cmCTest_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmProcessOutput.h"
#include "cmsys/String.hxx"
@@ -95,7 +95,7 @@ public:
typedef std::set<std::string> SetOfStrings;
/** Process Command line arguments */
- int Run(std::vector<std::string>&, std::string* output = CM_NULLPTR);
+ int Run(std::vector<std::string>&, std::string* output = nullptr);
/**
* Initialize and finalize testing
@@ -252,8 +252,8 @@ public:
* escaped for this to with spaces.
*/
bool RunCommand(const char* command, std::string* stdOut,
- std::string* stdErr, int* retVal = CM_NULLPTR,
- const char* dir = CM_NULLPTR, double timeout = 0.0,
+ std::string* stdErr, int* retVal = nullptr,
+ const char* dir = nullptr, double timeout = 0.0,
Encoding encoding = cmProcessOutput::Auto);
/**
@@ -438,7 +438,9 @@ public:
this->StreamErr = err;
}
void AddSiteProperties(cmXMLWriter& xml);
+
bool GetLabelSummary() { return this->LabelSummary; }
+ bool GetSubprojectSummary() { return this->SubprojectSummary; }
std::string GetCostDataFile();
@@ -453,6 +455,9 @@ public:
/** Return true if test should run until fail */
bool GetRepeatUntilFail() { return this->RepeatUntilFail; }
+ void GenerateSubprojectsOutput(cmXMLWriter& xml);
+ std::vector<std::string> GetLabelsForSubprojects();
+
private:
int RepeatTests;
bool RepeatUntilFail;
@@ -464,6 +469,7 @@ private:
bool ExtraVerbose;
bool ProduceXML;
bool LabelSummary;
+ bool SubprojectSummary;
bool UseHTTP10;
bool PrintLabels;
bool Failover;
@@ -571,7 +577,7 @@ private:
/** Check if the argument is the one specified */
bool CheckArgument(const std::string& arg, const char* varg1,
- const char* varg2 = CM_NULLPTR);
+ const char* varg2 = nullptr);
/** Output errors from a test */
void OutputTestErrors(std::vector<char> const& process_output);
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 0b025ab..d599275 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -173,7 +173,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
}
const char* cmCacheManager::PersistentProperties[] = { "ADVANCED", "MODIFIED",
- "STRINGS", CM_NULLPTR };
+ "STRINGS", nullptr };
bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey,
CacheEntry& e)
@@ -440,7 +440,7 @@ cmCacheManager::CacheEntry* cmCacheManager::GetCacheEntry(
if (i != this->Cache.end()) {
return &i->second;
}
- return CM_NULLPTR;
+ return nullptr;
}
cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(const char* key)
@@ -455,7 +455,7 @@ const char* cmCacheManager::GetInitializedCacheValue(
if (i != this->Cache.end() && i->second.Initialized) {
return i->second.Value.c_str();
}
- return CM_NULLPTR;
+ return nullptr;
}
void cmCacheManager::PrintCache(std::ostream& out) const
@@ -610,7 +610,7 @@ const char* cmCacheManager::CacheIterator::GetProperty(
if (!this->IsAtEnd()) {
return this->GetEntry().GetProperty(prop);
}
- return CM_NULLPTR;
+ return nullptr;
}
void cmCacheManager::CacheIterator::SetProperty(const std::string& p,
@@ -647,5 +647,5 @@ void cmCacheManager::CacheIterator::SetProperty(const std::string& p, bool v)
bool cmCacheManager::CacheIterator::PropertyExists(
const std::string& prop) const
{
- return this->GetProperty(prop) != CM_NULLPTR;
+ return this->GetProperty(prop) != nullptr;
}
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index c464311..e9e6570 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -117,7 +117,7 @@ public:
void PrintCache(std::ostream&) const;
///! Get the iterator for an entry with a given key.
- cmCacheManager::CacheIterator GetCacheIterator(const char* key = CM_NULLPTR);
+ cmCacheManager::CacheIterator GetCacheIterator(const char* key = nullptr);
///! Remove an entry from the cache
void RemoveCacheEntry(const std::string& key);
@@ -132,7 +132,7 @@ public:
{
cmCacheManager::CacheIterator it = this->GetCacheIterator(key.c_str());
if (it.IsAtEnd()) {
- return CM_NULLPTR;
+ return nullptr;
}
return it.GetValue();
}
@@ -175,8 +175,7 @@ public:
void RemoveCacheEntryProperty(std::string const& key,
std::string const& propName)
{
- this->GetCacheIterator(key.c_str())
- .SetProperty(propName, (void*)CM_NULLPTR);
+ this->GetCacheIterator(key.c_str()).SetProperty(propName, nullptr);
}
void AppendCacheEntryProperty(std::string const& key,
diff --git a/Source/cmCallVisualStudioMacro.h b/Source/cmCallVisualStudioMacro.h
index ad35d30..fdc9e66 100644
--- a/Source/cmCallVisualStudioMacro.h
+++ b/Source/cmCallVisualStudioMacro.h
@@ -3,7 +3,7 @@
#ifndef cmCallVisualStudioMacro_h
#define cmCallVisualStudioMacro_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index ad72fe2..2cc0b88 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -3,7 +3,7 @@
#ifndef cmCommand_h
#define cmCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
@@ -31,7 +31,7 @@ public:
* Construct the command. By default it has no makefile.
*/
cmCommand()
- : Makefile(CM_NULLPTR)
+ : Makefile(nullptr)
{
}
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index 4eb4531..4764620 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -19,7 +19,7 @@ cmCommandArgumentParserHelper::cmCommandArgumentParserHelper()
this->WarnUninitialized = false;
this->CheckSystemVars = false;
this->FileLine = -1;
- this->FileName = CM_NULLPTR;
+ this->FileName = nullptr;
this->RemoveEmpty = true;
this->EmptyVariable[0] = 0;
strcpy(this->DCURLYVariable, "${");
@@ -88,13 +88,13 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
e << "Syntax $" << key << "{} is not supported. "
<< "Only ${}, $ENV{}, and $CACHE{} are allowed.";
this->SetError(e.str());
- return CM_NULLPTR;
+ return nullptr;
}
char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
{
if (!var) {
- return CM_NULLPTR;
+ return nullptr;
}
if (this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) {
std::ostringstream ostr;
@@ -117,7 +117,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
}
}
- return CM_NULLPTR;
+ return nullptr;
}
if (this->EscapeQuotes && value) {
return this->AddString(cmSystemTools::EscapeQuotes(value));
@@ -169,7 +169,7 @@ char* cmCommandArgumentParserHelper::CombineUnions(char* in1, char* in2)
void cmCommandArgumentParserHelper::AllocateParserType(
cmCommandArgumentParserHelper::ParserType* pt, const char* str, int len)
{
- pt->str = CM_NULLPTR;
+ pt->str = nullptr;
if (len == 0) {
len = static_cast<int>(strlen(str));
}
diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h
index 465ca9e..cb2a390 100644
--- a/Source/cmCommandArgumentParserHelper.h
+++ b/Source/cmCommandArgumentParserHelper.h
@@ -3,7 +3,7 @@
#ifndef cmCommandArgumentParserHelper_h
#define cmCommandArgumentParserHelper_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx
index babddbe..36d4da4 100644
--- a/Source/cmCommandArgumentsHelper.cxx
+++ b/Source/cmCommandArgumentsHelper.cxx
@@ -11,11 +11,11 @@ cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args,
, ArgumentsBeforeEmpty(true)
, CurrentIndex(0)
{
- if (args != CM_NULLPTR) {
+ if (args != nullptr) {
args->AddArgument(this);
}
- if (this->Group != CM_NULLPTR) {
+ if (this->Group != nullptr) {
this->Group->ContainedArguments.push_back(this);
}
}
@@ -35,7 +35,7 @@ void cmCommandArgument::Follows(const cmCommandArgument* arg)
void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group)
{
- if (group != CM_NULLPTR) {
+ if (group != nullptr) {
this->ArgumentsBeforeEmpty = false;
this->ArgumentsBefore.insert(group->ContainedArguments.begin(),
group->ContainedArguments.end());
@@ -52,7 +52,7 @@ bool cmCommandArgument::MayFollow(const cmCommandArgument* current) const
bool cmCommandArgument::KeyMatches(const std::string& key) const
{
- if ((this->Key == CM_NULLPTR) || (this->Key[0] == '\0')) {
+ if ((this->Key == nullptr) || (this->Key[0] == '\0')) {
return true;
}
return (key == this->Key);
@@ -60,7 +60,7 @@ bool cmCommandArgument::KeyMatches(const std::string& key) const
void cmCommandArgument::ApplyOwnGroup()
{
- if (this->Group != CM_NULLPTR) {
+ if (this->Group != nullptr) {
for (std::vector<cmCommandArgument*>::const_iterator it =
this->Group->ContainedArguments.begin();
it != this->Group->ContainedArguments.end(); ++it) {
@@ -88,9 +88,9 @@ cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args,
const char* key,
cmCommandArgumentGroup* group)
: cmCommandArgument(args, key, group)
- , Ignore(CM_NULLPTR)
+ , Ignore(nullptr)
{
- if ((key == CM_NULLPTR) || (*key == 0)) {
+ if ((key == nullptr) || (*key == 0)) {
this->DataStart = 0;
} else {
this->DataStart = 1;
@@ -100,7 +100,7 @@ cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args,
bool cmCAStringVector::DoConsume(const std::string& arg, unsigned int index)
{
if (index >= this->DataStart) {
- if ((this->Ignore == CM_NULLPTR) || (arg != this->Ignore)) {
+ if ((this->Ignore == nullptr) || (arg != this->Ignore)) {
this->Vector.push_back(arg);
}
}
@@ -117,7 +117,7 @@ cmCAString::cmCAString(cmCommandArgumentsHelper* args, const char* key,
cmCommandArgumentGroup* group)
: cmCommandArgument(args, key, group)
{
- if ((key == CM_NULLPTR) || (*key == 0)) {
+ if ((key == nullptr) || (*key == 0)) {
this->DataStart = 0;
} else {
this->DataStart = 1;
@@ -199,7 +199,7 @@ void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group)
void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
std::vector<std::string>* unconsumedArgs)
{
- if (args == CM_NULLPTR) {
+ if (args == nullptr) {
return;
}
@@ -210,8 +210,8 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
(*argIt)->Reset();
}
- cmCommandArgument* activeArgument = CM_NULLPTR;
- const cmCommandArgument* previousArgument = CM_NULLPTR;
+ cmCommandArgument* activeArgument = nullptr;
+ const cmCommandArgument* previousArgument = nullptr;
for (std::vector<std::string>::const_iterator it = args->begin();
it != args->end(); ++it) {
for (std::vector<cmCommandArgument*>::iterator argIt =
@@ -229,10 +229,10 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
bool argDone = activeArgument->Consume(*it);
previousArgument = activeArgument;
if (argDone) {
- activeArgument = CM_NULLPTR;
+ activeArgument = nullptr;
}
} else {
- if (unconsumedArgs != CM_NULLPTR) {
+ if (unconsumedArgs != nullptr) {
unconsumedArgs->push_back(*it);
}
}
diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h
index 44db374..56d88e9 100644
--- a/Source/cmCommandArgumentsHelper.h
+++ b/Source/cmCommandArgumentsHelper.h
@@ -3,7 +3,7 @@
#ifndef cmCommandArgumentsHelper_h
#define cmCommandArgumentsHelper_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <set>
#include <string>
@@ -38,7 +38,7 @@ class cmCommandArgument
{
public:
cmCommandArgument(cmCommandArgumentsHelper* args, const char* key,
- cmCommandArgumentGroup* group = CM_NULLPTR);
+ cmCommandArgumentGroup* group = nullptr);
virtual ~cmCommandArgument() {}
/// this argument may follow after arg. 0 means it comes first.
@@ -90,7 +90,7 @@ class cmCAStringVector : public cmCommandArgument
{
public:
cmCAStringVector(cmCommandArgumentsHelper* args, const char* key,
- cmCommandArgumentGroup* group = CM_NULLPTR);
+ cmCommandArgumentGroup* group = nullptr);
/// Return the vector of strings
const std::vector<std::string>& GetVector() const { return this->Vector; }
@@ -113,7 +113,7 @@ class cmCAString : public cmCommandArgument
{
public:
cmCAString(cmCommandArgumentsHelper* args, const char* key,
- cmCommandArgumentGroup* group = CM_NULLPTR);
+ cmCommandArgumentGroup* group = nullptr);
/// Return the string
const std::string& GetString() const { return this->String; }
@@ -132,7 +132,7 @@ class cmCAEnabler : public cmCommandArgument
{
public:
cmCAEnabler(cmCommandArgumentsHelper* args, const char* key,
- cmCommandArgumentGroup* group = CM_NULLPTR);
+ cmCommandArgumentGroup* group = nullptr);
/// Has it been enabled ?
bool IsEnabled() const { return this->Enabled; }
@@ -149,7 +149,7 @@ class cmCADisabler : public cmCommandArgument
{
public:
cmCADisabler(cmCommandArgumentsHelper* args, const char* key,
- cmCommandArgumentGroup* group = CM_NULLPTR);
+ cmCommandArgumentGroup* group = nullptr);
/// Is it still enabled ?
bool IsEnabled() const { return this->Enabled; }
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index e1d8ef1..8a7d9bd 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -42,6 +42,7 @@
#include "cmIfCommand.h"
#include "cmIncludeCommand.h"
#include "cmIncludeDirectoryCommand.h"
+#include "cmIncludeGuardCommand.h"
#include "cmIncludeRegularExpressionCommand.h"
#include "cmInstallCommand.h"
#include "cmInstallFilesCommand.h"
@@ -67,7 +68,12 @@
#include "cmSiteNameCommand.h"
#include "cmStringCommand.h"
#include "cmSubdirCommand.h"
+#include "cmTargetCompileDefinitionsCommand.h"
+#include "cmTargetCompileFeaturesCommand.h"
+#include "cmTargetCompileOptionsCommand.h"
+#include "cmTargetIncludeDirectoriesCommand.h"
#include "cmTargetLinkLibrariesCommand.h"
+#include "cmTargetSourcesCommand.h"
#include "cmTryCompileCommand.h"
#include "cmTryRunCommand.h"
#include "cmUnsetCommand.h"
@@ -93,11 +99,6 @@
#include "cmRemoveDefinitionsCommand.h"
#include "cmSourceGroupCommand.h"
#include "cmSubdirDependsCommand.h"
-#include "cmTargetCompileDefinitionsCommand.h"
-#include "cmTargetCompileFeaturesCommand.h"
-#include "cmTargetCompileOptionsCommand.h"
-#include "cmTargetIncludeDirectoriesCommand.h"
-#include "cmTargetSourcesCommand.h"
#include "cmUseMangledMesaCommand.h"
#include "cmUtilitySourceCommand.h"
#include "cmVariableRequiresCommand.h"
@@ -132,6 +133,7 @@ void GetScriptingCommands(cmState* state)
state->AddBuiltinCommand("get_property", new cmGetPropertyCommand);
state->AddBuiltinCommand("if", new cmIfCommand);
state->AddBuiltinCommand("include", new cmIncludeCommand);
+ state->AddBuiltinCommand("include_guard", new cmIncludeGuardCommand);
state->AddBuiltinCommand("list", new cmListCommand);
state->AddBuiltinCommand("macro", new cmMacroCommand);
state->AddBuiltinCommand("make_directory", new cmMakeDirectoryCommand);
@@ -145,8 +147,6 @@ void GetScriptingCommands(cmState* state)
state->AddBuiltinCommand("separate_arguments",
new cmSeparateArgumentsCommand);
state->AddBuiltinCommand("set", new cmSetCommand);
- state->AddBuiltinCommand("set_directory_properties",
- new cmSetDirectoryPropertiesCommand);
state->AddBuiltinCommand("set_property", new cmSetPropertyCommand);
state->AddBuiltinCommand("site_name", new cmSiteNameCommand);
state->AddBuiltinCommand("string", new cmStringCommand);
@@ -229,6 +229,8 @@ void GetProjectCommands(cmState* state)
state->AddBuiltinCommand("install_targets", new cmInstallTargetsCommand);
state->AddBuiltinCommand("link_directories", new cmLinkDirectoriesCommand);
state->AddBuiltinCommand("project", new cmProjectCommand);
+ state->AddBuiltinCommand("set_directory_properties",
+ new cmSetDirectoryPropertiesCommand);
state->AddBuiltinCommand("set_source_files_properties",
new cmSetSourceFilesPropertiesCommand);
state->AddBuiltinCommand("set_target_properties",
@@ -236,8 +238,17 @@ void GetProjectCommands(cmState* state)
state->AddBuiltinCommand("set_tests_properties",
new cmSetTestsPropertiesCommand);
state->AddBuiltinCommand("subdirs", new cmSubdirCommand);
+ state->AddBuiltinCommand("target_compile_definitions",
+ new cmTargetCompileDefinitionsCommand);
+ state->AddBuiltinCommand("target_compile_features",
+ new cmTargetCompileFeaturesCommand);
+ state->AddBuiltinCommand("target_compile_options",
+ new cmTargetCompileOptionsCommand);
+ state->AddBuiltinCommand("target_include_directories",
+ new cmTargetIncludeDirectoriesCommand);
state->AddBuiltinCommand("target_link_libraries",
new cmTargetLinkLibrariesCommand);
+ state->AddBuiltinCommand("target_sources", new cmTargetSourcesCommand);
state->AddBuiltinCommand("try_compile", new cmTryCompileCommand);
state->AddBuiltinCommand("try_run", new cmTryRunCommand);
@@ -258,15 +269,6 @@ void GetProjectCommands(cmState* state)
state->AddBuiltinCommand("remove_definitions",
new cmRemoveDefinitionsCommand);
state->AddBuiltinCommand("source_group", new cmSourceGroupCommand);
- state->AddBuiltinCommand("target_compile_definitions",
- new cmTargetCompileDefinitionsCommand);
- state->AddBuiltinCommand("target_compile_features",
- new cmTargetCompileFeaturesCommand);
- state->AddBuiltinCommand("target_compile_options",
- new cmTargetCompileOptionsCommand);
- state->AddBuiltinCommand("target_include_directories",
- new cmTargetIncludeDirectoriesCommand);
- state->AddBuiltinCommand("target_sources", new cmTargetSourcesCommand);
state->AddDisallowedCommand(
"export_library_dependencies", new cmExportLibraryDependenciesCommand,
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 391d65c..a70839e 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCommonTargetGenerator.h"
-#include "cmConfigure.h"
#include <set>
#include <sstream>
#include <utility>
@@ -22,10 +21,11 @@
cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt)
: GeneratorTarget(gt)
, Makefile(gt->Makefile)
- , LocalGenerator(static_cast<cmLocalCommonGenerator*>(gt->LocalGenerator))
- , GlobalGenerator(static_cast<cmGlobalCommonGenerator*>(
+ , LocalCommonGenerator(
+ static_cast<cmLocalCommonGenerator*>(gt->LocalGenerator))
+ , GlobalCommonGenerator(static_cast<cmGlobalCommonGenerator*>(
gt->LocalGenerator->GetGlobalGenerator()))
- , ConfigName(LocalGenerator->GetConfigName())
+ , ConfigName(LocalCommonGenerator->GetConfigName())
{
}
@@ -62,10 +62,10 @@ void cmCommonTargetGenerator::AddModuleDefinitionFlag(
// Append the flag and value. Use ConvertToLinkReference to help
// vs6's "cl -link" pass it to the linker.
std::string flag = defFileFlag;
- flag += this->LocalGenerator->ConvertToOutputFormat(
+ flag += this->LocalCommonGenerator->ConvertToOutputFormat(
linkLineComputer->ConvertToLinkReference(mdi->DefFile),
cmOutputConverter::SHELL);
- this->LocalGenerator->AppendFlags(flags, flag);
+ this->LocalCommonGenerator->AppendFlags(flags, flag);
}
void cmCommonTargetGenerator::AppendFortranFormatFlags(
@@ -78,7 +78,7 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags(
const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT");
format = cmOutputConverter::GetFortranFormat(tgtfmt);
}
- const char* var = CM_NULLPTR;
+ const char* var = nullptr;
switch (format) {
case cmOutputConverter::FortranFormatFixed:
var = "CMAKE_Fortran_FORMAT_FIXED_FLAG";
@@ -90,8 +90,8 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags(
break;
}
if (var) {
- this->LocalGenerator->AppendFlags(flags,
- this->Makefile->GetDefinition(var));
+ this->LocalCommonGenerator->AppendFlags(
+ flags, this->Makefile->GetDefinition(var));
}
}
@@ -101,8 +101,8 @@ std::string cmCommonTargetGenerator::GetFlags(const std::string& l)
if (i == this->FlagsByLanguage.end()) {
std::string flags;
- this->LocalGenerator->GetTargetCompileFlags(this->GeneratorTarget,
- this->ConfigName, l, flags);
+ this->LocalCommonGenerator->GetTargetCompileFlags(
+ this->GeneratorTarget, this->ConfigName, l, flags);
ByLanguageMap::value_type entry(l, flags);
i = this->FlagsByLanguage.insert(entry).first;
@@ -115,11 +115,11 @@ std::string cmCommonTargetGenerator::GetDefines(const std::string& l)
ByLanguageMap::iterator i = this->DefinesByLanguage.find(l);
if (i == this->DefinesByLanguage.end()) {
std::set<std::string> defines;
- this->LocalGenerator->GetTargetDefines(this->GeneratorTarget,
- this->ConfigName, l, defines);
+ this->LocalCommonGenerator->GetTargetDefines(this->GeneratorTarget,
+ this->ConfigName, l, defines);
std::string definesString;
- this->LocalGenerator->JoinDefines(defines, definesString, l);
+ this->LocalCommonGenerator->JoinDefines(defines, definesString, l);
ByLanguageMap::value_type entry(l, definesString);
i = this->DefinesByLanguage.insert(entry).first;
@@ -198,9 +198,10 @@ std::string cmCommonTargetGenerator::GetManifests()
std::vector<std::string> manifests;
for (std::vector<cmSourceFile const*>::iterator mi = manifest_srcs.begin();
mi != manifest_srcs.end(); ++mi) {
- manifests.push_back(this->LocalGenerator->ConvertToOutputFormat(
- this->LocalGenerator->ConvertToRelativePath(
- this->LocalGenerator->GetWorkingDirectory(), (*mi)->GetFullPath()),
+ manifests.push_back(this->LocalCommonGenerator->ConvertToOutputFormat(
+ this->LocalCommonGenerator->ConvertToRelativePath(
+ this->LocalCommonGenerator->GetWorkingDirectory(),
+ (*mi)->GetFullPath()),
cmOutputConverter::SHELL));
}
@@ -233,6 +234,6 @@ void cmCommonTargetGenerator::AppendOSXVerFlag(std::string& flags,
// Append the flag since a non-zero version is specified.
std::ostringstream vflag;
vflag << flag << major << "." << minor << "." << patch;
- this->LocalGenerator->AppendFlags(flags, vflag.str());
+ this->LocalCommonGenerator->AppendFlags(flags, vflag.str());
}
}
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index c36145f..6b0f74e 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -37,8 +37,8 @@ protected:
cmGeneratorTarget* GeneratorTarget;
cmMakefile* Makefile;
- cmLocalCommonGenerator* LocalGenerator;
- cmGlobalCommonGenerator* GlobalGenerator;
+ cmLocalCommonGenerator* LocalCommonGenerator;
+ cmGlobalCommonGenerator* GlobalCommonGenerator;
std::string ConfigName;
void AppendFortranFormatFlags(std::string& flags,
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 9c516ee..2277bbe 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -194,7 +194,7 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target,
this->OldLinkDirMode = false;
// No computation has been done.
- this->CCG = CM_NULLPTR;
+ this->CCG = nullptr;
}
cmComputeLinkDepends::~cmComputeLinkDepends()
@@ -286,7 +286,7 @@ std::map<std::string, int>::iterator cmComputeLinkDepends::AllocateLinkEntry(
std::map<std::string, int>::iterator lei =
this->LinkEntryIndex.insert(index_entry).first;
this->EntryList.push_back(LinkEntry());
- this->InferredDependSets.push_back(CM_NULLPTR);
+ this->InferredDependSets.push_back(nullptr);
this->EntryConstraintGraph.push_back(EdgeList());
return lei;
}
@@ -314,7 +314,7 @@ int cmComputeLinkDepends::AddLinkEntry(cmLinkItem const& item)
// If the item has dependencies queue it to follow them.
if (entry.Target) {
// Target dependencies are always known. Follow them.
- BFSEntry qe = { index, CM_NULLPTR };
+ BFSEntry qe = { index, nullptr };
this->BFSQueue.push(qe);
} else {
// Look for an old-style <item>_LIB_DEPENDS variable.
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index 84ee916..dd0e029 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -40,7 +40,7 @@ public:
bool IsFlag;
LinkEntry()
: Item()
- , Target(CM_NULLPTR)
+ , Target(nullptr)
, IsSharedDep(false)
, IsFlag(false)
{
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index b2deaaa..f348a7e 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -260,7 +260,7 @@ cmComputeLinkInformation::cmComputeLinkInformation(
this->GlobalGenerator, target, "linker search path");
this->OrderRuntimeSearchPath = new cmOrderDirectories(
this->GlobalGenerator, target, "runtime search path");
- this->OrderDependentRPath = CM_NULLPTR;
+ this->OrderDependentRPath = nullptr;
// Get the language used for linking this target.
this->LinkLanguage = this->Target->GetLinkerLanguage(config);
@@ -281,7 +281,7 @@ cmComputeLinkInformation::cmComputeLinkInformation(
// On platforms without import libraries there may be a special flag
// to use when creating a plugin (module) that obtains symbols from
// the program that will load it.
- this->LoaderFlag = CM_NULLPTR;
+ this->LoaderFlag = nullptr;
if (!this->UseImportLibrary &&
this->Target->GetType() == cmStateEnums::MODULE_LIBRARY) {
std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_";
@@ -562,7 +562,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang)
for (std::vector<std::string>::const_iterator i = libsVec.begin();
i != libsVec.end(); ++i) {
if (this->ImplicitLinkLibs.find(*i) == this->ImplicitLinkLibs.end()) {
- this->AddItem(*i, CM_NULLPTR);
+ this->AddItem(*i, nullptr);
}
}
}
@@ -616,7 +616,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
// Also add the item the interface specifies to be used in its place.
std::string const& libName = tgt->GetImportedLibName(config);
if (!libName.empty()) {
- this->AddItem(libName, CM_NULLPTR);
+ this->AddItem(libName, nullptr);
}
} else {
// Decide whether to use an import library.
@@ -710,7 +710,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
// Check if we need to include the dependent shared library in other
// path ordering.
- cmOrderDirectories* order = CM_NULLPTR;
+ cmOrderDirectories* order = nullptr;
if (this->SharedDependencyMode == SharedDepModeLibDir &&
!this->LinkWithRuntimePath /* AddLibraryRuntimeInfo adds it */) {
// Add the item to the linker search path.
@@ -722,7 +722,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
if (order) {
if (tgt) {
std::string soName = tgt->GetSOName(this->Config);
- const char* soname = soName.empty() ? CM_NULLPTR : soName.c_str();
+ const char* soname = soName.empty() ? nullptr : soName.c_str();
order->AddRuntimeLibrary(lib, soname);
} else {
order->AddRuntimeLibrary(lib);
@@ -741,9 +741,9 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
this->LinkTypeEnabled = false;
// Lookup link type selection flags.
- const char* static_link_type_flag = CM_NULLPTR;
- const char* shared_link_type_flag = CM_NULLPTR;
- const char* target_type_str = CM_NULLPTR;
+ const char* static_link_type_flag = nullptr;
+ const char* shared_link_type_flag = nullptr;
+ const char* target_type_str = nullptr;
switch (this->Target->GetType()) {
case cmStateEnums::EXECUTABLE:
target_type_str = "EXE";
@@ -1623,7 +1623,7 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo(
// Try to get the soname of the library. Only files with this name
// could possibly conflict.
std::string soName = target->GetSOName(this->Config);
- const char* soname = soName.empty() ? CM_NULLPTR : soName.c_str();
+ const char* soname = soName.empty() ? nullptr : soName.c_str();
// Include this library in the runtime path ordering.
this->OrderRuntimeSearchPath->AddRuntimeLibrary(fullPath, soname);
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 00e3ad2..f8c6214 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -33,11 +33,11 @@ public:
Item()
: Value()
, IsPath(true)
- , Target(CM_NULLPTR)
+ , Target(nullptr)
{
}
Item(std::string const& v, bool p,
- cmGeneratorTarget const* target = CM_NULLPTR)
+ cmGeneratorTarget const* target = nullptr)
: Value(v)
, IsPath(p)
, Target(target)
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index ff19eac..ff0052b 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -161,7 +161,7 @@ void cmComputeTargetDepends::CollectTargets()
std::vector<cmLocalGenerator*> const& lgens =
this->GlobalGenerator->GetLocalGenerators();
for (unsigned int i = 0; i < lgens.size(); ++i) {
- const std::vector<cmGeneratorTarget*> targets =
+ const std::vector<cmGeneratorTarget*>& targets =
lgens[i]->GetGeneratorTargets();
for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin();
ti != targets.end(); ++ti) {
@@ -290,7 +290,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(
// within the project.
if (dependee && dependee->GetType() == cmStateEnums::EXECUTABLE &&
!dependee->IsExecutableWithExports()) {
- dependee = CM_NULLPTR;
+ dependee = nullptr;
}
if (dependee) {
@@ -348,7 +348,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
// within the project.
if (linking && dependee && dependee->GetType() == cmStateEnums::EXECUTABLE &&
!dependee->IsExecutableWithExports()) {
- dependee = CM_NULLPTR;
+ dependee = nullptr;
}
if (dependee) {
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index 2bacf73..f4d48d2 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmConditionEvaluator.h"
-#include "cmConfigure.h"
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
#include <sstream>
@@ -139,7 +138,7 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
if ((this->Policy54Status != cmPolicies::WARN &&
this->Policy54Status != cmPolicies::OLD) &&
argument.WasQuoted()) {
- return CM_NULLPTR;
+ return nullptr;
}
const char* def = this->Makefile.GetDefinition(argument.GetValue());
@@ -455,7 +454,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
if (this->IsKeyword(keyCOMMAND, *arg) && argP1 != newArgs.end()) {
cmCommand* command =
this->Makefile.GetState()->GetCommand(argP1->c_str());
- this->HandlePredicate(command != CM_NULLPTR, reducible, arg, newArgs,
+ this->HandlePredicate(command != nullptr, reducible, arg, newArgs,
argP1, argP2);
}
// does a policy exist
@@ -467,7 +466,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
// does a target exist
if (this->IsKeyword(keyTARGET, *arg) && argP1 != newArgs.end()) {
this->HandlePredicate(
- this->Makefile.FindTargetToUse(argP1->GetValue()) != CM_NULLPTR,
+ this->Makefile.FindTargetToUse(argP1->GetValue()) != nullptr,
reducible, arg, newArgs, argP1, argP2);
}
// does a test exist
@@ -475,8 +474,8 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
this->Policy64Status != cmPolicies::WARN) {
if (this->IsKeyword(keyTEST, *arg) && argP1 != newArgs.end()) {
const cmTest* haveTest = this->Makefile.GetTest(argP1->c_str());
- this->HandlePredicate(haveTest != CM_NULLPTR, reducible, arg,
- newArgs, argP1, argP2);
+ this->HandlePredicate(haveTest != nullptr, reducible, arg, newArgs,
+ argP1, argP2);
}
} else if (this->Policy64Status == cmPolicies::WARN &&
this->IsKeyword(keyTEST, *arg)) {
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index 524fdf8..e91471c 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -19,18 +19,14 @@
#cmakedefine HAVE_UNSETENV
#cmakedefine CMAKE_USE_ELF_PARSER
#cmakedefine CMAKE_USE_MACH_PARSER
-#cmakedefine CMAKE_USE_LIBUV
#cmakedefine CMake_HAVE_CXX_AUTO_PTR
#cmakedefine CMake_HAVE_CXX_EQ_DELETE
#cmakedefine CMake_HAVE_CXX_FALLTHROUGH
#cmakedefine CMake_HAVE_CXX_GNU_FALLTHROUGH
#cmakedefine CMake_HAVE_CXX_ATTRIBUTE_FALLTHROUGH
#cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
-#cmakedefine CMake_HAVE_CXX_NULLPTR
#cmakedefine CMake_HAVE_CXX_OVERRIDE
#cmakedefine CMake_HAVE_CXX_UNIQUE_PTR
-#cmakedefine CMake_HAVE_CXX_UNORDERED_MAP
-#cmakedefine CMake_HAVE_CXX_UNORDERED_SET
#define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
#define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
@@ -44,18 +40,12 @@
#define CM_FALLTHROUGH [[fallthrough]]
#elif defined(CMake_HAVE_CXX_GNU_FALLTHROUGH)
#define CM_FALLTHROUGH [[gnu::fallthrough]]
-elif defined(CMake_HAVE_CXX_ATTRIBUTE_FALLTHROUGH)
+#elif defined(CMake_HAVE_CXX_ATTRIBUTE_FALLTHROUGH)
#define CM_FALLTHROUGH __attribute__((fallthrough))
#else
#define CM_FALLTHROUGH
#endif
-#ifdef CMake_HAVE_CXX_NULLPTR
-#define CM_NULLPTR nullptr
-#else
-#define CM_NULLPTR 0
-#endif
-
#ifdef CMake_HAVE_CXX_OVERRIDE
#define CM_OVERRIDE override
#else
diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h
index 6cebbd2..54ca0bf 100644
--- a/Source/cmConfigureFileCommand.h
+++ b/Source/cmConfigureFileCommand.h
@@ -3,7 +3,7 @@
#ifndef cmConfigureFileCommand_h
#define cmConfigureFileCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmConnection.cxx b/Source/cmConnection.cxx
new file mode 100644
index 0000000..f3fc1ef
--- /dev/null
+++ b/Source/cmConnection.cxx
@@ -0,0 +1,158 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmConnection.h"
+
+#include "cmServer.h"
+#include "cm_uv.h"
+
+#include <cassert>
+#include <cstring>
+
+struct write_req_t
+{
+ uv_write_t req;
+ uv_buf_t buf;
+};
+
+void cmEventBasedConnection::on_alloc_buffer(uv_handle_t* handle,
+ size_t suggested_size,
+ uv_buf_t* buf)
+{
+ (void)(handle);
+ char* rawBuffer = new char[suggested_size];
+ *buf = uv_buf_init(rawBuffer, static_cast<unsigned int>(suggested_size));
+}
+
+void cmEventBasedConnection::on_read(uv_stream_t* stream, ssize_t nread,
+ const uv_buf_t* buf)
+{
+ auto conn = reinterpret_cast<cmEventBasedConnection*>(stream->data);
+ if (conn) {
+ if (nread >= 0) {
+ conn->ReadData(std::string(buf->base, buf->base + nread));
+ } else {
+ conn->OnDisconnect(static_cast<int>(nread));
+ }
+ }
+
+ delete[](buf->base);
+}
+
+void cmEventBasedConnection::on_close_delete(uv_handle_t* handle)
+{
+ delete handle;
+}
+
+void cmEventBasedConnection::on_close(uv_handle_t* /*handle*/)
+{
+}
+
+void cmEventBasedConnection::on_write(uv_write_t* req, int status)
+{
+ (void)(status);
+
+ // Free req and buffer
+ write_req_t* wr = reinterpret_cast<write_req_t*>(req);
+ delete[](wr->buf.base);
+ delete wr;
+}
+
+void cmEventBasedConnection::on_new_connection(uv_stream_t* stream, int status)
+{
+ (void)(status);
+ auto conn = reinterpret_cast<cmEventBasedConnection*>(stream->data);
+
+ if (conn) {
+ conn->Connect(stream);
+ }
+}
+
+bool cmEventBasedConnection::IsOpen() const
+{
+ return this->WriteStream != nullptr;
+}
+
+void cmEventBasedConnection::WriteData(const std::string& data)
+{
+ assert(this->WriteStream);
+
+ auto ds = data.size();
+
+ write_req_t* req = new write_req_t;
+ req->req.data = this;
+ req->buf = uv_buf_init(new char[ds], static_cast<unsigned int>(ds));
+ memcpy(req->buf.base, data.c_str(), ds);
+ uv_write(reinterpret_cast<uv_write_t*>(req),
+ static_cast<uv_stream_t*>(this->WriteStream), &req->buf, 1,
+ on_write);
+}
+
+void cmEventBasedConnection::ReadData(const std::string& data)
+{
+ this->RawReadBuffer += data;
+ if (BufferStrategy) {
+ std::string packet = BufferStrategy->BufferMessage(this->RawReadBuffer);
+ do {
+ ProcessRequest(packet);
+ packet = BufferStrategy->BufferMessage(this->RawReadBuffer);
+ } while (!packet.empty());
+
+ } else {
+ ProcessRequest(this->RawReadBuffer);
+ this->RawReadBuffer.clear();
+ }
+}
+
+cmEventBasedConnection::cmEventBasedConnection(
+ cmConnectionBufferStrategy* bufferStrategy)
+ : BufferStrategy(bufferStrategy)
+{
+}
+
+void cmEventBasedConnection::Connect(uv_stream_t* server)
+{
+ (void)server;
+ Server->OnConnected(nullptr);
+}
+
+void cmEventBasedConnection::OnDisconnect(int onerror)
+{
+ (void)onerror;
+ this->OnConnectionShuttingDown();
+ this->Server->OnDisconnect(this);
+}
+
+cmConnection::~cmConnection()
+{
+}
+
+bool cmConnection::OnConnectionShuttingDown()
+{
+ return true;
+}
+
+void cmConnection::SetServer(cmServerBase* s)
+{
+ Server = s;
+}
+
+void cmConnection::ProcessRequest(const std::string& request)
+{
+ Server->ProcessRequest(this, request);
+}
+
+bool cmConnection::OnServeStart(std::string* errString)
+{
+ (void)errString;
+ return true;
+}
+
+bool cmEventBasedConnection::OnConnectionShuttingDown()
+{
+ this->WriteStream->data = nullptr;
+ this->ReadStream->data = nullptr;
+
+ this->ReadStream = nullptr;
+ this->WriteStream = nullptr;
+ return true;
+}
diff --git a/Source/cmConnection.h b/Source/cmConnection.h
new file mode 100644
index 0000000..f9d50de
--- /dev/null
+++ b/Source/cmConnection.h
@@ -0,0 +1,118 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#pragma once
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include "cm_uv.h"
+
+#include <cstddef>
+#include <memory>
+#include <string>
+
+class cmServerBase;
+
+/***
+ * Given a sequence of bytes with any kind of buffering, instances of this
+ * class arrange logical chunks according to whatever the use case is for
+ * the connection.
+ */
+class cmConnectionBufferStrategy
+{
+public:
+ virtual ~cmConnectionBufferStrategy();
+
+ /***
+ * Called whenever with an active raw buffer. If a logical chunk
+ * becomes available, that chunk is returned and that portion is
+ * removed from the rawBuffer
+ *
+ * @param rawBuffer in/out parameter. Receive buffer; the buffer strategy is
+ * free to manipulate this buffer anyway it needs to.
+ *
+ * @return Next chunk from the stream. Returns the empty string if a chunk
+ * isn't ready yet. Users of this interface should repeatedly call this
+ * function until an empty string is returned since its entirely possible
+ * multiple chunks come in a single raw buffer.
+ */
+ virtual std::string BufferMessage(std::string& rawBuffer) = 0;
+
+ /***
+ * Resets the internal state of the buffering
+ */
+ virtual void clear();
+
+ // TODO: There should be a callback / flag set for errors
+};
+
+class cmConnection
+{
+ CM_DISABLE_COPY(cmConnection)
+
+public:
+ cmConnection() {}
+
+ virtual void WriteData(const std::string& data) = 0;
+
+ virtual ~cmConnection();
+
+ virtual bool OnConnectionShuttingDown();
+
+ virtual bool IsOpen() const = 0;
+
+ virtual void SetServer(cmServerBase* s);
+
+ virtual void ProcessRequest(const std::string& request);
+
+ virtual bool OnServeStart(std::string* pString);
+
+protected:
+ cmServerBase* Server = nullptr;
+};
+
+/***
+ * Abstraction of a connection; ties in event callbacks from libuv and notifies
+ * the server when appropriate
+ */
+class cmEventBasedConnection : public cmConnection
+{
+
+public:
+ /***
+ * @param bufferStrategy If no strategy is given, it will process the raw
+ * chunks as they come in. The connection
+ * owns the pointer given.
+ */
+ cmEventBasedConnection(cmConnectionBufferStrategy* bufferStrategy = nullptr);
+
+ virtual void Connect(uv_stream_t* server);
+
+ virtual void ReadData(const std::string& data);
+
+ bool IsOpen() const override;
+
+ void WriteData(const std::string& data) override;
+ bool OnConnectionShuttingDown() override;
+
+ virtual void OnDisconnect(int errorCode);
+ uv_stream_t* ReadStream = nullptr;
+ uv_stream_t* WriteStream = nullptr;
+
+ static void on_close(uv_handle_t* handle);
+ static void on_close_delete(uv_handle_t* handle);
+
+protected:
+ std::string RawReadBuffer;
+
+ std::unique_ptr<cmConnectionBufferStrategy> BufferStrategy;
+
+ static void on_read(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf);
+
+ static void on_write(uv_write_t* req, int status);
+
+ static void on_new_connection(uv_stream_t* stream, int status);
+
+ static void on_alloc_buffer(uv_handle_t* handle, size_t suggested_size,
+ uv_buf_t* buf);
+};
diff --git a/Source/cmContinueCommand.h b/Source/cmContinueCommand.h
index 92bc68e..51f991d 100644
--- a/Source/cmContinueCommand.h
+++ b/Source/cmContinueCommand.h
@@ -3,7 +3,7 @@
#ifndef cmContinueCommand_h
#define cmContinueCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 9a4abf3..86f5282 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCoreTryCompile.h"
-#include "cmConfigure.h"
#include "cmsys/Directory.hxx"
#include <set>
#include <sstream>
@@ -102,7 +101,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
}
const char* sourceDirectory = argv[2].c_str();
- const char* projectName = CM_NULLPTR;
+ const char* projectName = nullptr;
std::string targetName;
std::vector<std::string> cmakeFlags(1, "CMAKE_FLAGS"); // fake argv[0]
std::vector<std::string> compileDefs;
diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h
index f1f1e4b..47fb610 100644
--- a/Source/cmCreateTestSourceList.h
+++ b/Source/cmCreateTestSourceList.h
@@ -3,7 +3,7 @@
#ifndef cmCreateTestSourceList_h
#define cmCreateTestSourceList_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index 7995b2c..623c5e0 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -75,7 +75,7 @@ CM_AUTO_PTR<cmCryptoHash> cmCryptoHash::New(const char* algo)
if (strcmp(algo, "SHA3_512") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHash(AlgoSHA3_512));
}
- return CM_AUTO_PTR<cmCryptoHash>(CM_NULLPTR);
+ return CM_AUTO_PTR<cmCryptoHash>(nullptr);
}
bool cmCryptoHash::IntFromHexDigit(char input, char& output)
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h
index c380d85..9c13968 100644
--- a/Source/cmCryptoHash.h
+++ b/Source/cmCryptoHash.h
@@ -3,7 +3,7 @@
#ifndef cmCryptoHash_h
#define cmCryptoHash_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <stddef.h>
#include <string>
diff --git a/Source/cmCurl.h b/Source/cmCurl.h
index a2fa4b1..0688bb2 100644
--- a/Source/cmCurl.h
+++ b/Source/cmCurl.h
@@ -3,11 +3,11 @@
#ifndef cmCurl_h
#define cmCurl_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cm_curl.h"
#include <string>
-std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = CM_NULLPTR);
+std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = nullptr);
#endif
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index 5e377b5..cfd260c 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -4,8 +4,6 @@
#include "cmMakefile.h"
-#include "cmConfigure.h"
-
cmCustomCommand::cmCustomCommand()
: Backtrace()
{
@@ -30,7 +28,7 @@ cmCustomCommand::cmCustomCommand(cmMakefile const* mf,
, Backtrace()
, Comment(comment ? comment : "")
, WorkingDirectory(workingDirectory ? workingDirectory : "")
- , HaveComment(comment != CM_NULLPTR)
+ , HaveComment(comment != nullptr)
, EscapeAllowMakeVars(false)
, EscapeOldStyle(true)
, CommandExpandLists(false)
@@ -62,7 +60,7 @@ const cmCustomCommandLines& cmCustomCommand::GetCommandLines() const
const char* cmCustomCommand::GetComment() const
{
- const char* no_comment = CM_NULLPTR;
+ const char* no_comment = nullptr;
return this->HaveComment ? this->Comment.c_str() : no_comment;
}
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 67213ec..fdc0a97 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -13,8 +13,6 @@
#include "cmSystemTools.h"
#include "cm_auto_ptr.hxx"
-#include "cmConfigure.h"
-
cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
const std::string& config,
cmLocalGenerator* lg)
@@ -24,7 +22,6 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
, OldStyle(cc.GetEscapeOldStyle())
, MakeVars(cc.GetEscapeAllowMakeVars())
, GE(new cmGeneratorExpression(cc.GetBacktrace()))
- , DependsDone(false)
{
const cmCustomCommandLines& cmdlines = this->CC.GetCommandLines();
for (cmCustomCommandLines::const_iterator cmdline = cmdlines.begin();
@@ -44,6 +41,22 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
}
this->CommandLines.push_back(argv);
}
+
+ std::vector<std::string> depends = this->CC.GetDepends();
+ for (std::vector<std::string>::const_iterator i = depends.begin();
+ i != depends.end(); ++i) {
+ CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(*i);
+ std::vector<std::string> result;
+ cmSystemTools::ExpandListArgument(cge->Evaluate(this->LG, this->Config),
+ result);
+ for (std::vector<std::string>::iterator it = result.begin();
+ it != result.end(); ++it) {
+ if (cmSystemTools::FileIsFullPath(it->c_str())) {
+ *it = cmSystemTools::CollapseFullPath(*it);
+ }
+ }
+ this->Depends.insert(this->Depends.end(), result.begin(), result.end());
+ }
}
cmCustomCommandGenerator::~cmCustomCommandGenerator()
@@ -60,7 +73,7 @@ const char* cmCustomCommandGenerator::GetCrossCompilingEmulator(
unsigned int c) const
{
if (!this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")) {
- return CM_NULLPTR;
+ return nullptr;
}
std::string const& argv0 = this->CommandLines[c][0];
cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0);
@@ -68,7 +81,7 @@ const char* cmCustomCommandGenerator::GetCrossCompilingEmulator(
!target->IsImported()) {
return target->GetProperty("CROSSCOMPILING_EMULATOR");
}
- return CM_NULLPTR;
+ return nullptr;
}
const char* cmCustomCommandGenerator::GetArgv0Location(unsigned int c) const
@@ -81,7 +94,7 @@ const char* cmCustomCommandGenerator::GetArgv0Location(unsigned int c) const
!this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING"))) {
return target->GetLocation(this->Config);
}
- return CM_NULLPTR;
+ return nullptr;
}
std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
@@ -125,14 +138,13 @@ void cmCustomCommandGenerator::AppendArguments(unsigned int c,
std::string& cmd) const
{
unsigned int offset = 1;
- if (this->GetCrossCompilingEmulator(c) != CM_NULLPTR) {
+ if (this->GetCrossCompilingEmulator(c) != nullptr) {
offset = 0;
}
cmCustomCommandLine const& commandLine = this->CommandLines[c];
for (unsigned int j = offset; j < commandLine.size(); ++j) {
std::string arg;
- if (const char* location =
- j == 0 ? this->GetArgv0Location(c) : CM_NULLPTR) {
+ if (const char* location = j == 0 ? this->GetArgv0Location(c) : nullptr) {
// GetCommand returned the emulator instead of the argv0 location,
// so transform the latter now.
arg = location;
@@ -171,23 +183,5 @@ std::vector<std::string> const& cmCustomCommandGenerator::GetByproducts() const
std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const
{
- if (!this->DependsDone) {
- this->DependsDone = true;
- std::vector<std::string> depends = this->CC.GetDepends();
- for (std::vector<std::string>::const_iterator i = depends.begin();
- i != depends.end(); ++i) {
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(*i);
- std::vector<std::string> result;
- cmSystemTools::ExpandListArgument(cge->Evaluate(this->LG, this->Config),
- result);
- for (std::vector<std::string>::iterator it = result.begin();
- it != result.end(); ++it) {
- if (cmSystemTools::FileIsFullPath(it->c_str())) {
- *it = cmSystemTools::CollapseFullPath(*it);
- }
- }
- this->Depends.insert(this->Depends.end(), result.begin(), result.end());
- }
- }
return this->Depends;
}
diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h
index 0a2adb5..ea33b51 100644
--- a/Source/cmCustomCommandGenerator.h
+++ b/Source/cmCustomCommandGenerator.h
@@ -21,9 +21,8 @@ class cmCustomCommandGenerator
bool OldStyle;
bool MakeVars;
cmGeneratorExpression* GE;
- mutable bool DependsDone;
- mutable std::vector<std::string> Depends;
cmCustomCommandLines CommandLines;
+ std::vector<std::string> Depends;
const char* GetCrossCompilingEmulator(unsigned int c) const;
const char* GetArgv0Location(unsigned int c) const;
diff --git a/Source/cmDefinePropertyCommand.h b/Source/cmDefinePropertyCommand.h
index bc120c5..43f6c58 100644
--- a/Source/cmDefinePropertyCommand.h
+++ b/Source/cmDefinePropertyCommand.h
@@ -3,7 +3,7 @@
#ifndef cmDefinesPropertyCommand_h
#define cmDefinesPropertyCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 7aa7641..021f2e8 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmDefinitions.h"
-#include "cmConfigure.h"
#include <assert.h>
#include <set>
#include <utility>
@@ -35,7 +34,7 @@ const char* cmDefinitions::Get(const std::string& key, StackIter begin,
StackIter end)
{
Def const& def = cmDefinitions::GetInternal(key, begin, end, false);
- return def.Exists ? def.c_str() : CM_NULLPTR;
+ return def.Exists ? def.c_str() : nullptr;
}
void cmDefinitions::Raise(const std::string& key, StackIter begin,
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index ddb8918..528b157 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -6,10 +6,10 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
+#include <unordered_map>
#include <vector>
#include "cmLinkedTree.h"
-#include "cm_unordered_map.hxx"
/** \class cmDefinitions
* \brief Store a scope of variable definitions for CMake language.
@@ -70,7 +70,7 @@ private:
};
static Def NoDef;
- typedef CM_UNORDERED_MAP<std::string, Def> MapType;
+ typedef std::unordered_map<std::string, Def> MapType;
MapType Map;
static Def const& GetInternal(const std::string& key, StackIter begin,
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index c898d12..a0775b3 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -18,7 +18,7 @@ cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir)
: CompileDirectory()
, LocalGenerator(lg)
, Verbose(false)
- , FileComparison(CM_NULLPTR)
+ , FileComparison(nullptr)
, TargetDirectory(targetDir)
, MaxPath(16384)
, Dependee(new char[MaxPath])
@@ -125,7 +125,7 @@ bool cmDepends::CheckDependencies(
// regenerated.
bool okay = true;
bool dependerExists = false;
- DependencyVector* currentDependencies = CM_NULLPTR;
+ DependencyVector* currentDependencies = nullptr;
while (internalDepends.getline(this->Dependee, this->MaxPath)) {
if (this->Dependee[0] == 0 || this->Dependee[0] == '#' ||
@@ -167,7 +167,7 @@ bool cmDepends::CheckDependencies(
bool regenerate = false;
const char* dependee = this->Dependee + 1;
const char* depender = this->Depender;
- if (currentDependencies != CM_NULLPTR) {
+ if (currentDependencies != nullptr) {
currentDependencies->push_back(dependee);
}
@@ -227,9 +227,9 @@ bool cmDepends::CheckDependencies(
// Remove the information of this depender from the map, it needs
// to be rescanned
- if (currentDependencies != CM_NULLPTR) {
+ if (currentDependencies != nullptr) {
validDeps.erase(this->Depender);
- currentDependencies = CM_NULLPTR;
+ currentDependencies = nullptr;
}
// Remove the depender to be sure it is rebuilt.
@@ -246,7 +246,7 @@ bool cmDepends::CheckDependencies(
void cmDepends::SetIncludePathFromLanguage(const std::string& lang)
{
// Look for the new per "TARGET_" variant first:
- const char* includePath = CM_NULLPTR;
+ const char* includePath = nullptr;
std::string includePathVar = "CMAKE_";
includePathVar += lang;
includePathVar += "_TARGET_INCLUDE_PATH";
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index b33feb9..a4fee3c 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -3,7 +3,7 @@
#ifndef cmDepends_h
#define cmDepends_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <map>
@@ -29,7 +29,7 @@ class 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 = CM_NULLPTR, const char* targetDir = "");
+ cmDepends(cmLocalGenerator* lg = nullptr, const char* targetDir = "");
/** at what level will the compile be done from */
void SetCompileDirectory(const char* dir) { this->CompileDirectory = dir; }
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 2c464cc..588a78c 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -20,7 +20,7 @@
#define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: "
cmDependsC::cmDependsC()
- : ValidDeps(CM_NULLPTR)
+ : ValidDeps(nullptr)
{
}
@@ -96,7 +96,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
std::set<std::string> dependencies;
bool haveDeps = false;
- if (this->ValidDeps != CM_NULLPTR) {
+ if (this->ValidDeps != nullptr) {
std::map<std::string, DependencyVector>::const_iterator tmpIt =
this->ValidDeps->find(obj);
if (tmpIt != this->ValidDeps->end()) {
@@ -107,7 +107,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
if (!haveDeps) {
// Walk the dependency graph starting with the source file.
- int srcFiles = (int)sources.size();
+ int srcFiles = static_cast<int>(sources.size());
this->Encountered.clear();
for (std::set<std::string>::const_iterator srcIt = sources.begin();
@@ -259,12 +259,12 @@ void cmDependsC::ReadCacheFile()
}
std::string line;
- cmIncludeLines* cacheEntry = CM_NULLPTR;
+ cmIncludeLines* cacheEntry = nullptr;
bool haveFileName = false;
while (cmSystemTools::GetLineFromStream(fin, line)) {
if (line.empty()) {
- cacheEntry = CM_NULLPTR;
+ cacheEntry = nullptr;
haveFileName = false;
continue;
}
@@ -302,7 +302,7 @@ void cmDependsC::ReadCacheFile()
}
}
}
- } else if (cacheEntry != CM_NULLPTR) {
+ } else if (cacheEntry != nullptr) {
UnscannedEntry entry;
entry.FileName = line;
if (cmSystemTools::GetLineFromStream(fin, line)) {
diff --git a/Source/cmDependsC.h b/Source/cmDependsC.h
index 250d40f..7780ccf 100644
--- a/Source/cmDependsC.h
+++ b/Source/cmDependsC.h
@@ -3,7 +3,7 @@
#ifndef cmDependsC_h
#define cmDependsC_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmDepends.h"
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 8b05fab..e149a19 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -52,7 +52,7 @@ public:
};
cmDependsFortran::cmDependsFortran()
- : Internal(CM_NULLPTR)
+ : Internal(nullptr)
{
}
diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h
index ec208af..42879f1 100644
--- a/Source/cmDependsFortran.h
+++ b/Source/cmDependsFortran.h
@@ -3,7 +3,7 @@
#ifndef cmFortran_h
#define cmFortran_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <set>
diff --git a/Source/cmDependsJava.h b/Source/cmDependsJava.h
index a07bf09..4fd5960 100644
--- a/Source/cmDependsJava.h
+++ b/Source/cmDependsJava.h
@@ -3,7 +3,7 @@
#ifndef cmDependsJava_h
#define cmDependsJava_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmDepends.h"
diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx
index 7bc91bf..3a57a38 100644
--- a/Source/cmDependsJavaParserHelper.cxx
+++ b/Source/cmDependsJavaParserHelper.cxx
@@ -2,8 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmDependsJavaParserHelper.h"
-#include "cmConfigure.h"
-
#include "cmDependsJavaLexer.h"
#include "cmSystemTools.h"
@@ -57,7 +55,7 @@ void cmDependsJavaParserHelper::DeallocateParserType(char** pt)
if (!*pt) {
return;
}
- *pt = CM_NULLPTR;
+ *pt = nullptr;
this->UnionsAvailable--;
}
@@ -96,9 +94,9 @@ void cmDependsJavaParserHelper::SafePrintMissing(const char* str, int line,
for (cc = 0; cc < strlen(str); cc++) {
unsigned char ch = str[cc];
if (ch >= 32 && ch <= 126) {
- std::cout << (char)ch;
+ std::cout << static_cast<char>(ch);
} else {
- std::cout << "<" << (int)ch << ">";
+ std::cout << "<" << static_cast<int>(ch) << ">";
break;
}
}
@@ -158,15 +156,15 @@ void cmDependsJavaParserHelper::PrepareElement(
cmDependsJavaParserHelper::ParserType* me)
{
// Inititalize self
- me->str = CM_NULLPTR;
+ me->str = nullptr;
}
void cmDependsJavaParserHelper::AllocateParserType(
cmDependsJavaParserHelper::ParserType* pt, const char* str, int len)
{
- pt->str = CM_NULLPTR;
+ pt->str = nullptr;
if (len == 0) {
- len = (int)strlen(str);
+ len = static_cast<int>(strlen(str));
}
if (len == 0) {
return;
@@ -224,7 +222,7 @@ std::vector<std::string> cmDependsJavaParserHelper::GetFilesProduced()
std::vector<CurrentClass>::const_iterator it;
for (it = toplevel.NestedClasses.begin(); it != toplevel.NestedClasses.end();
++it) {
- it->AddFileNamesForPrinting(&files, CM_NULLPTR, "$");
+ it->AddFileNamesForPrinting(&files, nullptr, "$");
}
return files;
}
@@ -324,7 +322,7 @@ void cmDependsJavaParserHelper::Error(const char* str)
void cmDependsJavaParserHelper::UpdateCombine(const char* str1,
const char* str2)
{
- if (this->CurrentCombine == "" && str1 != CM_NULLPTR) {
+ if (this->CurrentCombine == "" && str1 != nullptr) {
this->CurrentCombine = str1;
}
this->CurrentCombine += ".";
diff --git a/Source/cmDisallowedCommand.h b/Source/cmDisallowedCommand.h
index 0030116..d5bb79a 100644
--- a/Source/cmDisallowedCommand.h
+++ b/Source/cmDisallowedCommand.h
@@ -3,7 +3,7 @@
#ifndef cmDisallowedCommand_h
#define cmDisallowedCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index c6286b3..4af44b4 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -41,12 +41,12 @@ static const char* cmDocumentationStandardOptions[][2] = {
{ "--help-variable-list [<f>]",
"List variables with help available and exit." },
{ "--help-variables [<f>]", "Print cmake-variables manual and exit." },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, nullptr }
};
static const char* cmDocumentationGeneratorsHeader[][2] = {
- { CM_NULLPTR, "The following generators are available on this platform:" },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, "The following generators are available on this platform:" },
+ { nullptr, nullptr }
};
cmDocumentation::cmDocumentation()
@@ -403,7 +403,7 @@ void cmDocumentation::SetSections(
void cmDocumentation::PrependSection(const char* name, const char* docs[][2])
{
- cmDocumentationSection* sec = CM_NULLPTR;
+ cmDocumentationSection* sec = nullptr;
if (this->AllSections.find(name) == this->AllSections.end()) {
sec =
new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
@@ -417,7 +417,7 @@ void cmDocumentation::PrependSection(const char* name, const char* docs[][2])
void cmDocumentation::PrependSection(const char* name,
std::vector<cmDocumentationEntry>& docs)
{
- cmDocumentationSection* sec = CM_NULLPTR;
+ cmDocumentationSection* sec = nullptr;
if (this->AllSections.find(name) == this->AllSections.end()) {
sec =
new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
@@ -430,7 +430,7 @@ void cmDocumentation::PrependSection(const char* name,
void cmDocumentation::AppendSection(const char* name, const char* docs[][2])
{
- cmDocumentationSection* sec = CM_NULLPTR;
+ cmDocumentationSection* sec = nullptr;
if (this->AllSections.find(name) == this->AllSections.end()) {
sec =
new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
@@ -444,7 +444,7 @@ void cmDocumentation::AppendSection(const char* name, const char* docs[][2])
void cmDocumentation::AppendSection(const char* name,
std::vector<cmDocumentationEntry>& docs)
{
- cmDocumentationSection* sec = CM_NULLPTR;
+ cmDocumentationSection* sec = nullptr;
if (this->AllSections.find(name) == this->AllSections.end()) {
sec =
new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index 2866fef..c80bed1 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -3,7 +3,7 @@
#ifndef _cmDocumentation_h
#define _cmDocumentation_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmDocumentationFormatter.h"
@@ -32,7 +32,7 @@ public:
* help arguments.
*/
bool CheckOptions(int argc, const char* const* argv,
- const char* exitOpt = CM_NULLPTR);
+ const char* exitOpt = nullptr);
/**
* Print help requested on the command line. Call after
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx
index 7fbe75c..2fe0360 100644
--- a/Source/cmDynamicLoader.cxx
+++ b/Source/cmDynamicLoader.cxx
@@ -22,7 +22,7 @@ private:
static cmDynamicLoaderCache* Instance;
};
-cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = CM_NULLPTR;
+cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = nullptr;
cmDynamicLoaderCache::~cmDynamicLoaderCache()
{
@@ -71,7 +71,7 @@ void cmDynamicLoaderCache::FlushCache()
cmsys::DynamicLoader::CloseLibrary(it->second);
}
delete cmDynamicLoaderCache::Instance;
- cmDynamicLoaderCache::Instance = CM_NULLPTR;
+ cmDynamicLoaderCache::Instance = nullptr;
}
cmDynamicLoaderCache* cmDynamicLoaderCache::GetInstance()
diff --git a/Source/cmDynamicLoader.h b/Source/cmDynamicLoader.h
index 7c46dd5..61d3b46 100644
--- a/Source/cmDynamicLoader.h
+++ b/Source/cmDynamicLoader.h
@@ -8,7 +8,7 @@
#ifndef cmDynamicLoader_h
#define cmDynamicLoader_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmsys/DynamicLoader.hxx" // IWYU pragma: export
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index fc97bf3..e2655e7 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -594,7 +594,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
if (dssi->second.Position > 0) {
return &dssi->second;
}
- return CM_NULLPTR;
+ return nullptr;
}
// Create an entry for this tag. Assume it is missing until found.
@@ -605,14 +605,14 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
// Try reading the dynamic section.
if (!this->LoadDynamicSection()) {
- return CM_NULLPTR;
+ return nullptr;
}
// Get the string table referenced by the DYNAMIC section.
ELF_Shdr const& sec = this->SectionHeaders[this->DynamicSectionIndex];
if (sec.sh_link >= this->SectionHeaders.size()) {
this->SetErrorMessage("Section DYNAMIC has invalid string table index.");
- return CM_NULLPTR;
+ return nullptr;
}
ELF_Shdr const& strtab = this->SectionHeaders[sec.sh_link];
@@ -627,7 +627,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
if (dyn.d_un.d_val >= strtab.sh_size) {
this->SetErrorMessage("Section DYNAMIC references string beyond "
"the end of its string section.");
- return CM_NULLPTR;
+ return nullptr;
}
// Seek to the position reported by the entry.
@@ -656,7 +656,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
if (!this->Stream) {
this->SetErrorMessage("Dynamic section specifies unreadable RPATH.");
se.Value = "";
- return CM_NULLPTR;
+ return nullptr;
}
// The value has been read successfully. Report it.
@@ -667,7 +667,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
return &se;
}
}
- return CM_NULLPTR;
+ return nullptr;
}
//============================================================================
@@ -683,7 +683,7 @@ const long cmELF::TagMipsRldMapRel = 0;
#endif
cmELF::cmELF(const char* fname)
- : Internal(CM_NULLPTR)
+ : Internal(nullptr)
{
// Try to open the file.
CM_AUTO_PTR<cmsys::ifstream> fin(new cmsys::ifstream(fname));
@@ -811,7 +811,7 @@ cmELF::StringEntry const* cmELF::GetSOName()
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary) {
return this->Internal->GetSOName();
}
- return CM_NULLPTR;
+ return nullptr;
}
cmELF::StringEntry const* cmELF::GetRPath()
@@ -821,7 +821,7 @@ cmELF::StringEntry const* cmELF::GetRPath()
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) {
return this->Internal->GetRPath();
}
- return CM_NULLPTR;
+ return nullptr;
}
cmELF::StringEntry const* cmELF::GetRunPath()
@@ -831,7 +831,7 @@ cmELF::StringEntry const* cmELF::GetRunPath()
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) {
return this->Internal->GetRunPath();
}
- return CM_NULLPTR;
+ return nullptr;
}
void cmELF::PrintInfo(std::ostream& os) const
diff --git a/Source/cmELF.h b/Source/cmELF.h
index a6e407f..678a595 100644
--- a/Source/cmELF.h
+++ b/Source/cmELF.h
@@ -3,7 +3,7 @@
#ifndef cmELF_h
#define cmELF_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <string>
diff --git a/Source/cmEnableLanguageCommand.h b/Source/cmEnableLanguageCommand.h
index 33c1c22..2b8cc24 100644
--- a/Source/cmEnableLanguageCommand.h
+++ b/Source/cmEnableLanguageCommand.h
@@ -3,7 +3,7 @@
#ifndef cmEnableLanguageCommand_h
#define cmEnableLanguageCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmEnableTestingCommand.h b/Source/cmEnableTestingCommand.h
index e249662..1743b25 100644
--- a/Source/cmEnableTestingCommand.h
+++ b/Source/cmEnableTestingCommand.h
@@ -3,7 +3,7 @@
#ifndef cmEnableTestingCommand_h
#define cmEnableTestingCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx
index fcc3c45..3c39816 100644
--- a/Source/cmExecProgramCommand.cxx
+++ b/Source/cmExecProgramCommand.cxx
@@ -86,7 +86,7 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args,
args[1].c_str(), verbose);
} else {
result = cmExecProgramCommand::RunCommand(command.c_str(), output, retVal,
- CM_NULLPTR, verbose);
+ nullptr, verbose);
}
if (!result) {
retVal = -1;
@@ -205,7 +205,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output,
}
fflush(stdout);
fflush(stderr);
- const char* cmd[] = { "/bin/sh", "-c", command, CM_NULLPTR };
+ const char* cmd[] = { "/bin/sh", "-c", command, nullptr };
cmsysProcess_SetCommand(cp, cmd);
#endif
@@ -217,7 +217,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output,
int p;
cmProcessOutput processOutput(encoding);
std::string strdata;
- while ((p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) {
+ while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) {
if (p == cmsysProcess_Pipe_STDOUT || p == cmsysProcess_Pipe_STDERR) {
if (verbose) {
processOutput.DecodeText(data, length, strdata);
@@ -235,7 +235,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output,
}
// All output has been read. Wait for the process to exit.
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
processOutput.DecodeText(output, output);
// Check the result of running the process.
diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h
index 6463c4d..e3d696e 100644
--- a/Source/cmExecProgramCommand.h
+++ b/Source/cmExecProgramCommand.h
@@ -3,7 +3,7 @@
#ifndef cmExecProgramCommand_h
#define cmExecProgramCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
@@ -38,8 +38,7 @@ public:
private:
static bool RunCommand(const char* command, std::string& output, int& retVal,
- const char* directory = CM_NULLPTR,
- bool verbose = true,
+ const char* directory = nullptr, bool verbose = true,
Encoding encoding = cmProcessOutput::Auto);
};
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index 8c10dbe..408497b 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -7,6 +7,7 @@
#include <sstream>
#include <stdio.h>
+#include "cmAlgorithms.h"
#include "cmMakefile.h"
#include "cmProcessOutput.h"
#include "cmSystemTools.h"
@@ -15,7 +16,7 @@ class cmExecutionStatus;
static bool cmExecuteProcessCommandIsWhitespace(char c)
{
- return (isspace((int)c) || c == '\n' || c == '\r');
+ return (isspace(static_cast<int>(c)) || c == '\n' || c == '\r');
}
void cmExecuteProcessCommandFixText(std::vector<char>& output,
@@ -46,6 +47,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
std::string output_variable;
std::string error_variable;
std::string result_variable;
+ std::string results_variable;
std::string working_directory;
cmProcessOutput::Encoding encoding = cmProcessOutput::None;
for (size_t i = 0; i < args.size(); ++i) {
@@ -77,6 +79,14 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
this->SetError(" called with no value for RESULT_VARIABLE.");
return false;
}
+ } else if (args[i] == "RESULTS_VARIABLE") {
+ doing_command = false;
+ if (++i < args.size()) {
+ results_variable = args[i];
+ } else {
+ this->SetError(" called with no value for RESULTS_VARIABLE.");
+ return false;
+ }
} else if (args[i] == "WORKING_DIRECTORY") {
doing_command = false;
if (++i < args.size()) {
@@ -166,7 +176,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
return false;
}
// Add the null terminating pointer to the command argument list.
- cmds[i].push_back(CM_NULLPTR);
+ cmds[i].push_back(nullptr);
}
// Parse the timeout string.
@@ -234,7 +244,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
int p;
cmProcessOutput processOutput(encoding);
std::string strdata;
- while ((p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) {
+ while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) {
// Put the output in the right place.
if (p == cmsysProcess_Pipe_STDOUT && !output_quiet) {
if (output_variable.empty()) {
@@ -266,7 +276,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
}
// All output has been read. Wait for the process to exit.
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
processOutput.DecodeText(tempOutput, tempOutput);
processOutput.DecodeText(tempError, tempError);
@@ -287,7 +297,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
switch (cmsysProcess_GetState(cp)) {
case cmsysProcess_State_Exited: {
int v = cmsysProcess_GetExitValue(cp);
- char buf[100];
+ char buf[16];
sprintf(buf, "%d", v);
this->Makefile->AddDefinition(result_variable, buf);
} break;
@@ -305,6 +315,47 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
break;
}
}
+ // Store the result of running the processes.
+ if (!results_variable.empty()) {
+ switch (cmsysProcess_GetState(cp)) {
+ case cmsysProcess_State_Exited: {
+ std::vector<std::string> res;
+ for (size_t i = 0; i < cmds.size(); ++i) {
+ switch (cmsysProcess_GetStateByIndex(cp, static_cast<int>(i))) {
+ case kwsysProcess_StateByIndex_Exited: {
+ int exitCode =
+ cmsysProcess_GetExitValueByIndex(cp, static_cast<int>(i));
+ char buf[16];
+ sprintf(buf, "%d", exitCode);
+ res.push_back(buf);
+ } break;
+ case kwsysProcess_StateByIndex_Exception:
+ res.push_back(cmsysProcess_GetExceptionStringByIndex(
+ cp, static_cast<int>(i)));
+ break;
+ case kwsysProcess_StateByIndex_Error:
+ default:
+ res.push_back("Error getting the child return code");
+ break;
+ }
+ }
+ this->Makefile->AddDefinition(results_variable,
+ cmJoin(res, ";").c_str());
+ } break;
+ case cmsysProcess_State_Exception:
+ this->Makefile->AddDefinition(results_variable,
+ cmsysProcess_GetExceptionString(cp));
+ break;
+ case cmsysProcess_State_Error:
+ this->Makefile->AddDefinition(results_variable,
+ cmsysProcess_GetErrorString(cp));
+ break;
+ case cmsysProcess_State_Expired:
+ this->Makefile->AddDefinition(results_variable,
+ "Process terminated due to timeout");
+ break;
+ }
+ }
// Delete the process instance.
cmsysProcess_Delete(cp);
diff --git a/Source/cmExecuteProcessCommand.h b/Source/cmExecuteProcessCommand.h
index 08fde0a..dcf7b1c 100644
--- a/Source/cmExecuteProcessCommand.h
+++ b/Source/cmExecuteProcessCommand.h
@@ -3,7 +3,7 @@
#ifndef cmExecuteProcessCommand_h
#define cmExecuteProcessCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx
index b443fb0..8662e8a 100644
--- a/Source/cmExportBuildAndroidMKGenerator.cxx
+++ b/Source/cmExportBuildAndroidMKGenerator.cxx
@@ -21,8 +21,8 @@
cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator()
{
- this->LG = CM_NULLPTR;
- this->ExportSet = CM_NULLPTR;
+ this->LG = nullptr;
+ this->ExportSet = nullptr;
}
void cmExportBuildAndroidMKGenerator::GenerateImportHeaderCode(
diff --git a/Source/cmExportBuildAndroidMKGenerator.h b/Source/cmExportBuildAndroidMKGenerator.h
index d028ef4..db386f0 100644
--- a/Source/cmExportBuildAndroidMKGenerator.h
+++ b/Source/cmExportBuildAndroidMKGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmExportBuildAndroidMKGenerator_h
#define cmExportBuildAndroidMKGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <string>
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index a1c424a..6e182b7 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -26,8 +26,8 @@ class cmSourceFile;
cmExportBuildFileGenerator::cmExportBuildFileGenerator()
{
- this->LG = CM_NULLPTR;
- this->ExportSet = CM_NULLPTR;
+ this->LG = nullptr;
+ this->ExportSet = nullptr;
}
void cmExportBuildFileGenerator::Compute(cmLocalGenerator* lg)
@@ -233,7 +233,7 @@ void cmExportBuildFileGenerator::HandleMissingTarget(
dependee->GetLocalGenerator()->GetGlobalGenerator();
std::vector<std::string> namespaces = this->FindNamespaces(gg, name);
- int targetOccurrences = (int)namespaces.size();
+ int targetOccurrences = static_cast<int>(namespaces.size());
if (targetOccurrences == 1) {
std::string missingTarget = namespaces[0];
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index 0556983..d509453 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmExportBuildFileGenerator_h
#define cmExportBuildFileGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmExportFileGenerator.h"
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 38cd511..64baa90 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -35,7 +35,7 @@ cmExportCommand::cmExportCommand()
, ExportOld(&Helper, "EXPORT_LINK_INTERFACE_LIBRARIES", &ArgumentGroup)
, AndroidMKFile(&Helper, "ANDROID_MK")
{
- this->ExportSet = CM_NULLPTR;
+ this->ExportSet = nullptr;
}
// cmExportCommand
@@ -51,10 +51,10 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args,
return this->HandlePackage(args);
}
if (args[0] == "EXPORT") {
- this->ExportSetName.Follows(CM_NULLPTR);
+ this->ExportSetName.Follows(nullptr);
this->ArgumentGroup.Follows(&this->ExportSetName);
} else {
- this->Targets.Follows(CM_NULLPTR);
+ this->Targets.Follows(nullptr);
this->ArgumentGroup.Follows(&this->Targets);
}
@@ -186,7 +186,7 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args,
}
// Setup export file generation.
- cmExportBuildFileGenerator* ebfg = CM_NULLPTR;
+ cmExportBuildFileGenerator* ebfg = nullptr;
if (android) {
ebfg = new cmExportBuildAndroidMKGenerator;
} else {
diff --git a/Source/cmExportCommand.h b/Source/cmExportCommand.h
index c47bc42..7b6ad11 100644
--- a/Source/cmExportCommand.h
+++ b/Source/cmExportCommand.h
@@ -3,7 +3,7 @@
#ifndef cmExportCommand_h
#define cmExportCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmExportInstallAndroidMKGenerator.h b/Source/cmExportInstallAndroidMKGenerator.h
index ebef783..bb43513 100644
--- a/Source/cmExportInstallAndroidMKGenerator.h
+++ b/Source/cmExportInstallAndroidMKGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmExportInstallAndroidMKGenerator_h
#define cmExportInstallAndroidMKGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <set>
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 664a342..350dc19 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -445,7 +445,7 @@ void cmExportInstallFileGenerator::HandleMissingTarget(
const std::string name = dependee->GetName();
cmGlobalGenerator* gg = dependee->GetLocalGenerator()->GetGlobalGenerator();
std::vector<std::string> namespaces = this->FindNamespaces(gg, name);
- int targetOccurrences = (int)namespaces.size();
+ int targetOccurrences = static_cast<int>(namespaces.size());
if (targetOccurrences == 1) {
std::string missingTarget = namespaces[0];
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h
index 8fa9b7f..e535873 100644
--- a/Source/cmExportInstallFileGenerator.h
+++ b/Source/cmExportInstallFileGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmExportInstallFileGenerator_h
#define cmExportInstallFileGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmExportFileGenerator.h"
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
index 69150ae..a1fdeae 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -4,6 +4,7 @@
#include "cmsys/FStream.hxx"
#include <map>
+#include <unordered_map>
#include <utility>
#include "cmGeneratedFileStream.h"
@@ -14,7 +15,6 @@
#include "cmTarget.h"
#include "cmTargetLinkLibraryType.h"
#include "cm_auto_ptr.hxx"
-#include "cm_unordered_map.hxx"
#include "cmake.h"
class cmExecutionStatus;
diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h
index 5559af9..286a3e0 100644
--- a/Source/cmExportLibraryDependenciesCommand.h
+++ b/Source/cmExportLibraryDependenciesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmExportLibraryDependenciesCommand_h
#define cmExportLibraryDependenciesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index cd0a7e6..54e0e71 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -62,8 +62,8 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
cmGeneratorExpression ge;
- cmGeneratorExpressionDAGChecker dagChecker(tgt->GetName(), propName,
- CM_NULLPTR, CM_NULLPTR);
+ cmGeneratorExpressionDAGChecker dagChecker(tgt->GetName(), propName, nullptr,
+ nullptr);
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h
index 9671fac..9f6ac03 100644
--- a/Source/cmExportTryCompileFileGenerator.h
+++ b/Source/cmExportTryCompileFileGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmExportTryCompileFileGenerator_h
#define cmExportTryCompileFileGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmExportFileGenerator.h"
diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx
index c3f026a..fe7159a 100644
--- a/Source/cmExprParserHelper.cxx
+++ b/Source/cmExprParserHelper.cxx
@@ -2,8 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExprParserHelper.h"
-#include "cmConfigure.h"
-
#include "cmExprLexer.h"
#include <iostream>
@@ -14,7 +12,7 @@ int cmExpr_yyparse(yyscan_t yyscanner);
cmExprParserHelper::cmExprParserHelper()
{
this->FileLine = -1;
- this->FileName = CM_NULLPTR;
+ this->FileName = nullptr;
}
cmExprParserHelper::~cmExprParserHelper()
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 5b7b827..547fc99 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -4,6 +4,7 @@
#include <map>
#include <ostream>
+#include <set>
#include <string.h>
#include <utility>
@@ -95,7 +96,7 @@ struct Tree
{
std::string path; // only one component of the path
std::vector<Tree> folders;
- std::vector<std::string> files;
+ std::set<std::string> files;
void InsertPath(const std::vector<std::string>& splitted,
std::vector<std::string>::size_type start,
const std::string& fileName);
@@ -112,7 +113,7 @@ void Tree::InsertPath(const std::vector<std::string>& splitted,
const std::string& fileName)
{
if (start == splitted.size()) {
- files.push_back(fileName);
+ files.insert(fileName);
return;
}
for (std::vector<Tree>::iterator it = folders.begin(); it != folders.end();
@@ -123,7 +124,7 @@ void Tree::InsertPath(const std::vector<std::string>& splitted,
return;
}
// last part of splitted
- it->files.push_back(fileName);
+ it->files.insert(fileName);
return;
}
}
@@ -136,7 +137,7 @@ void Tree::InsertPath(const std::vector<std::string>& splitted,
return;
}
// last part of splitted
- newFolder.files.push_back(fileName);
+ newFolder.files.insert(fileName);
folders.push_back(newFolder);
}
@@ -164,7 +165,7 @@ void Tree::BuildVirtualFolderImpl(std::string& virtualFolders,
void Tree::BuildUnit(cmXMLWriter& xml, const std::string& fsPath) const
{
- for (std::vector<std::string>::const_iterator it = files.begin();
+ for (std::set<std::string>::const_iterator it = files.begin();
it != files.end(); ++it) {
xml.StartElement("Unit");
xml.Attribute("filename", fsPath + *it);
@@ -185,7 +186,7 @@ void Tree::BuildUnitImpl(cmXMLWriter& xml,
const std::string& virtualFolderPath,
const std::string& fsPath) const
{
- for (std::vector<std::string>::const_iterator it = files.begin();
+ for (std::set<std::string>::const_iterator it = files.begin();
it != files.end(); ++it) {
xml.StartElement("Unit");
xml.Attribute("filename", fsPath + path + "/" + *it);
@@ -289,15 +290,16 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
xml.StartElement("Build");
- this->AppendTarget(xml, "all", CM_NULLPTR, make.c_str(), lgs[0],
+ this->AppendTarget(xml, "all", nullptr, make.c_str(), lgs[0],
compiler.c_str(), makeArgs);
// add all executable and library targets and some of the GLOBAL
// and UTILITY targets
for (std::vector<cmLocalGenerator*>::const_iterator lg = lgs.begin();
lg != lgs.end(); lg++) {
- std::vector<cmGeneratorTarget*> targets = (*lg)->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets =
+ (*lg)->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin();
ti != targets.end(); ti++) {
std::string targetName = (*ti)->GetName();
switch ((*ti)->GetType()) {
@@ -306,7 +308,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
// not from the subdirs
if (strcmp((*lg)->GetCurrentBinaryDirectory(),
(*lg)->GetBinaryDirectory()) == 0) {
- this->AppendTarget(xml, targetName, CM_NULLPTR, make.c_str(), *lg,
+ this->AppendTarget(xml, targetName, nullptr, make.c_str(), *lg,
compiler.c_str(), makeArgs);
}
} break;
@@ -322,7 +324,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
break;
}
- this->AppendTarget(xml, targetName, CM_NULLPTR, make.c_str(), *lg,
+ this->AppendTarget(xml, targetName, nullptr, make.c_str(), *lg,
compiler.c_str(), makeArgs);
break;
case cmStateEnums::EXECUTABLE:
@@ -359,8 +361,9 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
for (std::vector<cmLocalGenerator*>::const_iterator lg = lgs.begin();
lg != lgs.end(); lg++) {
cmMakefile* makefile = (*lg)->GetMakefile();
- std::vector<cmGeneratorTarget*> targets = (*lg)->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets =
+ (*lg)->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin();
ti != targets.end(); ti++) {
switch ((*ti)->GetType()) {
case cmStateEnums::EXECUTABLE:
@@ -515,7 +518,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(
xml.StartElement("Target");
xml.Attribute("title", targetName);
- if (target != CM_NULLPTR) {
+ if (target != nullptr) {
int cbTargetType = this->GetCBTargetType(target);
std::string workingDir = lg->GetCurrentBinaryDirectory();
if (target->GetType() == cmStateEnums::EXECUTABLE) {
@@ -523,12 +526,12 @@ void cmExtraCodeBlocksGenerator::AppendTarget(
// set the working directory to this dir.
const char* runtimeOutputDir =
makefile->GetDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY");
- if (runtimeOutputDir != CM_NULLPTR) {
+ if (runtimeOutputDir != nullptr) {
workingDir = runtimeOutputDir;
} else {
const char* executableOutputDir =
makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH");
- if (executableOutputDir != CM_NULLPTR) {
+ if (executableOutputDir != nullptr) {
workingDir = executableOutputDir;
}
}
diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h
index 450a9d0..9397733 100644
--- a/Source/cmExtraCodeBlocksGenerator.h
+++ b/Source/cmExtraCodeBlocksGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmExtraCodeBlocksGenerator_h
#define cmExtraCodeBlocksGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmExternalMakefileProjectGenerator.h"
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index b478f34..96502d5 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -292,8 +292,9 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile(
for (std::vector<cmLocalGenerator*>::const_iterator lg = lgs.begin();
lg != lgs.end(); lg++) {
cmMakefile* makefile = (*lg)->GetMakefile();
- std::vector<cmGeneratorTarget*> targets = (*lg)->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets =
+ (*lg)->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin();
ti != targets.end(); ti++) {
projectType = CollectSourceFiles(makefile, *ti, cFiles, otherFiles);
}
diff --git a/Source/cmExtraCodeLiteGenerator.h b/Source/cmExtraCodeLiteGenerator.h
index de33098..549802e 100644
--- a/Source/cmExtraCodeLiteGenerator.h
+++ b/Source/cmExtraCodeLiteGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalCodeLiteGenerator_h
#define cmGlobalCodeLiteGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmExternalMakefileProjectGenerator.h"
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 2a6ce98..684d1f5 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -222,17 +222,17 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out,
// now we have both, decide which one to use
std::string valueToUse;
- if (!envVarSet && cacheValue == CM_NULLPTR) {
+ if (!envVarSet && cacheValue == nullptr) {
// nothing known, do nothing
valueToUse = "";
- } else if (envVarSet && cacheValue == CM_NULLPTR) {
+ } else if (envVarSet && cacheValue == nullptr) {
// The variable is in the env, but not in the cache. Use it and put it
// in the cache
valueToUse = envVarValue;
mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
cacheEntryName.c_str(), cmStateEnums::STRING, true);
mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
- } else if (!envVarSet && cacheValue != CM_NULLPTR) {
+ } else if (!envVarSet && cacheValue != nullptr) {
// It is already in the cache, but not in the env, so use it from the cache
valueToUse = cacheValue;
} else {
@@ -475,7 +475,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml)
this->GlobalGenerator->GetLocalGenerators().begin();
lgIt != this->GlobalGenerator->GetLocalGenerators().end(); ++lgIt) {
cmMakefile* makefile = (*lgIt)->GetMakefile();
- const std::vector<cmGeneratorTarget*> targets =
+ const std::vector<cmGeneratorTarget*>& targets =
(*lgIt)->GetGeneratorTargets();
for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin();
@@ -853,8 +853,9 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
for (std::vector<cmLocalGenerator*>::const_iterator it =
this->GlobalGenerator->GetLocalGenerators().begin();
it != this->GlobalGenerator->GetLocalGenerators().end(); ++it) {
- std::vector<cmGeneratorTarget*> targets = (*it)->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator l = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets =
+ (*it)->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = targets.begin();
l != targets.end(); ++l) {
std::vector<std::string> includeDirs;
std::string config = mf->GetSafeDefinition("CMAKE_BUILD_TYPE");
@@ -910,7 +911,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
for (std::vector<cmLocalGenerator*>::const_iterator it =
this->GlobalGenerator->GetLocalGenerators().begin();
it != this->GlobalGenerator->GetLocalGenerators().end(); ++it) {
- const std::vector<cmGeneratorTarget*> targets =
+ const std::vector<cmGeneratorTarget*>& targets =
(*it)->GetGeneratorTargets();
std::string subdir = (*it)->ConvertToRelativePath(
this->HomeOutputDirectory, (*it)->GetCurrentBinaryDirectory());
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index 1380d18..5d2ca10 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -3,7 +3,7 @@
#ifndef cmExtraEclipseCDT4Generator_h
#define cmExtraEclipseCDT4Generator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmExternalMakefileProjectGenerator.h"
@@ -67,7 +67,7 @@ private:
const std::string& make,
const std::string& makeArguments,
const std::string& path, const char* prefix = "",
- const char* makeTarget = CM_NULLPTR);
+ const char* makeTarget = nullptr);
static void AppendScannerProfile(
cmXMLWriter& xml, const std::string& profileID, bool openActionEnabled,
const std::string& openActionFilePath, bool pParserEnabled,
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index 3730433..a75a400 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -115,7 +115,7 @@ void cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
for (std::vector<cmLocalGenerator*>::const_iterator it =
this->GlobalGenerator->GetLocalGenerators().begin();
it != this->GlobalGenerator->GetLocalGenerators().end(); ++it) {
- const std::vector<cmGeneratorTarget*> targets =
+ const std::vector<cmGeneratorTarget*>& targets =
(*it)->GetGeneratorTargets();
std::string currentDir = (*it)->GetCurrentBinaryDirectory();
bool topLevel = (currentDir == (*it)->GetBinaryDirectory());
@@ -135,9 +135,9 @@ void cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
if (targetName == "edit_cache") {
const char* editCommand =
(*it)->GetMakefile()->GetDefinition("CMAKE_EDIT_COMMAND");
- if (editCommand == CM_NULLPTR) {
+ if (editCommand == nullptr) {
insertTarget = false;
- } else if (strstr(editCommand, "ccmake") != CM_NULLPTR) {
+ } else if (strstr(editCommand, "ccmake") != nullptr) {
insertTarget = false;
}
}
diff --git a/Source/cmExtraKateGenerator.h b/Source/cmExtraKateGenerator.h
index 6b9c7af..7e80314 100644
--- a/Source/cmExtraKateGenerator.h
+++ b/Source/cmExtraKateGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmExtraKateGenerator_h
#define cmExtraKateGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmExternalMakefileProjectGenerator.h"
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 1fd1418..5bb424b 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -174,9 +174,9 @@ void cmExtraSublimeTextGenerator::AppendAllTargets(
std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
std::string compiler;
if (!lgs.empty()) {
- this->AppendTarget(fout, "all", lgs[0], CM_NULLPTR, make.c_str(), mf,
+ this->AppendTarget(fout, "all", lgs[0], nullptr, make.c_str(), mf,
compiler.c_str(), sourceFileFlags, true);
- this->AppendTarget(fout, "clean", lgs[0], CM_NULLPTR, make.c_str(), mf,
+ this->AppendTarget(fout, "clean", lgs[0], nullptr, make.c_str(), mf,
compiler.c_str(), sourceFileFlags, false);
}
@@ -185,8 +185,9 @@ void cmExtraSublimeTextGenerator::AppendAllTargets(
for (std::vector<cmLocalGenerator*>::const_iterator lg = lgs.begin();
lg != lgs.end(); lg++) {
cmMakefile* makefile = (*lg)->GetMakefile();
- std::vector<cmGeneratorTarget*> targets = (*lg)->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets =
+ (*lg)->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin();
ti != targets.end(); ti++) {
std::string targetName = (*ti)->GetName();
switch ((*ti)->GetType()) {
@@ -195,7 +196,7 @@ void cmExtraSublimeTextGenerator::AppendAllTargets(
// not from the subdirs
if (strcmp((*lg)->GetCurrentBinaryDirectory(),
(*lg)->GetBinaryDirectory()) == 0) {
- this->AppendTarget(fout, targetName, *lg, CM_NULLPTR, make.c_str(),
+ this->AppendTarget(fout, targetName, *lg, nullptr, make.c_str(),
makefile, compiler.c_str(), sourceFileFlags,
false);
}
@@ -212,7 +213,7 @@ void cmExtraSublimeTextGenerator::AppendAllTargets(
break;
}
- this->AppendTarget(fout, targetName, *lg, CM_NULLPTR, make.c_str(),
+ this->AppendTarget(fout, targetName, *lg, nullptr, make.c_str(),
makefile, compiler.c_str(), sourceFileFlags,
false);
break;
@@ -244,7 +245,7 @@ void cmExtraSublimeTextGenerator::AppendTarget(
MapSourceFileFlags& sourceFileFlags, bool firstTarget)
{
- if (target != CM_NULLPTR) {
+ if (target != nullptr) {
std::vector<cmSourceFile*> sourceFiles;
target->GetSourceFiles(sourceFiles,
makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
diff --git a/Source/cmExtraSublimeTextGenerator.h b/Source/cmExtraSublimeTextGenerator.h
index 9022d37..bf6d23f 100644
--- a/Source/cmExtraSublimeTextGenerator.h
+++ b/Source/cmExtraSublimeTextGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmExtraSublimeTextGenerator_h
#define cmExtraSublimeTextGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmExternalMakefileProjectGenerator.h"
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index ff78f52..03d1ad1 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -72,8 +72,8 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args,
// Add command for generating the .h and .cxx files
std::string no_main_dependency;
- const char* no_comment = CM_NULLPTR;
- const char* no_working_dir = CM_NULLPTR;
+ const char* no_comment = nullptr;
+ const char* no_working_dir = nullptr;
this->Makefile->AddCustomCommandToOutput(
cxxres, depends, no_main_dependency, commandLines, no_comment,
no_working_dir);
diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h
index d8045ab..64c29f8 100644
--- a/Source/cmFLTKWrapUICommand.h
+++ b/Source/cmFLTKWrapUICommand.h
@@ -3,7 +3,7 @@
#ifndef cmFLTKWrapUICommand_h
#define cmFLTKWrapUICommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 5777fb2..3af7484 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -55,14 +55,14 @@ class cmSystemToolsFileTime;
static mode_t mode_owner_read = S_IREAD;
static mode_t mode_owner_write = S_IWRITE;
static mode_t mode_owner_execute = S_IEXEC;
-static mode_t mode_group_read = 0;
-static mode_t mode_group_write = 0;
-static mode_t mode_group_execute = 0;
-static mode_t mode_world_read = 0;
-static mode_t mode_world_write = 0;
-static mode_t mode_world_execute = 0;
-static mode_t mode_setuid = 0;
-static mode_t mode_setgid = 0;
+static mode_t mode_group_read = 040;
+static mode_t mode_group_write = 020;
+static mode_t mode_group_execute = 010;
+static mode_t mode_world_read = 04;
+static mode_t mode_world_write = 02;
+static mode_t mode_world_execute = 01;
+static mode_t mode_setuid = 04000;
+static mode_t mode_setgid = 02000;
#else
static mode_t mode_owner_read = S_IRUSR;
static mode_t mode_owner_write = S_IWUSR;
@@ -269,17 +269,17 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args)
cmCommandArgumentGroup group;
cmCAString readArg(&argHelper, "READ");
- cmCAString fileNameArg(&argHelper, CM_NULLPTR);
- cmCAString resultArg(&argHelper, CM_NULLPTR);
+ cmCAString fileNameArg(&argHelper, nullptr);
+ cmCAString resultArg(&argHelper, nullptr);
cmCAString offsetArg(&argHelper, "OFFSET", &group);
cmCAString limitArg(&argHelper, "LIMIT", &group);
cmCAEnabler hexOutputArg(&argHelper, "HEX", &group);
- readArg.Follows(CM_NULLPTR);
+ readArg.Follows(nullptr);
fileNameArg.Follows(&readArg);
resultArg.Follows(&fileNameArg);
group.Follows(&resultArg);
- argHelper.Parse(&args, CM_NULLPTR);
+ argHelper.Parse(&args, nullptr);
std::string fileName = fileNameArg.GetString();
if (!cmsys::SystemTools::FileIsFullPath(fileName.c_str())) {
@@ -940,9 +940,9 @@ bool cmFileCommand::HandleDifferentCommand(
*/
// Evaluate arguments.
- const char* file_lhs = CM_NULLPTR;
- const char* file_rhs = CM_NULLPTR;
- const char* var = CM_NULLPTR;
+ const char* file_lhs = nullptr;
+ const char* file_rhs = nullptr;
+ const char* var = nullptr;
enum Doing
{
DoingNone,
@@ -997,7 +997,7 @@ struct cmFileCopier
, MatchlessFiles(true)
, FilePermissions(0)
, DirPermissions(0)
- , CurrentMatchRule(CM_NULLPTR)
+ , CurrentMatchRule(nullptr)
, UseGivenPermissionsFile(false)
, UseGivenPermissionsDir(false)
, UseSourcePermissions(true)
@@ -1076,11 +1076,26 @@ protected:
bool SetPermissions(const char* toFile, mode_t permissions)
{
- if (permissions && !cmSystemTools::SetPermissions(toFile, permissions)) {
- std::ostringstream e;
- e << this->Name << " cannot set permissions on \"" << toFile << "\"";
- this->FileCommand->SetError(e.str());
- return false;
+ if (permissions) {
+#ifdef WIN32
+ if (Makefile->IsOn("CMAKE_CROSSCOMPILING")) {
+ std::string mode_t_adt_filename =
+ std::string(toFile) + ":cmake_mode_t";
+
+ cmsys::ofstream permissionStream(mode_t_adt_filename.c_str());
+
+ if (permissionStream) {
+ permissionStream << std::oct << permissions << std::endl;
+ }
+ }
+#endif
+
+ if (!cmSystemTools::SetPermissions(toFile, permissions)) {
+ std::ostringstream e;
+ e << this->Name << " cannot set permissions on \"" << toFile << "\"";
+ this->FileCommand->SetError(e.str());
+ return false;
+ }
}
return true;
}
@@ -2028,9 +2043,9 @@ bool cmFileCommand::HandleRPathChangeCommand(
std::vector<std::string> const& args)
{
// Evaluate arguments.
- const char* file = CM_NULLPTR;
- const char* oldRPath = CM_NULLPTR;
- const char* newRPath = CM_NULLPTR;
+ const char* file = nullptr;
+ const char* oldRPath = nullptr;
+ const char* newRPath = nullptr;
enum Doing
{
DoingNone,
@@ -2118,7 +2133,7 @@ bool cmFileCommand::HandleRPathRemoveCommand(
std::vector<std::string> const& args)
{
// Evaluate arguments.
- const char* file = CM_NULLPTR;
+ const char* file = nullptr;
enum Doing
{
DoingNone,
@@ -2182,8 +2197,8 @@ bool cmFileCommand::HandleRPathCheckCommand(
std::vector<std::string> const& args)
{
// Evaluate arguments.
- const char* file = CM_NULLPTR;
- const char* rpath = CM_NULLPTR;
+ const char* file = nullptr;
+ const char* rpath = nullptr;
enum Doing
{
DoingNone,
@@ -2241,16 +2256,16 @@ bool cmFileCommand::HandleReadElfCommand(std::vector<std::string> const& args)
cmCommandArgumentGroup group;
cmCAString readArg(&argHelper, "READ_ELF");
- cmCAString fileNameArg(&argHelper, CM_NULLPTR);
+ cmCAString fileNameArg(&argHelper, nullptr);
cmCAString rpathArg(&argHelper, "RPATH", &group);
cmCAString runpathArg(&argHelper, "RUNPATH", &group);
cmCAString errorArg(&argHelper, "CAPTURE_ERROR", &group);
- readArg.Follows(CM_NULLPTR);
+ readArg.Follows(nullptr);
fileNameArg.Follows(&readArg);
group.Follows(&fileNameArg);
- argHelper.Parse(&args, CM_NULLPTR);
+ argHelper.Parse(&args, nullptr);
if (!cmSystemTools::FileExists(fileNameArg.GetString(), true)) {
std::ostringstream e;
@@ -2439,7 +2454,7 @@ namespace {
size_t cmWriteToFileCallback(void* ptr, size_t size, size_t nmemb, void* data)
{
- int realsize = (int)(size * nmemb);
+ int realsize = static_cast<int>(size * nmemb);
cmsys::ofstream* fout = static_cast<cmsys::ofstream*>(data);
const char* chPtr = static_cast<char*>(ptr);
fout->write(chPtr, realsize);
@@ -2449,7 +2464,7 @@ size_t cmWriteToFileCallback(void* ptr, size_t size, size_t nmemb, void* data)
size_t cmWriteToMemoryCallback(void* ptr, size_t size, size_t nmemb,
void* data)
{
- int realsize = (int)(size * nmemb);
+ int realsize = static_cast<int>(size * nmemb);
cmFileCommandVectorOfChar* vec =
static_cast<cmFileCommandVectorOfChar*>(data);
const char* chPtr = static_cast<char*>(ptr);
@@ -2581,7 +2596,7 @@ public:
}
}
- void release() { this->Easy = CM_NULLPTR; }
+ void release() { this->Easy = nullptr; }
private:
::CURL* Easy;
@@ -2743,7 +2758,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
msg += "\"";
if (!statusVar.empty()) {
std::ostringstream result;
- result << (int)0 << ";\"" << msg;
+ result << 0 << ";\"" << msg;
this->Makefile->AddDefinition(statusVar, result.str().c_str());
}
return true;
@@ -2816,10 +2831,10 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
cmFileCommandVectorOfChar chunkDebug;
- res = ::curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)&fout);
+ res = ::curl_easy_setopt(curl, CURLOPT_WRITEDATA, &fout);
check_curl_result(res, "DOWNLOAD cannot set write data: ");
- res = ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void*)&chunkDebug);
+ res = ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug);
check_curl_result(res, "DOWNLOAD cannot set debug data: ");
res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
@@ -2866,7 +2881,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
check_curl_result(res, "DOWNLOAD cannot set user password: ");
}
- struct curl_slist* headers = CM_NULLPTR;
+ struct curl_slist* headers = nullptr;
for (std::vector<std::string>::const_iterator h = curl_headers.begin();
h != curl_headers.end(); ++h) {
headers = ::curl_slist_append(headers, h->c_str());
@@ -2883,7 +2898,8 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
if (!statusVar.empty()) {
std::ostringstream result;
- result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\"";
+ result << static_cast<int>(res) << ";\"" << ::curl_easy_strerror(res)
+ << "\"";
this->Makefile->AddDefinition(statusVar, result.str().c_str());
}
@@ -2909,7 +2925,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
<< " for file: [" << file << "]" << std::endl
<< " expected hash: [" << expectedHash << "]" << std::endl
<< " actual hash: [" << actualHash << "]" << std::endl
- << " status: [" << (int)res << ";\""
+ << " status: [" << static_cast<int>(res) << ";\""
<< ::curl_easy_strerror(res) << "\"]" << std::endl;
if (!statusVar.empty() && res == 0) {
@@ -3065,10 +3081,10 @@ bool cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
cmFileCommandVectorOfChar chunkResponse;
cmFileCommandVectorOfChar chunkDebug;
- res = ::curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)&chunkResponse);
+ res = ::curl_easy_setopt(curl, CURLOPT_WRITEDATA, &chunkResponse);
check_curl_result(res, "UPLOAD cannot set write data: ");
- res = ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void*)&chunkDebug);
+ res = ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug);
check_curl_result(res, "UPLOAD cannot set debug data: ");
res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
@@ -3124,7 +3140,7 @@ bool cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
check_curl_result(res, "UPLOAD cannot set user password: ");
}
- struct curl_slist* headers = CM_NULLPTR;
+ struct curl_slist* headers = nullptr;
for (std::vector<std::string>::const_iterator h = curl_headers.begin();
h != curl_headers.end(); ++h) {
headers = ::curl_slist_append(headers, h->c_str());
@@ -3141,14 +3157,15 @@ bool cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
if (!statusVar.empty()) {
std::ostringstream result;
- result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\"";
+ result << static_cast<int>(res) << ";\"" << ::curl_easy_strerror(res)
+ << "\"";
this->Makefile->AddDefinition(statusVar, result.str().c_str());
}
::curl_global_cleanup();
fclose(fin);
- fin = CM_NULLPTR;
+ fin = nullptr;
if (!logVar.empty()) {
std::string log;
diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h
index d09ef42..1de8b59 100644
--- a/Source/cmFileCommand.h
+++ b/Source/cmFileCommand.h
@@ -3,7 +3,7 @@
#ifndef cmFileCommand_h
#define cmFileCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h
index ccef508..c9ab0db 100644
--- a/Source/cmFileLock.h
+++ b/Source/cmFileLock.h
@@ -3,7 +3,7 @@
#ifndef cmFileLock_h
#define cmFileLock_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h
index c96a8c2..af98270 100644
--- a/Source/cmFileLockPool.h
+++ b/Source/cmFileLockPool.h
@@ -3,7 +3,7 @@
#ifndef cmFileLockPool_h
#define cmFileLockPool_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmFileLockResult.cxx b/Source/cmFileLockResult.cxx
index a040705..9ca5d8a 100644
--- a/Source/cmFileLockResult.cxx
+++ b/Source/cmFileLockResult.cxx
@@ -5,6 +5,7 @@
#include <errno.h>
#include <string.h>
+#define WINMSG_BUF_LEN (1024)
cmFileLockResult cmFileLockResult::MakeOk()
{
return cmFileLockResult(OK, 0);
@@ -53,18 +54,12 @@ std::string cmFileLockResult::GetOutputMessage() const
case SYSTEM:
#if defined(_WIN32)
{
- char* errorText = NULL;
-
- // http://stackoverflow.com/a/455533/2288008
- DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS;
- ::FormatMessageA(flags, NULL, this->ErrorValue,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPSTR)&errorText, 0, NULL);
-
- if (errorText != NULL) {
- const std::string message = errorText;
- ::LocalFree(errorText);
+ char winmsg[WINMSG_BUF_LEN];
+ DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS;
+ if (FormatMessageA(flags, NULL, this->ErrorValue,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPSTR)winmsg, WINMSG_BUF_LEN, NULL)) {
+ const std::string message = winmsg;
return message;
} else {
return "Internal error (FormatMessageA failed)";
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx
index 8027535..c0401d7 100644
--- a/Source/cmFileMonitor.cxx
+++ b/Source/cmFileMonitor.cxx
@@ -171,7 +171,9 @@ public:
{
if (this->Handle) {
uv_fs_event_stop(this->Handle);
- uv_close(reinterpret_cast<uv_handle_t*>(this->Handle), &on_fs_close);
+ if (!uv_is_closing(reinterpret_cast<uv_handle_t*>(this->Handle))) {
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Handle), &on_fs_close);
+ }
this->Handle = nullptr;
}
cmVirtualDirectoryWatcher::StopWatching();
diff --git a/Source/cmFileMonitor.h b/Source/cmFileMonitor.h
index d7ec92a..632e751 100644
--- a/Source/cmFileMonitor.h
+++ b/Source/cmFileMonitor.h
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#pragma once
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <functional>
#include <string>
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index f591a8d..61e419c 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -4,10 +4,9 @@
#include <string>
#include <time.h>
+#include <unordered_map>
#include <utility>
-#include "cm_unordered_map.hxx"
-
// Use a platform-specific API to get file times efficiently.
#if !defined(_WIN32) || defined(__CYGWIN__)
#include "cm_sys_stat.h"
@@ -27,7 +26,7 @@ public:
bool FileTimesDiffer(const char* f1, const char* f2);
private:
- typedef CM_UNORDERED_MAP<std::string, cmFileTimeComparison_Type>
+ typedef std::unordered_map<std::string, cmFileTimeComparison_Type>
FileStatsMap;
FileStatsMap Files;
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index 10c6fe4..b195d27 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmFindBase.h"
-#include "cmConfigure.h"
#include <deque>
#include <iostream>
#include <iterator>
@@ -335,7 +334,7 @@ bool cmFindBase::CheckForVariableInCache()
cmState* state = this->Makefile->GetState();
const char* cacheEntry = state->GetCacheEntryValue(this->VariableName);
bool found = !cmSystemTools::IsNOTFOUND(cacheValue);
- bool cached = cacheEntry != CM_NULLPTR;
+ bool cached = cacheEntry != nullptr;
if (found) {
// If the user specifies the entry on the command line without a
// type we should add the type and docstring but keep the
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 4ef0f3e..9ebe824 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -242,13 +242,13 @@ void cmFindCommon::GetIgnoredPaths(std::vector<std::string>& ignore)
{
// null-terminated list of paths.
static const char* paths[] = { "CMAKE_SYSTEM_IGNORE_PATH",
- "CMAKE_IGNORE_PATH", CM_NULLPTR };
+ "CMAKE_IGNORE_PATH", nullptr };
// Construct the list of path roots with no trailing slashes.
for (const char** pathName = paths; *pathName; ++pathName) {
// Get the list of paths to ignore from the variable.
const char* ignorePath = this->Makefile->GetDefinition(*pathName);
- if ((ignorePath == CM_NULLPTR) || (strlen(ignorePath) == 0)) {
+ if ((ignorePath == nullptr) || (strlen(ignorePath) == 0)) {
continue;
}
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index 72dcd35..939a5bc 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -3,7 +3,7 @@
#ifndef cmFindCommon_h
#define cmFindCommon_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
#include <set>
diff --git a/Source/cmFindFileCommand.h b/Source/cmFindFileCommand.h
index bf57fec..88c2372 100644
--- a/Source/cmFindFileCommand.h
+++ b/Source/cmFindFileCommand.h
@@ -3,7 +3,7 @@
#ifndef cmFindFileCommand_h
#define cmFindFileCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmFindPathCommand.h"
diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h
index 9d38eab..fb0a44f 100644
--- a/Source/cmFindLibraryCommand.h
+++ b/Source/cmFindLibraryCommand.h
@@ -3,7 +3,7 @@
#ifndef cmFindLibraryCommand_h
#define cmFindLibraryCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 7797700..d0cc6ce 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1319,7 +1319,7 @@ public:
cmSystemTools::RemoveFile(this->File);
}
}
- void Release() { this->File = CM_NULLPTR; }
+ void Release() { this->File = nullptr; }
};
void cmFindPackageCommand::LoadPackageRegistryDir(std::string const& dir,
@@ -1642,7 +1642,7 @@ class cmFileList
public:
cmFileList()
: First()
- , Last(CM_NULLPTR)
+ , Last(nullptr)
{
}
virtual ~cmFileList() {}
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index 99b0059..69deb13 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -3,7 +3,7 @@
#ifndef cmFindPackageCommand_h
#define cmFindPackageCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cm_kwiml.h"
#include <map>
diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h
index 3761145..5b9ddf8 100644
--- a/Source/cmFindPathCommand.h
+++ b/Source/cmFindPathCommand.h
@@ -3,7 +3,7 @@
#ifndef cmFindPathCommand_h
#define cmFindPathCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h
index b0cd420..f4d78b4 100644
--- a/Source/cmFindProgramCommand.h
+++ b/Source/cmFindProgramCommand.h
@@ -3,7 +3,7 @@
#ifndef cmFindProgramCommand_h
#define cmFindProgramCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h
index 7c8a6d8..6787023 100644
--- a/Source/cmForEachCommand.h
+++ b/Source/cmForEachCommand.h
@@ -3,7 +3,7 @@
#ifndef cmForEachCommand_h
#define cmForEachCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h
index d8b0023..3f5ad87 100644
--- a/Source/cmFortranParser.h
+++ b/Source/cmFortranParser.h
@@ -4,7 +4,7 @@
#define cmFortranParser_h
#if !defined(cmFortranLexer_cxx) && !defined(cmFortranParser_cxx)
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <set>
#include <string>
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx
index 4e23f36..333b6c1 100644
--- a/Source/cmFortranParserImpl.cxx
+++ b/Source/cmFortranParserImpl.cxx
@@ -3,7 +3,6 @@
#include "cmFortranParser.h"
#include "cmSystemTools.h"
-#include "cmConfigure.h"
#include <assert.h>
#include <set>
#include <stack>
@@ -61,7 +60,7 @@ cmFortranParser_s::cmFortranParser_s(std::vector<std::string> const& includes,
// Create a dummy buffer that is never read but is the fallback
// buffer when the last file is popped off the stack.
YY_BUFFER_STATE buffer =
- cmFortran_yy_create_buffer(CM_NULLPTR, 4, this->Scanner);
+ cmFortran_yy_create_buffer(nullptr, 4, this->Scanner);
cmFortran_yy_switch_to_buffer(buffer, this->Scanner);
}
@@ -79,7 +78,7 @@ bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname)
std::string dir = cmSystemTools::GetParentDirectory(fname);
cmFortranFile f(file, current, dir);
YY_BUFFER_STATE buffer =
- cmFortran_yy_create_buffer(CM_NULLPTR, 16384, parser->Scanner);
+ cmFortran_yy_create_buffer(nullptr, 16384, parser->Scanner);
cmFortran_yy_switch_to_buffer(buffer, parser->Scanner);
parser->FileStack.push(f);
return true;
@@ -121,7 +120,7 @@ int cmFortranParser_Input(cmFortranParser* parser, char* buffer,
n = 1;
ff.LastCharWasNewline = true;
}
- return (int)n;
+ return static_cast<int>(n);
}
return 0;
}
diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h
index f263126..48d6b36 100644
--- a/Source/cmFunctionCommand.h
+++ b/Source/cmFunctionCommand.h
@@ -3,7 +3,7 @@
#ifndef cmFunctionCommand_h
#define cmFunctionCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h
index 56f9988..5144772 100644
--- a/Source/cmGeneratedFileStream.h
+++ b/Source/cmGeneratedFileStream.h
@@ -3,7 +3,7 @@
#ifndef cmGeneratedFileStream_h
#define cmGeneratedFileStream_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cm_codecvt.hxx"
#include "cmsys/FStream.hxx"
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 34516f5..9d9ae4e 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -3,7 +3,7 @@
#ifndef cmGeneratorExpression_h
#define cmGeneratorExpression_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmListFileCache.h"
@@ -71,12 +71,12 @@ class cmCompiledGeneratorExpression
CM_DISABLE_COPY(cmCompiledGeneratorExpression)
public:
- const char* Evaluate(
- cmLocalGenerator* lg, const std::string& config, bool quiet = false,
- cmGeneratorTarget const* headTarget = CM_NULLPTR,
- cmGeneratorTarget const* currentTarget = CM_NULLPTR,
- cmGeneratorExpressionDAGChecker* dagChecker = CM_NULLPTR,
- std::string const& language = std::string()) const;
+ const char* Evaluate(cmLocalGenerator* lg, const std::string& config,
+ bool quiet = false,
+ cmGeneratorTarget const* headTarget = nullptr,
+ cmGeneratorTarget const* currentTarget = nullptr,
+ cmGeneratorExpressionDAGChecker* dagChecker = nullptr,
+ std::string const& language = std::string()) const;
const char* Evaluate(cmLocalGenerator* lg, const std::string& config,
bool quiet, cmGeneratorTarget const* headTarget,
cmGeneratorExpressionDAGChecker* dagChecker,
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 557a192..a3974ab 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -3,7 +3,7 @@
#ifndef cmGeneratorExpressionDAGChecker_h
#define cmGeneratorExpressionDAGChecker_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmListFileCache.h"
@@ -61,7 +61,7 @@ struct cmGeneratorExpressionDAGChecker
void ReportError(cmGeneratorExpressionContext* context,
const std::string& expr);
- bool EvaluatingLinkLibraries(const char* tgt = CM_NULLPTR);
+ bool EvaluatingLinkLibraries(const char* tgt = nullptr);
#define DECLARE_TRANSITIVE_PROPERTY_METHOD(METHOD) bool METHOD() const;
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index 1526454..a2ff189 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGeneratorExpressionEvaluationFile.h"
-#include "cmConfigure.h"
#include "cmsys/FStream.hxx"
#include <sstream>
#include <utility>
@@ -20,11 +19,13 @@
cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
const std::string& input,
CM_AUTO_PTR<cmCompiledGeneratorExpression> outputFileExpr,
- CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent)
+ CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent,
+ cmPolicies::PolicyStatus policyStatusCMP0070)
: Input(input)
, OutputFileExpr(outputFileExpr)
, Condition(condition)
, InputIsContent(inputIsContent)
+ , PolicyStatusCMP0070(policyStatusCMP0070)
{
}
@@ -36,7 +37,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(
std::string rawCondition = this->Condition->GetInput();
if (!rawCondition.empty()) {
std::string condResult = this->Condition->Evaluate(
- lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, lang);
+ lg, config, false, nullptr, nullptr, nullptr, lang);
if (condResult == "0") {
return;
}
@@ -51,10 +52,16 @@ void cmGeneratorExpressionEvaluationFile::Generate(
}
}
- const std::string outputFileName = this->OutputFileExpr->Evaluate(
- lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, lang);
+ std::string outputFileName = this->OutputFileExpr->Evaluate(
+ lg, config, false, nullptr, nullptr, nullptr, lang);
const std::string outputContent = inputExpression->Evaluate(
- lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, lang);
+ lg, config, false, nullptr, nullptr, nullptr, lang);
+
+ if (cmSystemTools::FileIsFullPath(outputFileName)) {
+ outputFileName = cmSystemTools::CollapseFullPath(outputFileName);
+ } else {
+ outputFileName = this->FixRelativePath(outputFileName, PathForOutput, lg);
+ }
std::map<std::string, std::string>::iterator it =
outputFiles.find(outputFileName);
@@ -95,7 +102,7 @@ void cmGeneratorExpressionEvaluationFile::CreateOutputFile(
for (std::vector<std::string>::const_iterator le = enabledLanguages.begin();
le != enabledLanguages.end(); ++le) {
std::string name = this->OutputFileExpr->Evaluate(
- lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, *le);
+ lg, config, false, nullptr, nullptr, nullptr, *le);
cmSourceFile* sf = lg->GetMakefile()->GetOrCreateSource(name);
sf->SetProperty("GENERATED", "1");
@@ -111,12 +118,18 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg)
if (this->InputIsContent) {
inputContent = this->Input;
} else {
- lg->GetMakefile()->AddCMakeDependFile(this->Input);
- cmSystemTools::GetPermissions(this->Input.c_str(), perm);
- cmsys::ifstream fin(this->Input.c_str());
+ std::string inputFileName = this->Input;
+ if (cmSystemTools::FileIsFullPath(inputFileName)) {
+ inputFileName = cmSystemTools::CollapseFullPath(inputFileName);
+ } else {
+ inputFileName = this->FixRelativePath(inputFileName, PathForInput, lg);
+ }
+ lg->GetMakefile()->AddCMakeDependFile(inputFileName);
+ cmSystemTools::GetPermissions(inputFileName.c_str(), perm);
+ cmsys::ifstream fin(inputFileName.c_str());
if (!fin) {
std::ostringstream e;
- e << "Evaluation file \"" << this->Input << "\" cannot be read.";
+ e << "Evaluation file \"" << inputFileName << "\" cannot be read.";
lg->IssueMessage(cmake::FATAL_ERROR, e.str());
return;
}
@@ -159,3 +172,57 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg)
}
}
}
+
+std::string cmGeneratorExpressionEvaluationFile::FixRelativePath(
+ std::string const& relativePath, PathRole role, cmLocalGenerator* lg)
+{
+ std::string resultPath;
+ switch (this->PolicyStatusCMP0070) {
+ case cmPolicies::WARN: {
+ std::string arg;
+ switch (role) {
+ case PathForInput:
+ arg = "INPUT";
+ break;
+ case PathForOutput:
+ arg = "OUTPUT";
+ break;
+ }
+ std::ostringstream w;
+ /* clang-format off */
+ w <<
+ cmPolicies::GetPolicyWarning(cmPolicies::CMP0070) << "\n"
+ "file(GENERATE) given relative " << arg << " path:\n"
+ " " << relativePath << "\n"
+ "This is not defined behavior unless CMP0070 is set to NEW. "
+ "For compatibility with older versions of CMake, the previous "
+ "undefined behavior will be used."
+ ;
+ /* clang-format on */
+ lg->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ }
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ // OLD behavior is to use the relative path unchanged,
+ // which ends up being used relative to the working dir.
+ resultPath = relativePath;
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ // NEW behavior is to interpret the relative path with respect
+ // to the current source or binary directory.
+ switch (role) {
+ case PathForInput:
+ resultPath = cmSystemTools::CollapseFullPath(
+ relativePath, lg->GetCurrentSourceDirectory());
+ break;
+ case PathForOutput:
+ resultPath = cmSystemTools::CollapseFullPath(
+ relativePath, lg->GetCurrentBinaryDirectory());
+ break;
+ }
+ break;
+ }
+ return resultPath;
+}
diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h
index 9872746..ecf919d 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.h
+++ b/Source/cmGeneratorExpressionEvaluationFile.h
@@ -10,6 +10,7 @@
#include <vector>
#include "cmGeneratorExpression.h"
+#include "cmPolicies.h"
#include "cm_auto_ptr.hxx"
#include "cm_sys_stat.h"
@@ -21,7 +22,8 @@ public:
cmGeneratorExpressionEvaluationFile(
const std::string& input,
CM_AUTO_PTR<cmCompiledGeneratorExpression> outputFileExpr,
- CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent);
+ CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent,
+ cmPolicies::PolicyStatus policyStatusCMP0070);
void Generate(cmLocalGenerator* lg);
@@ -35,12 +37,21 @@ private:
cmCompiledGeneratorExpression* inputExpression,
std::map<std::string, std::string>& outputFiles, mode_t perm);
+ enum PathRole
+ {
+ PathForInput,
+ PathForOutput
+ };
+ std::string FixRelativePath(std::string const& filePath, PathRole role,
+ cmLocalGenerator* lg);
+
private:
const std::string Input;
const CM_AUTO_PTR<cmCompiledGeneratorExpression> OutputFileExpr;
const CM_AUTO_PTR<cmCompiledGeneratorExpression> Condition;
std::vector<std::string> Files;
const bool InputIsContent;
+ cmPolicies::PolicyStatus PolicyStatusCMP0070;
};
#endif
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 6ce4a8e..f2dbc26 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -153,7 +153,7 @@ std::string GeneratorExpressionContent::EvaluateParameters(
}
if ((numExpected > cmGeneratorExpressionNode::DynamicParameters &&
- (unsigned int)numExpected != parameters.size())) {
+ static_cast<unsigned int>(numExpected) != parameters.size())) {
if (numExpected == 0) {
reportError(context, this->GetOriginalExpression(),
"$<" + identifier + "> expression requires no parameters.");
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index a0a826a..a7e5f6f 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -3,7 +3,7 @@
#ifndef cmGeneratorExpressionEvaluator_h
#define cmGeneratorExpressionEvaluator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <stddef.h>
#include <string>
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index a57d2a0..7d34293 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -20,7 +20,6 @@
#include "cm_auto_ptr.hxx"
#include "cmake.h"
-#include "cmConfigure.h"
#include "cmsys/RegularExpression.hxx"
#include "cmsys/String.h"
#include <algorithm>
@@ -730,8 +729,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
CM_OVERRIDE
{
if (parameters.empty()) {
- return configurationNode.Evaluate(parameters, context, content,
- CM_NULLPTR);
+ return configurationNode.Evaluate(parameters, context, content, nullptr);
}
static cmsys::RegularExpression configValidator("^[A-Za-z0-9_]*$");
if (!configValidator.find(*parameters.begin())) {
@@ -750,8 +748,8 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
}
if (context->CurrentTarget && context->CurrentTarget->IsImported()) {
- const char* loc = CM_NULLPTR;
- const char* imp = CM_NULLPTR;
+ const char* loc = nullptr;
+ const char* imp = nullptr;
std::string suffix;
if (context->CurrentTarget->Target->GetMappedConfig(
context->Config, &loc, &imp, suffix)) {
@@ -813,7 +811,7 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode
reportError(
context, content->GetOriginalExpression(),
"$<COMPILE_LANGUAGE:...> may only be used to specify include "
- "directories compile definitions, compile options and to evaluate "
+ "directories, compile definitions, compile options, and to evaluate "
"components of the file(GENERATE) command.");
return std::string();
}
@@ -864,7 +862,7 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode
#define TRANSITIVE_PROPERTY_NAME(PROPERTY) , "INTERFACE_" #PROPERTY
static const char* targetPropertyTransitiveWhitelist[] = {
- CM_NULLPTR CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(TRANSITIVE_PROPERTY_NAME)
+ nullptr CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(TRANSITIVE_PROPERTY_NAME)
};
#undef TRANSITIVE_PROPERTY_NAME
@@ -1260,8 +1258,8 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
std::vector<std::string> objects;
if (gt->IsImported()) {
- const char* loc = CM_NULLPTR;
- const char* imp = CM_NULLPTR;
+ const char* loc = nullptr;
+ const char* imp = nullptr;
std::string suffix;
if (gt->Target->GetMappedConfig(context->Config, &loc, &imp, suffix)) {
cmSystemTools::ExpandListArgument(loc, objects);
@@ -1389,7 +1387,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
} compileFeaturesNode;
static const char* targetPolicyWhitelist[] = {
- CM_NULLPTR
+ nullptr
#define TARGET_POLICY_STRING(POLICY) , #POLICY
CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_STRING)
@@ -1873,7 +1871,7 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode(
}
NodeMap::const_iterator i = nodeMap.find(identifier);
if (i == nodeMap.end()) {
- return CM_NULLPTR;
+ return nullptr;
}
return i->second;
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 329c7a9..a0a3f4f 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -12,6 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unordered_set>
#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
@@ -32,7 +33,6 @@
#include "cmTargetLinkLibraryType.h"
#include "cmTargetPropertyComputer.h"
#include "cm_auto_ptr.hxx"
-#include "cm_unordered_set.hxx"
#include "cmake.h"
class cmMessenger;
@@ -204,14 +204,14 @@ const char* cmGeneratorTarget::GetProperty(const std::string& prop) const
if (!cmTargetPropertyComputer::PassesWhitelist(
this->GetType(), prop, this->Makefile->GetMessenger(),
this->GetBacktrace())) {
- return CM_NULLPTR;
+ return nullptr;
}
if (const char* result = cmTargetPropertyComputer::GetProperty(
this, prop, this->Makefile->GetMessenger(), this->GetBacktrace())) {
return result;
}
if (cmSystemTools::GetFatalErrorOccured()) {
- return CM_NULLPTR;
+ return nullptr;
}
return this->Target->GetProperty(prop);
}
@@ -326,6 +326,13 @@ std::string cmGeneratorTarget::GetOutputName(
return i->second;
}
+void cmGeneratorTarget::ClearSourcesCache()
+{
+ this->KindedSourcesMap.clear();
+ this->LinkImplementationLanguageIsContextDependent = true;
+ this->Objects.clear();
+}
+
void cmGeneratorTarget::AddSourceCommon(const std::string& src)
{
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
@@ -333,8 +340,7 @@ void cmGeneratorTarget::AddSourceCommon(const std::string& src)
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(src);
cge->SetEvaluateForBuildsystem(true);
this->SourceEntries.push_back(new TargetPropertyEntry(cge));
- this->KindedSourcesMap.clear();
- this->LinkImplementationLanguageIsContextDependent = true;
+ this->ClearSourcesCache();
}
void cmGeneratorTarget::AddSource(const std::string& src)
@@ -373,7 +379,7 @@ std::vector<cmSourceFile*> const* cmGeneratorTarget::GetSourceDepends(
if (i != this->SourceDepends.end()) {
return &i->second.Depends;
}
- return CM_NULLPTR;
+ return nullptr;
}
static void handleSystemIncludesDep(
@@ -511,7 +517,7 @@ bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
}
// Note: check consistency with messages from CheckIPOSupported
- const char* message = CM_NULLPTR;
+ const char* message = nullptr;
if (!this->Makefile->IsOn("_CMAKE_" + lang + "_IPO_SUPPORTED_BY_CMAKE")) {
message = "CMake doesn't support IPO for current compiler";
} else if (!this->Makefile->IsOn("_CMAKE_" + lang +
@@ -553,7 +559,7 @@ const char* cmGeneratorTarget::GetCustomObjectExtension() const
extension = ".ptx";
return extension.c_str();
}
- return CM_NULLPTR;
+ return nullptr;
}
void cmGeneratorTarget::AddExplicitObjectName(cmSourceFile const* sf)
@@ -749,7 +755,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(
if (iter == this->SystemIncludesCache.end()) {
cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "SYSTEM_INCLUDE_DIRECTORIES", CM_NULLPTR, CM_NULLPTR);
+ this->GetName(), "SYSTEM_INCLUDE_DIRECTORIES", nullptr, nullptr);
bool excludeImported = this->GetPropertyAsBool("NO_SYSTEM_FROM_IMPORTED");
@@ -817,7 +823,7 @@ static void AddInterfaceEntries(
static bool processSources(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
- std::vector<std::string>& srcs, CM_UNORDERED_SET<std::string>& uniqueSrcs,
+ std::vector<std::string>& srcs, std::unordered_set<std::string>& uniqueSrcs,
cmGeneratorExpressionDAGChecker* dagChecker, std::string const& config,
bool debugSources)
{
@@ -942,9 +948,9 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<std::string>& files,
}
cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), "SOURCES",
- CM_NULLPTR, CM_NULLPTR);
+ nullptr, nullptr);
- CM_UNORDERED_SET<std::string> uniqueSrcs;
+ std::unordered_set<std::string> uniqueSrcs;
bool contextDependentDirectSources =
processSources(this, this->SourceEntries, files, uniqueSrcs, &dagChecker,
config, debugSources);
@@ -1714,7 +1720,7 @@ const char* cmGeneratorTarget::GetExportMacro() const
}
return this->ExportMacro.c_str();
}
- return CM_NULLPTR;
+ return nullptr;
}
class cmTargetCollectLinkLanguages
@@ -1722,7 +1728,7 @@ class cmTargetCollectLinkLanguages
public:
cmTargetCollectLinkLanguages(cmGeneratorTarget const* target,
const std::string& config,
- CM_UNORDERED_SET<std::string>& languages,
+ std::unordered_set<std::string>& languages,
cmGeneratorTarget const* head)
: Config(config)
, Languages(languages)
@@ -1789,7 +1795,7 @@ public:
private:
std::string Config;
- CM_UNORDERED_SET<std::string>& Languages;
+ std::unordered_set<std::string>& Languages;
cmGeneratorTarget const* HeadTarget;
const cmGeneratorTarget* Target;
std::set<cmGeneratorTarget const*> Visited;
@@ -1861,7 +1867,7 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config,
LinkClosure& lc) const
{
// Get languages built in this target.
- CM_UNORDERED_SET<std::string> languages;
+ std::unordered_set<std::string> languages;
cmLinkImplementation const* impl = this->GetLinkImplementation(config);
assert(impl);
for (std::vector<std::string>::const_iterator li = impl->Languages.begin();
@@ -1878,7 +1884,7 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config,
}
// Store the transitive closure of languages.
- for (CM_UNORDERED_SET<std::string>::const_iterator li = languages.begin();
+ for (std::unordered_set<std::string>::const_iterator li = languages.begin();
li != languages.end(); ++li) {
lc.Languages.push_back(*li);
}
@@ -1899,7 +1905,8 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config,
}
// Now consider languages that propagate from linked targets.
- for (CM_UNORDERED_SET<std::string>::const_iterator sit = languages.begin();
+ for (std::unordered_set<std::string>::const_iterator sit =
+ languages.begin();
sit != languages.end(); ++sit) {
std::string propagates =
"CMAKE_" + *sit + "_LINKER_PREFERENCE_PROPAGATES";
@@ -1973,7 +1980,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
{
// There is no compile information for imported targets.
if (this->IsImported()) {
- return CM_NULLPTR;
+ return nullptr;
}
if (this->GetType() > cmStateEnums::OBJECT_LIBRARY) {
@@ -1982,7 +1989,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
msg += " which has type ";
msg += cmState::GetTargetTypeName(this->GetType());
this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
- return CM_NULLPTR;
+ return nullptr;
}
// Lookup/compute/cache the compile information for this configuration.
@@ -2008,7 +2015,7 @@ cmGeneratorTarget::GetModuleDefinitionInfo(std::string const& config) const
if (this->GetType() != cmStateEnums::SHARED_LIBRARY &&
this->GetType() != cmStateEnums::MODULE_LIBRARY &&
!this->IsExecutableWithExports()) {
- return CM_NULLPTR;
+ return nullptr;
}
// Lookup/compute/cache the compile information for this configuration.
@@ -2059,7 +2066,7 @@ void cmGeneratorTarget::GetAutoUicOptions(std::vector<std::string>& result,
cmGeneratorExpression ge;
cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "AUTOUIC_OPTIONS", CM_NULLPTR, CM_NULLPTR);
+ this->GetName(), "AUTOUIC_OPTIONS", nullptr, nullptr);
cmSystemTools::ExpandListArgument(
ge.Parse(prop)->Evaluate(this->LocalGenerator, config, false, this,
&dagChecker),
@@ -2144,7 +2151,7 @@ cmTargetTraceDependencies::cmTargetTraceDependencies(cmGeneratorTarget* target)
this->Makefile = target->Target->GetMakefile();
this->LocalGenerator = target->GetLocalGenerator();
this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
- this->CurrentEntry = CM_NULLPTR;
+ this->CurrentEntry = nullptr;
// Queue all the source files already specified for the target.
if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
@@ -2219,7 +2226,7 @@ void cmTargetTraceDependencies::Trace()
this->CheckCustomCommand(*cc);
}
}
- this->CurrentEntry = CM_NULLPTR;
+ this->CurrentEntry = nullptr;
this->GeneratorTarget->AddTracedSources(this->NewSources);
}
@@ -2418,7 +2425,7 @@ std::string cmGeneratorTarget::GetCompilePDBDirectory(
void cmGeneratorTarget::GetAppleArchs(const std::string& config,
std::vector<std::string>& archVec) const
{
- const char* archs = CM_NULLPTR;
+ const char* archs = nullptr;
if (!config.empty()) {
std::string defVarName = "OSX_ARCHITECTURES_";
defVarName += cmSystemTools::UpperCase(config);
@@ -2471,7 +2478,7 @@ static void processIncludeDirectories(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
std::vector<std::string>& includes,
- CM_UNORDERED_SET<std::string>& uniqueIncludes,
+ std::unordered_set<std::string>& uniqueIncludes,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugIncludes, const std::string& language)
{
@@ -2585,10 +2592,10 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
const std::string& config, const std::string& lang) const
{
std::vector<std::string> includes;
- CM_UNORDERED_SET<std::string> uniqueIncludes;
+ std::unordered_set<std::string> uniqueIncludes;
cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "INCLUDE_DIRECTORIES", CM_NULLPTR, CM_NULLPTR);
+ this->GetName(), "INCLUDE_DIRECTORIES", nullptr, nullptr);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -2651,7 +2658,7 @@ static void processCompileOptionsInternal(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
std::vector<std::string>& options,
- CM_UNORDERED_SET<std::string>& uniqueOptions,
+ std::unordered_set<std::string>& uniqueOptions,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugOptions, const char* logName, std::string const& language)
{
@@ -2689,7 +2696,7 @@ static void processCompileOptions(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
std::vector<std::string>& options,
- CM_UNORDERED_SET<std::string>& uniqueOptions,
+ std::unordered_set<std::string>& uniqueOptions,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugOptions, std::string const& language)
{
@@ -2702,10 +2709,10 @@ void cmGeneratorTarget::GetCompileOptions(std::vector<std::string>& result,
const std::string& config,
const std::string& language) const
{
- CM_UNORDERED_SET<std::string> uniqueOptions;
+ std::unordered_set<std::string> uniqueOptions;
cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "COMPILE_OPTIONS", CM_NULLPTR, CM_NULLPTR);
+ this->GetName(), "COMPILE_OPTIONS", nullptr, nullptr);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -2743,7 +2750,7 @@ static void processCompileFeatures(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
std::vector<std::string>& options,
- CM_UNORDERED_SET<std::string>& uniqueOptions,
+ std::unordered_set<std::string>& uniqueOptions,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugOptions)
{
@@ -2755,10 +2762,10 @@ static void processCompileFeatures(
void cmGeneratorTarget::GetCompileFeatures(std::vector<std::string>& result,
const std::string& config) const
{
- CM_UNORDERED_SET<std::string> uniqueFeatures;
+ std::unordered_set<std::string> uniqueFeatures;
cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "COMPILE_FEATURES", CM_NULLPTR, CM_NULLPTR);
+ this->GetName(), "COMPILE_FEATURES", nullptr, nullptr);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -2793,7 +2800,7 @@ static void processCompileDefinitions(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
std::vector<std::string>& options,
- CM_UNORDERED_SET<std::string>& uniqueOptions,
+ std::unordered_set<std::string>& uniqueOptions,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugOptions, std::string const& language)
{
@@ -2806,10 +2813,10 @@ void cmGeneratorTarget::GetCompileDefinitions(
std::vector<std::string>& list, const std::string& config,
const std::string& language) const
{
- CM_UNORDERED_SET<std::string> uniqueOptions;
+ std::unordered_set<std::string> uniqueOptions;
cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "COMPILE_DEFINITIONS", CM_NULLPTR, CM_NULLPTR);
+ this->GetName(), "COMPILE_DEFINITIONS", nullptr, nullptr);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -3045,8 +3052,8 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName,
this->IsFrameworkOnApple()) {
// Versioning is supported only for shared libraries and modules,
// and then only when the platform supports an soname flag.
- version = CM_NULLPTR;
- soversion = CM_NULLPTR;
+ version = nullptr;
+ soversion = nullptr;
}
if (version && !soversion) {
// The soversion must be set if the library version is set. Use
@@ -3122,7 +3129,7 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name,
const char* version = this->GetProperty("VERSION");
if (this->GetType() != cmStateEnums::EXECUTABLE ||
this->Makefile->IsOn("XCODE")) {
- version = CM_NULLPTR;
+ version = nullptr;
}
#endif
@@ -3228,7 +3235,7 @@ void cmGeneratorTarget::GetFullNameInternal(
const char* targetSuffix =
(isImportedLibraryArtifact ? this->GetProperty("IMPORT_SUFFIX")
: this->GetProperty("SUFFIX"));
- const char* configPostfix = CM_NULLPTR;
+ const char* configPostfix = nullptr;
if (!config.empty()) {
std::string configProp = cmSystemTools::UpperCase(config);
configProp += "_POSTFIX";
@@ -3236,7 +3243,7 @@ void cmGeneratorTarget::GetFullNameInternal(
// Mac application bundles and frameworks have no postfix.
if (configPostfix &&
(this->IsAppBundleOnApple() || this->IsFrameworkOnApple())) {
- configPostfix = CM_NULLPTR;
+ configPostfix = nullptr;
}
}
const char* prefixVar = this->Target->GetPrefixVariableInternal(artifact);
@@ -3270,14 +3277,14 @@ void cmGeneratorTarget::GetFullNameInternal(
fw_prefix = this->GetFrameworkDirectory(config, ContentLevel);
fw_prefix += "/";
targetPrefix = fw_prefix.c_str();
- targetSuffix = CM_NULLPTR;
+ targetSuffix = nullptr;
}
if (this->IsCFBundleOnApple()) {
fw_prefix = this->GetCFBundleDirectory(config, FullLevel);
fw_prefix += "/";
targetPrefix = fw_prefix.c_str();
- targetSuffix = CM_NULLPTR;
+ targetSuffix = nullptr;
}
// Begin the final name with the prefix.
@@ -3581,7 +3588,7 @@ const char* getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
case BoolType:
assert(false &&
"String compatibility check function called for boolean");
- return CM_NULLPTR;
+ return nullptr;
case StringType:
return tgt->GetLinkInterfaceDependentStringProperty(prop, config);
case NumberMinType:
@@ -3590,7 +3597,7 @@ const char* getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
return tgt->GetLinkInterfaceDependentNumberMaxProperty(prop, config);
}
assert(false && "Unreachable!");
- return CM_NULLPTR;
+ return nullptr;
}
template <typename PropertyType>
@@ -3628,7 +3635,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender,
}
if (emitted.insert(*pi).second) {
getLinkInterfaceDependentProperty<PropertyType>(depender, *pi, config, t,
- CM_NULLPTR);
+ nullptr);
if (cmSystemTools::GetErrorOccuredFlag()) {
return;
}
@@ -3706,25 +3713,25 @@ void cmGeneratorTarget::CheckPropertyCompatibility(
}
checkPropertyConsistency<bool>(this, li->Target, strBool, emittedBools,
- config, BoolType, CM_NULLPTR);
+ config, BoolType, nullptr);
if (cmSystemTools::GetErrorOccuredFlag()) {
return;
}
checkPropertyConsistency<const char*>(this, li->Target, strString,
emittedStrings, config, StringType,
- CM_NULLPTR);
+ nullptr);
if (cmSystemTools::GetErrorOccuredFlag()) {
return;
}
checkPropertyConsistency<const char*>(this, li->Target, strNumMin,
emittedMinNumbers, config,
- NumberMinType, CM_NULLPTR);
+ NumberMinType, nullptr);
if (cmSystemTools::GetErrorOccuredFlag()) {
return;
}
checkPropertyConsistency<const char*>(this, li->Target, strNumMax,
emittedMaxNumbers, config,
- NumberMaxType, CM_NULLPTR);
+ NumberMaxType, nullptr);
if (cmSystemTools::GetErrorOccuredFlag()) {
return;
}
@@ -3858,7 +3865,7 @@ std::pair<bool, const char*> consistentStringProperty(const char* lhs,
const char* rhs)
{
const bool b = strcmp(lhs, rhs) == 0;
- return std::make_pair(b, b ? lhs : CM_NULLPTR);
+ return std::make_pair(b, b ? lhs : nullptr);
}
std::pair<bool, const char*> consistentNumberProperty(const char* lhs,
@@ -3867,7 +3874,7 @@ std::pair<bool, const char*> consistentNumberProperty(const char* lhs,
{
char* pEnd;
- const char* const null_ptr = CM_NULLPTR;
+ const char* const null_ptr = nullptr;
long lnum = strtol(lhs, &pEnd, 0);
if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE) {
@@ -3900,7 +3907,7 @@ std::pair<bool, const char*> consistentProperty(const char* lhs,
return std::make_pair(true, lhs);
}
- const char* const null_ptr = CM_NULLPTR;
+ const char* const null_ptr = nullptr;
switch (t) {
case BoolType:
@@ -4063,28 +4070,28 @@ bool cmGeneratorTarget::GetLinkInterfaceDependentBoolProperty(
const std::string& p, const std::string& config) const
{
return checkInterfacePropertyCompatibility<bool>(this, p, config, "FALSE",
- BoolType, CM_NULLPTR);
+ BoolType, nullptr);
}
const char* cmGeneratorTarget::GetLinkInterfaceDependentStringProperty(
const std::string& p, const std::string& config) const
{
return checkInterfacePropertyCompatibility<const char*>(
- this, p, config, "empty", StringType, CM_NULLPTR);
+ this, p, config, "empty", StringType, nullptr);
}
const char* cmGeneratorTarget::GetLinkInterfaceDependentNumberMinProperty(
const std::string& p, const std::string& config) const
{
return checkInterfacePropertyCompatibility<const char*>(
- this, p, config, "empty", NumberMinType, CM_NULLPTR);
+ this, p, config, "empty", NumberMinType, nullptr);
}
const char* cmGeneratorTarget::GetLinkInterfaceDependentNumberMaxProperty(
const std::string& p, const std::string& config) const
{
return checkInterfacePropertyCompatibility<const char*>(
- this, p, config, "empty", NumberMaxType, CM_NULLPTR);
+ this, p, config, "empty", NumberMaxType, nullptr);
}
cmComputeLinkInformation* cmGeneratorTarget::GetLinkInformation(
@@ -4099,7 +4106,7 @@ cmComputeLinkInformation* cmGeneratorTarget::GetLinkInformation(
new cmComputeLinkInformation(this, config);
if (!info || !info->Compute()) {
delete info;
- info = CM_NULLPTR;
+ info = nullptr;
}
// Store the information for this configuration.
@@ -4291,8 +4298,8 @@ void cmGeneratorTarget::ExpandLinkItems(
std::vector<cmLinkItem>& items, bool& hadHeadSensitiveCondition) const
{
cmGeneratorExpression ge;
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, CM_NULLPTR,
- CM_NULLPTR);
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, nullptr,
+ nullptr);
// The $<LINK_ONLY> expression may be in a link interface to specify private
// link dependencies that are otherwise excluded from usage requirements.
if (usage_requirements_only) {
@@ -4320,7 +4327,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface(
// export symbols.
if (this->GetType() == cmStateEnums::EXECUTABLE &&
!this->IsExecutableWithExports()) {
- return CM_NULLPTR;
+ return nullptr;
}
// Lookup any existing link interface for this configuration.
@@ -4344,7 +4351,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface(
}
}
- return iface.Exists ? &iface : CM_NULLPTR;
+ return iface.Exists ? &iface : nullptr;
}
void cmGeneratorTarget::ComputeLinkInterface(
@@ -4357,7 +4364,7 @@ void cmGeneratorTarget::ComputeLinkInterface(
this->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
// Shared libraries may have runtime implementation dependencies
// on other shared libraries that are not in the interface.
- CM_UNORDERED_SET<std::string> emitted;
+ std::unordered_set<std::string> emitted;
for (std::vector<cmLinkItem>::const_iterator li =
iface.Libraries.begin();
li != iface.Libraries.end(); ++li) {
@@ -4436,7 +4443,7 @@ const cmLinkInterfaceLibraries* cmGeneratorTarget::GetLinkInterfaceLibraries(
// export symbols.
if (this->GetType() == cmStateEnums::EXECUTABLE &&
!this->IsExecutableWithExports()) {
- return CM_NULLPTR;
+ return nullptr;
}
// Lookup any existing link interface for this configuration.
@@ -4459,7 +4466,7 @@ const cmLinkInterfaceLibraries* cmGeneratorTarget::GetLinkInterfaceLibraries(
usage_requirements_only);
}
- return iface.Exists ? &iface : CM_NULLPTR;
+ return iface.Exists ? &iface : nullptr;
}
std::string cmGeneratorTarget::GetDirectory(
@@ -4494,7 +4501,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
{
// There is no output information for imported targets.
if (this->IsImported()) {
- return CM_NULLPTR;
+ return nullptr;
}
// Only libraries and executables have well-defined output files.
@@ -4504,7 +4511,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
msg += " which has type ";
msg += cmState::GetTargetTypeName(this->GetType());
this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
- return CM_NULLPTR;
+ return nullptr;
}
// Lookup/compute/cache the output information for this configuration.
@@ -4537,7 +4544,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
cmake::FATAL_ERROR,
"Target '" + this->GetName() + "' OUTPUT_DIRECTORY depends on itself.",
this->GetBacktrace());
- return CM_NULLPTR;
+ return nullptr;
}
return &i->second;
}
@@ -4552,7 +4559,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
// Look for a target property defining the target output directory
// based on the target type.
std::string targetTypeName = this->GetOutputTargetType(artifact);
- const char* propertyName = CM_NULLPTR;
+ const char* propertyName = nullptr;
std::string propertyNameStr = targetTypeName;
if (!propertyNameStr.empty()) {
propertyNameStr += "_OUTPUT_DIRECTORY";
@@ -4561,7 +4568,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
// Check for a per-configuration output directory target property.
std::string configUpper = cmSystemTools::UpperCase(conf);
- const char* configProp = CM_NULLPTR;
+ const char* configProp = nullptr;
std::string configPropStr = targetTypeName;
if (!configPropStr.empty()) {
configPropStr += "_OUTPUT_DIRECTORY_";
@@ -4629,7 +4636,7 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind,
{
// Look for a target property defining the target output directory
// based on the target type.
- const char* propertyName = CM_NULLPTR;
+ const char* propertyName = nullptr;
std::string propertyNameStr = kind;
if (!propertyNameStr.empty()) {
propertyNameStr += "_OUTPUT_DIRECTORY";
@@ -4639,7 +4646,7 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind,
// Check for a per-configuration output directory target property.
std::string configUpper = cmSystemTools::UpperCase(conf);
- const char* configProp = CM_NULLPTR;
+ const char* configProp = nullptr;
std::string configPropStr = kind;
if (!configPropStr.empty()) {
configPropStr += "_OUTPUT_DIRECTORY_";
@@ -4697,7 +4704,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
// An explicit list of interface libraries may be set for shared
// libraries and executables that export symbols.
- const char* explicitLibraries = CM_NULLPTR;
+ const char* explicitLibraries = nullptr;
std::string linkIfaceProp;
if (this->GetPolicyStatusCMP0022() != cmPolicies::OLD &&
this->GetPolicyStatusCMP0022() != cmPolicies::WARN) {
@@ -4824,7 +4831,7 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface(
{
cmGeneratorTarget::ImportInfo const* info = this->GetImportInfo(config);
if (!info) {
- return CM_NULLPTR;
+ return nullptr;
}
std::string CONFIG = cmSystemTools::UpperCase(config);
@@ -4860,7 +4867,7 @@ cmGeneratorTarget::ImportInfo const* cmGeneratorTarget::GetImportInfo(
{
// There is no imported information for non-imported targets.
if (!this->IsImported()) {
- return CM_NULLPTR;
+ return nullptr;
}
// Lookup/compute/cache the import information for this
@@ -4886,7 +4893,7 @@ cmGeneratorTarget::ImportInfo const* cmGeneratorTarget::GetImportInfo(
// If the location is empty then the target is not available for
// this configuration.
if (i->second.Location.empty() && i->second.ImportLibrary.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
// Return the import information.
@@ -4903,8 +4910,8 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
// Initialize members.
info.NoSOName = false;
- const char* loc = CM_NULLPTR;
- const char* imp = CM_NULLPTR;
+ const char* loc = nullptr;
+ const char* imp = nullptr;
std::string suffix;
if (!this->Target->GetMappedConfig(desired_config, &loc, &imp, suffix)) {
return;
@@ -5049,7 +5056,7 @@ const cmLinkImplementation* cmGeneratorTarget::GetLinkImplementation(
{
// There is no link implementation for imported targets.
if (this->IsImported()) {
- return CM_NULLPTR;
+ return nullptr;
}
std::string CONFIG = cmSystemTools::UpperCase(config);
@@ -5281,7 +5288,7 @@ cmGeneratorTarget::GetLinkImplementationLibrariesInternal(
{
// There is no link implementation for imported targets.
if (this->IsImported()) {
- return CM_NULLPTR;
+ return nullptr;
}
// Populate the link implementation libraries for this configuration.
@@ -5322,7 +5329,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
le != end; ++le, ++btIt) {
std::vector<std::string> llibs;
cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "LINK_LIBRARIES", CM_NULLPTR, CM_NULLPTR);
+ this->GetName(), "LINK_LIBRARIES", nullptr, nullptr);
cmGeneratorExpression ge(*btIt);
CM_AUTO_PTR<cmCompiledGeneratorExpression> const cge = ge.Parse(*le);
std::string const evaluated =
@@ -5415,7 +5422,7 @@ cmGeneratorTarget* cmGeneratorTarget::FindTargetToLink(
// within the project.
if (tgt && tgt->GetType() == cmStateEnums::EXECUTABLE &&
!tgt->IsExecutableWithExports()) {
- tgt = CM_NULLPTR;
+ tgt = nullptr;
}
if (tgt && tgt->GetType() == cmStateEnums::OBJECT_LIBRARY) {
@@ -5429,7 +5436,7 @@ cmGeneratorTarget* cmGeneratorTarget::FindTargetToLink(
"with the ENABLE_EXPORTS property set.";
cmake* cm = this->LocalGenerator->GetCMakeInstance();
cm->IssueMessage(cmake::FATAL_ERROR, e.str(), this->GetBacktrace());
- tgt = CM_NULLPTR;
+ tgt = nullptr;
}
return tgt;
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 52147e3..85311a7 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -3,7 +3,7 @@
#ifndef cmGeneratorTarget_h
#define cmGeneratorTarget_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmLinkItem.h"
#include "cmListFileCache.h"
@@ -491,6 +491,11 @@ public:
std::string GetOutputName(const std::string& config,
cmStateEnums::ArtifactType artifact) const;
+ /** Clears cached meta data for local and external source files.
+ * The meta data will be recomputed on demand.
+ */
+ void ClearSourcesCache();
+
void AddSource(const std::string& src);
void AddTracedSources(std::vector<std::string> const& srcs);
@@ -519,7 +524,7 @@ public:
{
SourceFileFlags()
: Type(SourceFileTypeNormal)
- , MacFolder(CM_NULLPTR)
+ , MacFolder(nullptr)
{
}
SourceFileType Type;
@@ -565,7 +570,7 @@ public:
/** Convert the given GNU import library name (.dll.a) to a name with a new
extension (.lib or ${CMAKE_IMPORT_LIBRARY_SUFFIX}). */
bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
- const char* newExt = CM_NULLPTR) const;
+ const char* newExt = nullptr) const;
bool IsExecutableWithExports() const;
diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx
index 5ba3326..fc82fee 100644
--- a/Source/cmGetCMakePropertyCommand.cxx
+++ b/Source/cmGetCMakePropertyCommand.cxx
@@ -37,7 +37,7 @@ bool cmGetCMakePropertyCommand::InitialPass(
this->Makefile->GetGlobalGenerator()->GetInstallComponents();
output = cmJoin(*components, ";");
} else {
- const char* prop = CM_NULLPTR;
+ const char* prop = nullptr;
if (!args[1].empty()) {
prop = this->Makefile->GetState()->GetGlobalProperty(args[1]);
}
diff --git a/Source/cmGetCMakePropertyCommand.h b/Source/cmGetCMakePropertyCommand.h
index 9dfc40f..803f051 100644
--- a/Source/cmGetCMakePropertyCommand.h
+++ b/Source/cmGetCMakePropertyCommand.h
@@ -3,7 +3,7 @@
#ifndef cmGetCMakePropertyCommand_h
#define cmGetCMakePropertyCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx
index 1005b15..a8cf6ab 100644
--- a/Source/cmGetDirectoryPropertyCommand.cxx
+++ b/Source/cmGetDirectoryPropertyCommand.cxx
@@ -70,7 +70,7 @@ bool cmGetDirectoryPropertyCommand::InitialPass(
return true;
}
- const char* prop = CM_NULLPTR;
+ const char* prop = nullptr;
if (!i->empty()) {
if (*i == "DEFINITIONS") {
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0059)) {
diff --git a/Source/cmGetDirectoryPropertyCommand.h b/Source/cmGetDirectoryPropertyCommand.h
index 7d97950..f373bc2 100644
--- a/Source/cmGetDirectoryPropertyCommand.h
+++ b/Source/cmGetDirectoryPropertyCommand.h
@@ -3,7 +3,7 @@
#ifndef cmGetDirectoryPropertyCommand_h
#define cmGetDirectoryPropertyCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h
index c8a23c7..b7141b2 100644
--- a/Source/cmGetFilenameComponentCommand.h
+++ b/Source/cmGetFilenameComponentCommand.h
@@ -3,7 +3,7 @@
#ifndef cmGetFilenameComponentCommand_h
#define cmGetFilenameComponentCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index ddecdf6..4494c3e 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -258,9 +258,9 @@ bool cmGetPropertyCommand::HandleTargetMode()
if (this->Makefile->IsAlias(this->Name)) {
return this->StoreResult(target->GetName().c_str());
}
- return this->StoreResult(CM_NULLPTR);
+ return this->StoreResult(nullptr);
}
- const char* prop_cstr = CM_NULLPTR;
+ const char* prop_cstr = nullptr;
cmListFileBacktrace bt = this->Makefile->GetBacktrace();
cmMessenger* messenger = this->Makefile->GetMessenger();
if (cmTargetPropertyComputer::PassesWhitelist(
@@ -333,7 +333,7 @@ bool cmGetPropertyCommand::HandleCacheMode()
return false;
}
- const char* value = CM_NULLPTR;
+ const char* value = nullptr;
if (this->Makefile->GetState()->GetCacheEntryValue(this->Name)) {
value = this->Makefile->GetState()->GetCacheEntryProperty(
this->Name, this->PropertyName);
@@ -357,7 +357,7 @@ bool cmGetPropertyCommand::HandleInstallMode()
std::string value;
bool isSet = file->GetProperty(this->PropertyName, value);
- return this->StoreResult(isSet ? value.c_str() : CM_NULLPTR);
+ return this->StoreResult(isSet ? value.c_str() : nullptr);
}
std::ostringstream e;
e << "given INSTALL name that could not be found or created: " << this->Name;
diff --git a/Source/cmGetPropertyCommand.h b/Source/cmGetPropertyCommand.h
index 6497801..44a3852 100644
--- a/Source/cmGetPropertyCommand.h
+++ b/Source/cmGetPropertyCommand.h
@@ -3,7 +3,7 @@
#ifndef cmGetPropertyCommand_h
#define cmGetPropertyCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmGetSourceFilePropertyCommand.cxx b/Source/cmGetSourceFilePropertyCommand.cxx
index 1a5f08e..75879a5 100644
--- a/Source/cmGetSourceFilePropertyCommand.cxx
+++ b/Source/cmGetSourceFilePropertyCommand.cxx
@@ -28,7 +28,7 @@ bool cmGetSourceFilePropertyCommand::InitialPass(
this->Makefile->AddDefinition(var, sf->GetLanguage().c_str());
return true;
}
- const char* prop = CM_NULLPTR;
+ const char* prop = nullptr;
if (!args[2].empty()) {
prop = sf->GetPropertyForUser(args[2]);
}
diff --git a/Source/cmGetSourceFilePropertyCommand.h b/Source/cmGetSourceFilePropertyCommand.h
index e96bb29..d4fef01 100644
--- a/Source/cmGetSourceFilePropertyCommand.h
+++ b/Source/cmGetSourceFilePropertyCommand.h
@@ -3,7 +3,7 @@
#ifndef cmGetSourceFilePropertyCommand_h
#define cmGetSourceFilePropertyCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx
index 0910a53..ec485aa 100644
--- a/Source/cmGetTargetPropertyCommand.cxx
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -34,7 +34,7 @@ bool cmGetTargetPropertyCommand::InitialPass(
prop_exists = true;
}
} else if (!args[2].empty()) {
- const char* prop_cstr = CM_NULLPTR;
+ const char* prop_cstr = nullptr;
cmListFileBacktrace bt = this->Makefile->GetBacktrace();
cmMessenger* messenger = this->Makefile->GetMessenger();
if (cmTargetPropertyComputer::PassesWhitelist(tgt->GetType(), args[2],
diff --git a/Source/cmGetTargetPropertyCommand.h b/Source/cmGetTargetPropertyCommand.h
index 5de3225..e74b7e1 100644
--- a/Source/cmGetTargetPropertyCommand.h
+++ b/Source/cmGetTargetPropertyCommand.h
@@ -3,7 +3,7 @@
#ifndef cmGetTargetPropertyCommand_h
#define cmGetTargetPropertyCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmGetTestPropertyCommand.cxx b/Source/cmGetTestPropertyCommand.cxx
index 6424515..0b0d6eb 100644
--- a/Source/cmGetTestPropertyCommand.cxx
+++ b/Source/cmGetTestPropertyCommand.cxx
@@ -20,7 +20,7 @@ bool cmGetTestPropertyCommand::InitialPass(
std::string const& var = args[2];
cmTest* test = this->Makefile->GetTest(testName);
if (test) {
- const char* prop = CM_NULLPTR;
+ const char* prop = nullptr;
if (!args[1].empty()) {
prop = test->GetProperty(args[1]);
}
diff --git a/Source/cmGetTestPropertyCommand.h b/Source/cmGetTestPropertyCommand.h
index b17e7a1..5a3ef40 100644
--- a/Source/cmGetTestPropertyCommand.h
+++ b/Source/cmGetTestPropertyCommand.h
@@ -3,7 +3,7 @@
#ifndef cmGetTestPropertyCommand_h
#define cmGetTestPropertyCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmGhsMultiGpj.h b/Source/cmGhsMultiGpj.h
index 7bc7bfc..b1eead1 100644
--- a/Source/cmGhsMultiGpj.h
+++ b/Source/cmGhsMultiGpj.h
@@ -3,7 +3,7 @@
#ifndef cmGhsMultiGpj_h
#define cmGhsMultiGpj_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
class cmGeneratedFileStream;
diff --git a/Source/cmGlobalCommonGenerator.h b/Source/cmGlobalCommonGenerator.h
index f2ad059..842a7c4 100644
--- a/Source/cmGlobalCommonGenerator.h
+++ b/Source/cmGlobalCommonGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalCommonGenerator_h
#define cmGlobalCommonGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmGlobalGenerator.h"
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 099f705..ab35593 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -89,9 +89,9 @@ cmGlobalGenerator::cmGlobalGenerator(cmake* cm)
// how long to let try compiles run
this->TryCompileTimeout = 0;
- this->ExtraGenerator = CM_NULLPTR;
- this->CurrentMakefile = CM_NULLPTR;
- this->TryCompileOuterMakefile = CM_NULLPTR;
+ this->ExtraGenerator = nullptr;
+ this->CurrentConfigureMakefile = nullptr;
+ this->TryCompileOuterMakefile = nullptr;
this->ConfigureDoneCMP0026AndCMP0024 = false;
this->FirstTimeProgress = 0.0f;
@@ -252,7 +252,7 @@ bool cmGlobalGenerator::GenerateImportFile(const std::string& file)
}
delete it->second;
- it->second = CM_NULLPTR;
+ it->second = nullptr;
this->BuildExportSets.erase(it);
return result;
}
@@ -490,7 +490,6 @@ void cmGlobalGenerator::EnableLanguage(
windowsVersionString << osviex.dwMajorVersion << "."
<< osviex.dwMinorVersion << "."
<< osviex.dwBuildNumber;
- windowsVersionString.str();
mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION",
windowsVersionString.str().c_str());
#endif
@@ -1075,7 +1074,7 @@ bool cmGlobalGenerator::GetLanguageEnabled(const std::string& l) const
void cmGlobalGenerator::ClearEnabledLanguages()
{
- return this->CMakeInstance->GetState()->ClearEnabledLanguages();
+ this->CMakeInstance->GetState()->ClearEnabledLanguages();
}
void cmGlobalGenerator::CreateLocalGenerators()
@@ -1145,7 +1144,7 @@ void cmGlobalGenerator::Configure()
std::ostringstream msg;
if (cmSystemTools::GetErrorOccuredFlag()) {
msg << "Configuring incomplete, errors occurred!";
- const char* logs[] = { "CMakeOutput.log", "CMakeError.log", CM_NULLPTR };
+ const char* logs[] = { "CMakeOutput.log", "CMakeError.log", nullptr };
for (const char** log = logs; *log; ++log) {
std::string f = this->CMakeInstance->GetHomeOutputDirectory();
f += this->CMakeInstance->GetCMakeFilesDirectory();
@@ -1192,7 +1191,7 @@ cmExportBuildFileGenerator* cmGlobalGenerator::GetExportedTargetsFile(
{
std::map<std::string, cmExportBuildFileGenerator*>::const_iterator it =
this->BuildExportSets.find(filename);
- return it == this->BuildExportSets.end() ? CM_NULLPTR : it->second;
+ return it == this->BuildExportSets.end() ? nullptr : it->second;
}
void cmGlobalGenerator::AddCMP0042WarnTarget(const std::string& target)
@@ -1352,7 +1351,7 @@ void cmGlobalGenerator::Generate()
"Generating", (static_cast<float>(i) + 1.0f) /
static_cast<float>(this->LocalGenerators.size()));
}
- this->SetCurrentMakefile(CM_NULLPTR);
+ this->SetCurrentMakefile(nullptr);
if (!this->GenerateCPackPropertiesFile()) {
this->GetCMakeInstance()->IssueMessage(
@@ -1375,7 +1374,7 @@ void cmGlobalGenerator::Generate()
this->WriteSummary();
- if (this->ExtraGenerator != CM_NULLPTR) {
+ if (this->ExtraGenerator != nullptr) {
this->ExtraGenerator->Generate();
}
@@ -1434,31 +1433,36 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
std::vector<const cmGeneratorTarget*> autogenTargets;
#ifdef CMAKE_BUILD_WITH_CMAKE
- for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
- std::vector<cmGeneratorTarget*> targets =
- this->LocalGenerators[i]->GetGeneratorTargets();
+ for (std::vector<cmLocalGenerator*>::const_iterator lgit =
+ this->LocalGenerators.begin();
+ lgit != this->LocalGenerators.end(); ++lgit) {
+ cmLocalGenerator* localGen = *lgit;
+ const std::vector<cmGeneratorTarget*>& targets =
+ localGen->GetGeneratorTargets();
+ // Find targets that require AUTOGEN processing
std::vector<cmGeneratorTarget*> filteredTargets;
filteredTargets.reserve(targets.size());
- for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin();
ti != targets.end(); ++ti) {
- if ((*ti)->GetType() == cmStateEnums::GLOBAL_TARGET) {
+ cmGeneratorTarget* target = *ti;
+ if (target->GetType() == cmStateEnums::GLOBAL_TARGET) {
continue;
}
- if ((*ti)->GetType() != cmStateEnums::EXECUTABLE &&
- (*ti)->GetType() != cmStateEnums::STATIC_LIBRARY &&
- (*ti)->GetType() != cmStateEnums::SHARED_LIBRARY &&
- (*ti)->GetType() != cmStateEnums::MODULE_LIBRARY &&
- (*ti)->GetType() != cmStateEnums::OBJECT_LIBRARY) {
+ if (target->GetType() != cmStateEnums::EXECUTABLE &&
+ target->GetType() != cmStateEnums::STATIC_LIBRARY &&
+ target->GetType() != cmStateEnums::SHARED_LIBRARY &&
+ target->GetType() != cmStateEnums::MODULE_LIBRARY &&
+ target->GetType() != cmStateEnums::OBJECT_LIBRARY) {
continue;
}
- if ((!(*ti)->GetPropertyAsBool("AUTOMOC") &&
- !(*ti)->GetPropertyAsBool("AUTOUIC") &&
- !(*ti)->GetPropertyAsBool("AUTORCC")) ||
- (*ti)->IsImported()) {
+ if ((!target->GetPropertyAsBool("AUTOMOC") &&
+ !target->GetPropertyAsBool("AUTOUIC") &&
+ !target->GetPropertyAsBool("AUTORCC")) ||
+ target->IsImported()) {
continue;
}
- // don't do anything if there is no Qt4 or Qt5Core (which contains moc):
- cmMakefile* mf = (*ti)->Target->GetMakefile();
+ // don't do anything if there is no Qt4 or Qt5Core (which contains moc)
+ cmMakefile* mf = target->Target->GetMakefile();
std::string qtMajorVersion = mf->GetSafeDefinition("QT_VERSION_MAJOR");
if (qtMajorVersion == "") {
qtMajorVersion = mf->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
@@ -1466,17 +1470,13 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
if (qtMajorVersion != "4" && qtMajorVersion != "5") {
continue;
}
-
- cmGeneratorTarget* gt = *ti;
-
- cmQtAutoGeneratorInitializer::InitializeAutogenSources(gt);
- filteredTargets.push_back(gt);
+ filteredTargets.push_back(target);
}
+ // Initialize AUTOGEN targets
for (std::vector<cmGeneratorTarget*>::iterator ti =
filteredTargets.begin();
ti != filteredTargets.end(); ++ti) {
- cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
- this->LocalGenerators[i], *ti);
+ cmQtAutoGeneratorInitializer::InitializeAutogenTarget(localGen, *ti);
autogenTargets.push_back(*ti);
}
}
@@ -1815,7 +1815,7 @@ int cmGlobalGenerator::Build(const std::string& /*unused*/,
output += "\n";
if (!cmSystemTools::RunSingleCommand(cleanCommand, outputPtr, outputPtr,
- &retVal, CM_NULLPTR, outputflag,
+ &retVal, nullptr, outputflag,
timeout)) {
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error("Generator: execution of make clean failed.");
@@ -1834,7 +1834,7 @@ int cmGlobalGenerator::Build(const std::string& /*unused*/,
output += "\n";
if (!cmSystemTools::RunSingleCommand(makeCommand, outputPtr, outputPtr,
- &retVal, CM_NULLPTR, outputflag,
+ &retVal, nullptr, outputflag,
timeout)) {
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error(
@@ -2057,7 +2057,7 @@ cmMakefile* cmGlobalGenerator::FindMakefile(const std::string& start_dir) const
if (i != this->MakefileSearchIndex.end()) {
return i->second;
}
- return CM_NULLPTR;
+ return nullptr;
}
///! Find a local generator by its startdirectory
@@ -2072,7 +2072,7 @@ cmLocalGenerator* cmGlobalGenerator::FindLocalGenerator(
return *it;
}
}
- return CM_NULLPTR;
+ return nullptr;
}
void cmGlobalGenerator::AddAlias(const std::string& name,
@@ -2117,7 +2117,7 @@ cmTarget* cmGlobalGenerator::FindTargetImpl(std::string const& name) const
if (i != this->TargetSearchIndex.end()) {
return i->second;
}
- return CM_NULLPTR;
+ return nullptr;
}
cmGeneratorTarget* cmGlobalGenerator::FindGeneratorTargetImpl(
@@ -2128,7 +2128,7 @@ cmGeneratorTarget* cmGlobalGenerator::FindGeneratorTargetImpl(
if (i != this->GeneratorTargetSearchIndex.end()) {
return i->second;
}
- return CM_NULLPTR;
+ return nullptr;
}
cmTarget* cmGlobalGenerator::FindTarget(const std::string& name,
@@ -2413,7 +2413,7 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
// install_strip
const char* install_strip = this->GetInstallStripTargetName();
- if ((install_strip != CM_NULLPTR) && (mf->IsSet("CMAKE_STRIP"))) {
+ if ((install_strip != nullptr) && (mf->IsSet("CMAKE_STRIP"))) {
gti.Name = install_strip;
gti.Message = "Installing the project stripped...";
gti.UsesTerminal = true;
@@ -2470,8 +2470,8 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(GlobalTargetInfo const& gti,
std::vector<std::string> no_byproducts;
std::vector<std::string> no_depends;
// Store the custom command in the target.
- cmCustomCommand cc(CM_NULLPTR, no_outputs, no_byproducts, no_depends,
- gti.CommandLines, CM_NULLPTR, gti.WorkingDir.c_str());
+ cmCustomCommand cc(nullptr, no_outputs, no_byproducts, no_depends,
+ gti.CommandLines, nullptr, gti.WorkingDir.c_str());
cc.SetUsesTerminal(gti.UsesTerminal);
target.AddPostBuildCommand(cc);
if (!gti.Message.empty()) {
@@ -2556,7 +2556,7 @@ void cmGlobalGenerator::SetExternalMakefileProjectGenerator(
cmExternalMakefileProjectGenerator* extraGenerator)
{
this->ExtraGenerator = extraGenerator;
- if (this->ExtraGenerator != CM_NULLPTR) {
+ if (this->ExtraGenerator != nullptr) {
this->ExtraGenerator->SetGlobalGenerator(this);
}
}
@@ -2594,9 +2594,9 @@ void cmGlobalGenerator::GetTargetSets(TargetDependSet& projectTargets,
continue;
}
// Get the targets in the makefile
- std::vector<cmGeneratorTarget*> tgts = (*i)->GetGeneratorTargets();
+ const std::vector<cmGeneratorTarget*>& tgts = (*i)->GetGeneratorTargets();
// loop over all the targets
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); ++l) {
cmGeneratorTarget* target = *l;
if (this->IsRootOnlyTarget(target) &&
@@ -2789,9 +2789,9 @@ void cmGlobalGenerator::WriteSummary()
cmGeneratedFileStream fout(fname.c_str());
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
- std::vector<cmGeneratorTarget*> tgts =
+ const std::vector<cmGeneratorTarget*>& tgts =
this->LocalGenerators[i]->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator it = tgts.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator it = tgts.begin();
it != tgts.end(); ++it) {
if ((*it)->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
@@ -2812,7 +2812,12 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
#ifdef CMAKE_BUILD_WITH_CMAKE
// Check whether labels are enabled for this target.
- if (const char* value = target->GetProperty("LABELS")) {
+ const char* targetLabels = target->GetProperty("LABELS");
+ const char* directoryLabels =
+ target->Target->GetMakefile()->GetProperty("LABELS");
+ const char* cmakeDirectoryLabels =
+ target->Target->GetMakefile()->GetDefinition("CMAKE_DIRECTORY_LABELS");
+ if (targetLabels || directoryLabels || cmakeDirectoryLabels) {
Json::Value lj_root(Json::objectValue);
Json::Value& lj_target = lj_root["target"] = Json::objectValue;
lj_target["name"] = target->GetName();
@@ -2822,19 +2827,53 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
cmSystemTools::MakeDirectory(dir.c_str());
cmGeneratedFileStream fout(file.c_str());
+ std::vector<std::string> labels;
+
// List the target-wide labels. All sources in the target get
// these labels.
- std::vector<std::string> labels;
- cmSystemTools::ExpandListArgument(value, labels);
- if (!labels.empty()) {
- fout << "# Target labels\n";
- for (std::vector<std::string>::const_iterator li = labels.begin();
- li != labels.end(); ++li) {
- fout << " " << *li << "\n";
- lj_target_labels.append(*li);
+ if (targetLabels) {
+ cmSystemTools::ExpandListArgument(targetLabels, labels);
+ if (!labels.empty()) {
+ fout << "# Target labels\n";
+ for (std::vector<std::string>::const_iterator li = labels.begin();
+ li != labels.end(); ++li) {
+ fout << " " << *li << "\n";
+ lj_target_labels.append(*li);
+ }
}
}
+ // List directory labels
+ std::vector<std::string> directoryLabelsList;
+ std::vector<std::string> cmakeDirectoryLabelsList;
+
+ if (directoryLabels) {
+ cmSystemTools::ExpandListArgument(directoryLabels, directoryLabelsList);
+ }
+
+ if (cmakeDirectoryLabels) {
+ cmSystemTools::ExpandListArgument(cmakeDirectoryLabels,
+ cmakeDirectoryLabelsList);
+ }
+
+ if (!directoryLabelsList.empty() || !cmakeDirectoryLabelsList.empty()) {
+ fout << "# Directory labels\n";
+ }
+
+ for (std::vector<std::string>::const_iterator li =
+ directoryLabelsList.begin();
+ li != directoryLabelsList.end(); ++li) {
+ fout << " " << *li << "\n";
+ lj_target_labels.append(*li);
+ }
+
+ for (std::vector<std::string>::const_iterator li =
+ cmakeDirectoryLabelsList.begin();
+ li != cmakeDirectoryLabelsList.end(); ++li) {
+ fout << " " << *li << "\n";
+ lj_target_labels.append(*li);
+ }
+
// List the source files with any per-source labels.
fout << "# Source files and their labels\n";
std::vector<cmSourceFile*> sources;
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 871178b..7ff141d 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -3,12 +3,13 @@
#ifndef cmGlobalGenerator_h
#define cmGlobalGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <map>
#include <set>
#include <string>
+#include <unordered_map>
#include <utility>
#include <vector>
@@ -19,7 +20,6 @@
#include "cmTarget.h"
#include "cmTargetDepend.h"
#include "cm_codecvt.hxx"
-#include "cm_unordered_map.hxx"
#if defined(CMAKE_BUILD_WITH_CMAKE)
#include "cmFileLockPool.h"
@@ -187,9 +187,15 @@ public:
return this->LocalGenerators;
}
- cmMakefile* GetCurrentMakefile() const { return this->CurrentMakefile; }
+ cmMakefile* GetCurrentMakefile() const
+ {
+ return this->CurrentConfigureMakefile;
+ }
- void SetCurrentMakefile(cmMakefile* mf) { this->CurrentMakefile = mf; }
+ void SetCurrentMakefile(cmMakefile* mf)
+ {
+ this->CurrentConfigureMakefile = mf;
+ }
void AddMakefile(cmMakefile* mf);
@@ -289,15 +295,15 @@ public:
virtual const char* GetAllTargetName() const { return "ALL_BUILD"; }
virtual const char* GetInstallTargetName() const { return "INSTALL"; }
- virtual const char* GetInstallLocalTargetName() const { return CM_NULLPTR; }
- virtual const char* GetInstallStripTargetName() const { return CM_NULLPTR; }
- virtual const char* GetPreinstallTargetName() const { return CM_NULLPTR; }
+ virtual const char* GetInstallLocalTargetName() const { return nullptr; }
+ virtual const char* GetInstallStripTargetName() const { return nullptr; }
+ virtual const char* GetPreinstallTargetName() const { return nullptr; }
virtual const char* GetTestTargetName() const { return "RUN_TESTS"; }
virtual const char* GetPackageTargetName() const { return "PACKAGE"; }
- virtual const char* GetPackageSourceTargetName() const { return CM_NULLPTR; }
- virtual const char* GetEditCacheTargetName() const { return CM_NULLPTR; }
- virtual const char* GetRebuildCacheTargetName() const { return CM_NULLPTR; }
- virtual const char* GetCleanTargetName() const { return CM_NULLPTR; }
+ virtual const char* GetPackageSourceTargetName() const { return nullptr; }
+ virtual const char* GetEditCacheTargetName() const { return nullptr; }
+ virtual const char* GetRebuildCacheTargetName() const { return nullptr; }
+ virtual const char* GetCleanTargetName() const { return nullptr; }
// Lookup edit_cache target command preferred by this generator.
virtual std::string GetEditCacheCommand() const { return ""; }
@@ -460,7 +466,7 @@ protected:
cmake* CMakeInstance;
std::vector<cmMakefile*> Makefiles;
std::vector<cmLocalGenerator*> LocalGenerators;
- cmMakefile* CurrentMakefile;
+ cmMakefile* CurrentConfigureMakefile;
// map from project name to vector of local generators in that project
std::map<std::string, std::vector<cmLocalGenerator*> > ProjectMap;
@@ -482,9 +488,10 @@ protected:
const char* GetPredefinedTargetsFolder();
private:
- typedef CM_UNORDERED_MAP<std::string, cmTarget*> TargetMap;
- typedef CM_UNORDERED_MAP<std::string, cmGeneratorTarget*> GeneratorTargetMap;
- typedef CM_UNORDERED_MAP<std::string, cmMakefile*> MakefileMap;
+ typedef std::unordered_map<std::string, cmTarget*> TargetMap;
+ typedef std::unordered_map<std::string, cmGeneratorTarget*>
+ GeneratorTargetMap;
+ typedef std::unordered_map<std::string, cmMakefile*> MakefileMap;
// Map efficiently from target name to cmTarget instance.
// Do not use this structure for looping over all targets.
// It contains both normal and globally visible imported targets.
@@ -550,7 +557,7 @@ private:
void IndexMakefile(cmMakefile* mf);
- virtual const char* GetBuildIgnoreErrorsFlag() const { return CM_NULLPTR; }
+ virtual const char* GetBuildIgnoreErrorsFlag() const { return nullptr; }
// Cache directory content and target files to be built.
struct DirectoryContent
diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h
index d5a6db0..125a9e2 100644
--- a/Source/cmGlobalGeneratorFactory.h
+++ b/Source/cmGlobalGeneratorFactory.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalGeneratorFactory_h
#define cmGlobalGeneratorFactory_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
@@ -48,7 +48,7 @@ public:
cmake* cm) const CM_OVERRIDE
{
if (name != T::GetActualName()) {
- return CM_NULLPTR;
+ return nullptr;
}
return new T(cm);
}
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 42ab4d9..788a179 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -260,7 +260,7 @@ void cmGlobalGhsMultiGenerator::Generate()
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
cmLocalGhsMultiGenerator* lg =
static_cast<cmLocalGhsMultiGenerator*>(this->LocalGenerators[i]);
- std::vector<cmGeneratorTarget*> tgts = lg->GetGeneratorTargets();
+ const std::vector<cmGeneratorTarget*>& tgts = lg->GetGeneratorTargets();
this->UpdateBuildFiles(tgts);
}
}
@@ -436,9 +436,9 @@ std::string cmGlobalGhsMultiGenerator::GetFileNameFromPath(
}
void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
- std::vector<cmGeneratorTarget*> tgts)
+ const std::vector<cmGeneratorTarget*>& tgts)
{
- for (std::vector<cmGeneratorTarget*>::iterator tgtsI = tgts.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator tgtsI = tgts.begin();
tgtsI != tgts.end(); ++tgtsI) {
const cmGeneratorTarget* tgt = *tgtsI;
if (IsTgtForBuild(tgt)) {
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index 7b3eebb..05a3a3c 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -116,7 +116,7 @@ private:
std::vector<cmsys::String>::const_iterator end,
GhsMultiGpj::Types projType);
static std::string GetFileNameFromPath(std::string const& path);
- void UpdateBuildFiles(std::vector<cmGeneratorTarget*> tgts);
+ void UpdateBuildFiles(const std::vector<cmGeneratorTarget*>& tgts);
bool IsTgtForBuild(const cmGeneratorTarget* tgt);
std::vector<cmGeneratedFileStream*> TargetSubProjects;
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index e72c6e3..39ac73a 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -115,21 +115,22 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile(
// make sure the file is part of this source tree
if ((tmp[0] != '/') &&
(strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) ==
- CM_NULLPTR)) {
+ nullptr)) {
files.insert(tmp);
tmp = cmSystemTools::GetFilenameName(tmp);
// add all files which dont match the default
// */CMakeLists.txt;*cmake; to the file pattern
if ((tmp != "CMakeLists.txt") &&
- (strstr(tmp.c_str(), ".cmake") == CM_NULLPTR)) {
+ (strstr(tmp.c_str(), ".cmake") == nullptr)) {
cmakeFilePattern += tmp + ";";
}
}
}
// get all sources
- std::vector<cmGeneratorTarget*> targets = (*it)->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets =
+ (*it)->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin();
ti != targets.end(); ti++) {
std::vector<cmSourceFile*> sources;
cmGeneratorTarget* gt = *ti;
@@ -146,7 +147,7 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile(
if ((tmp[0] != '/') &&
(strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) ==
- CM_NULLPTR) &&
+ nullptr) &&
(cmSystemTools::GetFilenameExtension(tmp) != ".moc")) {
files.insert(tmp);
@@ -170,7 +171,7 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile(
cmSystemTools::ReplaceString(tmp, projectDir.c_str(), "");
if ((tmp[0] != '/') &&
(strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) ==
- CM_NULLPTR)) {
+ nullptr)) {
files.insert(tmp);
}
}
@@ -300,12 +301,12 @@ void cmGlobalKdevelopGenerator::MergeProjectFiles(
it != lines.end(); it++) {
const char* line = (*it).c_str();
// skip these tags as they are always replaced
- if ((strstr(line, "<projectdirectory>") != CM_NULLPTR) ||
- (strstr(line, "<projectmanagement>") != CM_NULLPTR) ||
- (strstr(line, "<absoluteprojectpath>") != CM_NULLPTR) ||
- (strstr(line, "<filelistdirectory>") != CM_NULLPTR) ||
- (strstr(line, "<buildtool>") != CM_NULLPTR) ||
- (strstr(line, "<builddir>") != CM_NULLPTR)) {
+ if ((strstr(line, "<projectdirectory>") != nullptr) ||
+ (strstr(line, "<projectmanagement>") != nullptr) ||
+ (strstr(line, "<absoluteprojectpath>") != nullptr) ||
+ (strstr(line, "<filelistdirectory>") != nullptr) ||
+ (strstr(line, "<buildtool>") != nullptr) ||
+ (strstr(line, "<builddir>") != nullptr)) {
continue;
}
diff --git a/Source/cmGlobalKdevelopGenerator.h b/Source/cmGlobalKdevelopGenerator.h
index bdcf8a1..fd57782 100644
--- a/Source/cmGlobalKdevelopGenerator.h
+++ b/Source/cmGlobalKdevelopGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalKdevelopGenerator_h
#define cmGlobalKdevelopGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmExternalMakefileProjectGenerator.h"
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 2eef9e4..de3546b 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -474,9 +474,9 @@ void cmGlobalNinjaGenerator::WriteDefault(std::ostream& os,
cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm)
: cmGlobalCommonGenerator(cm)
- , BuildFileStream(CM_NULLPTR)
- , RulesFileStream(CM_NULLPTR)
- , CompileCommandsStream(CM_NULLPTR)
+ , BuildFileStream(nullptr)
+ , RulesFileStream(nullptr)
+ , CompileCommandsStream(nullptr)
, Rules()
, AllDependencies()
, UsingGCCOnWindows(false)
@@ -582,8 +582,8 @@ bool cmGlobalNinjaGenerator::FindMakeProgram(cmMakefile* mf)
command.push_back("--version");
std::string version;
std::string error;
- if (!cmSystemTools::RunSingleCommand(command, &version, &error, CM_NULLPTR,
- CM_NULLPTR,
+ if (!cmSystemTools::RunSingleCommand(command, &version, &error, nullptr,
+ nullptr,
cmSystemTools::OUTPUT_NONE)) {
mf->IssueMessage(cmake::FATAL_ERROR, "Running\n '" +
cmJoin(command, "' '") + "'\n"
@@ -741,7 +741,7 @@ void cmGlobalNinjaGenerator::AddRule(
description, comment, depfile, deptype,
rspfile, rspcontent, restat, generator);
- this->RuleCmdLength[name] = (int)command.size();
+ this->RuleCmdLength[name] = static_cast<int>(command.size());
}
bool cmGlobalNinjaGenerator::HasRule(const std::string& name)
@@ -805,7 +805,7 @@ void cmGlobalNinjaGenerator::CloseBuildFileStream()
{
if (this->BuildFileStream) {
delete this->BuildFileStream;
- this->BuildFileStream = CM_NULLPTR;
+ this->BuildFileStream = nullptr;
} else {
cmSystemTools::Error("Build file stream was not open.");
}
@@ -847,7 +847,7 @@ void cmGlobalNinjaGenerator::CloseRulesFileStream()
{
if (this->RulesFileStream) {
delete this->RulesFileStream;
- this->RulesFileStream = CM_NULLPTR;
+ this->RulesFileStream = nullptr;
} else {
cmSystemTools::Error("Rules file stream was not open.");
}
@@ -928,7 +928,7 @@ void cmGlobalNinjaGenerator::CloseCompileCommandsStream()
if (this->CompileCommandsStream) {
*this->CompileCommandsStream << "\n]";
delete this->CompileCommandsStream;
- this->CompileCommandsStream = CM_NULLPTR;
+ this->CompileCommandsStream = nullptr;
}
}
@@ -1092,7 +1092,7 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias,
// Mark the target's outputs as ambiguous to ensure that no other target uses
// the output as an alias.
for (cmNinjaDeps::iterator i = outputs.begin(); i != outputs.end(); ++i) {
- TargetAliases[*i] = CM_NULLPTR;
+ TargetAliases[*i] = nullptr;
}
// Insert the alias into the map. If the alias was already present in the
@@ -1100,7 +1100,7 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias,
std::pair<TargetAliasMap::iterator, bool> newAlias =
TargetAliases.insert(std::make_pair(buildAlias, target));
if (newAlias.second && newAlias.first->second != target) {
- newAlias.first->second = CM_NULLPTR;
+ newAlias.first->second = nullptr;
}
}
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index b0008f7..87affdc 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalNinjaGenerator_h
#define cmGlobalNinjaGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <map>
@@ -114,7 +114,7 @@ public:
const cmNinjaDeps& orderOnlyDeps,
const cmNinjaVars& variables,
const std::string& rspfile = std::string(),
- int cmdLineLimit = 0, bool* usedResponseFile = CM_NULLPTR);
+ int cmdLineLimit = 0, bool* usedResponseFile = nullptr);
/**
* Helper to write a build statement with the special 'phony' rule.
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 23b3718..05c9ce0 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -38,7 +38,7 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm)
#else
this->UseLinkScript = true;
#endif
- this->CommandDatabase = CM_NULLPTR;
+ this->CommandDatabase = nullptr;
this->IncludeDirective = "include";
this->DefineWindowsNULL = false;
@@ -161,10 +161,10 @@ void cmGlobalUnixMakefileGenerator3::Generate()
this->WriteMainMakefile2();
this->WriteMainCMakefile();
- if (this->CommandDatabase != CM_NULLPTR) {
+ if (this->CommandDatabase != nullptr) {
*this->CommandDatabase << std::endl << "]";
delete this->CommandDatabase;
- this->CommandDatabase = CM_NULLPTR;
+ this->CommandDatabase = nullptr;
}
}
@@ -172,7 +172,7 @@ void cmGlobalUnixMakefileGenerator3::AddCXXCompileCommand(
const std::string& sourceFile, const std::string& workingDirectory,
const std::string& compileCommand)
{
- if (this->CommandDatabase == CM_NULLPTR) {
+ if (this->CommandDatabase == nullptr) {
std::string commandDatabaseName =
std::string(this->GetCMakeInstance()->GetHomeOutputDirectory()) +
"/compile_commands.json";
@@ -382,8 +382,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefileLanguageRules(
for (unsigned int i = 0; i < lGenerators.size(); ++i) {
lg = static_cast<cmLocalUnixMakefileGenerator3*>(lGenerators[i]);
// for all of out targets
- std::vector<cmGeneratorTarget*> tgts = lg->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ const std::vector<cmGeneratorTarget*>& tgts = lg->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); l++) {
if (((*l)->GetType() == cmStateEnums::EXECUTABLE) ||
((*l)->GetType() == cmStateEnums::STATIC_LIBRARY) ||
@@ -414,8 +414,8 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRule2(
// The directory-level rule should depend on the target-level rules
// for all targets in the directory.
std::vector<std::string> depends;
- std::vector<cmGeneratorTarget*> targets = lg->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator l = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = targets.begin();
l != targets.end(); ++l) {
cmGeneratorTarget* gtarget = *l;
int type = gtarget->GetType();
@@ -547,8 +547,8 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
for (i = 0; i < this->LocalGenerators.size(); ++i) {
lg = static_cast<cmLocalUnixMakefileGenerator3*>(this->LocalGenerators[i]);
// for each target Generate the rule files for each target.
- std::vector<cmGeneratorTarget*> targets = lg->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator t = targets.begin();
t != targets.end(); ++t) {
cmGeneratorTarget* gtarget = *t;
// Don't emit the same rule twice (e.g. two targets with the same
@@ -629,8 +629,8 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
depends.push_back("cmake_check_build_system");
// for each target Generate the rule files for each target.
- std::vector<cmGeneratorTarget*> targets = lg->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator t = targets.begin();
t != targets.end(); ++t) {
cmGeneratorTarget* gtarget = *t;
int type = gtarget->GetType();
@@ -807,7 +807,7 @@ void cmGlobalUnixMakefileGenerator3::InitializeProgressMarks()
this->LocalGenerators.begin();
lgi != this->LocalGenerators.end(); ++lgi) {
cmLocalGenerator* lg = *lgi;
- std::vector<cmGeneratorTarget*> targets = lg->GetGeneratorTargets();
+ const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets();
for (std::vector<cmGeneratorTarget*>::const_iterator t = targets.begin();
t != targets.end(); ++t) {
cmGeneratorTarget* gt = *t;
@@ -952,8 +952,9 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule(
// the targets
if (lg2 == lg || lg->IsRootMakefile()) {
// for each target Generate the rule files for each target.
- std::vector<cmGeneratorTarget*> targets = lg2->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets =
+ lg2->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator t = targets.begin();
t != targets.end(); ++t) {
cmGeneratorTarget* target = *t;
cmStateEnums::TargetType type = target->GetType();
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index a656102..bc03c44 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalUnixMakefileGenerator3_h
#define cmGlobalUnixMakefileGenerator3_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <map>
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 4fff11a..1c0953a 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -495,7 +495,7 @@ const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const
{
std::string const& toolset = this->GetPlatformToolsetString();
if (toolset.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
return toolset.c_str();
}
@@ -519,7 +519,7 @@ cmGlobalVisualStudio10Generator::GetPlatformToolsetHostArchitecture() const
if (!this->GeneratorToolsetHostArchitecture.empty()) {
return this->GeneratorToolsetHostArchitecture.c_str();
}
- return CM_NULLPTR;
+ return nullptr;
}
const char* cmGlobalVisualStudio10Generator::GetPlatformToolsetCuda() const
@@ -527,7 +527,7 @@ const char* cmGlobalVisualStudio10Generator::GetPlatformToolsetCuda() const
if (!this->GeneratorToolsetCuda.empty()) {
return this->GeneratorToolsetCuda.c_str();
}
- return CM_NULLPTR;
+ return nullptr;
}
std::string const&
@@ -971,7 +971,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetClFlagTable() const
cmIDEFlagTable const* table = this->ToolsetOptions.GetClFlagTable(
this->GetPlatformName(), this->GetPlatformToolsetString());
- return (table != CM_NULLPTR) ? table : this->DefaultClFlagTable;
+ return (table != nullptr) ? table : this->DefaultClFlagTable;
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCSharpFlagTable()
@@ -980,7 +980,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCSharpFlagTable()
cmIDEFlagTable const* table = this->ToolsetOptions.GetCSharpFlagTable(
this->GetPlatformName(), this->GetPlatformToolsetString());
- return (table != CM_NULLPTR) ? table : this->DefaultCSharpFlagTable;
+ return (table != nullptr) ? table : this->DefaultCSharpFlagTable;
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetRcFlagTable() const
@@ -988,7 +988,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetRcFlagTable() const
cmIDEFlagTable const* table = this->ToolsetOptions.GetRcFlagTable(
this->GetPlatformName(), this->GetPlatformToolsetString());
- return (table != CM_NULLPTR) ? table : this->DefaultRcFlagTable;
+ return (table != nullptr) ? table : this->DefaultRcFlagTable;
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLibFlagTable() const
@@ -996,7 +996,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLibFlagTable() const
cmIDEFlagTable const* table = this->ToolsetOptions.GetLibFlagTable(
this->GetPlatformName(), this->GetPlatformToolsetString());
- return (table != CM_NULLPTR) ? table : this->DefaultLibFlagTable;
+ return (table != nullptr) ? table : this->DefaultLibFlagTable;
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLinkFlagTable() const
@@ -1004,7 +1004,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLinkFlagTable() const
cmIDEFlagTable const* table = this->ToolsetOptions.GetLinkFlagTable(
this->GetPlatformName(), this->GetPlatformToolsetString());
- return (table != CM_NULLPTR) ? table : this->DefaultLinkFlagTable;
+ return (table != nullptr) ? table : this->DefaultLinkFlagTable;
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCudaFlagTable() const
@@ -1023,7 +1023,7 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetMasmFlagTable() const
cmIDEFlagTable const* table = this->ToolsetOptions.GetMasmFlagTable(
this->GetPlatformName(), this->GetPlatformToolsetString());
- return (table != CM_NULLPTR) ? table : this->DefaultMasmFlagTable;
+ return (table != nullptr) ? table : this->DefaultMasmFlagTable;
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetNasmFlagTable() const
diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h
index b4b327d..8b75aad 100644
--- a/Source/cmGlobalVisualStudio11Generator.h
+++ b/Source/cmGlobalVisualStudio11Generator.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalVisualStudio11Generator_h
#define cmGlobalVisualStudio11Generator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <set>
diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h
index ebc95bb..d032782 100644
--- a/Source/cmGlobalVisualStudio12Generator.h
+++ b/Source/cmGlobalVisualStudio12Generator.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalVisualStudio12Generator_h
#define cmGlobalVisualStudio12Generator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <string>
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index c8cf02c..e2120b8 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -151,6 +151,13 @@ bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf,
mf->IssueMessage(cmake::FATAL_ERROR, e.str());
return false;
}
+ if (!cmSystemTools::VersionCompareEqual(this->WindowsTargetPlatformVersion,
+ this->SystemVersion)) {
+ std::ostringstream e;
+ e << "Selecting Windows SDK version " << this->WindowsTargetPlatformVersion
+ << " to target Windows " << this->SystemVersion << ".";
+ mf->DisplayStatus(e.str().c_str(), -1);
+ }
mf->AddDefinition("CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION",
this->WindowsTargetPlatformVersion.c_str());
return true;
diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h
index 0ce9a56..425fb22 100644
--- a/Source/cmGlobalVisualStudio14Generator.h
+++ b/Source/cmGlobalVisualStudio14Generator.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalVisualStudio14Generator_h
#define cmGlobalVisualStudio14Generator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <string>
diff --git a/Source/cmGlobalVisualStudio15Generator.h b/Source/cmGlobalVisualStudio15Generator.h
index 4be88f4..730784b 100644
--- a/Source/cmGlobalVisualStudio15Generator.h
+++ b/Source/cmGlobalVisualStudio15Generator.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalVisualStudio15Generator_h
#define cmGlobalVisualStudio15Generator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <string>
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index aeceb8d..624f9e5 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -202,7 +202,7 @@ void cmGlobalVisualStudio71Generator::WriteProjectConfigurations(
i != configs.end(); ++i) {
const char* dstConfig = target.GetProperty("MAP_IMPORTED_CONFIG_" +
cmSystemTools::UpperCase(*i));
- if (dstConfig == CM_NULLPTR) {
+ if (dstConfig == nullptr) {
dstConfig = i->c_str();
}
fout << "\t\t{" << guid << "}." << *i << ".ActiveCfg = " << dstConfig
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 7a42b72..728ad2d 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -320,10 +320,10 @@ void cmGlobalVisualStudio8Generator::AddExtraIDETargets()
cmGlobalVisualStudio7Generator::AddExtraIDETargets();
if (this->AddCheckTarget()) {
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
- std::vector<cmGeneratorTarget*> tgts =
+ const std::vector<cmGeneratorTarget*>& tgts =
this->LocalGenerators[i]->GetGeneratorTargets();
// All targets depend on the build-system check target.
- for (std::vector<cmGeneratorTarget*>::iterator ti = tgts.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator ti = tgts.begin();
ti != tgts.end(); ++ti) {
if ((*ti)->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
(*ti)->Target->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
@@ -356,7 +356,7 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations(
i != configs.end(); ++i) {
const char* dstConfig = target.GetProperty("MAP_IMPORTED_CONFIG_" +
cmSystemTools::UpperCase(*i));
- if (dstConfig == CM_NULLPTR) {
+ if (dstConfig == nullptr) {
dstConfig = i->c_str();
}
fout << "\t\t{" << guid << "}." << *i << "|" << this->GetPlatformName()
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 87a22d1..f85e409 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -82,8 +82,10 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
// Now make all targets depend on the ALL_BUILD target
for (std::vector<cmLocalGenerator*>::iterator i = gen.begin();
i != gen.end(); ++i) {
- std::vector<cmGeneratorTarget*> targets = (*i)->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets =
+ (*i)->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator t =
+ targets.begin();
t != targets.end(); ++t) {
cmGeneratorTarget* tgt = *t;
if (tgt->GetType() == cmStateEnums::GLOBAL_TARGET ||
@@ -298,8 +300,10 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
std::vector<cmLocalGenerator*>& gen = it->second;
for (std::vector<cmLocalGenerator*>::iterator i = gen.begin();
i != gen.end(); ++i) {
- std::vector<cmGeneratorTarget*> targets = (*i)->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets =
+ (*i)->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator ti =
+ targets.begin();
ti != targets.end(); ++ti) {
this->ComputeVSTargetDepends(*ti);
}
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index c12a933..04d97c5 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalVisualStudioGenerator_h
#define cmGlobalVisualStudioGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <map>
diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h
index b2d6d5d..bd09715 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.h
+++ b/Source/cmGlobalWatcomWMakeGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalWatcomWMakeGenerator_h
#define cmGlobalWatcomWMakeGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmGlobalGeneratorFactory.h"
#include "cmGlobalUnixMakefileGenerator3.h"
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 3cd14e1..9dbb173 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -193,7 +193,7 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(
if (version_number < 30) {
cm->IssueMessage(cmake::FATAL_ERROR,
"Xcode " + version_string + " not supported.");
- return CM_NULLPTR;
+ return nullptr;
}
CM_AUTO_PTR<cmGlobalXCodeGenerator> gg(
@@ -440,8 +440,8 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
continue;
}
- std::vector<cmGeneratorTarget*> tgts = lg->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ const std::vector<cmGeneratorTarget*>& tgts = lg->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); l++) {
cmGeneratorTarget* target = *l;
@@ -925,12 +925,12 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets(
cmLocalGenerator* gen, std::vector<cmXCodeObject*>& targets)
{
this->SetCurrentLocalGenerator(gen);
- std::vector<cmGeneratorTarget*> tgts =
+ const std::vector<cmGeneratorTarget*>& tgts =
this->CurrentLocalGenerator->GetGeneratorTargets();
typedef std::map<std::string, cmGeneratorTarget*, cmCompareTargets>
cmSortedTargets;
cmSortedTargets sortedTargets;
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); l++) {
sortedTargets[(*l)->GetName()] = *l;
}
@@ -1210,7 +1210,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets(
void cmGlobalXCodeGenerator::ForceLinkerLanguages()
{
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
- std::vector<cmGeneratorTarget*> tgts =
+ const std::vector<cmGeneratorTarget*>& tgts =
this->LocalGenerators[i]->GetGeneratorTargets();
// All targets depend on the build-system check target.
for (std::vector<cmGeneratorTarget*>::const_iterator ti = tgts.begin();
@@ -1517,17 +1517,6 @@ void cmGlobalXCodeGenerator::AddCommandsToBuildPhase(
makecmd += " all";
buildphase->AddAttribute("shellScript", this->CreateString(makecmd));
buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
-
- cmXCodeObject* outputFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
- for (std::vector<cmCustomCommand>::const_iterator i = commands.begin();
- i != commands.end(); ++i) {
- std::vector<std::string> const& outputs = i->GetOutputs();
- for (std::vector<std::string>::const_iterator j = outputs.begin();
- j != outputs.end(); ++j) {
- outputFiles->AddObject(this->CreateString(*j));
- }
- }
- buildphase->AddAttribute("outputPaths", outputFiles);
}
void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
@@ -2706,8 +2695,8 @@ bool cmGlobalXCodeGenerator::CreateGroups(
i != generators.end(); ++i) {
cmMakefile* mf = (*i)->GetMakefile();
std::vector<cmSourceGroup> sourceGroups = mf->GetSourceGroups();
- std::vector<cmGeneratorTarget*> tgts = (*i)->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ const std::vector<cmGeneratorTarget*>& tgts = (*i)->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); l++) {
cmGeneratorTarget* gtgt = *l;
@@ -3309,6 +3298,31 @@ void cmGlobalXCodeGenerator::OutputXCodeProject(
void cmGlobalXCodeGenerator::OutputXCodeSharedSchemes(
const std::string& xcProjDir)
{
+ // collect all tests for the targets
+ std::map<std::string, cmXCodeScheme::TestObjects> testables;
+
+ for (std::vector<cmXCodeObject*>::const_iterator i =
+ this->XCodeObjects.begin();
+ i != this->XCodeObjects.end(); ++i) {
+ cmXCodeObject* obj = *i;
+ if (obj->GetType() != cmXCodeObject::OBJECT ||
+ obj->GetIsA() != cmXCodeObject::PBXNativeTarget) {
+ continue;
+ }
+
+ if (!obj->GetTarget()->IsXCTestOnApple()) {
+ continue;
+ }
+
+ const char* testee = obj->GetTarget()->GetProperty("XCTEST_TESTEE");
+ if (!testee) {
+ continue;
+ }
+
+ testables[testee].push_back(obj);
+ }
+
+ // generate scheme
for (std::vector<cmXCodeObject*>::const_iterator i =
this->XCodeObjects.begin();
i != this->XCodeObjects.end(); ++i) {
@@ -3316,8 +3330,9 @@ void cmGlobalXCodeGenerator::OutputXCodeSharedSchemes(
if (obj->GetType() == cmXCodeObject::OBJECT &&
(obj->GetIsA() == cmXCodeObject::PBXNativeTarget ||
obj->GetIsA() == cmXCodeObject::PBXAggregateTarget)) {
- cmXCodeScheme schm(obj, this->CurrentConfigurationTypes,
- this->XcodeVersion);
+ const std::string& targetName = obj->GetTarget()->GetName();
+ cmXCodeScheme schm(obj, testables[targetName],
+ this->CurrentConfigurationTypes, this->XcodeVersion);
schm.WriteXCodeSharedScheme(xcProjDir,
this->RelativeToSource(xcProjDir.c_str()));
}
@@ -3583,7 +3598,7 @@ bool cmGlobalXCodeGenerator::HasKnownObjectFileLocation(
std::string* reason) const
{
if (this->ObjectDirArch.find('$') != std::string::npos) {
- if (reason != CM_NULLPTR) {
+ if (reason != nullptr) {
*reason = " under Xcode with multiple architectures";
}
return false;
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index e69793b..7f57335 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmGlobalXCodeGenerator_h
#define cmGlobalXCodeGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <map>
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index 7e953ce..b334f41 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGraphVizWriter.h"
-#include "cmConfigure.h"
#include <iostream>
#include <sstream>
#include <utility>
@@ -150,7 +149,7 @@ void cmGraphVizWriter::WriteTargetDependersFiles(const char* fileName)
for (std::map<std::string, const cmGeneratorTarget*>::const_iterator ptrIt =
this->TargetPtrs.begin();
ptrIt != this->TargetPtrs.end(); ++ptrIt) {
- if (ptrIt->second == CM_NULLPTR) {
+ if (ptrIt->second == nullptr) {
continue;
}
@@ -194,7 +193,7 @@ void cmGraphVizWriter::WritePerTargetFiles(const char* fileName)
for (std::map<std::string, const cmGeneratorTarget*>::const_iterator ptrIt =
this->TargetPtrs.begin();
ptrIt != this->TargetPtrs.end(); ++ptrIt) {
- if (ptrIt->second == CM_NULLPTR) {
+ if (ptrIt->second == nullptr) {
continue;
}
@@ -240,7 +239,7 @@ void cmGraphVizWriter::WriteGlobalFile(const char* fileName)
for (std::map<std::string, const cmGeneratorTarget*>::const_iterator ptrIt =
this->TargetPtrs.begin();
ptrIt != this->TargetPtrs.end(); ++ptrIt) {
- if (ptrIt->second == CM_NULLPTR) {
+ if (ptrIt->second == nullptr) {
continue;
}
@@ -279,7 +278,7 @@ void cmGraphVizWriter::WriteConnections(
this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str);
- if (targetPtrIt->second == CM_NULLPTR) // it's an external library
+ if (targetPtrIt->second == nullptr) // it's an external library
{
return;
}
@@ -330,7 +329,7 @@ void cmGraphVizWriter::WriteDependerConnections(
this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str);
- if (targetPtrIt->second == CM_NULLPTR) // it's an external library
+ if (targetPtrIt->second == nullptr) // it's an external library
{
return;
}
@@ -341,7 +340,7 @@ void cmGraphVizWriter::WriteDependerConnections(
for (std::map<std::string, const cmGeneratorTarget*>::const_iterator
dependerIt = this->TargetPtrs.begin();
dependerIt != this->TargetPtrs.end(); ++dependerIt) {
- if (dependerIt->second == CM_NULLPTR) {
+ if (dependerIt->second == nullptr) {
continue;
}
@@ -420,7 +419,8 @@ int cmGraphVizWriter::CollectAllTargets()
for (std::vector<cmLocalGenerator*>::const_iterator lit =
this->LocalGenerators.begin();
lit != this->LocalGenerators.end(); ++lit) {
- std::vector<cmGeneratorTarget*> targets = (*lit)->GetGeneratorTargets();
+ const std::vector<cmGeneratorTarget*>& targets =
+ (*lit)->GetGeneratorTargets();
for (std::vector<cmGeneratorTarget*>::const_iterator it = targets.begin();
it != targets.end(); ++it) {
const char* realTargetName = (*it)->GetName().c_str();
@@ -445,7 +445,8 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
for (std::vector<cmLocalGenerator*>::const_iterator lit =
this->LocalGenerators.begin();
lit != this->LocalGenerators.end(); ++lit) {
- std::vector<cmGeneratorTarget*> targets = (*lit)->GetGeneratorTargets();
+ const std::vector<cmGeneratorTarget*>& targets =
+ (*lit)->GetGeneratorTargets();
for (std::vector<cmGeneratorTarget*>::const_iterator it = targets.begin();
it != targets.end(); ++it) {
const char* realTargetName = (*it)->GetName().c_str();
@@ -469,7 +470,7 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
std::ostringstream ostr;
ostr << this->GraphNodePrefix << cnt++;
this->TargetNamesNodes[libName] = ostr.str();
- this->TargetPtrs[libName] = CM_NULLPTR;
+ this->TargetPtrs[libName] = nullptr;
// str << " \"" << ostr << "\" [ label=\"" << libName
// << "\" shape=\"ellipse\"];" << std::endl;
}
diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx
index 78dceb7..8deb8c1 100644
--- a/Source/cmHexFileConverter.cxx
+++ b/Source/cmHexFileConverter.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmHexFileConverter.h"
-#include "cmConfigure.h"
#include <stdio.h>
#include <string.h>
@@ -22,7 +21,7 @@ static bool cm_IsHexChar(char c)
static unsigned int ChompStrlen(const char* line)
{
- if (line == CM_NULLPTR) {
+ if (line == nullptr) {
return 0;
}
unsigned int length = static_cast<unsigned int>(strlen(line));
@@ -139,7 +138,7 @@ cmHexFileConverter::FileType cmHexFileConverter::DetermineFileType(
{
char buf[1024];
FILE* inFile = cmsys::SystemTools::Fopen(inFileName, "rb");
- if (inFile == CM_NULLPTR) {
+ if (inFile == nullptr) {
return Binary;
}
@@ -188,11 +187,11 @@ bool cmHexFileConverter::TryConvert(const char* inFileName,
// try to open the file
FILE* inFile = cmsys::SystemTools::Fopen(inFileName, "rb");
FILE* outFile = cmsys::SystemTools::Fopen(outFileName, "wb");
- if ((inFile == CM_NULLPTR) || (outFile == CM_NULLPTR)) {
- if (inFile != CM_NULLPTR) {
+ if ((inFile == nullptr) || (outFile == nullptr)) {
+ if (inFile != nullptr) {
fclose(inFile);
}
- if (outFile != CM_NULLPTR) {
+ if (outFile != nullptr) {
fclose(outFile);
}
return false;
@@ -201,7 +200,7 @@ bool cmHexFileConverter::TryConvert(const char* inFileName,
// convert them line by line
bool success = false;
char buf[1024];
- while (fgets(buf, 1024, inFile) != CM_NULLPTR) {
+ while (fgets(buf, 1024, inFile) != nullptr) {
if (type == MotorolaSrec) {
success = ConvertMotorolaSrecLine(buf, outFile);
} else if (type == IntelHex) {
diff --git a/Source/cmHexFileConverter.h b/Source/cmHexFileConverter.h
index 1050bc1..25278e4 100644
--- a/Source/cmHexFileConverter.h
+++ b/Source/cmHexFileConverter.h
@@ -3,6 +3,8 @@
#ifndef cmHexFileConverter_h
#define cmHexFileConverter_h
+#include "cmConfigure.h" // IWYU pragma: keep
+
/** \class cmHexFileConverter
* \brief Can detects Intel Hex and Motorola S-record files and convert them
* to binary files.
diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h
index 19e96bd..af03128 100644
--- a/Source/cmIDEOptions.h
+++ b/Source/cmIDEOptions.h
@@ -3,7 +3,7 @@
#ifndef cmIDEOptions_h
#define cmIDEOptions_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
#include <string>
diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h
index 5877a7d..da2fce9 100644
--- a/Source/cmIfCommand.h
+++ b/Source/cmIfCommand.h
@@ -3,7 +3,7 @@
#ifndef cmIfCommand_h
#define cmIfCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index 12e0c9a..cd4d850 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -78,7 +78,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
if (gg->IsExportedTargetsFile(fname_abs)) {
- const char* modal = CM_NULLPTR;
+ const char* modal = nullptr;
std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
diff --git a/Source/cmIncludeCommand.h b/Source/cmIncludeCommand.h
index 16dda0e..ceda931 100644
--- a/Source/cmIncludeCommand.h
+++ b/Source/cmIncludeCommand.h
@@ -3,7 +3,7 @@
#ifndef cmIncludeCommand_h
#define cmIncludeCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h
index 12de698..a7b3685 100644
--- a/Source/cmIncludeDirectoryCommand.h
+++ b/Source/cmIncludeDirectoryCommand.h
@@ -3,7 +3,7 @@
#ifndef cmIncludeDirectoryCommand_h
#define cmIncludeDirectoryCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmIncludeExternalMSProjectCommand.h b/Source/cmIncludeExternalMSProjectCommand.h
index 375646f..88ee2f8 100644
--- a/Source/cmIncludeExternalMSProjectCommand.h
+++ b/Source/cmIncludeExternalMSProjectCommand.h
@@ -3,7 +3,7 @@
#ifndef cmIncludeExternalMSProjectCommand_h
#define cmIncludeExternalMSProjectCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmIncludeGuardCommand.cxx b/Source/cmIncludeGuardCommand.cxx
new file mode 100644
index 0000000..505b07c
--- /dev/null
+++ b/Source/cmIncludeGuardCommand.cxx
@@ -0,0 +1,108 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmIncludeGuardCommand.h"
+
+#include "cmExecutionStatus.h"
+#include "cmMakefile.h"
+#include "cmStateDirectory.h"
+#include "cmStateSnapshot.h"
+#include "cmSystemTools.h"
+#include "cmake.h"
+
+namespace {
+
+enum IncludeGuardScope
+{
+ VARIABLE,
+ DIRECTORY,
+ GLOBAL
+};
+
+std::string GetIncludeGuardVariableName(std::string const& filePath)
+{
+ std::string result = "__INCGUARD_";
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ result += cmSystemTools::ComputeStringMD5(filePath);
+#else
+ result += cmSystemTools::MakeCidentifier(filePath);
+#endif
+ result += "__";
+ return result;
+}
+
+bool CheckIncludeGuardIsSet(cmMakefile* mf, std::string const& includeGuardVar)
+{
+ if (mf->GetProperty(includeGuardVar)) {
+ return true;
+ }
+ cmStateSnapshot dirSnapshot =
+ mf->GetStateSnapshot().GetBuildsystemDirectoryParent();
+ while (dirSnapshot.GetState()) {
+ cmStateDirectory stateDir = dirSnapshot.GetDirectory();
+ if (stateDir.GetProperty(includeGuardVar)) {
+ return true;
+ }
+ dirSnapshot = dirSnapshot.GetBuildsystemDirectoryParent();
+ }
+ return false;
+}
+
+} // anonymous namespace
+
+// cmIncludeGuardCommand
+bool cmIncludeGuardCommand::InitialPass(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
+{
+ if (args.size() > 1) {
+ this->SetError(
+ "given an invalid number of arguments. The command takes at "
+ "most 1 argument.");
+ return false;
+ }
+
+ IncludeGuardScope scope = VARIABLE;
+
+ if (!args.empty()) {
+ std::string const& arg = args[0];
+ if (arg == "DIRECTORY") {
+ scope = DIRECTORY;
+ } else if (arg == "GLOBAL") {
+ scope = GLOBAL;
+ } else {
+ this->SetError("given an invalid scope: " + arg);
+ return false;
+ }
+ }
+
+ std::string includeGuardVar = GetIncludeGuardVariableName(
+ this->Makefile->GetDefinition("CMAKE_CURRENT_LIST_FILE"));
+
+ cmMakefile* const mf = this->Makefile;
+
+ switch (scope) {
+ case VARIABLE:
+ if (mf->IsDefinitionSet(includeGuardVar)) {
+ status.SetReturnInvoked();
+ return true;
+ }
+ mf->AddDefinition(includeGuardVar, true);
+ break;
+ case DIRECTORY:
+ if (CheckIncludeGuardIsSet(mf, includeGuardVar)) {
+ status.SetReturnInvoked();
+ return true;
+ }
+ mf->SetProperty(includeGuardVar, "TRUE");
+ break;
+ case GLOBAL:
+ cmake* const cm = mf->GetCMakeInstance();
+ if (cm->GetProperty(includeGuardVar)) {
+ status.SetReturnInvoked();
+ return true;
+ }
+ cm->SetProperty(includeGuardVar, "TRUE");
+ break;
+ }
+
+ return true;
+}
diff --git a/Source/cmIncludeGuardCommand.h b/Source/cmIncludeGuardCommand.h
new file mode 100644
index 0000000..4dc3d90
--- /dev/null
+++ b/Source/cmIncludeGuardCommand.h
@@ -0,0 +1,37 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmIncludeGuardCommand_h
+#define cmIncludeGuardCommand_h
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <string>
+#include <vector>
+
+#include "cmCommand.h"
+
+class cmExecutionStatus;
+
+/** \class cmIncludeGuardCommand
+ * \brief cmIncludeGuardCommand identical to C++ #pragma_once command
+ * Can work in 3 modes: GLOBAL (works on global properties),
+ * DIRECTORY(use directory property), VARIABLE(unnamed overload without
+ * arguments) define an ordinary variable to be used as include guard checker
+ */
+class cmIncludeGuardCommand : public cmCommand
+{
+public:
+ /**
+ * This is a virtual constructor for the command.
+ */
+ cmCommand* Clone() CM_OVERRIDE { return new cmIncludeGuardCommand; }
+
+ /**
+ * This is called when the command is first encountered in
+ * the CMakeLists.txt file.
+ */
+ bool InitialPass(std::vector<std::string> const& args,
+ cmExecutionStatus& status) CM_OVERRIDE;
+};
+
+#endif
diff --git a/Source/cmIncludeRegularExpressionCommand.h b/Source/cmIncludeRegularExpressionCommand.h
index bac4b8f..3ea0443 100644
--- a/Source/cmIncludeRegularExpressionCommand.h
+++ b/Source/cmIncludeRegularExpressionCommand.h
@@ -3,7 +3,7 @@
#ifndef cmIncludeRegularExpressionCommand_h
#define cmIncludeRegularExpressionCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 294fb17..7402105 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -204,7 +204,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
cmCommandArgumentsHelper argHelper;
cmCommandArgumentGroup group;
- cmCAStringVector genericArgVector(&argHelper, CM_NULLPTR);
+ cmCAStringVector genericArgVector(&argHelper, nullptr);
cmCAStringVector archiveArgVector(&argHelper, "ARCHIVE", &group);
cmCAStringVector libraryArgVector(&argHelper, "LIBRARY", &group);
cmCAStringVector runtimeArgVector(&argHelper, "RUNTIME", &group);
@@ -216,10 +216,10 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
&group);
cmCAStringVector publicHeaderArgVector(&argHelper, "PUBLIC_HEADER", &group);
cmCAStringVector resourceArgVector(&argHelper, "RESOURCE", &group);
- genericArgVector.Follows(CM_NULLPTR);
+ genericArgVector.Follows(nullptr);
group.Follows(&genericArgVector);
- argHelper.Parse(&args, CM_NULLPTR);
+ argHelper.Parse(&args, nullptr);
// now parse the generic args (i.e. the ones not specialized on LIBRARY/
// ARCHIVE, RUNTIME etc. (see above)
@@ -229,7 +229,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
cmCAStringVector targetList(&genericArgs.Parser, "TARGETS");
cmCAString exports(&genericArgs.Parser, "EXPORT",
&genericArgs.ArgumentGroup);
- targetList.Follows(CM_NULLPTR);
+ targetList.Follows(nullptr);
genericArgs.ArgumentGroup.Follows(&targetList);
genericArgs.Parse(&genericArgVector.GetVector(), &unknownArgs);
bool success = genericArgs.Finalize();
@@ -402,15 +402,15 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
ti != targets.end(); ++ti) {
// Handle each target type.
cmTarget& target = *(*ti);
- cmInstallTargetGenerator* archiveGenerator = CM_NULLPTR;
- cmInstallTargetGenerator* libraryGenerator = CM_NULLPTR;
- cmInstallTargetGenerator* runtimeGenerator = CM_NULLPTR;
- cmInstallTargetGenerator* objectGenerator = CM_NULLPTR;
- cmInstallTargetGenerator* frameworkGenerator = CM_NULLPTR;
- cmInstallTargetGenerator* bundleGenerator = CM_NULLPTR;
- cmInstallFilesGenerator* privateHeaderGenerator = CM_NULLPTR;
- cmInstallFilesGenerator* publicHeaderGenerator = CM_NULLPTR;
- cmInstallFilesGenerator* resourceGenerator = CM_NULLPTR;
+ cmInstallTargetGenerator* archiveGenerator = nullptr;
+ cmInstallTargetGenerator* libraryGenerator = nullptr;
+ cmInstallTargetGenerator* runtimeGenerator = nullptr;
+ cmInstallTargetGenerator* objectGenerator = nullptr;
+ cmInstallTargetGenerator* frameworkGenerator = nullptr;
+ cmInstallTargetGenerator* bundleGenerator = nullptr;
+ cmInstallFilesGenerator* privateHeaderGenerator = nullptr;
+ cmInstallFilesGenerator* publicHeaderGenerator = nullptr;
+ cmInstallFilesGenerator* resourceGenerator = nullptr;
// Track whether this is a namelink-only rule.
bool namelinkOnly = false;
@@ -437,8 +437,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
runtimeGenerator =
CreateInstallTargetGenerator(target, runtimeArgs, false);
}
- if ((archiveGenerator == CM_NULLPTR) &&
- (runtimeGenerator == CM_NULLPTR)) {
+ if ((archiveGenerator == nullptr) && (runtimeGenerator == nullptr)) {
this->SetError("Library TARGETS given no DESTINATION!");
return false;
}
@@ -688,16 +687,16 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
}
// Keep track of whether we're installing anything in each category
- installsArchive = installsArchive || archiveGenerator != CM_NULLPTR;
- installsLibrary = installsLibrary || libraryGenerator != CM_NULLPTR;
- installsRuntime = installsRuntime || runtimeGenerator != CM_NULLPTR;
- installsObject = installsObject || objectGenerator != CM_NULLPTR;
- installsFramework = installsFramework || frameworkGenerator != CM_NULLPTR;
- installsBundle = installsBundle || bundleGenerator != CM_NULLPTR;
+ installsArchive = installsArchive || archiveGenerator != nullptr;
+ installsLibrary = installsLibrary || libraryGenerator != nullptr;
+ installsRuntime = installsRuntime || runtimeGenerator != nullptr;
+ installsObject = installsObject || objectGenerator != nullptr;
+ installsFramework = installsFramework || frameworkGenerator != nullptr;
+ installsBundle = installsBundle || bundleGenerator != nullptr;
installsPrivateHeader =
- installsPrivateHeader || privateHeaderGenerator != CM_NULLPTR;
+ installsPrivateHeader || privateHeaderGenerator != nullptr;
installsPublicHeader =
- installsPublicHeader || publicHeaderGenerator != CM_NULLPTR;
+ installsPublicHeader || publicHeaderGenerator != nullptr;
installsResource = installsResource || resourceGenerator;
this->Makefile->AddInstallGenerator(archiveGenerator);
@@ -779,7 +778,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
bool programs = (args[0] == "PROGRAMS");
cmInstallCommandArguments ica(this->DefaultComponentName);
cmCAStringVector files(&ica.Parser, programs ? "PROGRAMS" : "FILES");
- files.Follows(CM_NULLPTR);
+ files.Follows(nullptr);
ica.ArgumentGroup.Follows(&files);
std::vector<std::string> unknownArgs;
ica.Parse(&args, &unknownArgs);
@@ -819,7 +818,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
for (std::vector<std::string>::const_iterator fileIt = filesVector.begin();
fileIt != filesVector.end(); ++fileIt) {
if (gg->IsExportedTargetsFile(*fileIt)) {
- const char* modal = CM_NULLPTR;
+ const char* modal = nullptr;
std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
@@ -895,7 +894,7 @@ bool cmInstallCommand::HandleDirectoryMode(
bool exclude_from_all = false;
bool message_never = false;
std::vector<std::string> dirs;
- const char* destination = CM_NULLPTR;
+ const char* destination = nullptr;
std::string permissions_file;
std::string permissions_dir;
std::vector<std::string> configurations;
@@ -1181,7 +1180,7 @@ bool cmInstallCommand::HandleExportAndroidMKMode(
cmCAEnabler exportOld(&ica.Parser, "EXPORT_LINK_INTERFACE_LIBRARIES",
&ica.ArgumentGroup);
cmCAString filename(&ica.Parser, "FILE", &ica.ArgumentGroup);
- exp.Follows(CM_NULLPTR);
+ exp.Follows(nullptr);
ica.ArgumentGroup.Follows(&exp);
std::vector<std::string> unknownArgs;
@@ -1273,7 +1272,7 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
cmCAEnabler exportOld(&ica.Parser, "EXPORT_LINK_INTERFACE_LIBRARIES",
&ica.ArgumentGroup);
cmCAString filename(&ica.Parser, "FILE", &ica.ArgumentGroup);
- exp.Follows(CM_NULLPTR);
+ exp.Follows(nullptr);
ica.ArgumentGroup.Follows(&exp);
std::vector<std::string> unknownArgs;
diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h
index f5d1f92..b34f560 100644
--- a/Source/cmInstallCommand.h
+++ b/Source/cmInstallCommand.h
@@ -3,7 +3,7 @@
#ifndef cmInstallCommand_h
#define cmInstallCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx
index b73414d..072d2a5 100644
--- a/Source/cmInstallCommandArguments.cxx
+++ b/Source/cmInstallCommandArguments.cxx
@@ -2,15 +2,13 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmInstallCommandArguments.h"
-#include "cmConfigure.h"
-
#include "cmSystemTools.h"
// Table of valid permissions.
const char* cmInstallCommandArguments::PermissionsTable[] = {
"OWNER_READ", "OWNER_WRITE", "OWNER_EXECUTE", "GROUP_READ",
"GROUP_WRITE", "GROUP_EXECUTE", "WORLD_READ", "WORLD_WRITE",
- "WORLD_EXECUTE", "SETUID", "SETGID", CM_NULLPTR
+ "WORLD_EXECUTE", "SETUID", "SETGID", nullptr
};
const std::string cmInstallCommandArguments::EmptyString;
@@ -28,7 +26,7 @@ cmInstallCommandArguments::cmInstallCommandArguments(
, Optional(&Parser, "OPTIONAL", &ArgumentGroup)
, NamelinkOnly(&Parser, "NAMELINK_ONLY", &ArgumentGroup)
, NamelinkSkip(&Parser, "NAMELINK_SKIP", &ArgumentGroup)
- , GenericArguments(CM_NULLPTR)
+ , GenericArguments(nullptr)
, DefaultComponentName(defaultComponent)
{
}
@@ -38,7 +36,7 @@ const std::string& cmInstallCommandArguments::GetDestination() const
if (!this->DestinationString.empty()) {
return this->DestinationString;
}
- if (this->GenericArguments != CM_NULLPTR) {
+ if (this->GenericArguments != nullptr) {
return this->GenericArguments->GetDestination();
}
return this->EmptyString;
@@ -49,7 +47,7 @@ const std::string& cmInstallCommandArguments::GetComponent() const
if (!this->Component.GetString().empty()) {
return this->Component.GetString();
}
- if (this->GenericArguments != CM_NULLPTR) {
+ if (this->GenericArguments != nullptr) {
return this->GenericArguments->GetComponent();
}
if (!this->DefaultComponentName.empty()) {
@@ -64,7 +62,7 @@ const std::string& cmInstallCommandArguments::GetRename() const
if (!this->Rename.GetString().empty()) {
return this->Rename.GetString();
}
- if (this->GenericArguments != CM_NULLPTR) {
+ if (this->GenericArguments != nullptr) {
return this->GenericArguments->GetRename();
}
return this->EmptyString;
@@ -75,7 +73,7 @@ const std::string& cmInstallCommandArguments::GetPermissions() const
if (!this->PermissionsString.empty()) {
return this->PermissionsString;
}
- if (this->GenericArguments != CM_NULLPTR) {
+ if (this->GenericArguments != nullptr) {
return this->GenericArguments->GetPermissions();
}
return this->EmptyString;
@@ -86,7 +84,7 @@ bool cmInstallCommandArguments::GetOptional() const
if (this->Optional.IsEnabled()) {
return true;
}
- if (this->GenericArguments != CM_NULLPTR) {
+ if (this->GenericArguments != nullptr) {
return this->GenericArguments->GetOptional();
}
return false;
@@ -97,7 +95,7 @@ bool cmInstallCommandArguments::GetExcludeFromAll() const
if (this->ExcludeFromAll.IsEnabled()) {
return true;
}
- if (this->GenericArguments != CM_NULLPTR) {
+ if (this->GenericArguments != nullptr) {
return this->GenericArguments->GetExcludeFromAll();
}
return false;
@@ -108,7 +106,7 @@ bool cmInstallCommandArguments::GetNamelinkOnly() const
if (this->NamelinkOnly.IsEnabled()) {
return true;
}
- if (this->GenericArguments != CM_NULLPTR) {
+ if (this->GenericArguments != nullptr) {
return this->GenericArguments->GetNamelinkOnly();
}
return false;
@@ -119,7 +117,7 @@ bool cmInstallCommandArguments::GetNamelinkSkip() const
if (this->NamelinkSkip.IsEnabled()) {
return true;
}
- if (this->GenericArguments != CM_NULLPTR) {
+ if (this->GenericArguments != nullptr) {
return this->GenericArguments->GetNamelinkSkip();
}
return false;
@@ -131,7 +129,7 @@ const std::vector<std::string>& cmInstallCommandArguments::GetConfigurations()
if (!this->Configurations.GetVector().empty()) {
return this->Configurations.GetVector();
}
- if (this->GenericArguments != CM_NULLPTR) {
+ if (this->GenericArguments != nullptr) {
return this->GenericArguments->GetConfigurations();
}
return this->Configurations.GetVector();
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index 54ad85c..1ca9893 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -17,7 +17,7 @@ cmInstallDirectoryGenerator::cmInstallDirectoryGenerator(
bool optional)
: cmInstallGenerator(dest, configurations, component, message,
exclude_from_all)
- , LocalGenerator(CM_NULLPTR)
+ , LocalGenerator(nullptr)
, Directories(dirs)
, FilePermissions(file_permissions)
, DirPermissions(dir_permissions)
@@ -86,7 +86,7 @@ void cmInstallDirectoryGenerator::AddDirectoryInstallRule(
std::vector<std::string> const& dirs)
{
// Write code to install the directories.
- const char* no_rename = CM_NULLPTR;
+ const char* no_rename = nullptr;
this->AddInstallRule(os, this->GetDestination(config),
cmInstallType_DIRECTORY, dirs, this->Optional,
this->FilePermissions.c_str(),
diff --git a/Source/cmInstallDirectoryGenerator.h b/Source/cmInstallDirectoryGenerator.h
index aa2cbc6..d699599 100644
--- a/Source/cmInstallDirectoryGenerator.h
+++ b/Source/cmInstallDirectoryGenerator.h
@@ -6,7 +6,7 @@
#include "cmInstallGenerator.h"
#include "cmScriptGenerator.h"
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <string>
diff --git a/Source/cmInstallExportAndroidMKGenerator.cxx b/Source/cmInstallExportAndroidMKGenerator.cxx
index 8eeaa9c..dd85b88 100644
--- a/Source/cmInstallExportAndroidMKGenerator.cxx
+++ b/Source/cmInstallExportAndroidMKGenerator.cxx
@@ -95,8 +95,8 @@ void cmInstallExportAndroidMKGenerator::GenerateScriptConfigs(
std::string config_test = this->CreateConfigTest(i->first);
os << indent << "if(" << config_test << ")\n";
this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files,
- false, this->FilePermissions.c_str(), CM_NULLPTR,
- CM_NULLPTR, CM_NULLPTR, indent.Next());
+ false, this->FilePermissions.c_str(), nullptr,
+ nullptr, nullptr, indent.Next());
os << indent << "endif()\n";
files.clear();
}
@@ -135,6 +135,6 @@ void cmInstallExportAndroidMKGenerator::GenerateScriptActions(
std::vector<std::string> files;
files.push_back(this->MainImportFile);
this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files,
- false, this->FilePermissions.c_str(), CM_NULLPTR,
- CM_NULLPTR, CM_NULLPTR, indent);
+ false, this->FilePermissions.c_str(), nullptr, nullptr,
+ nullptr, indent);
}
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index b176e85..ec1b210 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -29,7 +29,7 @@ cmInstallExportGenerator::cmInstallExportGenerator(
, FileName(filename)
, Namespace(name_space)
, ExportOld(exportOld)
- , LocalGenerator(CM_NULLPTR)
+ , LocalGenerator(nullptr)
{
if (android) {
#ifdef CMAKE_BUILD_WITH_CMAKE
@@ -181,8 +181,8 @@ void cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os,
std::string config_test = this->CreateConfigTest(i->first);
os << indent << "if(" << config_test << ")\n";
this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files,
- false, this->FilePermissions.c_str(), CM_NULLPTR,
- CM_NULLPTR, CM_NULLPTR, indent.Next());
+ false, this->FilePermissions.c_str(), nullptr,
+ nullptr, nullptr, indent.Next());
os << indent << "endif()\n";
files.clear();
}
@@ -221,6 +221,6 @@ void cmInstallExportGenerator::GenerateScriptActions(std::ostream& os,
std::vector<std::string> files;
files.push_back(this->MainImportFile);
this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files,
- false, this->FilePermissions.c_str(), CM_NULLPTR,
- CM_NULLPTR, CM_NULLPTR, indent);
+ false, this->FilePermissions.c_str(), nullptr, nullptr,
+ nullptr, indent);
}
diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h
index 047e6b3..35c7743 100644
--- a/Source/cmInstallExportGenerator.h
+++ b/Source/cmInstallExportGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmInstallExportGenerator_h
#define cmInstallExportGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmInstallGenerator.h"
#include "cmScriptGenerator.h"
diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h
index b3c27b8..702b332 100644
--- a/Source/cmInstallFilesCommand.h
+++ b/Source/cmInstallFilesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmInstallFilesCommand_h
#define cmInstallFilesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index 6323a91..4fcff4f 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -16,7 +16,7 @@ cmInstallFilesGenerator::cmInstallFilesGenerator(
const char* rename, bool optional)
: cmInstallGenerator(dest, configurations, component, message,
exclude_from_all)
- , LocalGenerator(CM_NULLPTR)
+ , LocalGenerator(nullptr)
, Files(files)
, FilePermissions(file_permissions)
, Rename(rename)
@@ -58,12 +58,12 @@ void cmInstallFilesGenerator::AddFilesInstallRule(
std::vector<std::string> const& files)
{
// Write code to install the files.
- const char* no_dir_permissions = CM_NULLPTR;
+ const char* no_dir_permissions = nullptr;
this->AddInstallRule(
os, this->GetDestination(config),
(this->Programs ? cmInstallType_PROGRAMS : cmInstallType_FILES), files,
this->Optional, this->FilePermissions.c_str(), no_dir_permissions,
- this->Rename.c_str(), CM_NULLPTR, indent);
+ this->Rename.c_str(), nullptr, indent);
}
void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os,
diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h
index 62b57f9..b2c7c4b 100644
--- a/Source/cmInstallFilesGenerator.h
+++ b/Source/cmInstallFilesGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmInstallFilesGenerator_h
#define cmInstallFilesGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmInstallGenerator.h"
#include "cmScriptGenerator.h"
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index 13b588e..3fbb3af 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -131,9 +131,9 @@ void cmInstallGenerator::AddInstallRule(
std::string cmInstallGenerator::CreateComponentTest(const char* component,
bool exclude_from_all)
{
- std::string result = "\"${CMAKE_INSTALL_COMPONENT}\" STREQUAL \"";
+ std::string result = "\"x${CMAKE_INSTALL_COMPONENT}x\" STREQUAL \"x";
result += component;
- result += "\"";
+ result += "x\"";
if (!exclude_from_all) {
result += " OR NOT CMAKE_INSTALL_COMPONENT";
}
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index 8f8701f..813cbe8 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmInstallGenerator_h
#define cmInstallGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmInstallType.h"
#include "cmScriptGenerator.h"
@@ -41,9 +41,9 @@ public:
void AddInstallRule(
std::ostream& os, std::string const& dest, cmInstallType type,
std::vector<std::string> const& files, bool optional = false,
- const char* permissions_file = CM_NULLPTR,
- const char* permissions_dir = CM_NULLPTR, const char* rename = CM_NULLPTR,
- const char* literal_args = CM_NULLPTR, Indent indent = Indent());
+ const char* permissions_file = nullptr,
+ const char* permissions_dir = nullptr, const char* rename = nullptr,
+ const char* literal_args = nullptr, Indent indent = Indent());
/** Get the install destination as it should appear in the
installation script. */
diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h
index 242fb95..e0ecbda 100644
--- a/Source/cmInstallProgramsCommand.h
+++ b/Source/cmInstallProgramsCommand.h
@@ -3,7 +3,7 @@
#ifndef cmInstallProgramsCommand_h
#define cmInstallProgramsCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx
index b39a622..f7e6e44 100644
--- a/Source/cmInstallScriptGenerator.cxx
+++ b/Source/cmInstallScriptGenerator.cxx
@@ -11,7 +11,7 @@ cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script,
bool code,
const char* component,
bool exclude_from_all)
- : cmInstallGenerator(CM_NULLPTR, std::vector<std::string>(), component,
+ : cmInstallGenerator(nullptr, std::vector<std::string>(), component,
MessageDefault, exclude_from_all)
, Script(script)
, Code(code)
diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h
index e183999..7e19aa6 100644
--- a/Source/cmInstallScriptGenerator.h
+++ b/Source/cmInstallScriptGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmInstallScriptGenerator_h
#define cmInstallScriptGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmInstallGenerator.h"
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 84d6f7a..2b15aeb 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -28,7 +28,7 @@ cmInstallTargetGenerator::cmInstallTargetGenerator(
: cmInstallGenerator(dest, configurations, component, message,
exclude_from_all)
, TargetName(targetName)
- , Target(CM_NULLPTR)
+ , Target(nullptr)
, FilePermissions(file_permissions)
, ImportLibrary(implib)
, Optional(optional)
@@ -312,8 +312,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
&cmInstallTargetGenerator::PreReplacementTweaks);
// Write code to install the target file.
- const char* no_dir_permissions = CM_NULLPTR;
- const char* no_rename = CM_NULLPTR;
+ const char* no_dir_permissions = nullptr;
+ const char* no_rename = nullptr;
bool optional = this->Optional || this->ImportLibrary;
this->AddInstallRule(os, this->GetDestination(config), type, filesFrom,
optional, this->FilePermissions.c_str(),
@@ -351,8 +351,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfigObjectLibrary(
std::string const obj_dir = this->Target->GetObjectDirectory(config);
std::string const literal_args = " FILES_FROM_DIR \"" + obj_dir + "\"";
- const char* no_dir_permissions = CM_NULLPTR;
- const char* no_rename = CM_NULLPTR;
+ const char* no_dir_permissions = nullptr;
+ const char* no_rename = nullptr;
this->AddInstallRule(os, dest, cmInstallType_FILES, objects, this->Optional,
this->FilePermissions.c_str(), no_dir_permissions,
no_rename, literal_args.c_str(), indent);
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index cf2de58..385d995 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmInstallTargetGenerator_h
#define cmInstallTargetGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmInstallGenerator.h"
#include "cmScriptGenerator.h"
diff --git a/Source/cmInstallTargetsCommand.cxx b/Source/cmInstallTargetsCommand.cxx
index e00eba0..d721ca0 100644
--- a/Source/cmInstallTargetsCommand.cxx
+++ b/Source/cmInstallTargetsCommand.cxx
@@ -2,12 +2,12 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmInstallTargetsCommand.h"
+#include <unordered_map>
#include <utility>
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmTarget.h"
-#include "cm_unordered_map.hxx"
class cmExecutionStatus;
diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h
index cc84843..17622fb 100644
--- a/Source/cmInstallTargetsCommand.h
+++ b/Source/cmInstallTargetsCommand.h
@@ -3,7 +3,7 @@
#ifndef cmInstallTargetsCommand_h
#define cmInstallTargetsCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index d51fd8d..035c900 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -7,11 +7,10 @@
#include "cmMakefile.h"
#include "cmSystemTools.h"
-#include "cmConfigure.h"
#include <utility>
cmInstalledFile::cmInstalledFile()
- : NameExpression(CM_NULLPTR)
+ : NameExpression(nullptr)
{
}
diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h
index b64e48d..6297073 100644
--- a/Source/cmLinkDirectoriesCommand.h
+++ b/Source/cmLinkDirectoriesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmLinkDirectoriesCommand_h
#define cmLinkDirectoriesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index f0fded2..e8c9487 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -3,7 +3,7 @@
#ifndef cmLinkItem_h
#define cmLinkItem_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <algorithm>
#include <map>
@@ -24,7 +24,7 @@ class cmLinkItem : public std::string
public:
cmLinkItem()
: std_string()
- , Target(CM_NULLPTR)
+ , Target(nullptr)
{
}
cmLinkItem(const std_string& n, cmGeneratorTarget const* t)
@@ -105,7 +105,7 @@ struct cmOptionalLinkInterface : public cmLinkInterface
, AllDone(false)
, Exists(false)
, HadHeadSensitiveCondition(false)
- , ExplicitLibraries(CM_NULLPTR)
+ , ExplicitLibraries(nullptr)
{
}
bool LibrariesDone;
diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h
index f1b3a68..54121dd 100644
--- a/Source/cmLinkLibrariesCommand.h
+++ b/Source/cmLinkLibrariesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmLinkLibrariesCommand_h
#define cmLinkLibrariesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmLinkLineComputer.h b/Source/cmLinkLineComputer.h
index d33e8d1..a016358 100644
--- a/Source/cmLinkLineComputer.h
+++ b/Source/cmLinkLineComputer.h
@@ -4,7 +4,7 @@
#ifndef cmLinkLineComputer_h
#define cmLinkLineComputer_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
diff --git a/Source/cmLinkLineDeviceComputer.h b/Source/cmLinkLineDeviceComputer.h
index c3fac61..66941d3 100644
--- a/Source/cmLinkLineDeviceComputer.h
+++ b/Source/cmLinkLineDeviceComputer.h
@@ -4,7 +4,7 @@
#ifndef cmLinkLineDeviceComputer_h
#define cmLinkLineDeviceComputer_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h
index 55592cb..8865e23 100644
--- a/Source/cmLinkedTree.h
+++ b/Source/cmLinkedTree.h
@@ -3,7 +3,7 @@
#ifndef cmLinkedTree_h
#define cmLinkedTree_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <assert.h>
#include <iterator>
@@ -49,7 +49,7 @@ public:
public:
iterator()
- : Tree(CM_NULLPTR)
+ : Tree(nullptr)
, Position(0)
{
}
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 0542c4f..ae4f0a8 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -182,9 +182,9 @@ bool cmListCommand::HandleGetCommand(std::vector<std::string> const& args)
value += sep;
sep = ";";
if (item < 0) {
- item = (int)nitem + item;
+ item = static_cast<int>(nitem) + item;
}
- if (item < 0 || nitem <= (size_t)item) {
+ if (item < 0 || nitem <= static_cast<size_t>(item)) {
std::ostringstream str;
str << "index: " << item << " out of range (-" << nitem << ", "
<< nitem - 1 << ")";
@@ -273,9 +273,9 @@ bool cmListCommand::HandleInsertCommand(std::vector<std::string> const& args)
if (!varArgsExpanded.empty()) {
size_t nitem = varArgsExpanded.size();
if (item < 0) {
- item = (int)nitem + item;
+ item = static_cast<int>(nitem) + item;
}
- if (item < 0 || nitem <= (size_t)item) {
+ if (item < 0 || nitem <= static_cast<size_t>(item)) {
std::ostringstream str;
str << "index: " << item << " out of range (-" << varArgsExpanded.size()
<< ", "
@@ -423,9 +423,9 @@ bool cmListCommand::HandleRemoveAtCommand(std::vector<std::string> const& args)
for (cc = 2; cc < args.size(); ++cc) {
int item = atoi(args[cc].c_str());
if (item < 0) {
- item = (int)nitem + item;
+ item = static_cast<int>(nitem) + item;
}
- if (item < 0 || nitem <= (size_t)item) {
+ if (item < 0 || nitem <= static_cast<size_t>(item)) {
std::ostringstream str;
str << "index: " << item << " out of range (-" << nitem << ", "
<< nitem - 1 << ")";
diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h
index 7789f7d..7d3800a 100644
--- a/Source/cmListCommand.h
+++ b/Source/cmListCommand.h
@@ -3,7 +3,7 @@
#ifndef cmListCommand_h
#define cmListCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 0c73cd7..8e8a54d 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -9,7 +9,6 @@
#include "cmSystemTools.h"
#include "cmake.h"
-#include "cmConfigure.h"
#include <algorithm>
#include <assert.h>
#include <sstream>
@@ -82,7 +81,7 @@ bool cmListFileParser::ParseFile()
}
if (bom == cmListFileLexer_BOM_Broken) {
- cmListFileLexer_SetFileName(this->Lexer, CM_NULLPTR, CM_NULLPTR);
+ cmListFileLexer_SetFileName(this->Lexer, nullptr, nullptr);
this->IssueFileOpenError("Error while reading Byte-Order-Mark. "
"File not seekable?");
return false;
@@ -90,7 +89,7 @@ bool cmListFileParser::ParseFile()
// Verify the Byte-Order-Mark, if any.
if (bom != cmListFileLexer_BOM_None && bom != cmListFileLexer_BOM_UTF8) {
- cmListFileLexer_SetFileName(this->Lexer, CM_NULLPTR, CM_NULLPTR);
+ cmListFileLexer_SetFileName(this->Lexer, nullptr, nullptr);
this->IssueFileOpenError(
"File starts with a Byte-Order-Mark that is not UTF-8.");
return false;
@@ -330,13 +329,13 @@ cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot const& bottom,
cmListFileBacktrace::cmListFileBacktrace()
: Bottom()
- , Cur(CM_NULLPTR)
+ , Cur(nullptr)
{
}
cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot const& snapshot)
: Bottom(snapshot.GetCallStackBottom())
- , Cur(CM_NULLPTR)
+ , Cur(nullptr)
{
}
diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h
index 1a8a0fc..e46144d 100644
--- a/Source/cmLoadCacheCommand.h
+++ b/Source/cmLoadCacheCommand.h
@@ -3,7 +3,7 @@
#ifndef cmLoadCacheCommand_h
#define cmLoadCacheCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <set>
#include <string>
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index 92a32a1..5ce48e3 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -63,7 +63,7 @@ public:
void FinalPass() CM_OVERRIDE;
bool HasFinalPass() const CM_OVERRIDE
{
- return this->info.FinalPass != CM_NULLPTR;
+ return this->info.FinalPass != nullptr;
}
static const char* LastName;
@@ -86,11 +86,11 @@ public:
#endif
signal(SIGILL, TrapsForSignalsCFunction);
} else {
- signal(SIGSEGV, CM_NULLPTR);
+ signal(SIGSEGV, nullptr);
#ifdef SIGBUS
- signal(SIGBUS, CM_NULLPTR);
+ signal(SIGBUS, nullptr);
#endif
- signal(SIGILL, CM_NULLPTR);
+ signal(SIGILL, nullptr);
}
}
@@ -102,7 +102,7 @@ extern "C" void TrapsForSignalsCFunction(int sig)
cmLoadedCommand::TrapsForSignals(sig);
}
-const char* cmLoadedCommand::LastName = CM_NULLPTR;
+const char* cmLoadedCommand::LastName = nullptr;
bool cmLoadedCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
@@ -118,17 +118,16 @@ bool cmLoadedCommand::InitialPass(std::vector<std::string> const& args,
// create argc and argv and then invoke the command
int argc = static_cast<int>(args.size());
- char** argv = CM_NULLPTR;
+ char** argv = nullptr;
if (argc) {
- argv = (char**)malloc(argc * sizeof(char*));
+ argv = reinterpret_cast<char**>(malloc(argc * sizeof(char*)));
}
int i;
for (i = 0; i < argc; ++i) {
argv[i] = strdup(args[i].c_str());
}
cmLoadedCommand::InstallSignalHandlers(info.Name);
- int result =
- info.InitialPass((void*)&info, (void*)this->Makefile, argc, argv);
+ int result = info.InitialPass(&info, this->Makefile, argc, argv);
cmLoadedCommand::InstallSignalHandlers(info.Name, 1);
cmFreeArguments(argc, argv);
@@ -147,7 +146,7 @@ void cmLoadedCommand::FinalPass()
{
if (this->info.FinalPass) {
cmLoadedCommand::InstallSignalHandlers(info.Name);
- this->info.FinalPass((void*)&this->info, (void*)this->Makefile);
+ this->info.FinalPass(&this->info, this->Makefile);
cmLoadedCommand::InstallSignalHandlers(info.Name, 1);
}
}
@@ -156,7 +155,7 @@ cmLoadedCommand::~cmLoadedCommand()
{
if (this->info.Destructor) {
cmLoadedCommand::InstallSignalHandlers(info.Name);
- this->info.Destructor((void*)&this->info);
+ this->info.Destructor(&this->info);
cmLoadedCommand::InstallSignalHandlers(info.Name, 1);
}
if (this->info.Error) {
@@ -225,14 +224,13 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& args,
// find the init function
std::string initFuncName = args[0] + "Init";
- CM_INIT_FUNCTION initFunction =
- (CM_INIT_FUNCTION)cmsys::DynamicLoader::GetSymbolAddress(lib,
- initFuncName);
+ CM_INIT_FUNCTION initFunction = reinterpret_cast<CM_INIT_FUNCTION>(
+ cmsys::DynamicLoader::GetSymbolAddress(lib, initFuncName));
if (!initFunction) {
initFuncName = "_";
initFuncName += args[0];
initFuncName += "Init";
- initFunction = (CM_INIT_FUNCTION)(
+ initFunction = reinterpret_cast<CM_INIT_FUNCTION>(
cmsys::DynamicLoader::GetSymbolAddress(lib, initFuncName));
}
// if the symbol is found call it to set the name on the
diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h
index 030786e..30bb7da 100644
--- a/Source/cmLoadCommandCommand.h
+++ b/Source/cmLoadCommandCommand.h
@@ -3,7 +3,7 @@
#ifndef cmLoadCommandCommand_h
#define cmLoadCommandCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmLocalCommonGenerator.h b/Source/cmLocalCommonGenerator.h
index a5afcd8..999085e 100644
--- a/Source/cmLocalCommonGenerator.h
+++ b/Source/cmLocalCommonGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmLocalCommonGenerator_h
#define cmLocalCommonGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 6ce31c5..6e0e28c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -214,8 +214,8 @@ void cmLocalGenerator::TraceDependencies()
this->GlobalGenerator->CreateEvaluationSourceFiles(*ci);
}
// Generate the rule files for each target.
- std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator t = targets.begin();
t != targets.end(); ++t) {
if ((*t)->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
@@ -259,6 +259,17 @@ void cmLocalGenerator::GenerateTestFiles()
fout << "include(\"" << testIncludeFile << "\")" << std::endl;
}
+ const char* testIncludeFiles =
+ this->Makefile->GetProperty("TEST_INCLUDE_FILES");
+ if (testIncludeFiles) {
+ std::vector<std::string> includesList;
+ cmSystemTools::ExpandListArgument(testIncludeFiles, includesList);
+ for (std::vector<std::string>::const_iterator i = includesList.begin();
+ i != includesList.end(); ++i) {
+ fout << "include(\"" << *i << "\")" << std::endl;
+ }
+ }
+
// Ask each test generator to write its code.
std::vector<cmTestGenerator*> const& testers =
this->Makefile->GetTestGenerators();
@@ -277,6 +288,25 @@ void cmLocalGenerator::GenerateTestFiles()
outP = cmOutputConverter::EscapeForCMake(outP);
fout << "subdirs(" << outP << ")" << std::endl;
}
+
+ // Add directory labels property
+ const char* directoryLabels =
+ this->Makefile->GetDefinition("CMAKE_DIRECTORY_LABELS");
+ const char* labels = this->Makefile->GetProperty("LABELS");
+
+ if (labels || directoryLabels) {
+ fout << "set_directory_properties(PROPERTIES LABELS ";
+ if (labels) {
+ fout << cmOutputConverter::EscapeForCMake(labels);
+ }
+ if (labels && directoryLabels) {
+ fout << ";";
+ }
+ if (directoryLabels) {
+ fout << cmOutputConverter::EscapeForCMake(directoryLabels);
+ }
+ fout << ")" << std::endl;
+ }
}
void cmLocalGenerator::CreateEvaluationFileOutputs(std::string const& config)
@@ -327,6 +357,7 @@ void cmLocalGenerator::GenerateInstallRules()
{
// Compute the install prefix.
const char* prefix = this->Makefile->GetDefinition("CMAKE_INSTALL_PREFIX");
+
#if defined(_WIN32) && !defined(__CYGWIN__)
std::string prefix_win32;
if (!prefix) {
@@ -370,7 +401,7 @@ void cmLocalGenerator::GenerateInstallRules()
// Choose a default install configuration.
std::string default_config = config;
const char* default_order[] = { "RELEASE", "MINSIZEREL", "RELWITHDEBINFO",
- "DEBUG", CM_NULLPTR };
+ "DEBUG", nullptr };
for (const char** c = default_order; *c && default_config.empty(); ++c) {
for (std::vector<std::string>::iterator i = configurationTypes.begin();
i != configurationTypes.end(); ++i) {
@@ -451,6 +482,19 @@ void cmLocalGenerator::GenerateInstallRules()
/* clang-format on */
}
+ // Copy cmake cross compile state to install code.
+ if (const char* crosscompiling =
+ this->Makefile->GetDefinition("CMAKE_CROSSCOMPILING")) {
+ /* clang-format off */
+ fout <<
+ "# Is this installation the result of a crosscompile?\n"
+ "if(NOT DEFINED CMAKE_CROSSCOMPILING)\n"
+ " set(CMAKE_CROSSCOMPILING \"" << crosscompiling << "\")\n"
+ "endif()\n"
+ "\n";
+ /* clang-format on */
+ }
+
// Ask each install generator to write its code.
std::vector<cmInstallGenerator*> const& installers =
this->Makefile->GetInstallGenerators();
@@ -504,6 +548,8 @@ void cmLocalGenerator::GenerateInstallRules()
void cmLocalGenerator::AddGeneratorTarget(cmGeneratorTarget* gt)
{
this->GeneratorTargets.push_back(gt);
+ this->GeneratorTargetSearchIndex.insert(
+ std::pair<std::string, cmGeneratorTarget*>(gt->GetName(), gt));
this->GlobalGenerator->IndexGeneratorTarget(gt);
}
@@ -537,13 +583,12 @@ private:
cmGeneratorTarget* cmLocalGenerator::FindLocalNonAliasGeneratorTarget(
const std::string& name) const
{
- std::vector<cmGeneratorTarget*>::const_iterator ti =
- std::find_if(this->GeneratorTargets.begin(), this->GeneratorTargets.end(),
- NamedGeneratorTargetFinder(name));
- if (ti != this->GeneratorTargets.end()) {
- return *ti;
+ GeneratorTargetMap::const_iterator ti =
+ this->GeneratorTargetSearchIndex.find(name);
+ if (ti != this->GeneratorTargetSearchIndex.end()) {
+ return ti->second;
}
- return CM_NULLPTR;
+ return nullptr;
}
void cmLocalGenerator::ComputeTargetManifest()
@@ -556,8 +601,8 @@ void cmLocalGenerator::ComputeTargetManifest()
}
// Add our targets to the manifest for each configuration.
- std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator t = targets.begin();
t != targets.end(); ++t) {
cmGeneratorTarget* target = *t;
if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
@@ -581,8 +626,8 @@ bool cmLocalGenerator::ComputeTargetCompileFeatures()
}
// Process compile features of all targets.
- std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator t = targets.begin();
t != targets.end(); ++t) {
cmGeneratorTarget* target = *t;
for (std::vector<std::string>::iterator ci = configNames.begin();
@@ -663,7 +708,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
// normal flag is repeated for each directory.
std::string sysFlagVar = "CMAKE_INCLUDE_SYSTEM_FLAG_";
sysFlagVar += lang;
- const char* sysIncludeFlag = CM_NULLPTR;
+ const char* sysIncludeFlag = nullptr;
if (repeatFlag) {
sysIncludeFlag = this->Makefile->GetDefinition(sysFlagVar);
}
@@ -1301,7 +1346,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
target->GetAppleArchs(config, archs);
const char* sysroot = this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT");
if (sysroot && sysroot[0] == '/' && !sysroot[1]) {
- sysroot = CM_NULLPTR;
+ sysroot = nullptr;
}
std::string sysrootFlagVar =
std::string("CMAKE_") + lang + "_SYSROOT_FLAG";
@@ -1502,20 +1547,34 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
// This compiler has no notion of language standard levels.
return;
}
- std::string stdProp = lang + "_STANDARD";
- const char* standardProp = target->GetProperty(stdProp);
- if (!standardProp) {
- return;
- }
std::string extProp = lang + "_EXTENSIONS";
- std::string type = "EXTENSION";
bool ext = true;
if (const char* extPropValue = target->GetProperty(extProp)) {
if (cmSystemTools::IsOff(extPropValue)) {
ext = false;
- type = "STANDARD";
}
}
+ std::string stdProp = lang + "_STANDARD";
+ const char* standardProp = target->GetProperty(stdProp);
+ if (!standardProp) {
+ if (ext) {
+ // No language standard is specified and extensions are not disabled.
+ // Check if this compiler needs a flag to enable extensions.
+ std::string const option_flag =
+ "CMAKE_" + lang + "_EXTENSION_COMPILE_OPTION";
+ if (const char* opt =
+ target->Target->GetMakefile()->GetDefinition(option_flag)) {
+ std::vector<std::string> optVec;
+ cmSystemTools::ExpandListArgument(opt, optVec);
+ for (size_t i = 0; i < optVec.size(); ++i) {
+ this->AppendFlagEscape(flags, optVec[i]);
+ }
+ }
+ }
+ return;
+ }
+
+ std::string const type = ext ? "EXTENSION" : "STANDARD";
if (target->GetPropertyAsBool(lang + "_STANDARD_REQUIRED")) {
std::string option_flag =
@@ -1583,8 +1642,10 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
return;
}
- // Greater or equal because the standards are stored in
- // backward chronological order.
+ // If the standard requested is older than the compiler's default
+ // then we need to use a flag to change it. The comparison is
+ // greater-or-equal because the standards are stored in backward
+ // chronological order.
if (stdIt >= defaultStdIt) {
std::string option_flag =
"CMAKE_" + lang + *stdIt + "_" + type + "_COMPILE_OPTION";
@@ -1599,6 +1660,9 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
return;
}
+ // The standard requested is at least as new as the compiler's default,
+ // and the standard request is not required. Decay to the newest standard
+ // for which a flag is defined.
for (; stdIt < defaultStdIt; ++stdIt) {
std::string option_flag =
"CMAKE_" + lang + *stdIt + "_" + type + "_COMPILE_OPTION";
@@ -1679,7 +1743,7 @@ void cmLocalGenerator::AddVisibilityPresetFlags(
}
std::string warnCMP0063;
- std::string* pWarnCMP0063 = CM_NULLPTR;
+ std::string* pWarnCMP0063 = nullptr;
if (target->GetType() != cmStateEnums::SHARED_LIBRARY &&
target->GetType() != cmStateEnums::MODULE_LIBRARY &&
!target->IsExecutableWithExports()) {
@@ -1790,7 +1854,7 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
std::string const& lang,
int targetType)
{
- const char* picFlags = CM_NULLPTR;
+ const char* picFlags = nullptr;
if (targetType == cmStateEnums::EXECUTABLE) {
std::string flagsVar = "CMAKE_";
@@ -1873,7 +1937,7 @@ void cmLocalGenerator::AppendIPOLinkerFlags(std::string& flags,
const std::string name = "CMAKE_" + lang + "_LINK_OPTIONS_IPO";
const char* rawFlagsList = this->Makefile->GetDefinition(name);
- if (rawFlagsList == CM_NULLPTR) {
+ if (rawFlagsList == nullptr) {
return;
}
@@ -2003,7 +2067,7 @@ const char* cmLocalGenerator::GetFeature(const std::string& feature,
}
snp = snp.GetBuildsystemDirectoryParent();
}
- return CM_NULLPTR;
+ return nullptr;
}
std::string cmLocalGenerator::GetProjectName() const
@@ -2058,8 +2122,8 @@ void cmLocalGenerator::GenerateTargetInstallRules(
{
// Convert the old-style install specification from each target to
// an install generator and run it.
- std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); ++l) {
if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
@@ -2067,7 +2131,7 @@ void cmLocalGenerator::GenerateTargetInstallRules(
// Include the user-specified pre-install script for this target.
if (const char* preinstall = (*l)->GetProperty("PRE_INSTALL_SCRIPT")) {
- cmInstallScriptGenerator g(preinstall, false, CM_NULLPTR, false);
+ cmInstallScriptGenerator g(preinstall, false, nullptr, false);
g.Generate(os, config, configurationTypes);
}
@@ -2120,7 +2184,7 @@ void cmLocalGenerator::GenerateTargetInstallRules(
// Include the user-specified post-install script for this target.
if (const char* postinstall = (*l)->GetProperty("POST_INSTALL_SCRIPT")) {
- cmInstallScriptGenerator g(postinstall, false, CM_NULLPTR, false);
+ cmInstallScriptGenerator g(postinstall, false, nullptr, false);
g.Generate(os, config, configurationTypes);
}
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 9f78be4..4a7d2ca 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -3,13 +3,14 @@
#ifndef cmLocalGenerator_h
#define cmLocalGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cm_kwiml.h"
#include <iosfwd>
#include <map>
#include <set>
#include <string>
+#include <unordered_map>
#include <vector>
#include "cmListFileCache.h"
@@ -282,8 +283,8 @@ public:
// Compute object file names.
std::string GetObjectFileNameWithoutTarget(
const cmSourceFile& source, std::string const& dir_max,
- bool* hasSourceExtension = CM_NULLPTR,
- char const* customOutputExtension = CM_NULLPTR);
+ bool* hasSourceExtension = nullptr,
+ char const* customOutputExtension = nullptr);
/** Fill out the static linker flags for the given target. */
void GetStaticLibraryFlags(std::string& flags, std::string const& config,
@@ -311,7 +312,7 @@ public:
virtual void ComputeObjectFilenames(
std::map<cmSourceFile const*, std::string>& mapping,
- cmGeneratorTarget const* gt = CM_NULLPTR);
+ cmGeneratorTarget const* gt = nullptr);
bool IsWindowsShell() const;
bool IsWatcomWMake() const;
@@ -353,8 +354,12 @@ protected:
std::string::size_type ObjectPathMax;
std::set<std::string> ObjectMaxPathViolations;
- std::set<cmGeneratorTarget const*> WarnCMP0063;
+ typedef std::unordered_map<std::string, cmGeneratorTarget*>
+ GeneratorTargetMap;
+ GeneratorTargetMap GeneratorTargetSearchIndex;
std::vector<cmGeneratorTarget*> GeneratorTargets;
+
+ std::set<cmGeneratorTarget const*> WarnCMP0063;
std::vector<cmGeneratorTarget*> ImportedGeneratorTargets;
std::vector<cmGeneratorTarget*> OwnedImportedGeneratorTargets;
std::map<std::string, std::string> AliasTargets;
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index 5f37af5..ab6774e 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -20,9 +20,9 @@ cmLocalGhsMultiGenerator::~cmLocalGhsMultiGenerator()
void cmLocalGhsMultiGenerator::Generate()
{
- std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
+ const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); ++l) {
if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 266710c..9fa3ca5 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -79,8 +79,8 @@ void cmLocalNinjaGenerator::Generate()
}
}
- std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator t = targets.begin();
t != targets.end(); ++t) {
if ((*t)->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index a45e018..83bc9d3 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmLocalNinjaGenerator_h
#define cmLocalNinjaGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <map>
@@ -76,7 +76,7 @@ public:
void ComputeObjectFilenames(
std::map<cmSourceFile const*, std::string>& mapping,
- cmGeneratorTarget const* gt = CM_NULLPTR) CM_OVERRIDE;
+ cmGeneratorTarget const* gt = nullptr) CM_OVERRIDE;
protected:
std::string ConvertToIncludeReference(
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 9b9d22c..cde2621 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -116,10 +116,10 @@ void cmLocalUnixMakefileGenerator3::Generate()
this->Makefile->IsOn("CMAKE_SKIP_ASSEMBLY_SOURCE_RULES");
// Generate the rule files for each target.
- std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
+ const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
cmGlobalUnixMakefileGenerator3* gg =
static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
- for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator t = targets.begin();
t != targets.end(); ++t) {
if ((*t)->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
@@ -172,8 +172,8 @@ void cmLocalUnixMakefileGenerator3::ComputeObjectFilenames(
void cmLocalUnixMakefileGenerator3::GetLocalObjectFiles(
std::map<std::string, LocalObjectInfo>& localObjectFiles)
{
- std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin();
ti != targets.end(); ++ti) {
cmGeneratorTarget* gt = *ti;
if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
@@ -348,7 +348,7 @@ void cmLocalUnixMakefileGenerator3::WriteObjectConvenienceRule(
std::vector<std::string> depends;
depends.push_back(output);
std::vector<std::string> no_commands;
- this->WriteMakeRule(ruleFileStream, CM_NULLPTR, outNoExt, depends,
+ this->WriteMakeRule(ruleFileStream, nullptr, outNoExt, depends,
no_commands, true, true);
inHelp = false;
}
@@ -382,9 +382,9 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets(
// for each target we just provide a rule to cd up to the top and do a make
// on the target
- std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
+ const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
std::string localName;
- for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator t = targets.begin();
t != targets.end(); ++t) {
if (((*t)->GetType() == cmStateEnums::EXECUTABLE) ||
((*t)->GetType() == cmStateEnums::STATIC_LIBRARY) ||
@@ -718,7 +718,7 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsTop(
// Add a fake suffix to keep HP happy. Must be max 32 chars for SGI make.
std::vector<std::string> depends;
depends.push_back(".hpux_make_needs_suffix_list");
- this->WriteMakeRule(makefileStream, CM_NULLPTR, ".SUFFIXES", depends,
+ this->WriteMakeRule(makefileStream, nullptr, ".SUFFIXES", depends,
no_commands, false);
if (this->IsWatcomWMake()) {
// Switch on WMake feature, if an error or interrupt occurs during
@@ -1186,7 +1186,7 @@ void cmLocalUnixMakefileGenerator3::AppendEcho(
line = "";
// Progress appears only on first line.
- progress = CM_NULLPTR;
+ progress = nullptr;
// Terminate on end-of-string.
if (*c == '\0') {
@@ -1460,7 +1460,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
std::string lang = *li;
// Create the scanner for this language
- cmDepends* scanner = CM_NULLPTR;
+ cmDepends* scanner = nullptr;
if (lang == "C" || lang == "CXX" || lang == "RC" || lang == "ASM" ||
lang == "CUDA") {
// TODO: Handle RC (resource files) dependencies correctly.
@@ -1562,8 +1562,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
this->WriteDivider(ruleFileStream);
ruleFileStream << "# Targets provided globally by CMake.\n"
<< "\n";
- std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
- std::vector<cmGeneratorTarget*>::iterator glIt;
+ const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
+ std::vector<cmGeneratorTarget*>::const_iterator glIt;
for (glIt = targets.begin(); glIt != targets.end(); ++glIt) {
if ((*glIt)->GetType() == cmStateEnums::GLOBAL_TARGET) {
std::string targetString =
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index f64409c..16c305a 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -3,7 +3,7 @@
#ifndef cmLocalUnixMakefileGenerator3_h
#define cmLocalUnixMakefileGenerator3_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmDepends.h"
#include "cmLocalCommonGenerator.h"
@@ -108,8 +108,7 @@ public:
std::string Arg;
};
void AppendEcho(std::vector<std::string>& commands, std::string const& text,
- EchoColor color = EchoNormal,
- EchoProgress const* = CM_NULLPTR);
+ EchoColor color = EchoNormal, EchoProgress const* = nullptr);
/** Get whether the makefile is to have color. */
bool GetColorMakefile() const { return this->ColorMakefile; }
@@ -238,11 +237,11 @@ protected:
cmGeneratorTarget* target,
std::string const& relative,
bool echo_comment = false,
- std::ostream* content = CM_NULLPTR);
+ std::ostream* content = nullptr);
void AppendCleanCommand(std::vector<std::string>& commands,
const std::vector<std::string>& files,
cmGeneratorTarget* target,
- const char* filename = CM_NULLPTR);
+ const char* filename = nullptr);
// Helper methods for dependeny updates.
bool ScanDependencies(
@@ -255,7 +254,7 @@ private:
void ComputeObjectFilenames(
std::map<cmSourceFile const*, std::string>& mapping,
- cmGeneratorTarget const* gt = CM_NULLPTR) CM_OVERRIDE;
+ cmGeneratorTarget const* gt = nullptr) CM_OVERRIDE;
friend class cmMakefileTargetGenerator;
friend class cmMakefileExecutableTargetGenerator;
@@ -272,7 +271,7 @@ private:
cmGeneratorTarget* Target;
std::string Language;
LocalObjectEntry()
- : Target(CM_NULLPTR)
+ : Target(nullptr)
, Language()
{
}
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index 85d4a73..db1776a 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -60,8 +60,8 @@ cmLocalVisualStudio10Generator::~cmLocalVisualStudio10Generator()
void cmLocalVisualStudio10Generator::Generate()
{
- std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); ++l) {
if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
diff --git a/Source/cmLocalVisualStudio10Generator.h b/Source/cmLocalVisualStudio10Generator.h
index e57dd8f..4cd56dd 100644
--- a/Source/cmLocalVisualStudio10Generator.h
+++ b/Source/cmLocalVisualStudio10Generator.h
@@ -3,7 +3,7 @@
#ifndef cmLocalVisualStudio10Generator_h
#define cmLocalVisualStudio10Generator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index dd08e5b..857ce46 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -62,8 +62,8 @@ cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator()
void cmLocalVisualStudio7Generator::AddHelperCommands()
{
// Now create GUIDs for targets
- std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); ++l) {
if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
@@ -91,8 +91,9 @@ void cmLocalVisualStudio7Generator::AddCMakeListsRules()
// specification source changes.
if (cmSourceFile* sf = this->CreateVCProjBuildRule()) {
// Add the rule to targets that need it.
- std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ const std::vector<cmGeneratorTarget*>& tgts =
+ this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); ++l) {
if ((*l)->GetType() == cmStateEnums::GLOBAL_TARGET) {
continue;
@@ -110,8 +111,8 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
// Visual Studio .NET 2003 Service Pack 1 will not run post-build
// commands for targets in which no sources are built. Add dummy
// rules to force these targets to build.
- std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); l++) {
if ((*l)->GetType() == cmStateEnums::GLOBAL_TARGET) {
std::vector<std::string> no_depends;
@@ -150,10 +151,10 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles()
}
// Get the set of targets in this directory.
- std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
+ const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
// Create the project file for each target.
- for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
l != tgts.end(); l++) {
if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 89a3ee3..7a77574 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -3,7 +3,7 @@
#ifndef cmLocalVisualStudio7Generator_h
#define cmLocalVisualStudio7Generator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <string>
diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h
index 85fb8a5..c47db4f 100644
--- a/Source/cmLocalVisualStudioGenerator.h
+++ b/Source/cmLocalVisualStudioGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmLocalVisualStudioGenerator_h
#define cmLocalVisualStudioGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
#include <memory>
diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx
index 739ef43..355c394 100644
--- a/Source/cmLocalXCodeGenerator.cxx
+++ b/Source/cmLocalXCodeGenerator.cxx
@@ -42,8 +42,8 @@ void cmLocalXCodeGenerator::Generate()
{
cmLocalGenerator::Generate();
- std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator iter = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator iter = targets.begin();
iter != targets.end(); ++iter) {
(*iter)->HasMacOSXRpathInstallNameDir("");
}
@@ -53,8 +53,8 @@ void cmLocalXCodeGenerator::GenerateInstallRules()
{
cmLocalGenerator::GenerateInstallRules();
- std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator iter = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator iter = targets.begin();
iter != targets.end(); ++iter) {
(*iter)->HasMacOSXRpathInstallNameDir("");
}
diff --git a/Source/cmLocale.h b/Source/cmLocale.h
index 9f90a3a..174f0f0 100644
--- a/Source/cmLocale.h
+++ b/Source/cmLocale.h
@@ -3,7 +3,7 @@
#ifndef cmLocale_h
#define cmLocale_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <locale.h>
#include <string>
@@ -14,7 +14,7 @@ class cmLocaleRAII
public:
cmLocaleRAII()
- : OldLocale(setlocale(LC_CTYPE, CM_NULLPTR))
+ : OldLocale(setlocale(LC_CTYPE, nullptr))
{
setlocale(LC_CTYPE, "");
}
diff --git a/Source/cmMSVC60LinkLineComputer.h b/Source/cmMSVC60LinkLineComputer.h
index f2892d5..19e2c16 100644
--- a/Source/cmMSVC60LinkLineComputer.h
+++ b/Source/cmMSVC60LinkLineComputer.h
@@ -4,7 +4,7 @@
#ifndef cmMSVC60LinkLineComputer_h
#define cmMSVC60LinkLineComputer_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
diff --git a/Source/cmMachO.h b/Source/cmMachO.h
index 42745cf..aa17c6a 100644
--- a/Source/cmMachO.h
+++ b/Source/cmMachO.h
@@ -3,7 +3,7 @@
#ifndef cmMachO_h
#define cmMachO_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <string>
diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h
index 0d35fe0..cbfb60f 100644
--- a/Source/cmMacroCommand.h
+++ b/Source/cmMacroCommand.h
@@ -3,7 +3,7 @@
#ifndef cmMacroCommand_h
#define cmMacroCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h
index af72eab..214cf92 100644
--- a/Source/cmMakeDirectoryCommand.h
+++ b/Source/cmMakeDirectoryCommand.h
@@ -3,7 +3,7 @@
#ifndef cmMakeDirectoryCommand_h
#define cmMakeDirectoryCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 608b18a..230c210 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -66,8 +66,8 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
this->DefineFlags = " ";
- this->cmDefineRegex.compile("#cmakedefine[ \t]+([A-Za-z_0-9]*)");
- this->cmDefine01Regex.compile("#cmakedefine01[ \t]+([A-Za-z_0-9]*)");
+ this->cmDefineRegex.compile("#([ \t]*)cmakedefine[ \t]+([A-Za-z_0-9]*)");
+ this->cmDefine01Regex.compile("#([ \t]*)cmakedefine01[ \t]+([A-Za-z_0-9]*)");
this->cmAtVarRegex.compile("(@[A-Za-z_0-9/.+-]+@)");
this->cmNamedCurly.compile("^[A-Za-z0-9/_.+-]+{");
@@ -87,12 +87,10 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
#if defined(CMAKE_BUILD_WITH_CMAKE)
this->AddSourceGroup("", "^.*$");
- this->AddSourceGroup("Source Files",
- "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp"
- "|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$");
+ this->AddSourceGroup("Source Files", CM_SOURCE_REGEX);
this->AddSourceGroup("Header Files", CM_HEADER_REGEX);
this->AddSourceGroup("CMake Rules", "\\.rule$");
- this->AddSourceGroup("Resources", "\\.plist$");
+ this->AddSourceGroup("Resources", CM_RESOURCE_REGEX);
this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$");
this->ObjectLibrariesSourceGroupIndex = this->SourceGroups.size();
@@ -592,7 +590,8 @@ void cmMakefile::AddEvaluationFile(
CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent)
{
this->EvaluationFiles.push_back(new cmGeneratorExpressionEvaluationFile(
- inputFile, outputName, condition, inputIsContent));
+ inputFile, outputName, condition, inputIsContent,
+ this->GetPolicyStatus(cmPolicies::CMP0070)));
}
std::vector<cmGeneratorExpressionEvaluationFile*>
@@ -780,7 +779,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
// Make sure there is at least one output.
if (outputs.empty()) {
cmSystemTools::Error("Attempt to add a custom rule with no output!");
- return CM_NULLPTR;
+ return nullptr;
}
// Validate custom commands. TODO: More strict?
@@ -791,12 +790,12 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
std::ostringstream e;
e << "COMMAND may not contain literal quotes:\n " << cl[0] << "\n";
this->IssueMessage(cmake::FATAL_ERROR, e.str());
- return CM_NULLPTR;
+ return nullptr;
}
}
// Choose a source file on which to store the custom command.
- cmSourceFile* file = CM_NULLPTR;
+ cmSourceFile* file = nullptr;
if (!commandLines.empty() && !main_dependency.empty()) {
// The main dependency was specified. Use it unless a different
// custom command already used it.
@@ -810,7 +809,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
}
// The existing custom command is different. We need to
// generate a rule file for this new command.
- file = CM_NULLPTR;
+ file = nullptr;
} else if (!file) {
file = this->CreateSource(main_dependency);
}
@@ -934,7 +933,7 @@ void cmMakefile::AddCustomCommandOldStyle(
std::vector<std::string> no_byproducts;
this->AddCustomCommandToTarget(target, no_byproducts, depends,
commandLines, cmTarget::POST_BUILD, comment,
- CM_NULLPTR);
+ nullptr);
return;
}
@@ -952,14 +951,14 @@ void cmMakefile::AddCustomCommandOldStyle(
if (sourceFiles.find(source)) {
// The source looks like a real file. Use it as the main dependency.
sf = this->AddCustomCommandToOutput(output, depends, source,
- commandLines, comment, CM_NULLPTR);
+ commandLines, comment, nullptr);
} else {
// The source may not be a real file. Do not use a main dependency.
std::string no_main_dependency;
std::vector<std::string> depends2 = depends;
depends2.push_back(source);
sf = this->AddCustomCommandToOutput(output, depends2, no_main_dependency,
- commandLines, comment, CM_NULLPTR);
+ commandLines, comment, nullptr);
}
// If the rule was added to the source (and not a .rule file),
@@ -1236,6 +1235,9 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent)
}
}
+ // labels
+ this->SetProperty("LABELS", parent->GetProperty("LABELS"));
+
// link libraries
this->SetProperty("LINK_LIBRARIES", parent->GetProperty("LINK_LIBRARIES"));
@@ -1757,7 +1759,7 @@ void cmMakefile::RemoveDefinition(const std::string& name)
cmVariableWatch* vv = this->GetVariableWatch();
if (vv) {
vv->VariableAccessed(name, cmVariableWatch::VARIABLE_REMOVED_ACCESS,
- CM_NULLPTR, this);
+ nullptr, this);
}
#endif
}
@@ -1908,7 +1910,7 @@ cmSourceFile* cmMakefile::LinearGetSourceFileWithOutput(
}
// otherwise return NULL
- return CM_NULLPTR;
+ return nullptr;
}
cmSourceFile* cmMakefile::GetSourceFileWithOutput(
@@ -1924,14 +1926,14 @@ cmSourceFile* cmMakefile::GetSourceFileWithOutput(
if (o != this->OutputToSource.end()) {
return (*o).second;
}
- return CM_NULLPTR;
+ return nullptr;
}
#if defined(CMAKE_BUILD_WITH_CMAKE)
cmSourceGroup* cmMakefile::GetSourceGroup(
const std::vector<std::string>& name) const
{
- cmSourceGroup* sg = CM_NULLPTR;
+ cmSourceGroup* sg = nullptr;
// first look for source group starting with the same as the one we want
for (std::vector<cmSourceGroup>::const_iterator sgIt =
@@ -1944,11 +1946,11 @@ cmSourceGroup* cmMakefile::GetSourceGroup(
}
}
- if (sg != CM_NULLPTR) {
+ if (sg != nullptr) {
// iterate through its children to find match source group
for (unsigned int i = 1; i < name.size(); ++i) {
sg = sg->LookupChild(name[i].c_str());
- if (sg == CM_NULLPTR) {
+ if (sg == nullptr) {
break;
}
}
@@ -1966,14 +1968,14 @@ void cmMakefile::AddSourceGroup(const std::string& name, const char* regex)
void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
const char* regex)
{
- cmSourceGroup* sg = CM_NULLPTR;
+ cmSourceGroup* sg = nullptr;
std::vector<std::string> currentName;
int i = 0;
const int lastElement = static_cast<int>(name.size() - 1);
for (i = lastElement; i >= 0; --i) {
currentName.assign(name.begin(), name.begin() + i + 1);
sg = this->GetSourceGroup(currentName);
- if (sg != CM_NULLPTR) {
+ if (sg != nullptr) {
break;
}
}
@@ -2001,8 +2003,7 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
}
// build the whole source group path
for (++i; i <= lastElement; ++i) {
- sg->AddChild(
- cmSourceGroup(name[i].c_str(), CM_NULLPTR, sg->GetFullName()));
+ sg->AddChild(cmSourceGroup(name[i].c_str(), nullptr, sg->GetFullName()));
sg = sg->LookupChild(name[i].c_str());
}
@@ -2252,7 +2253,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const
}
}
#endif
- return def != CM_NULLPTR;
+ return def != nullptr;
}
const char* cmMakefile::GetDefinition(const std::string& name) const
@@ -2561,7 +2562,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
openstack.pop_back();
result.append(last, in - last);
std::string const& lookup = result.substr(var.loc);
- const char* value = CM_NULLPTR;
+ const char* value = nullptr;
std::string varresult;
std::string svalue;
static const std::string lineVar = "CMAKE_CURRENT_LIST_LINE";
@@ -2617,7 +2618,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
if (!atOnly) {
t_lookup lookup;
const char* next = in + 1;
- const char* start = CM_NULLPTR;
+ const char* start = nullptr;
char nextc = *next;
if (nextc == '{') {
// Looking for a variable.
@@ -3101,7 +3102,7 @@ cmSourceFile* cmMakefile::GetSource(const std::string& sourceName) const
return sf;
}
}
- return CM_NULLPTR;
+ return nullptr;
}
cmSourceFile* cmMakefile::CreateSource(const std::string& sourceName,
@@ -3302,7 +3303,7 @@ cmVariableWatch* cmMakefile::GetVariableWatch() const
this->GetCMakeInstance()->GetVariableWatch()) {
return this->GetCMakeInstance()->GetVariableWatch();
}
- return CM_NULLPTR;
+ return nullptr;
}
#endif
@@ -3432,18 +3433,22 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
// Replace #cmakedefine instances.
if (this->cmDefineRegex.find(line)) {
- const char* def = this->GetDefinition(this->cmDefineRegex.match(1));
+ const char* def = this->GetDefinition(this->cmDefineRegex.match(2));
if (!cmSystemTools::IsOff(def)) {
- cmSystemTools::ReplaceString(line, "#cmakedefine", "#define");
+ const std::string indentation = this->cmDefineRegex.match(1);
+ cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine",
+ "#" + indentation + "define");
output += line;
} else {
output += "/* #undef ";
- output += this->cmDefineRegex.match(1);
+ output += this->cmDefineRegex.match(2);
output += " */";
}
} else if (this->cmDefine01Regex.find(line)) {
- const char* def = this->GetDefinition(this->cmDefine01Regex.match(1));
- cmSystemTools::ReplaceString(line, "#cmakedefine01", "#define");
+ const std::string indentation = this->cmDefine01Regex.match(1);
+ const char* def = this->GetDefinition(this->cmDefine01Regex.match(2));
+ cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine01",
+ "#" + indentation + "define");
output += line;
if (!cmSystemTools::IsOff(def)) {
output += " 1";
@@ -3463,7 +3468,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
}
// Perform variable replacements.
- this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, CM_NULLPTR,
+ this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, nullptr,
-1, true, true);
}
@@ -3603,7 +3608,7 @@ cmTarget* cmMakefile::FindLocalNonAliasTarget(const std::string& name) const
if (i != this->Targets.end()) {
return &i->second;
}
- return CM_NULLPTR;
+ return nullptr;
}
cmTest* cmMakefile::CreateTest(const std::string& testName)
@@ -3625,7 +3630,7 @@ cmTest* cmMakefile::GetTest(const std::string& testName) const
if (mi != this->Tests.end()) {
return mi->second;
}
- return CM_NULLPTR;
+ return nullptr;
}
void cmMakefile::AddCMakeDependFilesFromUser()
@@ -3896,16 +3901,6 @@ bool cmMakefile::EnforceUniqueDir(const std::string& srcPath,
return false;
}
-void cmMakefile::AddQtUiFileWithOptions(cmSourceFile* sf)
-{
- this->QtUiFilesWithOptions.push_back(sf);
-}
-
-std::vector<cmSourceFile*> cmMakefile::GetQtUiFilesWithOptions() const
-{
- return this->QtUiFilesWithOptions;
-}
-
static std::string const matchVariables[] = {
"CMAKE_MATCH_0", "CMAKE_MATCH_1", "CMAKE_MATCH_2", "CMAKE_MATCH_3",
"CMAKE_MATCH_4", "CMAKE_MATCH_5", "CMAKE_MATCH_6", "CMAKE_MATCH_7",
@@ -4093,10 +4088,10 @@ bool cmMakefile::IgnoreErrorsCMP0061() const
}
#define FEATURE_STRING(F) , #F
-static const char* const C_FEATURES[] = { CM_NULLPTR FOR_EACH_C_FEATURE(
+static const char* const C_FEATURES[] = { nullptr FOR_EACH_C_FEATURE(
FEATURE_STRING) };
-static const char* const CXX_FEATURES[] = { CM_NULLPTR FOR_EACH_CXX_FEATURE(
+static const char* const CXX_FEATURES[] = { nullptr FOR_EACH_CXX_FEATURE(
FEATURE_STRING) };
#undef FEATURE_STRING
@@ -4204,7 +4199,7 @@ const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang,
this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
this->Backtrace);
}
- return CM_NULLPTR;
+ return nullptr;
}
const char* featuresKnown =
@@ -4227,7 +4222,7 @@ const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang,
this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
this->Backtrace);
}
- return CM_NULLPTR;
+ return nullptr;
}
return featuresKnown;
}
@@ -4375,6 +4370,18 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
cmStrCmp(existingCxxStandard))
: cmArrayEnd(CXX_STANDARDS);
+ if (needCxx17 &&
+ existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
+ cmArrayEnd(CXX_STANDARDS),
+ cmStrCmp("17"))) {
+ return false;
+ }
+ if (needCxx14 &&
+ existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
+ cmArrayEnd(CXX_STANDARDS),
+ cmStrCmp("14"))) {
+ return false;
+ }
if (needCxx11 &&
existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
cmArrayEnd(CXX_STANDARDS),
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index e65ba46..938b61b 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -3,7 +3,7 @@
#ifndef cmMakefile_h
#define cmMakefile_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmsys/RegularExpression.hxx"
#include <deque>
@@ -12,6 +12,7 @@
#include <stack>
#include <stddef.h>
#include <string>
+#include <unordered_map>
#include <vector>
#include "cmAlgorithms.h"
@@ -22,7 +23,6 @@
#include "cmStateTypes.h"
#include "cmTarget.h"
#include "cm_auto_ptr.hxx"
-#include "cm_unordered_map.hxx"
#include "cmake.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -187,24 +187,26 @@ public:
* Add a utility to the build. A utiltity target is a command that
* is run every time the target is built.
*/
- cmTarget* AddUtilityCommand(
- const std::string& utilityName, bool excludeFromAll,
- const std::vector<std::string>& depends, const char* workingDirectory,
- const char* command, const char* arg1 = CM_NULLPTR,
- const char* arg2 = CM_NULLPTR, const char* arg3 = CM_NULLPTR,
- const char* arg4 = CM_NULLPTR);
+ cmTarget* AddUtilityCommand(const std::string& utilityName,
+ bool excludeFromAll,
+ const std::vector<std::string>& depends,
+ const char* workingDirectory,
+ const char* command, const char* arg1 = nullptr,
+ const char* arg2 = nullptr,
+ const char* arg3 = nullptr,
+ const char* arg4 = nullptr);
cmTarget* AddUtilityCommand(
const std::string& utilityName, bool excludeFromAll,
const char* workingDirectory, const std::vector<std::string>& depends,
const cmCustomCommandLines& commandLines, bool escapeOldStyle = true,
- const char* comment = CM_NULLPTR, bool uses_terminal = false,
+ const char* comment = nullptr, bool uses_terminal = false,
bool command_expand_lists = false);
cmTarget* AddUtilityCommand(
const std::string& utilityName, bool excludeFromAll,
const char* workingDirectory, const std::vector<std::string>& byproducts,
const std::vector<std::string>& depends,
const cmCustomCommandLines& commandLines, bool escapeOldStyle = true,
- const char* comment = CM_NULLPTR, bool uses_terminal = false,
+ const char* comment = nullptr, bool uses_terminal = false,
bool command_expand_lists = false);
/**
@@ -272,14 +274,14 @@ public:
/**
* Add a root source group for consideration when adding a new source.
*/
- void AddSourceGroup(const std::string& name, const char* regex = CM_NULLPTR);
+ void AddSourceGroup(const std::string& name, const char* regex = nullptr);
/**
* Add a source group for consideration when adding a new source.
* name is tokenized.
*/
void AddSourceGroup(const std::vector<std::string>& name,
- const char* regex = CM_NULLPTR);
+ const char* regex = nullptr);
#endif
@@ -521,7 +523,7 @@ public:
const char* ExpandVariablesInString(std::string& source) const;
const char* ExpandVariablesInString(std::string& source, bool escapeQuotes,
bool noEscapes, bool atOnly = false,
- const char* filename = CM_NULLPTR,
+ const char* filename = nullptr,
long line = -1, bool removeEmpty = false,
bool replaceAt = false) const;
@@ -594,11 +596,11 @@ public:
*/
bool ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
std::vector<std::string>& outArgs,
- const char* filename = CM_NULLPTR) const;
+ const char* filename = nullptr) const;
bool ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
std::vector<cmExpandedCommandArgument>& outArgs,
- const char* filename = CM_NULLPTR) const;
+ const char* filename = nullptr) const;
/**
* Get the instance
@@ -736,9 +738,6 @@ public:
cmStringRange GetCompileDefinitionsEntries() const;
cmBacktraceRange GetCompileDefinitionsBacktraces() const;
- void AddQtUiFileWithOptions(cmSourceFile* sf);
- std::vector<cmSourceFile*> GetQtUiFilesWithOptions() const;
-
std::set<std::string> const& GetSystemIncludeDirectories() const
{
return this->SystemIncludeDirectories;
@@ -747,7 +746,7 @@ public:
bool PolicyOptionalWarningEnabled(std::string const& var);
bool AddRequiredTargetFeature(cmTarget* target, const std::string& feature,
- std::string* error = CM_NULLPTR) const;
+ std::string* error = nullptr) const;
bool CompileFeatureKnown(cmTarget const* target, const std::string& feature,
std::string& lang, std::string* error) const;
@@ -871,7 +870,7 @@ private:
friend class cmParseFileScope;
std::vector<cmTarget*> ImportedTargetsOwned;
- typedef CM_UNORDERED_MAP<std::string, cmTarget*> TargetMap;
+ typedef std::unordered_map<std::string, cmTarget*> TargetMap;
TargetMap ImportedTargets;
// Internal policy stack management.
@@ -909,7 +908,7 @@ private:
cmSourceFile* LinearGetSourceFileWithOutput(const std::string& cname) const;
// A map for fast output to input look up.
- typedef CM_UNORDERED_MAP<std::string, cmSourceFile*> OutputToSourceMap;
+ typedef std::unordered_map<std::string, cmSourceFile*> OutputToSourceMap;
OutputToSourceMap OutputToSource;
void UpdateOutputToSourceMap(std::vector<std::string> const& outputs,
@@ -917,14 +916,12 @@ private:
void UpdateOutputToSourceMap(std::string const& output,
cmSourceFile* source);
- std::vector<cmSourceFile*> QtUiFilesWithOptions;
-
bool AddRequiredTargetCFeature(cmTarget* target, const std::string& feature,
- std::string* error = CM_NULLPTR) const;
+ std::string* error = nullptr) const;
bool AddRequiredTargetCxxFeature(cmTarget* target,
const std::string& feature,
- std::string* error = CM_NULLPTR) const;
+ std::string* error = nullptr) const;
void CheckNeededCLanguage(const std::string& feature, bool& needC90,
bool& needC99, bool& needC11) const;
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 359b9fd..b9b3c2f 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -284,7 +284,7 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule(
commands1.clear();
// Write the build rule.
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
targetOutputReal, depends, commands,
false);
@@ -687,7 +687,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
}
// Write the build rule.
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
targetFullPathReal, depends, commands,
false);
@@ -698,7 +698,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
depends.clear();
commands.clear();
depends.push_back(targetFullPathReal);
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
targetFullPath, depends, commands,
false);
}
diff --git a/Source/cmMakefileExecutableTargetGenerator.h b/Source/cmMakefileExecutableTargetGenerator.h
index 01aa627..122e817 100644
--- a/Source/cmMakefileExecutableTargetGenerator.h
+++ b/Source/cmMakefileExecutableTargetGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmMakefileExecutableTargetGenerator_h
#define cmMakefileExecutableTargetGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 3d1594b..2faef67 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -117,7 +117,7 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules()
this->AppendObjectDepends(depends);
// Write the rule.
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
this->GeneratorTarget->GetName(),
depends, commands, true);
@@ -454,7 +454,7 @@ void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules(
std::vector<std::string> outputs(1, targetOutputReal);
// Write the build rule.
- this->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, outputs, depends,
+ this->WriteMakeRule(*this->BuildFileStream, nullptr, outputs, depends,
commands, false);
// Write the main driver rule to build everything in this target.
@@ -1008,7 +1008,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
}
// Write the build rule.
- this->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, outputs, depends,
+ this->WriteMakeRule(*this->BuildFileStream, nullptr, outputs, depends,
commands, false);
// Write the main driver rule to build everything in this target.
diff --git a/Source/cmMakefileLibraryTargetGenerator.h b/Source/cmMakefileLibraryTargetGenerator.h
index da1d8b6..307cd15 100644
--- a/Source/cmMakefileLibraryTargetGenerator.h
+++ b/Source/cmMakefileLibraryTargetGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmMakefileLibraryTargetGenerator_h
#define cmMakefileLibraryTargetGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmMakefileTargetGenerator.h"
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index a4511b6..b9bcdef 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -32,12 +32,12 @@
cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
: cmCommonTargetGenerator(target)
- , OSXBundleGenerator(CM_NULLPTR)
- , MacOSXContentGenerator(CM_NULLPTR)
+ , OSXBundleGenerator(nullptr)
+ , MacOSXContentGenerator(nullptr)
{
- this->BuildFileStream = CM_NULLPTR;
- this->InfoFileStream = CM_NULLPTR;
- this->FlagFileStream = CM_NULLPTR;
+ this->BuildFileStream = nullptr;
+ this->InfoFileStream = nullptr;
+ this->FlagFileStream = nullptr;
this->CustomCommandDriver = OnBuild;
this->LocalGenerator =
static_cast<cmLocalUnixMakefileGenerator3*>(target->GetLocalGenerator());
@@ -60,7 +60,7 @@ cmMakefileTargetGenerator::~cmMakefileTargetGenerator()
cmMakefileTargetGenerator* cmMakefileTargetGenerator::New(
cmGeneratorTarget* tgt)
{
- cmMakefileTargetGenerator* result = CM_NULLPTR;
+ cmMakefileTargetGenerator* result = nullptr;
switch (tgt->GetType()) {
case cmStateEnums::EXECUTABLE:
@@ -139,7 +139,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
cmSystemTools::ExpandListArgument(
cge->Evaluate(this->LocalGenerator, config, false, this->GeneratorTarget,
- CM_NULLPTR, CM_NULLPTR),
+ nullptr, nullptr),
this->CleanFiles);
}
@@ -337,7 +337,7 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()(
output, cmOutputConverter::SHELL);
commands.push_back(copyCommand);
this->Generator->LocalGenerator->WriteMakeRule(
- *this->Generator->BuildFileStream, CM_NULLPTR, output, depends, commands,
+ *this->Generator->BuildFileStream, nullptr, output, depends, commands,
false);
this->Generator->ExtraFiles.insert(output);
}
@@ -657,7 +657,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
}
// Maybe insert a compiler launcher like ccache or distcc
- if (!compileCommands.empty() && (lang == "C" || lang == "CXX")) {
+ if (!compileCommands.empty() &&
+ (lang == "C" || lang == "CXX" || lang == "CUDA")) {
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
const char* clauncher =
this->GeneratorTarget->GetProperty(clauncher_prop);
@@ -710,7 +711,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
}
// Write the rule.
- this->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, outputs, depends,
+ this->WriteMakeRule(*this->BuildFileStream, nullptr, outputs, depends,
commands);
bool do_preprocess_rules = lang_has_preprocessor &&
@@ -769,7 +770,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
commands.push_back(cmd);
}
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
relativeObjI, force_depends,
commands, false);
}
@@ -817,7 +818,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
commands.push_back(cmd);
}
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
relativeObjS, force_depends,
commands, false);
}
@@ -829,7 +830,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
objectRequires += ".requires";
std::vector<std::string> p_depends;
// always provide an empty requires target
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
objectRequires, p_depends, no_commands,
true);
@@ -847,14 +848,14 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
p_depends.clear();
p_depends.push_back(objectRequires);
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
objectProvides, p_depends, r_commands,
true);
// write the provides.build rule dependency on the obj file
p_depends.clear();
p_depends.push_back(relativeObj);
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR, temp,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, temp,
p_depends, no_commands, false);
}
@@ -880,7 +881,7 @@ void cmMakefileTargetGenerator::WriteTargetRequiresRules()
}
// Write the rule.
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
depTarget, depends, no_commands, true);
}
@@ -902,7 +903,7 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules()
this->LocalGenerator->GetBinaryDirectory());
// Write the rule.
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
cleanTarget, depends, commands, true);
}
@@ -959,7 +960,7 @@ bool cmMakefileTargetGenerator::WriteMakeRule(
if (!o_symbolic) {
output_commands.push_back("@$(CMAKE_COMMAND) -E touch_nocreate " + out);
}
- this->LocalGenerator->WriteMakeRule(os, CM_NULLPTR, *o, output_depends,
+ this->LocalGenerator->WriteMakeRule(os, nullptr, *o, output_depends,
output_commands, o_symbolic, in_help);
if (!o_symbolic) {
@@ -1106,7 +1107,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
}
// Write the rule.
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
depTarget, depends, commands, true);
}
@@ -1169,8 +1170,8 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile(
// Write the rule.
const std::vector<std::string>& outputs = ccg.GetOutputs();
- bool symbolic = this->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
- outputs, depends, commands);
+ bool symbolic = this->WriteMakeRule(*this->BuildFileStream, nullptr, outputs,
+ depends, commands);
// If the rule has changed make sure the output is rebuilt.
if (!symbolic) {
@@ -1341,7 +1342,7 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(
std::vector<std::string> depends;
depends.push_back(main_output);
- const char* comment = CM_NULLPTR;
+ const char* comment = nullptr;
if (relink) {
// Setup the comment for the preinstall driver.
comment = "Rule to relink during preinstall.";
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index 92c9f60..e0e9580 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmMakefileTargetGenerator_h
#define cmMakefileTargetGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <map>
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx
index a7c5d27..46df0d8 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -95,7 +95,7 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
}
// Write the rule.
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr,
this->GeneratorTarget->GetName(),
depends, commands, true);
diff --git a/Source/cmMakefileUtilityTargetGenerator.h b/Source/cmMakefileUtilityTargetGenerator.h
index 8df5dd4..2826392 100644
--- a/Source/cmMakefileUtilityTargetGenerator.h
+++ b/Source/cmMakefileUtilityTargetGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmMakefileUtilityTargetGenerator_h
#define cmMakefileUtilityTargetGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmMakefileTargetGenerator.h"
diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx
index 14fd96f..45c59b9 100644
--- a/Source/cmMarkAsAdvancedCommand.cxx
+++ b/Source/cmMarkAsAdvancedCommand.cxx
@@ -34,7 +34,7 @@ bool cmMarkAsAdvancedCommand::InitialPass(std::vector<std::string> const& args,
cmState* state = this->Makefile->GetState();
if (!state->GetCacheEntryValue(variable)) {
this->Makefile->GetCMakeInstance()->AddCacheEntry(
- variable, CM_NULLPTR, CM_NULLPTR, cmStateEnums::UNINITIALIZED);
+ variable, nullptr, nullptr, cmStateEnums::UNINITIALIZED);
overwrite = true;
}
if (!state->GetCacheEntryValue(variable)) {
diff --git a/Source/cmMarkAsAdvancedCommand.h b/Source/cmMarkAsAdvancedCommand.h
index a7791a9..6c22d4c 100644
--- a/Source/cmMarkAsAdvancedCommand.h
+++ b/Source/cmMarkAsAdvancedCommand.h
@@ -3,7 +3,7 @@
#ifndef cmMarkAsAdvancedCommand_h
#define cmMarkAsAdvancedCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmMathCommand.h b/Source/cmMathCommand.h
index 67dbdda..bc97402 100644
--- a/Source/cmMathCommand.h
+++ b/Source/cmMathCommand.h
@@ -3,7 +3,7 @@
#ifndef cmMathCommand_h
#define cmMathCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h
index 96939e5..59ee458 100644
--- a/Source/cmMessageCommand.h
+++ b/Source/cmMessageCommand.h
@@ -3,7 +3,7 @@
#ifndef cmMessageCommand_h
#define cmMessageCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmNinjaLinkLineComputer.h b/Source/cmNinjaLinkLineComputer.h
index 13f05a8..a75de05 100644
--- a/Source/cmNinjaLinkLineComputer.h
+++ b/Source/cmNinjaLinkLineComputer.h
@@ -4,7 +4,7 @@
#ifndef cmNinjaLinkLineComputer_h
#define cmNinjaLinkLineComputer_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 14a4ef8..ddac20e 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -142,7 +142,7 @@ const char* cmNinjaNormalTargetGenerator::GetVisibleTypeName() const
case cmStateEnums::EXECUTABLE:
return "executable";
default:
- return CM_NULLPTR;
+ return nullptr;
}
}
@@ -409,10 +409,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
this->GetLocalGenerator()->ConvertToOutputFormat(
cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL);
if (targetType == cmStateEnums::EXECUTABLE) {
+ std::vector<std::string> commandLines;
+ commandLines.push_back(cmakeCommand +
+ " -E cmake_symlink_executable $in $out");
+ commandLines.push_back("$POST_BUILD");
+
this->GetGlobalGenerator()->AddRule(
"CMAKE_SYMLINK_EXECUTABLE",
- cmakeCommand + " -E cmake_symlink_executable"
- " $in $out && $POST_BUILD",
+ this->GetLocalGenerator()->BuildCommandLine(commandLines),
"Creating executable symlink $out", "Rule for creating "
"executable symlink.",
/*depfile*/ "",
@@ -422,10 +426,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
/*restat*/ "",
/*generator*/ false);
} else {
+ std::vector<std::string> commandLines;
+ commandLines.push_back(cmakeCommand +
+ " -E cmake_symlink_library $in $SONAME $out");
+ commandLines.push_back("$POST_BUILD");
+
this->GetGlobalGenerator()->AddRule(
"CMAKE_SYMLINK_LIBRARY",
- cmakeCommand + " -E cmake_symlink_library"
- " $in $SONAME $out && $POST_BUILD",
+ this->GetLocalGenerator()->BuildCommandLine(commandLines),
"Creating library symlink $out", "Rule for creating "
"library symlink.",
/*depfile*/ "",
@@ -477,7 +485,16 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
this->TargetLinkLanguage, this->GetConfigName());
const char* linkCmd = mf->GetDefinition(linkCmdVar);
if (linkCmd) {
- cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
+ std::string linkCmdStr = linkCmd;
+ if (this->GetGeneratorTarget()->HasImplibGNUtoMS()) {
+ std::string ruleVar = "CMAKE_";
+ ruleVar += this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
+ ruleVar += "_GNUtoMS_RULE";
+ if (const char* rule = this->Makefile->GetDefinition(ruleVar)) {
+ linkCmdStr += rule;
+ }
+ }
+ cmSystemTools::ExpandListArgument(linkCmdStr, linkCmds);
if (this->GetGeneratorTarget()->GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
std::string cmakeCommand =
this->GetLocalGenerator()->ConvertToOutputFormat(
diff --git a/Source/cmNinjaNormalTargetGenerator.h b/Source/cmNinjaNormalTargetGenerator.h
index 677b1c6..d8baa67 100644
--- a/Source/cmNinjaNormalTargetGenerator.h
+++ b/Source/cmNinjaNormalTargetGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmNinjaNormalTargetGenerator_h
#define cmNinjaNormalTargetGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmNinjaTargetGenerator.h"
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index d38dbcb..4a4e5b2 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -47,14 +47,14 @@ cmNinjaTargetGenerator* cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
return new cmNinjaUtilityTargetGenerator(target);
default:
- return CM_NULLPTR;
+ return nullptr;
}
}
cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target)
: cmCommonTargetGenerator(target)
- , MacOSXContentGenerator(CM_NULLPTR)
- , OSXBundleGenerator(CM_NULLPTR)
+ , MacOSXContentGenerator(nullptr)
+ , OSXBundleGenerator(nullptr)
, MacContentFolders()
, LocalGenerator(
static_cast<cmLocalNinjaGenerator*>(target->GetLocalGenerator()))
@@ -557,17 +557,11 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
// Write the rule for ninja dyndep file generation.
std::vector<std::string> ddCmds;
-#ifdef _WIN32
- // Windows command line length is limited -> use response file for dyndep
- // rules
+ // Command line length is almost always limited -> use response file for
+ // dyndep rules
std::string ddRspFile = "$out.rsp";
std::string ddRspContent = "$in";
std::string ddInput = "@" + ddRspFile;
-#else
- std::string ddRspFile;
- std::string ddRspContent;
- std::string ddInput = "$in";
-#endif
// Run CMake dependency scanner on preprocessed output.
std::string const cmake = this->GetLocalGenerator()->ConvertToOutputFormat(
@@ -648,7 +642,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
}
// Maybe insert a compiler launcher like ccache or distcc
- if (!compileCmds.empty() && (lang == "C" || lang == "CXX")) {
+ if (!compileCmds.empty() &&
+ (lang == "C" || lang == "CXX" || lang == "CUDA")) {
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
const char* clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
if (clauncher && *clauncher) {
@@ -896,9 +891,15 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
// The actual compilation will now use the preprocessed source.
explicitDeps.push_back(ppFileName);
- // Preprocessing and compilation use the same flags.
+ // Preprocessing and compilation generally use the same flags.
ppVars["FLAGS"] = vars["FLAGS"];
+ // In case compilation requires flags that are incompatible with
+ // preprocessing, include them here.
+ std::string const postFlag =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_POSTPROCESS_FLAG");
+ this->LocalGenerator->AppendFlags(vars["FLAGS"], postFlag);
+
// Move preprocessor definitions to the preprocessor build statement.
std::swap(ppVars["DEFINES"], vars["DEFINES"]);
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 5eb7a9a..e15ba25 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmNinjaTargetGenerator_h
#define cmNinjaTargetGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCommonTargetGenerator.h"
#include "cmGlobalNinjaGenerator.h"
diff --git a/Source/cmNinjaUtilityTargetGenerator.h b/Source/cmNinjaUtilityTargetGenerator.h
index 9256e36..361befe 100644
--- a/Source/cmNinjaUtilityTargetGenerator.h
+++ b/Source/cmNinjaUtilityTargetGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmNinjaUtilityTargetGenerator_h
#define cmNinjaUtilityTargetGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmNinjaTargetGenerator.h"
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index beddc6e..847e3f2 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -2,8 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmOSXBundleGenerator.h"
-#include "cmConfigure.h"
-
#include "cmGeneratorTarget.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
@@ -21,7 +19,7 @@ cmOSXBundleGenerator::cmOSXBundleGenerator(cmGeneratorTarget* target,
, Makefile(target->Target->GetMakefile())
, LocalGenerator(target->GetLocalGenerator())
, ConfigName(configName)
- , MacContentFolders(CM_NULLPTR)
+ , MacContentFolders(nullptr)
{
if (this->MustSkip()) {
return;
diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h
index 634e3a8..d6e51a5 100644
--- a/Source/cmOptionCommand.h
+++ b/Source/cmOptionCommand.h
@@ -3,7 +3,7 @@
#ifndef cmOptionCommand_h
#define cmOptionCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h
index 3a0637a..5916f7a 100644
--- a/Source/cmOrderDirectories.h
+++ b/Source/cmOrderDirectories.h
@@ -3,7 +3,7 @@
#ifndef cmOrderDirectories_h
#define cmOrderDirectories_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmsys/RegularExpression.hxx"
#include <map>
@@ -26,7 +26,7 @@ public:
const char* purpose);
~cmOrderDirectories();
void AddRuntimeLibrary(std::string const& fullPath,
- const char* soname = CM_NULLPTR);
+ const char* soname = nullptr);
void AddLinkLibrary(std::string const& fullPath);
void AddUserDirectories(std::vector<std::string> const& extra);
void AddLanguageDirectories(std::vector<std::string> const& dirs);
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 14c986d..f56d212 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -389,7 +389,7 @@ int cmOutputConverter::Shell__CharNeedsQuotes(char c, int flags)
int cmOutputConverter::Shell__CharIsMakeVariableName(char c)
{
- return c && (c == '_' || isalpha(((int)c)));
+ return c && (c == '_' || isalpha((static_cast<int>(c))));
}
const char* cmOutputConverter::Shell__SkipMakeVariables(const char* c)
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index 2339d68..2fd266a 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -5,6 +5,7 @@
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
#include <map>
+#include <unordered_map>
#include <utility>
#include "cmAlgorithms.h"
@@ -13,7 +14,6 @@
#include "cmSourceFile.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
-#include "cm_unordered_map.hxx"
class cmExecutionStatus;
@@ -31,7 +31,7 @@ public:
*/
cmDependInformation()
: DependDone(false)
- , SourceFile(CM_NULLPTR)
+ , SourceFile(nullptr)
{
}
@@ -157,7 +157,7 @@ public:
*/
const cmDependInformation* FindDependencies(const char* file)
{
- cmDependInformation* info = this->GetDependInformation(file, CM_NULLPTR);
+ cmDependInformation* info = this->GetDependInformation(file, nullptr);
this->GenerateDependInformation(info);
return info;
}
@@ -202,7 +202,7 @@ protected:
message += includeFile;
message += " for file ";
message += info->FullPath;
- cmSystemTools::Error(message.c_str(), CM_NULLPTR);
+ cmSystemTools::Error(message.c_str(), nullptr);
}
continue;
}
@@ -328,7 +328,7 @@ protected:
// See if the cmSourceFile for it has any files specified as
// dependency hints.
- if (info->SourceFile != CM_NULLPTR) {
+ if (info->SourceFile != nullptr) {
// Get the cmSourceFile corresponding to this.
const cmSourceFile& cFile = *(info->SourceFile);
diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h
index d20bfbd..6dcb888 100644
--- a/Source/cmOutputRequiredFilesCommand.h
+++ b/Source/cmOutputRequiredFilesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmOutputRequiredFilesCommand_h
#define cmOutputRequiredFilesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <set>
#include <stdio.h>
diff --git a/Source/cmParseArgumentsCommand.h b/Source/cmParseArgumentsCommand.h
index 359fb85..469a76a 100644
--- a/Source/cmParseArgumentsCommand.h
+++ b/Source/cmParseArgumentsCommand.h
@@ -3,7 +3,7 @@
#ifndef cmParseArgumentsCommand_h
#define cmParseArgumentsCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmPipeConnection.cxx b/Source/cmPipeConnection.cxx
new file mode 100644
index 0000000..b18a1d6
--- /dev/null
+++ b/Source/cmPipeConnection.cxx
@@ -0,0 +1,79 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmPipeConnection.h"
+
+#include "cmServer.h"
+
+cmPipeConnection::cmPipeConnection(const std::string& name,
+ cmConnectionBufferStrategy* bufferStrategy)
+ : cmEventBasedConnection(bufferStrategy)
+ , PipeName(name)
+{
+}
+
+void cmPipeConnection::Connect(uv_stream_t* server)
+{
+ if (this->ClientPipe) {
+ // Accept and close all pipes but the first:
+ uv_pipe_t* rejectPipe = new uv_pipe_t();
+
+ uv_pipe_init(this->Server->GetLoop(), rejectPipe, 0);
+ uv_accept(server, reinterpret_cast<uv_stream_t*>(rejectPipe));
+ uv_close(reinterpret_cast<uv_handle_t*>(rejectPipe), &on_close_delete);
+ return;
+ }
+
+ this->ClientPipe = new uv_pipe_t();
+ uv_pipe_init(this->Server->GetLoop(), this->ClientPipe, 0);
+ this->ClientPipe->data = static_cast<cmEventBasedConnection*>(this);
+ auto client = reinterpret_cast<uv_stream_t*>(this->ClientPipe);
+ if (uv_accept(server, client) != 0) {
+ uv_close(reinterpret_cast<uv_handle_t*>(client), &on_close_delete);
+ this->ClientPipe = nullptr;
+ return;
+ }
+ this->ReadStream = client;
+ this->WriteStream = client;
+
+ uv_read_start(this->ReadStream, on_alloc_buffer, on_read);
+ Server->OnConnected(this);
+}
+
+bool cmPipeConnection::OnServeStart(std::string* errorMessage)
+{
+ this->ServerPipe = new uv_pipe_t();
+ uv_pipe_init(this->Server->GetLoop(), this->ServerPipe, 0);
+ this->ServerPipe->data = static_cast<cmEventBasedConnection*>(this);
+
+ int r;
+ if ((r = uv_pipe_bind(this->ServerPipe, this->PipeName.c_str())) != 0) {
+ *errorMessage = std::string("Internal Error with ") + this->PipeName +
+ ": " + uv_err_name(r);
+ return false;
+ }
+ auto serverStream = reinterpret_cast<uv_stream_t*>(this->ServerPipe);
+ if ((r = uv_listen(serverStream, 1, on_new_connection)) != 0) {
+ *errorMessage = std::string("Internal Error listening on ") +
+ this->PipeName + ": " + uv_err_name(r);
+ return false;
+ }
+
+ return cmConnection::OnServeStart(errorMessage);
+}
+
+bool cmPipeConnection::OnConnectionShuttingDown()
+{
+ if (this->ClientPipe) {
+ uv_close(reinterpret_cast<uv_handle_t*>(this->ClientPipe),
+ &on_close_delete);
+ this->WriteStream->data = nullptr;
+ }
+ uv_close(reinterpret_cast<uv_handle_t*>(this->ServerPipe), &on_close_delete);
+
+ this->ClientPipe = nullptr;
+ this->ServerPipe = nullptr;
+ this->WriteStream = nullptr;
+ this->ReadStream = nullptr;
+
+ return cmConnection::OnConnectionShuttingDown();
+}
diff --git a/Source/cmPipeConnection.h b/Source/cmPipeConnection.h
new file mode 100644
index 0000000..7b89842
--- /dev/null
+++ b/Source/cmPipeConnection.h
@@ -0,0 +1,28 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#pragma once
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <string>
+
+#include "cmConnection.h"
+#include "cm_uv.h"
+
+class cmPipeConnection : public cmEventBasedConnection
+{
+public:
+ cmPipeConnection(const std::string& name,
+ cmConnectionBufferStrategy* bufferStrategy = nullptr);
+
+ bool OnServeStart(std::string* pString) override;
+
+ bool OnConnectionShuttingDown() override;
+
+ void Connect(uv_stream_t* server) override;
+
+private:
+ const std::string PipeName;
+ uv_pipe_t* ServerPipe = nullptr;
+ uv_pipe_t* ClientPipe = nullptr;
+};
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index da3edd4..910f6fb 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -8,7 +8,6 @@
#include "cmVersion.h"
#include "cmake.h"
-#include "cmConfigure.h"
#include <assert.h>
#include <ctype.h>
#include <sstream>
@@ -62,9 +61,9 @@ static const char* idToString(cmPolicies::PolicyID id)
CM_FOR_EACH_POLICY_ID(POLICY_CASE)
#undef POLICY_CASE
case cmPolicies::CMPCOUNT:
- return CM_NULLPTR;
+ return nullptr;
}
- return CM_NULLPTR;
+ return nullptr;
}
static const char* idToVersion(cmPolicies::PolicyID id)
@@ -76,9 +75,9 @@ static const char* idToVersion(cmPolicies::PolicyID id)
CM_FOR_EACH_POLICY_ID_VERSION(POLICY_CASE)
#undef POLICY_CASE
case cmPolicies::CMPCOUNT:
- return CM_NULLPTR;
+ return nullptr;
}
- return CM_NULLPTR;
+ return nullptr;
}
static bool isPolicyNewerThan(cmPolicies::PolicyID id, unsigned int majorV,
@@ -108,9 +107,9 @@ const char* idToShortDescription(cmPolicies::PolicyID id)
CM_FOR_EACH_POLICY_ID_DOC(POLICY_CASE)
#undef POLICY_CASE
case cmPolicies::CMPCOUNT:
- return CM_NULLPTR;
+ return nullptr;
}
- return CM_NULLPTR;
+ return nullptr;
}
static void DiagnoseAncientPolicies(
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 69cbc18..354011a 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -206,7 +206,12 @@ class cmMakefile;
cmPolicies::WARN) \
SELECT(POLICY, CMP0069, \
"INTERPROCEDURAL_OPTIMIZATION is enforced when enabled.", 3, 9, 0, \
- cmPolicies::WARN)
+ cmPolicies::WARN) \
+ SELECT(POLICY, CMP0070, \
+ "Define file(GENERATE) behavior for relative paths.", 3, 10, 0, \
+ cmPolicies::WARN) \
+ SELECT(POLICY, CMP0071, "Let AUTOMOC and AUTOUIC process GENERATED files.", \
+ 3, 10, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
#define CM_FOR_EACH_POLICY_ID(POLICY) \
diff --git a/Source/cmProcessTools.cxx b/Source/cmProcessTools.cxx
index de7b061..67b4a97 100644
--- a/Source/cmProcessTools.cxx
+++ b/Source/cmProcessTools.cxx
@@ -10,22 +10,22 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out,
OutputParser* err, Encoding encoding)
{
cmsysProcess_Execute(cp);
- char* data = CM_NULLPTR;
+ char* data = nullptr;
int length = 0;
int p;
cmProcessOutput processOutput(encoding);
std::string strdata;
while ((out || err) &&
- (p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) {
+ (p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) {
if (out && p == cmsysProcess_Pipe_STDOUT) {
processOutput.DecodeText(data, length, strdata, 1);
if (!out->Process(strdata.c_str(), int(strdata.size()))) {
- out = CM_NULLPTR;
+ out = nullptr;
}
} else if (err && p == cmsysProcess_Pipe_STDERR) {
processOutput.DecodeText(data, length, strdata, 2);
if (!err->Process(strdata.c_str(), int(strdata.size()))) {
- err = CM_NULLPTR;
+ err = nullptr;
}
}
}
@@ -41,12 +41,12 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out,
out->Process(strdata.c_str(), int(strdata.size()));
}
}
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
}
cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR)
- : Log(CM_NULLPTR)
- , Prefix(CM_NULLPTR)
+ : Log(nullptr)
+ , Prefix(nullptr)
, Separator(sep)
, LineEnd('\0')
, IgnoreCR(ignoreCR)
diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h
index e7d9a10..5b357cd 100644
--- a/Source/cmProcessTools.h
+++ b/Source/cmProcessTools.h
@@ -3,7 +3,7 @@
#ifndef cmProcessTools_h
#define cmProcessTools_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmProcessOutput.h"
#include <iosfwd>
@@ -70,7 +70,7 @@ public:
class OutputLogger : public LineParser
{
public:
- OutputLogger(std::ostream& log, const char* prefix = CM_NULLPTR)
+ OutputLogger(std::ostream& log, const char* prefix = nullptr)
{
this->SetLog(&log, prefix);
}
@@ -81,7 +81,7 @@ public:
/** Run a process and send output to given parsers. */
static void RunProcess(struct cmsysProcess_s* cp, OutputParser* out,
- OutputParser* err = CM_NULLPTR,
+ OutputParser* err = nullptr,
Encoding encoding = cmProcessOutput::Auto);
};
diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h
index 3c579ac..afe489a 100644
--- a/Source/cmProjectCommand.h
+++ b/Source/cmProjectCommand.h
@@ -3,7 +3,7 @@
#ifndef cmProjectCommand_h
#define cmProjectCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmProperty.cxx b/Source/cmProperty.cxx
index 222afb4..27f0ecd 100644
--- a/Source/cmProperty.cxx
+++ b/Source/cmProperty.cxx
@@ -2,8 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmProperty.h"
-#include "cmConfigure.h"
-
void cmProperty::Set(const char* value)
{
this->Value = value;
@@ -24,5 +22,5 @@ const char* cmProperty::GetValue() const
if (this->ValueHasBeenSet) {
return this->Value.c_str();
}
- return CM_NULLPTR;
+ return nullptr;
}
diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx
index 1e089d1..4905c24 100644
--- a/Source/cmPropertyMap.cxx
+++ b/Source/cmPropertyMap.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmPropertyMap.h"
-#include "cmConfigure.h"
#include <algorithm>
#include <assert.h>
#include <utility>
@@ -59,7 +58,7 @@ const char* cmPropertyMap::GetPropertyValue(const std::string& name) const
cmPropertyMap::const_iterator it = this->find(name);
if (it == this->end()) {
- return CM_NULLPTR;
+ return nullptr;
}
return it->second.GetValue();
}
diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx
index de9e545..ae1fdfa 100644
--- a/Source/cmQTWrapCPPCommand.cxx
+++ b/Source/cmQTWrapCPPCommand.cxx
@@ -78,7 +78,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& args,
depends.push_back(hname);
std::string no_main_dependency;
- const char* no_working_dir = CM_NULLPTR;
+ const char* no_working_dir = nullptr;
this->Makefile->AddCustomCommandToOutput(
newName, depends, no_main_dependency, commandLines, "Qt Wrapped File",
no_working_dir);
diff --git a/Source/cmQTWrapCPPCommand.h b/Source/cmQTWrapCPPCommand.h
index ad1ccf3..014a4ab 100644
--- a/Source/cmQTWrapCPPCommand.h
+++ b/Source/cmQTWrapCPPCommand.h
@@ -3,7 +3,7 @@
#ifndef cmQTWrapCPPCommand_h
#define cmQTWrapCPPCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx
index d3c6631..3d586d6 100644
--- a/Source/cmQTWrapUICommand.cxx
+++ b/Source/cmQTWrapUICommand.cxx
@@ -109,8 +109,8 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args,
std::vector<std::string> depends;
depends.push_back(uiName);
std::string no_main_dependency;
- const char* no_comment = CM_NULLPTR;
- const char* no_working_dir = CM_NULLPTR;
+ const char* no_comment = nullptr;
+ const char* no_working_dir = nullptr;
this->Makefile->AddCustomCommandToOutput(
hName, depends, no_main_dependency, hCommandLines, no_comment,
no_working_dir);
diff --git a/Source/cmQTWrapUICommand.h b/Source/cmQTWrapUICommand.h
index ac7ab01..f7e6bdd 100644
--- a/Source/cmQTWrapUICommand.h
+++ b/Source/cmQTWrapUICommand.h
@@ -3,7 +3,7 @@
#ifndef cmQTWrapUICommand_h
#define cmQTWrapUICommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmQtAutoGeneratorCommon.cxx b/Source/cmQtAutoGeneratorCommon.cxx
index 3e1b58c..a8e6b96 100644
--- a/Source/cmQtAutoGeneratorCommon.cxx
+++ b/Source/cmQtAutoGeneratorCommon.cxx
@@ -38,7 +38,7 @@ static bool RccListInputsQt4(const std::string& fileName,
osst << ifs.rdbuf();
qrcContents = osst.str();
} else {
- if (errorMessage != CM_NULLPTR) {
+ if (errorMessage != nullptr) {
std::ostringstream ost;
ost << "AutoRcc: Error: Rcc file not readable:\n"
<< cmQtAutoGeneratorCommon::Quoted(fileName) << "\n";
@@ -98,7 +98,7 @@ static bool RccListInputsQt5(const std::string& rccCommand,
int retVal = 0;
bool result =
cmSystemTools::RunSingleCommand(command, &rccStdOut, &rccStdErr, &retVal,
- CM_NULLPTR, cmSystemTools::OUTPUT_NONE);
+ nullptr, cmSystemTools::OUTPUT_NONE);
if (result && retVal == 0 &&
rccStdOut.find("--list") != std::string::npos) {
hasDashDashList = true;
@@ -117,10 +117,10 @@ static bool RccListInputsQt5(const std::string& rccCommand,
command.push_back(fileName);
result =
cmSystemTools::RunSingleCommand(command, &rccStdOut, &rccStdErr, &retVal,
- CM_NULLPTR, cmSystemTools::OUTPUT_NONE);
+ nullptr, cmSystemTools::OUTPUT_NONE);
}
if (!result || retVal) {
- if (errorMessage != CM_NULLPTR) {
+ if (errorMessage != nullptr) {
std::ostringstream ost;
ost << "AutoRcc: Error: Rcc list process for " << fileName
<< " failed:\n"
@@ -153,7 +153,7 @@ static bool RccListInputsQt5(const std::string& rccCommand,
std::string::size_type pos = eline.find(searchString);
if (pos == std::string::npos) {
- if (errorMessage != CM_NULLPTR) {
+ if (errorMessage != nullptr) {
std::ostringstream ost;
ost << "AutoRcc: Error: Rcc lists unparsable output:\n"
<< cmQtAutoGeneratorCommon::Quoted(eline) << "\n";
@@ -205,7 +205,7 @@ bool cmQtAutoGeneratorCommon::RccListInputs(const std::string& qtMajorVersion,
allGood = RccListInputsQt5(rccCommand, fileName, files, errorMessage);
}
} else {
- if (errorMessage != CM_NULLPTR) {
+ if (errorMessage != nullptr) {
std::ostringstream ost;
ost << "AutoRcc: Error: Rcc file does not exist:\n"
<< cmQtAutoGeneratorCommon::Quoted(fileName) << "\n";
diff --git a/Source/cmQtAutoGeneratorCommon.h b/Source/cmQtAutoGeneratorCommon.h
index a131baf..23a882a 100644
--- a/Source/cmQtAutoGeneratorCommon.h
+++ b/Source/cmQtAutoGeneratorCommon.h
@@ -3,7 +3,7 @@
#ifndef cmQtAutoGeneratorCommon_h
#define cmQtAutoGeneratorCommon_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
@@ -33,7 +33,7 @@ public:
const std::string& rccCommand,
const std::string& fileName,
std::vector<std::string>& files,
- std::string* errorMessage = CM_NULLPTR);
+ std::string* errorMessage = nullptr);
};
#endif
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index cecf165..07fb528 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -4,6 +4,7 @@
#include "cmQtAutoGeneratorCommon.h"
#include "cmAlgorithms.h"
+#include "cmCustomCommand.h"
#include "cmCustomCommandLines.h"
#include "cmFilePathChecksum.h"
#include "cmGeneratorTarget.h"
@@ -11,6 +12,7 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmOutputConverter.h"
+#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmSourceGroup.h"
#include "cmState.h"
@@ -18,40 +20,30 @@
#include "cmTarget.h"
#include "cm_sys_stat.h"
#include "cmake.h"
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#include "cmGlobalVisualStudioGenerator.h"
-#endif
-
-#include "cmConfigure.h"
#include "cmsys/FStream.hxx"
+
#include <algorithm>
#include <map>
#include <set>
+#include <sstream>
#include <string>
#include <utility>
#include <vector>
-static void utilCopyTargetProperty(cmTarget* destinationTarget,
- cmTarget* sourceTarget,
- const std::string& propertyName)
+inline static const char* SafeString(const char* value)
{
- const char* propertyValue = sourceTarget->GetProperty(propertyName);
- if (propertyValue) {
- destinationTarget->SetProperty(propertyName, propertyValue);
- }
+ return (value != nullptr) ? value : "";
}
-inline static bool PropertyEnabled(cmSourceFile* sourceFile, const char* key)
+static std::string GetSafeProperty(cmGeneratorTarget const* target,
+ const char* key)
{
- return cmSystemTools::IsOn(sourceFile->GetPropertyForUser(key));
+ return std::string(SafeString(target->GetProperty(key)));
}
-static std::string GetSafeProperty(cmGeneratorTarget const* target,
- const char* key)
+inline static bool AutogenMultiConfig(cmGlobalGenerator* globalGen)
{
- const char* tmp = target->GetProperty(key);
- return std::string((tmp != CM_NULLPTR) ? tmp : "");
+ return globalGen->IsMultiConfig();
}
static std::string GetAutogenTargetName(cmGeneratorTarget const* target)
@@ -93,7 +85,7 @@ static std::string GetQtMajorVersion(cmGeneratorTarget const* target)
}
const char* targetQtVersion =
target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", "");
- if (targetQtVersion != CM_NULLPTR) {
+ if (targetQtVersion != nullptr) {
qtMajorVersion = targetQtVersion;
}
return qtMajorVersion;
@@ -113,7 +105,7 @@ static std::string GetQtMinorVersion(cmGeneratorTarget const* target,
const char* targetQtVersion =
target->GetLinkInterfaceDependentStringProperty("QT_MINOR_VERSION", "");
- if (targetQtVersion != CM_NULLPTR) {
+ if (targetQtVersion != nullptr) {
qtMinorVersion = targetQtVersion;
}
return qtMinorVersion;
@@ -154,28 +146,13 @@ static void GetCompileDefinitionsAndDirectories(
}
}
-static bool IsMultiConfig(cmGlobalGenerator* globalGen)
-{
- // FIXME: Xcode does not support per-config sources, yet.
- // (EXCLUDED_SOURCE_FILE_NAMES)
- // Treat it as a single configuration generator meanwhile.
- if (globalGen->GetName().find("Xcode") != std::string::npos) {
- return false;
- }
- // FIXME: Visual Studio does not fully support per-config sources yet.
- if (globalGen->GetName().find("Visual Studio") != std::string::npos) {
- return false;
- }
- return globalGen->IsMultiConfig();
-}
-
static std::vector<std::string> GetConfigurations(
- cmMakefile* makefile, std::string* config = CM_NULLPTR)
+ cmMakefile* makefile, std::string* config = nullptr)
{
std::vector<std::string> configs;
{
std::string cfg = makefile->GetConfigurations(configs);
- if (config != CM_NULLPTR) {
+ if (config != nullptr) {
*config = cfg;
}
}
@@ -189,7 +166,7 @@ static std::vector<std::string> GetConfigurations(
static std::vector<std::string> GetConfigurationSuffixes(cmMakefile* makefile)
{
std::vector<std::string> suffixes;
- if (IsMultiConfig(makefile->GetGlobalGenerator())) {
+ if (AutogenMultiConfig(makefile->GetGlobalGenerator())) {
makefile->GetConfigurations(suffixes);
for (std::vector<std::string>::iterator it = suffixes.begin();
it != suffixes.end(); ++it) {
@@ -216,13 +193,20 @@ static void AddDefinitionEscaped(cmMakefile* makefile, const char* key,
key, cmOutputConverter::EscapeForCMake(cmJoin(values, ";")).c_str());
}
+static void AddDefinitionEscaped(cmMakefile* makefile, const char* key,
+ const std::set<std::string>& values)
+{
+ makefile->AddDefinition(
+ key, cmOutputConverter::EscapeForCMake(cmJoin(values, ";")).c_str());
+}
+
static bool AddToSourceGroup(cmMakefile* makefile, const std::string& fileName,
cmQtAutoGeneratorCommon::GeneratorType genType)
{
- cmSourceGroup* sourceGroup = CM_NULLPTR;
+ cmSourceGroup* sourceGroup = nullptr;
// Acquire source group
{
- const char* groupName = CM_NULLPTR;
+ const char* groupName = nullptr;
// Use generator specific group name
switch (genType) {
case cmQtAutoGeneratorCommon::MOC:
@@ -237,27 +221,27 @@ static bool AddToSourceGroup(cmMakefile* makefile, const std::string& fileName,
break;
}
// Use default group name on demand
- if ((groupName == CM_NULLPTR) || (*groupName == 0)) {
+ if ((groupName == nullptr) || (*groupName == 0)) {
groupName =
makefile->GetState()->GetGlobalProperty("AUTOGEN_SOURCE_GROUP");
}
// Generate a source group on demand
- if ((groupName != CM_NULLPTR) && (*groupName != 0)) {
+ if ((groupName != nullptr) && (*groupName != 0)) {
{
const char* delimiter =
makefile->GetDefinition("SOURCE_GROUP_DELIMITER");
- if (delimiter == CM_NULLPTR) {
+ if (delimiter == nullptr) {
delimiter = "\\";
}
std::vector<std::string> folders =
cmSystemTools::tokenize(groupName, delimiter);
sourceGroup = makefile->GetSourceGroup(folders);
- if (sourceGroup == CM_NULLPTR) {
+ if (sourceGroup == nullptr) {
makefile->AddSourceGroup(folders);
sourceGroup = makefile->GetSourceGroup(folders);
}
}
- if (sourceGroup == CM_NULLPTR) {
+ if (sourceGroup == nullptr) {
cmSystemTools::Error(
"Autogen: Could not create or find source group: ",
cmQtAutoGeneratorCommon::Quoted(groupName).c_str());
@@ -265,101 +249,164 @@ static bool AddToSourceGroup(cmMakefile* makefile, const std::string& fileName,
}
}
}
- if (sourceGroup != CM_NULLPTR) {
+ if (sourceGroup != nullptr) {
sourceGroup->AddGroupFile(fileName);
}
return true;
}
-static void AddGeneratedSource(cmMakefile* makefile,
+static void AddCleanFile(cmMakefile* makefile, const std::string& fileName)
+{
+ makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", fileName.c_str(),
+ false);
+}
+
+static void AddGeneratedSource(cmGeneratorTarget* target,
const std::string& filename,
cmQtAutoGeneratorCommon::GeneratorType genType)
{
- cmSourceFile* gFile = makefile->GetOrCreateSource(filename, true);
- gFile->SetProperty("GENERATED", "1");
- gFile->SetProperty("SKIP_AUTOGEN", "On");
+ cmMakefile* makefile = target->Target->GetMakefile();
+ {
+ cmSourceFile* gFile = makefile->GetOrCreateSource(filename, true);
+ gFile->SetProperty("GENERATED", "1");
+ gFile->SetProperty("SKIP_AUTOGEN", "On");
+ }
+ target->AddSource(filename);
AddToSourceGroup(makefile, filename, genType);
}
-static void AcquireScanFiles(cmGeneratorTarget const* target,
- std::vector<std::string>& mocUicSources,
- std::vector<std::string>& mocUicHeaders,
- std::vector<std::string>& mocSkipList,
- std::vector<std::string>& uicSkipList)
+struct AutogenSetup
{
- const bool mocTarget = target->GetPropertyAsBool("AUTOMOC");
- const bool uicTarget = target->GetPropertyAsBool("AUTOUIC");
+ std::vector<std::string> sources;
+ std::vector<std::string> headers;
- std::vector<cmSourceFile*> srcFiles;
- target->GetConfigCommonSourceFiles(srcFiles);
+ std::set<std::string> mocSkip;
+ std::set<std::string> uicSkip;
+
+ std::map<std::string, std::string> configSuffix;
+ std::map<std::string, std::string> configMocIncludes;
+ std::map<std::string, std::string> configMocDefines;
+ std::map<std::string, std::string> configUicOptions;
+};
+
+static void SetupAcquireScanFiles(cmGeneratorTarget const* target,
+ bool mocEnabled, bool uicEnabled,
+ const std::vector<cmSourceFile*>& srcFiles,
+ AutogenSetup& setup)
+{
+ // Read skip files from makefile sources
+ {
+ const std::vector<cmSourceFile*>& allSources =
+ target->Makefile->GetSourceFiles();
+ for (std::vector<cmSourceFile*>::const_iterator fit = allSources.begin();
+ fit != allSources.end(); ++fit) {
+ cmSourceFile* sf = *fit;
+ // sf->GetExtension() is only valid after sf->GetFullPath() ...
+ const std::string& fPath = sf->GetFullPath();
+ const cmSystemTools::FileFormat fileType =
+ cmSystemTools::GetFileFormat(sf->GetExtension().c_str());
+ if (!(fileType == cmSystemTools::CXX_FILE_FORMAT) &&
+ !(fileType == cmSystemTools::HEADER_FILE_FORMAT)) {
+ continue;
+ }
+ const bool skipAll = sf->GetPropertyAsBool("SKIP_AUTOGEN");
+ const bool mocSkip =
+ mocEnabled && (skipAll || sf->GetPropertyAsBool("SKIP_AUTOMOC"));
+ const bool uicSkip =
+ uicEnabled && (skipAll || sf->GetPropertyAsBool("SKIP_AUTOUIC"));
+ if (mocSkip || uicSkip) {
+ const std::string absFile = cmsys::SystemTools::GetRealPath(fPath);
+ if (mocSkip) {
+ setup.mocSkip.insert(absFile);
+ }
+ if (uicSkip) {
+ setup.uicSkip.insert(absFile);
+ }
+ }
+ }
+ }
+
+ const cmPolicies::PolicyStatus CMP0071_status =
+ target->Makefile->GetPolicyStatus(cmPolicies::CMP0071);
for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
fileIt != srcFiles.end(); ++fileIt) {
cmSourceFile* sf = *fileIt;
+ // sf->GetExtension() is only valid after sf->GetFullPath() ...
+ const std::string& fPath = sf->GetFullPath();
const cmSystemTools::FileFormat fileType =
cmSystemTools::GetFileFormat(sf->GetExtension().c_str());
-
if (!(fileType == cmSystemTools::CXX_FILE_FORMAT) &&
!(fileType == cmSystemTools::HEADER_FILE_FORMAT)) {
continue;
}
- if (PropertyEnabled(sf, "GENERATED") &&
- !target->GetPropertyAsBool("__UNDOCUMENTED_AUTOGEN_GENERATED_FILES")) {
- // FIXME: Add a policy whose NEW behavior allows generated files.
- // The implementation already works. We disable it here to avoid
- // changing behavior for existing projects that do not expect it.
+ // Real file path
+ const std::string absFile = cmsys::SystemTools::GetRealPath(fPath);
+ // Skip test
+ const bool mocSkip = !mocEnabled || (setup.mocSkip.count(absFile) != 0);
+ const bool uicSkip = !uicEnabled || (setup.uicSkip.count(absFile) != 0);
+ if (mocSkip && uicSkip) {
continue;
}
- const std::string absFile =
- cmsys::SystemTools::GetRealPath(sf->GetFullPath());
- // Skip flags
- const bool skipAll = PropertyEnabled(sf, "SKIP_AUTOGEN");
- const bool mocSkip = skipAll || PropertyEnabled(sf, "SKIP_AUTOMOC");
- const bool uicSkip = skipAll || PropertyEnabled(sf, "SKIP_AUTOUIC");
- // Add file name to skip lists.
- // Do this even when the file is not added to the sources/headers lists
- // because the file name may be extracted from an other file when
- // processing
- if (mocSkip) {
- mocSkipList.push_back(absFile);
- }
- if (uicSkip) {
- uicSkipList.push_back(absFile);
- }
- if ((mocTarget && !mocSkip) || (uicTarget && !uicSkip)) {
- // Add file name to sources or headers list
- switch (fileType) {
- case cmSystemTools::CXX_FILE_FORMAT:
- mocUicSources.push_back(absFile);
- break;
- case cmSystemTools::HEADER_FILE_FORMAT:
- mocUicHeaders.push_back(absFile);
+ // For GENERATED files check status of policy CMP0071
+ if (sf->GetPropertyAsBool("GENERATED")) {
+ bool policyAccept = false;
+ switch (CMP0071_status) {
+ case cmPolicies::WARN: {
+ std::ostringstream ost;
+ ost << cmPolicies::GetPolicyWarning(cmPolicies::CMP0071) << "\n";
+ ost << "AUTOMOC/AUTOUIC: Ignoring GENERATED source file:\n";
+ ost << " " << cmQtAutoGeneratorCommon::Quoted(absFile) << "\n";
+ target->Makefile->IssueMessage(cmake::AUTHOR_WARNING, ost.str());
+ }
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ // Ignore GENERATED file
break;
- default:
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ // Process GENERATED file
+ policyAccept = true;
break;
}
+ if (!policyAccept) {
+ continue;
+ }
+ }
+
+ // Add file name to sources or headers list
+ switch (fileType) {
+ case cmSystemTools::CXX_FILE_FORMAT:
+ setup.sources.push_back(absFile);
+ break;
+ case cmSystemTools::HEADER_FILE_FORMAT:
+ setup.headers.push_back(absFile);
+ break;
+ default:
+ break;
}
}
}
-static void MocSetupAutoTarget(
- cmGeneratorTarget const* target, const std::string& autogenTargetName,
- std::string const& qtMajorVersion, std::string const& config,
- std::vector<std::string> const& configs,
- std::vector<std::string> const& mocSkipList,
- std::map<std::string, std::string>& configMocIncludes,
- std::map<std::string, std::string>& configMocDefines)
+static void SetupAutoTargetMoc(cmGeneratorTarget const* target,
+ std::string const& qtMajorVersion,
+ std::string const& config,
+ std::vector<std::string> const& configs,
+ AutogenSetup& setup)
{
- cmLocalGenerator* lg = target->GetLocalGenerator();
+ cmLocalGenerator* localGen = target->GetLocalGenerator();
cmMakefile* makefile = target->Target->GetMakefile();
+ AddDefinitionEscaped(makefile, "_moc_skip", setup.mocSkip);
AddDefinitionEscaped(makefile, "_moc_options",
GetSafeProperty(target, "AUTOMOC_MOC_OPTIONS"));
- AddDefinitionEscaped(makefile, "_moc_skip", mocSkipList);
AddDefinitionEscaped(makefile, "_moc_relaxed_mode",
makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE") ? "TRUE"
: "FALSE");
+ AddDefinitionEscaped(makefile, "_moc_macro_names",
+ GetSafeProperty(target, "AUTOMOC_MACRO_NAMES"));
AddDefinitionEscaped(makefile, "_moc_depend_filters",
GetSafeProperty(target, "AUTOMOC_DEPEND_FILTERS"));
@@ -386,42 +433,41 @@ static void MocSetupAutoTarget(
GetCompileDefinitionsAndDirectories(target, *li, configIncs,
configCompileDefs);
if (configIncs != incs) {
- configMocIncludes[*li] = cmOutputConverter::EscapeForCMake(configIncs);
+ setup.configMocIncludes[*li] = configIncs;
}
if (configCompileDefs != compileDefs) {
- configMocDefines[*li] =
- cmOutputConverter::EscapeForCMake(configCompileDefs);
+ setup.configMocDefines[*li] = configCompileDefs;
}
}
}
// Moc executable
{
+ std::string mocExec;
std::string err;
- const char* mocExec = CM_NULLPTR;
+
if (qtMajorVersion == "5") {
- cmGeneratorTarget* qt5Moc = lg->FindGeneratorTargetToUse("Qt5::moc");
- if (qt5Moc != CM_NULLPTR) {
- mocExec = qt5Moc->ImportedGetLocation("");
+ cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt5::moc");
+ if (tgt != nullptr) {
+ mocExec = SafeString(tgt->ImportedGetLocation(""));
} else {
- err = "Qt5::moc target not found " + autogenTargetName;
+ err = "AUTOMOC: Qt5::moc target not found";
}
} else if (qtMajorVersion == "4") {
- cmGeneratorTarget* qt4Moc = lg->FindGeneratorTargetToUse("Qt4::moc");
- if (qt4Moc != CM_NULLPTR) {
- mocExec = qt4Moc->ImportedGetLocation("");
+ cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt4::moc");
+ if (tgt != nullptr) {
+ mocExec = SafeString(tgt->ImportedGetLocation(""));
} else {
- err = "Qt4::moc target not found " + autogenTargetName;
+ err = "AUTOMOC: Qt4::moc target not found";
}
} else {
- err = "The CMAKE_AUTOMOC feature supports only Qt 4 and Qt 5 ";
- err += autogenTargetName;
+ err = "The AUTOMOC feature supports only Qt 4 and Qt 5";
}
- // Add definition or error
+
if (err.empty()) {
- AddDefinitionEscaped(makefile, "_qt_moc_executable",
- mocExec ? mocExec : "");
+ AddDefinitionEscaped(makefile, "_qt_moc_executable", mocExec);
} else {
+ err += " (" + target->GetName() + ")";
cmSystemTools::Error(err.c_str());
}
}
@@ -435,26 +481,30 @@ static void UicGetOpts(cmGeneratorTarget const* target,
optString = cmJoin(opts, ";");
}
-static void UicSetupAutoTarget(
- cmGeneratorTarget const* target, std::string const& qtMajorVersion,
- std::string const& config, std::vector<std::string> const& configs,
- std::vector<std::string> const& uicSkipList,
- std::map<std::string, std::string>& configUicOptions)
+static void SetupAutoTargetUic(cmGeneratorTarget const* target,
+ std::string const& qtMajorVersion,
+ std::string const& config,
+ std::vector<std::string> const& configs,
+ AutogenSetup& setup)
{
- cmLocalGenerator* lg = target->GetLocalGenerator();
+ cmLocalGenerator* localGen = target->GetLocalGenerator();
cmMakefile* makefile = target->Target->GetMakefile();
- AddDefinitionEscaped(makefile, "_uic_skip", uicSkipList);
+ AddDefinitionEscaped(makefile, "_uic_skip", setup.uicSkip);
// Uic search paths
{
std::vector<std::string> uicSearchPaths;
- cmSystemTools::ExpandListArgument(
- GetSafeProperty(target, "AUTOUIC_SEARCH_PATHS"), uicSearchPaths);
- const std::string srcDir = makefile->GetCurrentSourceDirectory();
- for (std::vector<std::string>::iterator it = uicSearchPaths.begin();
- it != uicSearchPaths.end(); ++it) {
- *it = cmSystemTools::CollapseFullPath(*it, srcDir);
+ {
+ const std::string usp = GetSafeProperty(target, "AUTOUIC_SEARCH_PATHS");
+ if (!usp.empty()) {
+ cmSystemTools::ExpandListArgument(usp, uicSearchPaths);
+ const std::string srcDir = makefile->GetCurrentSourceDirectory();
+ for (std::vector<std::string>::iterator it = uicSearchPaths.begin();
+ it != uicSearchPaths.end(); ++it) {
+ *it = cmSystemTools::CollapseFullPath(*it, srcDir);
+ }
+ }
}
AddDefinitionEscaped(makefile, "_uic_search_paths", uicSearchPaths);
}
@@ -471,8 +521,7 @@ static void UicSetupAutoTarget(
std::string configUicOpts;
UicGetOpts(target, *li, configUicOpts);
if (configUicOpts != uicOpts) {
- configUicOptions[*li] =
- cmOutputConverter::EscapeForCMake(configUicOpts);
+ setup.configUicOptions[*li] = configUicOpts;
}
}
}
@@ -481,25 +530,25 @@ static void UicSetupAutoTarget(
std::vector<std::string> uiFileFiles;
std::vector<std::string> uiFileOptions;
{
- std::set<std::string> skipped;
- skipped.insert(uicSkipList.begin(), uicSkipList.end());
-
- const std::vector<cmSourceFile*> uiFilesWithOptions =
- makefile->GetQtUiFilesWithOptions();
- for (std::vector<cmSourceFile*>::const_iterator fileIt =
- uiFilesWithOptions.begin();
- fileIt != uiFilesWithOptions.end(); ++fileIt) {
- cmSourceFile* sf = *fileIt;
- const std::string absFile =
- cmsys::SystemTools::GetRealPath(sf->GetFullPath());
- if (skipped.insert(absFile).second) {
- // The file wasn't skipped
- uiFileFiles.push_back(absFile);
- {
- std::string opts = sf->GetProperty("AUTOUIC_OPTIONS");
- cmSystemTools::ReplaceString(opts, ";",
- cmQtAutoGeneratorCommon::listSep);
- uiFileOptions.push_back(opts);
+ const std::string uiExt = "ui";
+ const std::vector<cmSourceFile*>& srcFiles = makefile->GetSourceFiles();
+ for (std::vector<cmSourceFile*>::const_iterator fit = srcFiles.begin();
+ fit != srcFiles.end(); ++fit) {
+ cmSourceFile* sf = *fit;
+ // sf->GetExtension() is only valid after sf->GetFullPath() ...
+ const std::string& fPath = sf->GetFullPath();
+ if (sf->GetExtension() == uiExt) {
+ // Check if the files has uic options
+ std::string uicOpts = sf->GetProperty("AUTOUIC_OPTIONS");
+ if (!uicOpts.empty()) {
+ const std::string absFile = cmsys::SystemTools::GetRealPath(fPath);
+ // Check if file isn't skipped
+ if (setup.uicSkip.count(absFile) == 0) {
+ uiFileFiles.push_back(absFile);
+ cmSystemTools::ReplaceString(uicOpts, ";",
+ cmQtAutoGeneratorCommon::listSep);
+ uiFileOptions.push_back(uicOpts);
+ }
}
}
}
@@ -511,30 +560,30 @@ static void UicSetupAutoTarget(
// Uic executable
{
std::string err;
- const char* uicExec = CM_NULLPTR;
+ std::string uicExec;
+
if (qtMajorVersion == "5") {
- cmGeneratorTarget* qt5Uic = lg->FindGeneratorTargetToUse("Qt5::uic");
- if (qt5Uic != CM_NULLPTR) {
- uicExec = qt5Uic->ImportedGetLocation("");
+ cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt5::uic");
+ if (tgt != nullptr) {
+ uicExec = SafeString(tgt->ImportedGetLocation(""));
} else {
// Project does not use Qt5Widgets, but has AUTOUIC ON anyway
}
} else if (qtMajorVersion == "4") {
- cmGeneratorTarget* qt4Uic = lg->FindGeneratorTargetToUse("Qt4::uic");
- if (qt4Uic != CM_NULLPTR) {
- uicExec = qt4Uic->ImportedGetLocation("");
+ cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt4::uic");
+ if (tgt != nullptr) {
+ uicExec = SafeString(tgt->ImportedGetLocation(""));
} else {
- err = "Qt4::uic target not found " + target->GetName();
+ err = "AUTOUIC: Qt4::uic target not found";
}
} else {
- err = "The CMAKE_AUTOUIC feature supports only Qt 4 and Qt 5 ";
- err += target->GetName();
+ err = "The AUTOUIC feature supports only Qt 4 and Qt 5";
}
- // Add definition or error
+
if (err.empty()) {
- AddDefinitionEscaped(makefile, "_qt_uic_executable",
- uicExec ? uicExec : "");
+ AddDefinitionEscaped(makefile, "_qt_uic_executable", uicExec);
} else {
+ err += " (" + target->GetName() + ")";
cmSystemTools::Error(err.c_str());
}
}
@@ -544,27 +593,30 @@ static std::string RccGetExecutable(cmGeneratorTarget const* target,
const std::string& qtMajorVersion)
{
std::string rccExec;
- cmLocalGenerator* lg = target->GetLocalGenerator();
+ std::string err;
+
+ cmLocalGenerator* localGen = target->GetLocalGenerator();
if (qtMajorVersion == "5") {
- cmGeneratorTarget* qt5Rcc = lg->FindGeneratorTargetToUse("Qt5::rcc");
- if (qt5Rcc != CM_NULLPTR) {
- rccExec = qt5Rcc->ImportedGetLocation("");
+ cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt5::rcc");
+ if (tgt != nullptr) {
+ rccExec = SafeString(tgt->ImportedGetLocation(""));
} else {
- cmSystemTools::Error("Qt5::rcc target not found ",
- target->GetName().c_str());
+ err = "AUTORCC: Qt5::rcc target not found";
}
} else if (qtMajorVersion == "4") {
- cmGeneratorTarget* qt4Rcc = lg->FindGeneratorTargetToUse("Qt4::rcc");
- if (qt4Rcc != CM_NULLPTR) {
- rccExec = qt4Rcc->ImportedGetLocation("");
+ cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse("Qt4::rcc");
+ if (tgt != nullptr) {
+ rccExec = SafeString(tgt->ImportedGetLocation(""));
} else {
- cmSystemTools::Error("Qt4::rcc target not found ",
- target->GetName().c_str());
+ err = "AUTORCC: Qt4::rcc target not found";
}
} else {
- cmSystemTools::Error(
- "The CMAKE_AUTORCC feature supports only Qt 4 and Qt 5 ",
- target->GetName().c_str());
+ err = "The AUTORCC feature supports only Qt 4 and Qt 5";
+ }
+
+ if (!err.empty()) {
+ err += " (" + target->GetName() + ")";
+ cmSystemTools::Error(err.c_str());
}
return rccExec;
}
@@ -606,38 +658,38 @@ static void RccMergeOptions(std::vector<std::string>& opts,
opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
}
-static void RccSetupAutoTarget(cmGeneratorTarget const* target,
- const std::string& qtMajorVersion)
+static void SetupAutoTargetRcc(cmGeneratorTarget const* target,
+ const std::string& qtMajorVersion,
+ const std::vector<cmSourceFile*>& srcFiles)
{
cmMakefile* makefile = target->Target->GetMakefile();
const bool qtMajorVersion5 = (qtMajorVersion == "5");
const std::string rccCommand = RccGetExecutable(target, qtMajorVersion);
- std::vector<std::string> _rcc_files;
- std::vector<std::string> _rcc_inputs;
+ std::vector<std::string> rccFiles;
+ std::vector<std::string> rccInputs;
std::vector<std::string> rccFileFiles;
std::vector<std::string> rccFileOptions;
std::vector<std::string> rccOptionsTarget;
- if (const char* opts = target->GetProperty("AUTORCC_OPTIONS")) {
- cmSystemTools::ExpandListArgument(opts, rccOptionsTarget);
- }
- std::vector<cmSourceFile*> srcFiles;
- target->GetConfigCommonSourceFiles(srcFiles);
+ cmSystemTools::ExpandListArgument(GetSafeProperty(target, "AUTORCC_OPTIONS"),
+ rccOptionsTarget);
+
for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
fileIt != srcFiles.end(); ++fileIt) {
cmSourceFile* sf = *fileIt;
+ // sf->GetExtension() is only valid after sf->GetFullPath() ...
+ const std::string& fPath = sf->GetFullPath();
if ((sf->GetExtension() == "qrc") &&
- !PropertyEnabled(sf, "SKIP_AUTOGEN") &&
- !PropertyEnabled(sf, "SKIP_AUTORCC")) {
- const std::string absFile =
- cmsys::SystemTools::GetRealPath(sf->GetFullPath());
+ !sf->GetPropertyAsBool("SKIP_AUTOGEN") &&
+ !sf->GetPropertyAsBool("SKIP_AUTORCC")) {
+ const std::string absFile = cmsys::SystemTools::GetRealPath(fPath);
// qrc file
- _rcc_files.push_back(absFile);
+ rccFiles.push_back(absFile);
// qrc file entries
{
std::string entriesList = "{";
// Read input file list only for non generated .qrc files.
- if (!PropertyEnabled(sf, "GENERATED")) {
+ if (!sf->GetPropertyAsBool("GENERATED")) {
std::string error;
std::vector<std::string> files;
if (cmQtAutoGeneratorCommon::RccListInputs(
@@ -648,7 +700,7 @@ static void RccSetupAutoTarget(cmGeneratorTarget const* target,
}
}
entriesList += "}";
- _rcc_inputs.push_back(entriesList);
+ rccInputs.push_back(entriesList);
}
// rcc options for this qrc file
{
@@ -670,70 +722,50 @@ static void RccSetupAutoTarget(cmGeneratorTarget const* target,
}
AddDefinitionEscaped(makefile, "_qt_rcc_executable", rccCommand);
- AddDefinitionEscaped(makefile, "_rcc_files", _rcc_files);
- AddDefinitionEscaped(makefile, "_rcc_inputs", _rcc_inputs);
+ AddDefinitionEscaped(makefile, "_rcc_files", rccFiles);
+ AddDefinitionEscaped(makefile, "_rcc_inputs", rccInputs);
AddDefinitionEscaped(makefile, "_rcc_options_files", rccFileFiles);
AddDefinitionEscaped(makefile, "_rcc_options_options", rccFileOptions);
}
-void cmQtAutoGeneratorInitializer::InitializeAutogenSources(
- cmGeneratorTarget* target)
-{
- if (target->GetPropertyAsBool("AUTOMOC")) {
- cmMakefile* makefile = target->Target->GetMakefile();
- const std::vector<std::string> suffixes =
- GetConfigurationSuffixes(makefile);
- // Get build directory
- const std::string autogenBuildDir = GetAutogenTargetBuildDir(target);
- // Register all compilation files as generated
- for (std::vector<std::string>::const_iterator it = suffixes.begin();
- it != suffixes.end(); ++it) {
- std::string mcFile = autogenBuildDir + "/mocs_compilation";
- mcFile += *it;
- mcFile += ".cpp";
- AddGeneratedSource(makefile, mcFile, cmQtAutoGeneratorCommon::MOC);
- }
- // Mocs compilation file
- if (IsMultiConfig(target->GetGlobalGenerator())) {
- target->AddSource(autogenBuildDir + "/mocs_compilation_$<CONFIG>.cpp");
- } else {
- target->AddSource(autogenBuildDir + "/mocs_compilation.cpp");
- }
- }
-}
-
void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
- cmLocalGenerator* lg, cmGeneratorTarget* target)
+ cmLocalGenerator* localGen, cmGeneratorTarget* target)
{
cmMakefile* makefile = target->Target->GetMakefile();
+ cmGlobalGenerator* globalGen = localGen->GetGlobalGenerator();
// Create a custom target for running generators at buildtime
const bool mocEnabled = target->GetPropertyAsBool("AUTOMOC");
const bool uicEnabled = target->GetPropertyAsBool("AUTOUIC");
const bool rccEnabled = target->GetPropertyAsBool("AUTORCC");
- const bool multiConfig = IsMultiConfig(target->GetGlobalGenerator());
+ const bool multiConfig = AutogenMultiConfig(globalGen);
const std::string autogenTargetName = GetAutogenTargetName(target);
const std::string autogenBuildDir = GetAutogenTargetBuildDir(target);
const std::string workingDirectory =
cmSystemTools::CollapseFullPath("", makefile->GetCurrentBinaryDirectory());
- const std::string qtMajorVersion = GetQtMajorVersion(target);
- const std::string rccCommand = RccGetExecutable(target, qtMajorVersion);
const std::vector<std::string> suffixes = GetConfigurationSuffixes(makefile);
- std::vector<std::string> autogenDepends;
+ std::set<std::string> autogenDependsSet;
std::vector<std::string> autogenProvides;
+ bool usePRE_BUILD = false;
+ if (globalGen->GetName().find("Visual Studio") != std::string::npos) {
+ // Under VS use a PRE_BUILD event instead of a separate target to
+ // reduce the number of targets loaded into the IDE.
+ // This also works around a VS 11 bug that may skip updating the target:
+ // https://connect.microsoft.com/VisualStudio/feedback/details/769495
+ usePRE_BUILD = true;
+ }
+
// Remove build directories on cleanup
- makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
- autogenBuildDir.c_str(), false);
+ AddCleanFile(makefile, autogenBuildDir);
// Remove old settings on cleanup
{
std::string base = GetAutogenTargetFilesDir(target);
+ base += "/AutogenOldSettings";
for (std::vector<std::string>::const_iterator it = suffixes.begin();
it != suffixes.end(); ++it) {
- std::string fname = base + "/AutogenOldSettings" + *it + ".cmake";
- makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", fname.c_str(),
- false);
+ AddCleanFile(makefile, base + *it + ".cmake");
}
}
@@ -777,151 +809,173 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
// Add moc compilation to generated files list
if (mocEnabled) {
- for (std::vector<std::string>::const_iterator it = suffixes.begin();
- it != suffixes.end(); ++it) {
- std::string mcFile = autogenBuildDir + "/mocs_compilation";
- mcFile += *it;
- mcFile += ".cpp";
- autogenProvides.push_back(mcFile);
- }
+ const std::string mocsComp = autogenBuildDir + "/mocs_compilation.cpp";
+ AddGeneratedSource(target, mocsComp, cmQtAutoGeneratorCommon::MOC);
+ autogenProvides.push_back(mocsComp);
}
// Add autogen includes directory to the origin target INCLUDE_DIRECTORIES
if (mocEnabled || uicEnabled) {
+ std::string includeDir = autogenBuildDir + "/include";
if (multiConfig) {
- target->AddIncludeDirectory(autogenBuildDir + "/include_$<CONFIG>",
- true);
-
- } else {
- target->AddIncludeDirectory(autogenBuildDir + "/include", true);
+ includeDir += "_$<CONFIG>";
}
+ target->AddIncludeDirectory(includeDir, true);
}
-#if defined(_WIN32) && !defined(__CYGWIN__)
- bool usePRE_BUILD = false;
- cmGlobalGenerator* gg = lg->GetGlobalGenerator();
- if (gg->GetName().find("Visual Studio") != std::string::npos) {
- // Under VS use a PRE_BUILD event instead of a separate target to
- // reduce the number of targets loaded into the IDE.
- // This also works around a VS 11 bug that may skip updating the target:
- // https://connect.microsoft.com/VisualStudio/feedback/details/769495
- usePRE_BUILD = true;
+ // Add user defined autogen target dependencies
+ {
+ const std::string deps = GetSafeProperty(target, "AUTOGEN_TARGET_DEPENDS");
+ if (!deps.empty()) {
+ std::vector<std::string> extraDepends;
+ cmSystemTools::ExpandListArgument(deps, extraDepends);
+ autogenDependsSet.insert(extraDepends.begin(), extraDepends.end());
+ }
}
-#endif
-
- // Initialize autogen target dependencies
- if (const char* deps = target->GetProperty("AUTOGEN_TARGET_DEPENDS")) {
- cmSystemTools::ExpandListArgument(deps, autogenDepends);
+ // Add utility target dependencies to the autogen dependencies
+ {
+ const std::set<std::string>& utils = target->Target->GetUtilities();
+ for (std::set<std::string>::const_iterator it = utils.begin();
+ it != utils.end(); ++it) {
+ const std::string& targetName = *it;
+ if (makefile->FindTargetToUse(targetName) != nullptr) {
+ autogenDependsSet.insert(targetName);
+ }
+ }
}
- // Add link library targets to the autogen dependencies
+ // Add link library target dependencies to the autogen dependencies
{
const cmTarget::LinkLibraryVectorType& libVec =
target->Target->GetOriginalLinkLibraries();
for (cmTarget::LinkLibraryVectorType::const_iterator it = libVec.begin();
it != libVec.end(); ++it) {
const std::string& libName = it->first;
- if (makefile->FindTargetToUse(libName) != CM_NULLPTR) {
- autogenDepends.push_back(libName);
+ if (makefile->FindTargetToUse(libName) != nullptr) {
+ autogenDependsSet.insert(libName);
}
}
}
+
+ // Extract relevant source files
+ std::vector<std::string> generatedSources;
+ std::vector<std::pair<std::string, bool> > qrcSources;
{
- cmFilePathChecksum fpathCheckSum(makefile);
- // Iterate over all source files
+ const std::string qrcExt = "qrc";
std::vector<cmSourceFile*> srcFiles;
target->GetConfigCommonSourceFiles(srcFiles);
for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
fileIt != srcFiles.end(); ++fileIt) {
cmSourceFile* sf = *fileIt;
- if (!PropertyEnabled(sf, "SKIP_AUTOGEN")) {
- std::string const& ext = sf->GetExtension();
- // Add generated file that will be scanned by moc or uic to
- // the dependencies
- if (mocEnabled || uicEnabled) {
- const cmSystemTools::FileFormat fileType =
- cmSystemTools::GetFileFormat(ext.c_str());
- if ((fileType == cmSystemTools::CXX_FILE_FORMAT) ||
- (fileType == cmSystemTools::HEADER_FILE_FORMAT)) {
- if (PropertyEnabled(sf, "GENERATED")) {
- if ((mocEnabled && !PropertyEnabled(sf, "SKIP_AUTOMOC")) ||
- (uicEnabled && !PropertyEnabled(sf, "SKIP_AUTOUIC"))) {
- autogenDepends.push_back(
- cmsys::SystemTools::GetRealPath(sf->GetFullPath()));
-#if defined(_WIN32) && !defined(__CYGWIN__)
- // Cannot use PRE_BUILD with generated files
- usePRE_BUILD = false;
-#endif
- }
+ if (sf->GetPropertyAsBool("SKIP_AUTOGEN")) {
+ continue;
+ }
+ // sf->GetExtension() is only valid after sf->GetFullPath() ...
+ const std::string& fPath = sf->GetFullPath();
+ const std::string& ext = sf->GetExtension();
+ // Register generated files that will be scanned by moc or uic
+ if (mocEnabled || uicEnabled) {
+ const cmSystemTools::FileFormat fileType =
+ cmSystemTools::GetFileFormat(ext.c_str());
+ if ((fileType == cmSystemTools::CXX_FILE_FORMAT) ||
+ (fileType == cmSystemTools::HEADER_FILE_FORMAT)) {
+ if (sf->GetPropertyAsBool("GENERATED")) {
+ if ((mocEnabled && !sf->GetPropertyAsBool("SKIP_AUTOMOC")) ||
+ (uicEnabled && !sf->GetPropertyAsBool("SKIP_AUTOUIC"))) {
+ generatedSources.push_back(
+ cmsys::SystemTools::GetRealPath(fPath));
}
}
}
- // Process rcc enabled files
- if (rccEnabled && (ext == "qrc") &&
- !PropertyEnabled(sf, "SKIP_AUTORCC")) {
- const std::string absFile =
- cmsys::SystemTools::GetRealPath(sf->GetFullPath());
-
- // Compose rcc output file name
- {
- std::string rccOutBase = autogenBuildDir + "/";
- rccOutBase += fpathCheckSum.getPart(absFile);
- rccOutBase += "/qrc_";
- rccOutBase +=
- cmsys::SystemTools::GetFilenameWithoutLastExtension(absFile);
-
- // Register rcc ouput file as generated
- for (std::vector<std::string>::const_iterator it =
- suffixes.begin();
- it != suffixes.end(); ++it) {
- std::string rccOutCfg = rccOutBase;
- rccOutCfg += *it;
- rccOutCfg += ".cpp";
- AddGeneratedSource(makefile, rccOutCfg,
- cmQtAutoGeneratorCommon::RCC);
- autogenProvides.push_back(rccOutCfg);
- }
- // Add rcc output file to origin target sources
- if (multiConfig) {
- target->AddSource(rccOutBase + "_$<CONFIG>.cpp");
- } else {
- target->AddSource(rccOutBase + ".cpp");
- }
- }
+ }
+ // Register rcc enabled files
+ if (rccEnabled && (ext == qrcExt) &&
+ !sf->GetPropertyAsBool("SKIP_AUTORCC")) {
+ qrcSources.push_back(
+ std::pair<std::string, bool>(cmsys::SystemTools::GetRealPath(fPath),
+ sf->GetPropertyAsBool("GENERATED")));
+ }
+ }
+ // cmGeneratorTarget::GetConfigCommonSourceFiles computes the target's
+ // sources meta data cache. Clear it so that OBJECT library targets that
+ // are AUTOGEN initialized after this target get their added
+ // mocs_compilation.cpp source acknowledged by this target.
+ target->ClearSourcesCache();
+ }
+
+ if (!generatedSources.empty()) {
+ for (std::vector<std::string>::const_iterator it =
+ generatedSources.begin();
+ it != generatedSources.end(); ++it) {
+ autogenDependsSet.insert(*it);
+ }
+ }
+
+ if (!qrcSources.empty()) {
+ const std::string qtMajorVersion = GetQtMajorVersion(target);
+ const std::string rccCommand = RccGetExecutable(target, qtMajorVersion);
+ const cmFilePathChecksum fpathCheckSum(makefile);
+ for (std::vector<std::pair<std::string, bool> >::const_iterator it =
+ qrcSources.begin();
+ it != qrcSources.end(); ++it) {
+ const std::string& absFile = it->first;
+
+ // Compose rcc output file name
+ {
+ std::string rccBuildFile = autogenBuildDir + "/";
+ rccBuildFile += fpathCheckSum.getPart(absFile);
+ rccBuildFile += "/qrc_";
+ rccBuildFile +=
+ cmsys::SystemTools::GetFilenameWithoutLastExtension(absFile);
+ rccBuildFile += ".cpp";
+
+ // Register rcc ouput file as generated
+ AddGeneratedSource(target, rccBuildFile, cmQtAutoGeneratorCommon::RCC);
+ // Register rcc ouput file as generated by the _autogen target
+ autogenProvides.push_back(rccBuildFile);
+ }
- if (PropertyEnabled(sf, "GENERATED")) {
- // Add generated qrc file to the dependencies
- autogenDepends.push_back(absFile);
+ if (it->second) {
+ // Add generated qrc file to the dependencies
+ autogenDependsSet.insert(absFile);
+ } else {
+ // Run cmake again when .qrc file changes
+ makefile->AddCMakeDependFile(absFile);
+ // Add the qrc input files to the dependencies
+ {
+ std::string error;
+ std::vector<std::string> extraDepends;
+ if (cmQtAutoGeneratorCommon::RccListInputs(
+ qtMajorVersion, rccCommand, absFile, extraDepends, &error)) {
+ autogenDependsSet.insert(extraDepends.begin(), extraDepends.end());
} else {
- // Run cmake again when .qrc file changes
- makefile->AddCMakeDependFile(absFile);
-
- // Add the qrc input files to the dependencies
- std::string error;
- if (!cmQtAutoGeneratorCommon::RccListInputs(
- qtMajorVersion, rccCommand, absFile, autogenDepends,
- &error)) {
- cmSystemTools::Error(error.c_str());
- }
+ cmSystemTools::Error(error.c_str());
}
-#if defined(_WIN32) && !defined(__CYGWIN__)
- // Cannot use PRE_BUILD because the resource files themselves
- // may not be sources within the target so VS may not know the
- // target needs to re-build at all.
- usePRE_BUILD = false;
-#endif
}
}
}
}
-#if defined(_WIN32) && !defined(__CYGWIN__)
+ // Convert std::set to std::vector
+ const std::vector<std::string> autogenDepends(autogenDependsSet.begin(),
+ autogenDependsSet.end());
+ // Disable PRE_BUILD on demand
if (usePRE_BUILD) {
- // If the autogen target depends on an other target don't use PRE_BUILD
- for (std::vector<std::string>::iterator it = autogenDepends.begin();
- it != autogenDepends.end(); ++it) {
- if (makefile->FindTargetToUse(*it) != CM_NULLPTR) {
- usePRE_BUILD = false;
- break;
+ if (!generatedSources.empty() || !qrcSources.empty()) {
+ // - Cannot use PRE_BUILD with generated files
+ // - Cannot use PRE_BUILD because the resource files themselves
+ // may not be sources within the target so VS may not know the
+ // target needs to re-build at all.
+ usePRE_BUILD = false;
+ }
+ if (usePRE_BUILD) {
+ // If the autogen target depends on an other target don't use PRE_BUILD
+ for (std::vector<std::string>::const_iterator it =
+ autogenDepends.begin();
+ it != autogenDepends.end(); ++it) {
+ if (makefile->FindTargetToUse(*it) != nullptr) {
+ usePRE_BUILD = false;
+ break;
+ }
}
}
}
@@ -936,31 +990,33 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
cc.SetEscapeOldStyle(false);
cc.SetEscapeAllowMakeVars(true);
target->Target->AddPreBuildCommand(cc);
- } else
-#endif
- {
+ } else {
cmTarget* autogenTarget = makefile->AddUtilityCommand(
autogenTargetName, true, workingDirectory.c_str(),
/*byproducts=*/autogenProvides, autogenDepends, commandLines, false,
autogenComment.c_str());
- cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
- lg->AddGeneratorTarget(gt);
+ localGen->AddGeneratorTarget(
+ new cmGeneratorTarget(autogenTarget, localGen));
- // Set target folder
- const char* autogenFolder =
- makefile->GetState()->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER");
- if (!autogenFolder) {
- autogenFolder =
- makefile->GetState()->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER");
- }
- if (autogenFolder && *autogenFolder) {
- autogenTarget->SetProperty("FOLDER", autogenFolder);
- } else {
- // inherit FOLDER property from target (#13688)
- utilCopyTargetProperty(gt->Target, target->Target, "FOLDER");
+ // Set autogen target FOLDER
+ {
+ const char* autogenFolder =
+ makefile->GetState()->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER");
+ if (autogenFolder == nullptr) {
+ autogenFolder =
+ makefile->GetState()->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER");
+ }
+ // Inherit FOLDER property from target (#13688)
+ if (autogenFolder == nullptr) {
+ autogenFolder = target->Target->GetProperty("FOLDER");
+ }
+ if ((autogenFolder != nullptr) && (*autogenFolder != '\0')) {
+ autogenTarget->SetProperty("FOLDER", autogenFolder);
+ }
}
+ // Add autogen target to the origin target dependencies
target->Target->AddUtility(autogenTargetName);
}
}
@@ -978,54 +1034,46 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
std::string config;
const std::vector<std::string> configs(GetConfigurations(makefile, &config));
- // Configurations settings buffers
+ // Configuration suffixes
std::map<std::string, std::string> configSuffix;
- std::map<std::string, std::string> configMocIncludes;
- std::map<std::string, std::string> configMocDefines;
- std::map<std::string, std::string> configUicOptions;
-
- // Configuration suffix
- if (IsMultiConfig(target->GetGlobalGenerator())) {
+ if (AutogenMultiConfig(target->GetGlobalGenerator())) {
for (std::vector<std::string>::const_iterator it = configs.begin();
it != configs.end(); ++it) {
configSuffix[*it] = "_" + *it;
}
}
+ // Configurations settings buffers
+ AutogenSetup setup;
+
// Basic setup
{
const bool mocEnabled = target->GetPropertyAsBool("AUTOMOC");
const bool uicEnabled = target->GetPropertyAsBool("AUTOUIC");
const bool rccEnabled = target->GetPropertyAsBool("AUTORCC");
- const std::string autogenTargetName = GetAutogenTargetName(target);
const std::string qtMajorVersion = GetQtMajorVersion(target);
-
- std::vector<std::string> sources;
- std::vector<std::string> headers;
-
- if (mocEnabled || uicEnabled || rccEnabled) {
- std::vector<std::string> mocSkipList;
- std::vector<std::string> uicSkipList;
- AcquireScanFiles(target, sources, headers, mocSkipList, uicSkipList);
- if (mocEnabled) {
- MocSetupAutoTarget(target, autogenTargetName, qtMajorVersion, config,
- configs, mocSkipList, configMocIncludes,
- configMocDefines);
- }
- if (uicEnabled) {
- UicSetupAutoTarget(target, qtMajorVersion, config, configs,
- uicSkipList, configUicOptions);
+ {
+ std::vector<cmSourceFile*> srcFiles;
+ target->GetConfigCommonSourceFiles(srcFiles);
+ if (mocEnabled || uicEnabled) {
+ SetupAcquireScanFiles(target, mocEnabled, uicEnabled, srcFiles, setup);
+ if (mocEnabled) {
+ SetupAutoTargetMoc(target, qtMajorVersion, config, configs, setup);
+ }
+ if (uicEnabled) {
+ SetupAutoTargetUic(target, qtMajorVersion, config, configs, setup);
+ }
}
if (rccEnabled) {
- RccSetupAutoTarget(target, qtMajorVersion);
+ SetupAutoTargetRcc(target, qtMajorVersion, srcFiles);
}
}
- AddDefinitionEscaped(makefile, "_autogen_build_dir",
+ AddDefinitionEscaped(makefile, "_build_dir",
GetAutogenTargetBuildDir(target));
AddDefinitionEscaped(makefile, "_qt_version_major", qtMajorVersion);
- AddDefinitionEscaped(makefile, "_sources", sources);
- AddDefinitionEscaped(makefile, "_headers", headers);
+ AddDefinitionEscaped(makefile, "_sources", setup.sources);
+ AddDefinitionEscaped(makefile, "_headers", setup.headers);
}
// Generate info file
@@ -1038,8 +1086,8 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
}
// Append custom definitions to info file on demand
- if (!configSuffix.empty() || !configMocDefines.empty() ||
- !configMocIncludes.empty() || !configUicOptions.empty()) {
+ if (!configSuffix.empty() || !setup.configMocDefines.empty() ||
+ !setup.configMocIncludes.empty() || !setup.configUicOptions.empty()) {
// Ensure we have write permission in case .in was read-only.
mode_t perm = 0;
@@ -1061,29 +1109,29 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
it = configSuffix.begin(),
end = configSuffix.end();
it != end; ++it) {
- ofs << "set(AM_CONFIG_SUFFIX_" << it->first << " " << it->second
- << ")\n";
+ ofs << "set(AM_CONFIG_SUFFIX_" << it->first << " "
+ << cmOutputConverter::EscapeForCMake(it->second) << ")\n";
}
for (std::map<std::string, std::string>::iterator
- it = configMocDefines.begin(),
- end = configMocDefines.end();
+ it = setup.configMocDefines.begin(),
+ end = setup.configMocDefines.end();
it != end; ++it) {
- ofs << "set(AM_MOC_DEFINITIONS_" << it->first << " " << it->second
- << ")\n";
+ ofs << "set(AM_MOC_DEFINITIONS_" << it->first << " "
+ << cmOutputConverter::EscapeForCMake(it->second) << ")\n";
}
for (std::map<std::string, std::string>::iterator
- it = configMocIncludes.begin(),
- end = configMocIncludes.end();
+ it = setup.configMocIncludes.begin(),
+ end = setup.configMocIncludes.end();
it != end; ++it) {
- ofs << "set(AM_MOC_INCLUDES_" << it->first << " " << it->second
- << ")\n";
+ ofs << "set(AM_MOC_INCLUDES_" << it->first << " "
+ << cmOutputConverter::EscapeForCMake(it->second) << ")\n";
}
for (std::map<std::string, std::string>::iterator
- it = configUicOptions.begin(),
- end = configUicOptions.end();
+ it = setup.configUicOptions.begin(),
+ end = setup.configUicOptions.end();
it != end; ++it) {
- ofs << "set(AM_UIC_TARGET_OPTIONS_" << it->first << " " << it->second
- << ")\n";
+ ofs << "set(AM_UIC_TARGET_OPTIONS_" << it->first << " "
+ << cmOutputConverter::EscapeForCMake(it->second) << ")\n";
}
} else {
// File open error
diff --git a/Source/cmQtAutoGeneratorInitializer.h b/Source/cmQtAutoGeneratorInitializer.h
index ca806f5..48ae70e 100644
--- a/Source/cmQtAutoGeneratorInitializer.h
+++ b/Source/cmQtAutoGeneratorInitializer.h
@@ -11,8 +11,7 @@ class cmLocalGenerator;
class cmQtAutoGeneratorInitializer
{
public:
- static void InitializeAutogenSources(cmGeneratorTarget* target);
- static void InitializeAutogenTarget(cmLocalGenerator* lg,
+ static void InitializeAutogenTarget(cmLocalGenerator* localGen,
cmGeneratorTarget* target);
static void SetupAutoGenerateTarget(cmGeneratorTarget const* target);
};
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index c79f66d..e51033a 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -3,7 +3,6 @@
#include "cmQtAutoGenerators.h"
#include "cmQtAutoGeneratorCommon.h"
-#include "cmConfigure.h"
#include "cmsys/FStream.hxx"
#include "cmsys/Terminal.h"
#include <algorithm>
@@ -81,7 +80,7 @@ static void InfoGet(cmMakefile* makefile, const char* key,
static void InfoGetConfig(cmMakefile* makefile, const char* key,
const std::string& config, std::string& value)
{
- const char* valueConf = CM_NULLPTR;
+ const char* valueConf = nullptr;
{
std::string keyConf = key;
if (!config.empty()) {
@@ -90,7 +89,7 @@ static void InfoGetConfig(cmMakefile* makefile, const char* key,
}
valueConf = makefile->GetDefinition(keyConf);
}
- if (valueConf == CM_NULLPTR) {
+ if (valueConf == nullptr) {
valueConf = makefile->GetSafeDefinition(key);
}
value = valueConf;
@@ -280,10 +279,10 @@ cmQtAutoGenerators::cmQtAutoGenerators()
}
// Moc macro filters
- this->MocMacroFilters[0].first = "Q_OBJECT";
- this->MocMacroFilters[0].second.compile("[\n][ \t]*Q_OBJECT[^a-zA-Z0-9_]");
- this->MocMacroFilters[1].first = "Q_GADGET";
- this->MocMacroFilters[1].second.compile("[\n][ \t]*Q_GADGET[^a-zA-Z0-9_]");
+ this->MocMacroFilters.push_back(
+ MocMacroFilter("Q_OBJECT", "[\n][ \t]*{?[ \t]*Q_OBJECT[^a-zA-Z0-9_]"));
+ this->MocMacroFilters.push_back(
+ MocMacroFilter("Q_GADGET", "[\n][ \t]*{?[ \t]*Q_GADGET[^a-zA-Z0-9_]"));
// Precompile regular expressions
this->MocRegExpInclude.compile(
@@ -364,6 +363,9 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
return false;
}
+ // -- Meta
+ InfoGetConfig(makefile, "AM_CONFIG_SUFFIX", config, this->ConfigSuffix);
+
// - Old settings file
{
this->SettingsFile = cmSystemTools::CollapseFullPath(targetDirectory);
@@ -373,9 +375,6 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
this->SettingsFile += ".cmake";
}
- // -- Meta
- InfoGetConfig(makefile, "AM_CONFIG_SUFFIX", config, this->ConfigSuffix);
-
// - Files and directories
InfoGet(makefile, "AM_CMAKE_SOURCE_DIR", this->ProjectSourceDir);
InfoGet(makefile, "AM_CMAKE_BINARY_DIR", this->ProjectBinaryDir);
@@ -400,7 +399,6 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
InfoGet(makefile, "AM_QT_UIC_EXECUTABLE", this->UicExecutable);
InfoGet(makefile, "AM_QT_RCC_EXECUTABLE", this->RccExecutable);
- InfoGet(makefile, "AM_MOC_PREDEFS_CMD", this->MocPredefsCmd);
// Check Qt version
if ((this->QtMajorVersion != "4") && (this->QtMajorVersion != "5")) {
this->LogError("AutoGen: Error: Unsupported Qt version: " +
@@ -425,6 +423,16 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
InfoGet(makefile, "AM_MOC_OPTIONS", this->MocOptions);
InfoGet(makefile, "AM_MOC_RELAXED_MODE", this->MocRelaxedMode);
{
+ std::vector<std::string> MocMacroNames;
+ InfoGet(makefile, "AM_MOC_MACRO_NAMES", MocMacroNames);
+ for (std::vector<std::string>::const_iterator dit =
+ MocMacroNames.begin();
+ dit != MocMacroNames.end(); ++dit) {
+ this->MocMacroFilters.push_back(
+ MocMacroFilter(*dit, "[^a-zA-Z0-9_]" + *dit + "[^a-zA-Z0-9_]"));
+ }
+ }
+ {
std::vector<std::string> mocDependFilters;
InfoGet(makefile, "AM_MOC_DEPEND_FILTERS", mocDependFilters);
// Insert Q_PLUGIN_METADATA dependency filter
@@ -450,6 +458,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
return false;
}
}
+ InfoGet(makefile, "AM_MOC_PREDEFS_CMD", this->MocPredefsCmd);
}
// - Uic
@@ -634,9 +643,7 @@ bool cmQtAutoGenerators::SettingsFileWrite()
void cmQtAutoGenerators::Init(cmMakefile* makefile)
{
// Mocs compilation file
- this->MocCompFileRel = "mocs_compilation";
- this->MocCompFileRel += this->ConfigSuffix;
- this->MocCompFileRel += ".cpp";
+ this->MocCompFileRel = "mocs_compilation.cpp";
this->MocCompFileAbs = cmSystemTools::CollapseCombinedPath(
this->AutogenBuildDir, this->MocCompFileRel);
@@ -647,7 +654,9 @@ void cmQtAutoGenerators::Init(cmMakefile* makefile)
// Moc predefs file
if (!this->MocPredefsCmd.empty()) {
- this->MocPredefsFileRel = "moc_predefs.h";
+ this->MocPredefsFileRel = "moc_predefs";
+ this->MocPredefsFileRel += this->ConfigSuffix;
+ this->MocPredefsFileRel += ".h";
this->MocPredefsFileAbs = cmSystemTools::CollapseCombinedPath(
this->AutogenBuildDir, this->MocPredefsFileRel);
}
@@ -722,10 +731,10 @@ bool cmQtAutoGenerators::RunAutogen()
// the program goes through all .cpp files to see which moc files are
// included. It is not really interesting how the moc file is named, but
// what file the moc is created from. Once a moc is included the same moc
- // may not be included in the mocs_compilation_$<CONFIG>.cpp file anymore.
+ // may not be included in the mocs_compilation.cpp file anymore.
// OTOH if there's a header containing Q_OBJECT where no corresponding
// moc file is included anywhere a moc_<filename>.cpp file is created and
- // included in the mocs_compilation_$<CONFIG>.cpp file.
+ // included in the mocs_compilation.cpp file.
// Create AUTOGEN include directory
{
@@ -798,14 +807,16 @@ bool cmQtAutoGenerators::RunAutogen()
bool cmQtAutoGenerators::MocRequired(const std::string& contentText,
std::string* macroName)
{
- for (unsigned int ii = 0; ii != cmArraySize(this->MocMacroFilters); ++ii) {
- MocMacroFilter& filter = this->MocMacroFilters[ii];
+ for (std::vector<MocMacroFilter>::iterator fit =
+ this->MocMacroFilters.begin();
+ fit != this->MocMacroFilters.end(); ++fit) {
+ MocMacroFilter& filter = *fit;
// Run a simple find string operation before the expensive
// regular expression check
if (contentText.find(filter.first) != std::string::npos) {
if (filter.second.find(contentText)) {
// Return macro name on demand
- if (macroName != CM_NULLPTR) {
+ if (macroName != nullptr) {
*macroName = filter.first;
}
return true;
@@ -927,7 +938,7 @@ void cmQtAutoGenerators::UicParseContent(
}
const char* contentChars = contentText.c_str();
- if (strstr(contentChars, "ui_") != CM_NULLPTR) {
+ if (strstr(contentChars, "ui_") != nullptr) {
while (this->UicRegExpInclude.find(contentChars)) {
uisIncluded[absFilename].push_back(this->UicRegExpInclude.match(1));
contentChars += this->UicRegExpInclude.end();
@@ -961,7 +972,7 @@ bool cmQtAutoGenerators::MocParseSourceContent(
// and if the string search already fails, we don't have to try the
// expensive regexp
const char* contentChars = contentText.c_str();
- if (strstr(contentChars, "moc") != CM_NULLPTR) {
+ if (strstr(contentChars, "moc") != nullptr) {
// Iterate over all included moc files
while (this->MocRegExpInclude.find(contentChars)) {
const std::string incString = this->MocRegExpInclude.match(1);
@@ -1253,7 +1264,9 @@ bool cmQtAutoGenerators::MocGenerateAll(
if (!this->MocPredefsCmd.empty()) {
if (this->MocSettingsChanged ||
FileAbsentOrOlder(this->MocPredefsFileAbs, this->SettingsFile)) {
- this->LogBold("Generating MOC predefs " + this->MocPredefsFileRel);
+ if (this->Verbose) {
+ this->LogBold("Generating MOC predefs " + this->MocPredefsFileRel);
+ }
std::string output;
{
@@ -1340,7 +1353,9 @@ bool cmQtAutoGenerators::MocGenerateAll(
if (this->FileDiffers(this->MocCompFileAbs, automocSource)) {
// Actually write mocs compilation file
- this->LogBold("Generating MOC compilation " + this->MocCompFileRel);
+ if (this->Verbose) {
+ this->LogBold("Generating MOC compilation " + this->MocCompFileRel);
+ }
if (!this->FileWrite("AutoMoc", this->MocCompFileAbs, automocSource)) {
return false;
}
@@ -1391,7 +1406,9 @@ bool cmQtAutoGenerators::MocGenerateFile(
}
if (generateMoc) {
// Log
- this->LogBold("Generating MOC source " + mocFileRel);
+ if (this->Verbose) {
+ this->LogBold("Generating MOC source " + mocFileRel);
+ }
// Make sure the parent directory exists
if (this->MakeParentDirectory("AutoMoc", mocFileAbs)) {
@@ -1446,31 +1463,62 @@ bool cmQtAutoGenerators::MocGenerateFile(
bool cmQtAutoGenerators::UicFindIncludedFile(std::string& absFile,
const std::string& sourceFile,
- const std::string& includeString)
+ const std::string& searchPath,
+ const std::string& searchFile)
{
bool success = false;
- // Search in vicinity of the source
+ std::vector<std::string> testFiles;
+ // Collect search paths list
{
- std::string testPath = SubDirPrefix(sourceFile);
- testPath += includeString;
- if (cmsys::SystemTools::FileExists(testPath.c_str())) {
- absFile = cmsys::SystemTools::GetRealPath(testPath);
+ const std::string searchFileFull = searchPath + searchFile;
+ // Vicinity of the source
+ {
+ const std::string sourcePath = SubDirPrefix(sourceFile);
+ testFiles.push_back(sourcePath + searchFile);
+ if (!searchPath.empty()) {
+ testFiles.push_back(sourcePath + searchFileFull);
+ }
+ }
+ // AUTOUIC search paths
+ if (!this->UicSearchPaths.empty()) {
+ for (std::vector<std::string>::const_iterator iit =
+ this->UicSearchPaths.begin();
+ iit != this->UicSearchPaths.end(); ++iit) {
+ testFiles.push_back(*iit + "/" + searchFile);
+ }
+ if (!searchPath.empty()) {
+ for (std::vector<std::string>::const_iterator iit =
+ this->UicSearchPaths.begin();
+ iit != this->UicSearchPaths.end(); ++iit) {
+ testFiles.push_back(*iit + "/" + searchFileFull);
+ }
+ }
+ }
+ }
+
+ // Search for the .ui file!
+ for (std::vector<std::string>::const_iterator iit = testFiles.begin();
+ iit != testFiles.end(); ++iit) {
+ const std::string& testFile = *iit;
+ if (cmsys::SystemTools::FileExists(testFile.c_str())) {
+ absFile = cmsys::SystemTools::GetRealPath(testFile);
success = true;
+ break;
}
}
- // Search in include directories
+
+ // Log error
if (!success) {
- for (std::vector<std::string>::const_iterator iit =
- this->UicSearchPaths.begin();
- iit != this->UicSearchPaths.end(); ++iit) {
- const std::string fullPath = ((*iit) + '/' + includeString);
- if (cmsys::SystemTools::FileExists(fullPath.c_str())) {
- absFile = cmsys::SystemTools::GetRealPath(fullPath);
- success = true;
- break;
- }
+ std::ostringstream ost;
+ ost << "AutoUic: Error: " << Quoted(sourceFile) << "\n";
+ ost << "Could not find " << Quoted(searchFile) << " in\n";
+ for (std::vector<std::string>::const_iterator iit = testFiles.begin();
+ iit != testFiles.end(); ++iit) {
+ ost << " " << Quoted(*iit) << "\n";
}
+ this->LogError(ost.str());
}
+
return success;
}
@@ -1500,16 +1548,14 @@ bool cmQtAutoGenerators::UicGenerateAll(
const std::string uiBasePath = SubDirPrefix(*uit);
const std::string uiBaseName =
cmsys::SystemTools::GetFilenameWithoutLastExtension(*uit).substr(3);
- const std::string searchFileName = uiBasePath + uiBaseName + ".ui";
+ const std::string uiFileName = uiBaseName + ".ui";
std::string uiInputFile;
- if (UicFindIncludedFile(uiInputFile, source, searchFileName)) {
+ if (UicFindIncludedFile(uiInputFile, source, uiBasePath, uiFileName)) {
std::string uiOutputFile = uiBasePath + "ui_" + uiBaseName + ".h";
cmSystemTools::ReplaceString(uiOutputFile, "..", "__");
uiGenMap[uiInputFile] = uiOutputFile;
testMap[uiInputFile] = uiOutputFile;
} else {
- this->LogError("AutoUic: Error: " + Quoted(sit->first) +
- "\nCould not find " + Quoted(searchFileName));
return false;
}
}
@@ -1567,7 +1613,9 @@ bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName,
}
if (generateUic) {
// Log
- this->LogBold("Generating UIC header " + uicFileRel);
+ if (this->Verbose) {
+ this->LogBold("Generating UIC header " + uicFileRel);
+ }
// Make sure the parent directory exists
if (this->MakeParentDirectory("AutoUic", uicFileAbs)) {
@@ -1673,10 +1721,10 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile,
{
bool rccGenerated = false;
bool generateRcc = this->RccSettingsChanged;
-
const std::string rccBuildFile =
cmSystemTools::CollapseCombinedPath(this->AutogenBuildDir, rccOutputFile);
+ // Check if regeneration is required
if (!generateRcc) {
// Test if the resources list file is newer than build file
generateRcc = FileAbsentOrOlder(rccBuildFile, rccInputFile);
@@ -1692,13 +1740,13 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile,
readFiles, &error)) {
files = &readFiles;
} else {
- files = CM_NULLPTR;
+ files = nullptr;
this->LogError(error);
this->RccRunFailed = true;
}
}
// Test if any input file is newer than the build file
- if (files != CM_NULLPTR) {
+ if (files != nullptr) {
for (std::vector<std::string>::const_iterator it = files->begin();
it != files->end(); ++it) {
if (FileAbsentOrOlder(rccBuildFile, *it)) {
@@ -1709,9 +1757,12 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile,
}
}
}
+ // Regenerate on demand
if (generateRcc) {
// Log
- this->LogBold("Generating RCC source " + rccOutputFile);
+ if (this->Verbose) {
+ this->LogBold("Generating RCC source " + rccOutputFile);
+ }
// Make sure the parent directory exists
if (this->MakeParentDirectory("AutoRcc", rccBuildFile)) {
@@ -1764,6 +1815,41 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile,
this->RccRunFailed = true;
}
}
+ // For a multi configuration generator generate a wrapper file
+ if (!this->ConfigSuffix.empty() && !this->RccRunFailed) {
+ // Wrapper file name
+ const std::string cppSuffix = ".cpp";
+ const size_t suffixLength = this->ConfigSuffix.size() + cppSuffix.size();
+ const std::string wrapperFileRel =
+ rccOutputFile.substr(0, rccOutputFile.size() - suffixLength) + cppSuffix;
+ const std::string wrapperFileAbs = cmSystemTools::CollapseCombinedPath(
+ this->AutogenBuildDir, wrapperFileRel);
+ // Wrapper file content
+ std::string content =
+ "// This is an autogenerated configuration wrapper file. Do not edit.\n"
+ "#include \"";
+ content += cmsys::SystemTools::GetFilenameName(rccBuildFile);
+ content += "\"\n";
+ // Write content to file
+ if (this->FileDiffers(wrapperFileAbs, content)) {
+ // Write new wrapper file if the content differs
+ if (this->Verbose) {
+ this->LogBold("Generating RCC wrapper " + wrapperFileRel);
+ }
+ if (!this->FileWrite("AutoRcc", wrapperFileAbs, content)) {
+ // Error
+ rccGenerated = false;
+ this->RccRunFailed = true;
+ }
+ } else if (rccGenerated) {
+ // Only touch wrapper file if the content matches
+ if (this->Verbose) {
+ this->LogInfo("Touching RCC wrapper " + wrapperFileRel);
+ }
+ cmSystemTools::Touch(wrapperFileAbs, false);
+ }
+ }
+
return rccGenerated;
}
@@ -1956,7 +2042,7 @@ bool cmQtAutoGenerators::RunCommand(const std::vector<std::string>& command,
// Execute command
int retVal = 0;
bool res = cmSystemTools::RunSingleCommand(
- command, &output, &output, &retVal, CM_NULLPTR,
+ command, &output, &output, &retVal, nullptr,
verbose ? cmSystemTools::OUTPUT_MERGE : cmSystemTools::OUTPUT_NONE);
return (res && (retVal == 0));
}
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index b525364..a8eb961 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -59,7 +59,7 @@ private:
// -- Content analysis
bool MocRequired(const std::string& contentText,
- std::string* macroName = CM_NULLPTR);
+ std::string* macroName = nullptr);
void MocFindDepends(
const std::string& absFilename, const std::string& contentText,
std::map<std::string, std::set<std::string> >& mocDepends);
@@ -112,7 +112,8 @@ private:
// -- Uic file generation
bool UicFindIncludedFile(std::string& absFile, const std::string& sourceFile,
- const std::string& includeString);
+ const std::string& searchPath,
+ const std::string& searchFile);
bool UicGenerateAll(
const std::map<std::string, std::vector<std::string> >& includedUis);
bool UicGenerateFile(const std::string& realName,
@@ -200,7 +201,7 @@ private:
std::vector<std::string> MocOptions;
std::vector<std::string> MocPredefsCmd;
std::vector<MocDependFilter> MocDependFilters;
- MocMacroFilter MocMacroFilters[2];
+ std::vector<MocMacroFilter> MocMacroFilters;
cmsys::RegularExpression MocRegExpInclude;
// -- Uic
bool UicSettingsChanged;
diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h
index f2e89f6..9e035d7 100644
--- a/Source/cmRemoveCommand.h
+++ b/Source/cmRemoveCommand.h
@@ -3,7 +3,7 @@
#ifndef cmRemoveCommand_h
#define cmRemoveCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmRemoveDefinitionsCommand.h b/Source/cmRemoveDefinitionsCommand.h
index 9a9a5d5..c2c6b0e 100644
--- a/Source/cmRemoveDefinitionsCommand.h
+++ b/Source/cmRemoveDefinitionsCommand.h
@@ -3,7 +3,7 @@
#ifndef cmRemoveDefinitionsCommand_h
#define cmRemoveDefinitionsCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmReturnCommand.h b/Source/cmReturnCommand.h
index 87900e7..53c91cd 100644
--- a/Source/cmReturnCommand.h
+++ b/Source/cmReturnCommand.h
@@ -3,7 +3,7 @@
#ifndef cmReturnCommand_h
#define cmReturnCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx
index 753a1ba..768e15a 100644
--- a/Source/cmScriptGenerator.cxx
+++ b/Source/cmScriptGenerator.cxx
@@ -10,7 +10,7 @@ cmScriptGenerator::cmScriptGenerator(
: RuntimeConfigVariable(config_var)
, Configurations(configurations)
, ConfigurationName("")
- , ConfigurationTypes(CM_NULLPTR)
+ , ConfigurationTypes(nullptr)
, ActionsPerConfig(false)
{
}
@@ -27,7 +27,7 @@ void cmScriptGenerator::Generate(
this->ConfigurationTypes = &configurationTypes;
this->GenerateScript(os);
this->ConfigurationName = "";
- this->ConfigurationTypes = CM_NULLPTR;
+ this->ConfigurationTypes = nullptr;
}
static void cmScriptGeneratorEncodeConfig(const std::string& config,
diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h
index d0879c6..c8fed19 100644
--- a/Source/cmScriptGenerator.h
+++ b/Source/cmScriptGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmScriptGenerator_h
#define cmScriptGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <ostream>
#include <string>
diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx
index 0df6e0c..0f2ef6e 100644
--- a/Source/cmSearchPath.cxx
+++ b/Source/cmSearchPath.cxx
@@ -42,7 +42,7 @@ void cmSearchPath::AddPath(const std::string& path)
void cmSearchPath::AddUserPath(const std::string& path)
{
- assert(this->FC != CM_NULLPTR);
+ assert(this->FC != nullptr);
std::vector<std::string> outPaths;
@@ -77,7 +77,7 @@ void cmSearchPath::AddUserPath(const std::string& path)
void cmSearchPath::AddCMakePath(const std::string& variable)
{
- assert(this->FC != CM_NULLPTR);
+ assert(this->FC != nullptr);
// Get a path from a CMake variable.
if (const char* value = this->FC->Makefile->GetDefinition(variable)) {
@@ -104,7 +104,7 @@ void cmSearchPath::AddEnvPath(const std::string& variable)
void cmSearchPath::AddCMakePrefixPath(const std::string& variable)
{
- assert(this->FC != CM_NULLPTR);
+ assert(this->FC != nullptr);
// Get a path from a CMake variable.
if (const char* value = this->FC->Makefile->GetDefinition(variable)) {
@@ -168,7 +168,7 @@ void cmSearchPath::AddSuffixes(const std::vector<std::string>& suffixes)
void cmSearchPath::AddPrefixPaths(const std::vector<std::string>& paths,
const char* base)
{
- assert(this->FC != CM_NULLPTR);
+ assert(this->FC != nullptr);
// default for programs
std::string subdir = "bin";
@@ -209,7 +209,7 @@ void cmSearchPath::AddPrefixPaths(const std::vector<std::string>& paths,
void cmSearchPath::AddPathInternal(const std::string& path, const char* base)
{
- assert(this->FC != CM_NULLPTR);
+ assert(this->FC != nullptr);
std::string collapsed = cmSystemTools::CollapseFullPath(path, base);
diff --git a/Source/cmSearchPath.h b/Source/cmSearchPath.h
index 932022a..fd0c7c5 100644
--- a/Source/cmSearchPath.h
+++ b/Source/cmSearchPath.h
@@ -3,7 +3,7 @@
#ifndef cmSearchPath_h
#define cmSearchPath_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <set>
#include <string>
@@ -23,7 +23,7 @@ public:
// cmSearchPath must be initialized from a valid pointer. The only reason
// for the default is to allow it to be easily used in stl containers.
// Attempting to initialize with a NULL value will fail an assertion
- cmSearchPath(cmFindCommon* findCmd = CM_NULLPTR);
+ cmSearchPath(cmFindCommon* findCmd = nullptr);
~cmSearchPath();
const std::vector<std::string>& GetPaths() const { return this->Paths; }
@@ -42,8 +42,8 @@ public:
protected:
void AddPrefixPaths(const std::vector<std::string>& paths,
- const char* base = CM_NULLPTR);
- void AddPathInternal(const std::string& path, const char* base = CM_NULLPTR);
+ const char* base = nullptr);
+ void AddPathInternal(const std::string& path, const char* base = nullptr);
cmFindCommon* FC;
std::vector<std::string> Paths;
diff --git a/Source/cmSeparateArgumentsCommand.h b/Source/cmSeparateArgumentsCommand.h
index 6bf8549..2d4c7cd 100644
--- a/Source/cmSeparateArgumentsCommand.h
+++ b/Source/cmSeparateArgumentsCommand.h
@@ -3,7 +3,7 @@
#ifndef cmSeparateArgumentsCommand_h
#define cmSeparateArgumentsCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx
index 7fc6ed7..c3e6811 100644
--- a/Source/cmServer.cxx
+++ b/Source/cmServer.cxx
@@ -2,7 +2,9 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmServer.h"
-#include "cmServerConnection.h"
+#include "cmAlgorithms.h"
+#include "cmConnection.h"
+#include "cmFileMonitor.h"
#include "cmServerDictionary.h"
#include "cmServerProtocol.h"
#include "cmSystemTools.h"
@@ -14,8 +16,23 @@
#include <algorithm>
#include <cassert>
#include <cstdint>
+#include <memory>
#include <utility>
+void on_signal(uv_signal_t* signal, int signum)
+{
+ auto conn = reinterpret_cast<cmServerBase*>(signal->data);
+ conn->OnSignal(signum);
+}
+
+static void on_walk_to_shutdown(uv_handle_t* handle, void* arg)
+{
+ (void)arg;
+ if (!uv_is_closing(handle)) {
+ uv_close(handle, &cmEventBasedConnection::on_close);
+ }
+}
+
class cmServer::DebugInfo
{
public:
@@ -30,13 +47,12 @@ public:
uint64_t StartTime;
};
-cmServer::cmServer(cmServerConnection* conn, bool supportExperimental)
- : Connection(conn)
+cmServer::cmServer(cmConnection* conn, bool supportExperimental)
+ : cmServerBase(conn)
, SupportExperimental(supportExperimental)
{
- this->Connection->SetServer(this);
// Register supported protocols:
- this->RegisterProtocol(new cmServerProtocol1_0);
+ this->RegisterProtocol(new cmServerProtocol1);
}
cmServer::~cmServer()
@@ -48,41 +64,33 @@ cmServer::~cmServer()
for (cmServerProtocol* p : this->SupportedProtocols) {
delete p;
}
-
- delete this->Connection;
}
-void cmServer::PopOne()
+void cmServer::ProcessRequest(cmConnection* connection,
+ const std::string& input)
{
- if (this->Queue.empty()) {
- return;
- }
-
Json::Reader reader;
Json::Value value;
- const std::string input = this->Queue.front();
- this->Queue.erase(this->Queue.begin());
-
if (!reader.parse(input, value)) {
- this->WriteParseError("Failed to parse JSON input.");
+ this->WriteParseError(connection, "Failed to parse JSON input.");
return;
}
std::unique_ptr<DebugInfo> debug;
Json::Value debugValue = value["debug"];
if (!debugValue.isNull()) {
- debug = std::make_unique<DebugInfo>();
+ debug = cm::make_unique<DebugInfo>();
debug->OutputFile = debugValue["dumpToFile"].asString();
debug->PrintStatistics = debugValue["showStats"].asBool();
}
- const cmServerRequest request(this, value[kTYPE_KEY].asString(),
+ const cmServerRequest request(this, connection, value[kTYPE_KEY].asString(),
value[kCOOKIE_KEY].asString(), value);
if (request.Type == "") {
cmServerResponse response(request);
response.SetError("No type given in request.");
- this->WriteResponse(response, nullptr);
+ this->WriteResponse(connection, response, nullptr);
return;
}
@@ -91,9 +99,11 @@ void cmServer::PopOne()
if (this->Protocol) {
this->Protocol->CMakeInstance()->SetProgressCallback(
reportProgress, const_cast<cmServerRequest*>(&request));
- this->WriteResponse(this->Protocol->Process(request), debug.get());
+ this->WriteResponse(connection, this->Protocol->Process(request),
+ debug.get());
} else {
- this->WriteResponse(this->SetProtocolVersion(request), debug.get());
+ this->WriteResponse(connection, this->SetProtocolVersion(request),
+ debug.get());
}
}
@@ -115,7 +125,7 @@ void cmServer::RegisterProtocol(cmServerProtocol* protocol)
}
}
-void cmServer::PrintHello() const
+void cmServer::PrintHello(cmConnection* connection) const
{
Json::Value hello = Json::objectValue;
hello[kTYPE_KEY] = "hello";
@@ -134,13 +144,7 @@ void cmServer::PrintHello() const
protocolVersions.append(tmp);
}
- this->WriteJsonObject(hello, nullptr);
-}
-
-void cmServer::QueueRequest(const std::string& request)
-{
- this->Queue.push_back(request);
- this->PopOne();
+ this->WriteJsonObject(connection, hello, nullptr);
}
void cmServer::reportProgress(const char* msg, float progress, void* data)
@@ -216,7 +220,7 @@ cmServerResponse cmServer::SetProtocolVersion(const cmServerRequest& request)
std::string errorMessage;
if (!this->Protocol->Activate(this, request, &errorMessage)) {
- this->Protocol = CM_NULLPTR;
+ this->Protocol = nullptr;
return request.ReportError("Failed to activate protocol version: " +
errorMessage);
}
@@ -232,17 +236,26 @@ bool cmServer::Serve(std::string* errorMessage)
}
assert(!this->Protocol);
- return Connection->ProcessEvents(errorMessage);
+ return cmServerBase::Serve(errorMessage);
}
cmFileMonitor* cmServer::FileMonitor() const
{
- return Connection->FileMonitor();
+ return fileMonitor.get();
}
void cmServer::WriteJsonObject(const Json::Value& jsonValue,
const DebugInfo* debug) const
{
+ for (auto& connection : this->Connections) {
+ WriteJsonObject(connection.get(), jsonValue, debug);
+ }
+}
+
+void cmServer::WriteJsonObject(cmConnection* connection,
+ const Json::Value& jsonValue,
+ const DebugInfo* debug) const
+{
Json::FastWriter writer;
auto beforeJson = uv_hrtime();
@@ -272,7 +285,7 @@ void cmServer::WriteJsonObject(const Json::Value& jsonValue,
}
}
- Connection->WriteData(std::string("\n") + kSTART_MAGIC + std::string("\n") +
+ connection->WriteData(std::string("\n") + kSTART_MAGIC + std::string("\n") +
result + kEND_MAGIC + std::string("\n"));
}
@@ -311,7 +324,7 @@ void cmServer::WriteProgress(const cmServerRequest& request, int min,
obj[kPROGRESS_MAXIMUM_KEY] = max;
obj[kPROGRESS_CURRENT_KEY] = current;
- this->WriteJsonObject(obj, nullptr);
+ this->WriteJsonObject(request.Connection, obj, nullptr);
}
void cmServer::WriteMessage(const cmServerRequest& request,
@@ -331,10 +344,11 @@ void cmServer::WriteMessage(const cmServerRequest& request,
obj[kTITLE_KEY] = title;
}
- WriteJsonObject(obj, nullptr);
+ WriteJsonObject(request.Connection, obj, nullptr);
}
-void cmServer::WriteParseError(const std::string& message) const
+void cmServer::WriteParseError(cmConnection* connection,
+ const std::string& message) const
{
Json::Value obj = Json::objectValue;
obj[kTYPE_KEY] = kERROR_TYPE;
@@ -342,7 +356,7 @@ void cmServer::WriteParseError(const std::string& message) const
obj[kREPLY_TO_KEY] = "";
obj[kCOOKIE_KEY] = "";
- this->WriteJsonObject(obj, nullptr);
+ this->WriteJsonObject(connection, obj, nullptr);
}
void cmServer::WriteSignal(const std::string& name,
@@ -358,7 +372,8 @@ void cmServer::WriteSignal(const std::string& name,
WriteJsonObject(obj, nullptr);
}
-void cmServer::WriteResponse(const cmServerResponse& response,
+void cmServer::WriteResponse(cmConnection* connection,
+ const cmServerResponse& response,
const DebugInfo* debug) const
{
assert(response.IsComplete());
@@ -371,5 +386,163 @@ void cmServer::WriteResponse(const cmServerResponse& response,
obj[kERROR_MESSAGE_KEY] = response.ErrorMessage();
}
- this->WriteJsonObject(obj, debug);
+ this->WriteJsonObject(connection, obj, debug);
+}
+
+void cmServer::OnConnected(cmConnection* connection)
+{
+ PrintHello(connection);
+}
+
+void cmServer::OnServeStart()
+{
+ cmServerBase::OnServeStart();
+ fileMonitor = std::make_shared<cmFileMonitor>(GetLoop());
+}
+
+void cmServer::StartShutDown()
+{
+ if (fileMonitor) {
+ fileMonitor->StopMonitoring();
+ fileMonitor.reset();
+ }
+ cmServerBase::StartShutDown();
+}
+
+static void __start_thread(void* arg)
+{
+ auto server = reinterpret_cast<cmServerBase*>(arg);
+ std::string error;
+ server->Serve(&error);
+}
+
+bool cmServerBase::StartServeThread()
+{
+ ServeThreadRunning = true;
+ uv_thread_create(&ServeThread, __start_thread, this);
+ return true;
+}
+
+bool cmServerBase::Serve(std::string* errorMessage)
+{
+ errorMessage->clear();
+
+ uv_signal_init(&Loop, &this->SIGINTHandler);
+ uv_signal_init(&Loop, &this->SIGHUPHandler);
+
+ this->SIGINTHandler.data = this;
+ this->SIGHUPHandler.data = this;
+
+ uv_signal_start(&this->SIGINTHandler, &on_signal, SIGINT);
+ uv_signal_start(&this->SIGHUPHandler, &on_signal, SIGHUP);
+
+ OnServeStart();
+
+ for (auto& connection : Connections) {
+ if (!connection->OnServeStart(errorMessage)) {
+ return false;
+ }
+ }
+
+ if (uv_run(&Loop, UV_RUN_DEFAULT) != 0) {
+ *errorMessage = "Internal Error: Event loop stopped in unclean state.";
+ StartShutDown();
+ return false;
+ }
+
+ ServeThreadRunning = false;
+ return true;
+}
+
+void cmServerBase::OnConnected(cmConnection*)
+{
+}
+
+void cmServerBase::OnDisconnect()
+{
+}
+
+void cmServerBase::OnServeStart()
+{
+ uv_signal_start(&this->SIGINTHandler, &on_signal, SIGINT);
+ uv_signal_start(&this->SIGHUPHandler, &on_signal, SIGHUP);
+}
+
+void cmServerBase::StartShutDown()
+{
+ if (!uv_is_closing(
+ reinterpret_cast<const uv_handle_t*>(&this->SIGINTHandler))) {
+ uv_signal_stop(&this->SIGINTHandler);
+ }
+
+ if (!uv_is_closing(
+ reinterpret_cast<const uv_handle_t*>(&this->SIGHUPHandler))) {
+ uv_signal_stop(&this->SIGHUPHandler);
+ }
+
+ for (auto& connection : Connections) {
+ connection->OnConnectionShuttingDown();
+ }
+ Connections.clear();
+
+ uv_stop(&Loop);
+
+ uv_walk(&Loop, on_walk_to_shutdown, nullptr);
+
+ uv_run(&Loop, UV_RUN_DEFAULT);
+}
+
+bool cmServerBase::OnSignal(int signum)
+{
+ (void)signum;
+ StartShutDown();
+ return true;
+}
+
+cmServerBase::cmServerBase(cmConnection* connection)
+{
+ uv_loop_init(&Loop);
+
+ uv_signal_init(&Loop, &this->SIGINTHandler);
+ uv_signal_init(&Loop, &this->SIGHUPHandler);
+
+ this->SIGINTHandler.data = this;
+ this->SIGHUPHandler.data = this;
+
+ AddNewConnection(connection);
+}
+
+cmServerBase::~cmServerBase()
+{
+
+ if (ServeThreadRunning) {
+ StartShutDown();
+ uv_thread_join(&ServeThread);
+ }
+
+ uv_loop_close(&Loop);
+}
+
+void cmServerBase::AddNewConnection(cmConnection* ownedConnection)
+{
+ Connections.emplace_back(ownedConnection);
+ ownedConnection->SetServer(this);
+}
+
+uv_loop_t* cmServerBase::GetLoop()
+{
+ return &Loop;
+}
+
+void cmServerBase::OnDisconnect(cmConnection* pConnection)
+{
+ auto pred = [pConnection](const std::unique_ptr<cmConnection>& m) {
+ return m.get() == pConnection;
+ };
+ Connections.erase(
+ std::remove_if(Connections.begin(), Connections.end(), pred),
+ Connections.end());
+ if (Connections.empty()) {
+ StartShutDown();
+ }
}
diff --git a/Source/cmServer.h b/Source/cmServer.h
index b814050..eafd860 100644
--- a/Source/cmServer.h
+++ b/Source/cmServer.h
@@ -2,31 +2,88 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#pragma once
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cm_jsoncpp_value.h"
#include "cm_uv.h"
+#include <memory> // IWYU pragma: keep
#include <string>
#include <vector>
+class cmConnection;
class cmFileMonitor;
-class cmServerConnection;
class cmServerProtocol;
class cmServerRequest;
class cmServerResponse;
-class cmServer
+/***
+ * This essentially hold and manages a libuv event queue and responds to
+ * messages
+ * on any of its connections.
+ */
+class cmServerBase
+{
+public:
+ cmServerBase(cmConnection* connection);
+ virtual ~cmServerBase();
+
+ virtual void AddNewConnection(cmConnection* ownedConnection);
+
+ /***
+ * The main override responsible for tailoring behavior towards
+ * whatever the given server is supposed to do
+ *
+ * This should almost always be called by the given connections
+ * directly.
+ *
+ * @param connection The connectiont the request was received on
+ * @param request The actual request
+ */
+ virtual void ProcessRequest(cmConnection* connection,
+ const std::string& request) = 0;
+ virtual void OnConnected(cmConnection* connection);
+ virtual void OnDisconnect();
+
+ /***
+ * Start a dedicated thread. If this is used to start the server, it will
+ * join on the
+ * servers dtor.
+ */
+ virtual bool StartServeThread();
+ virtual bool Serve(std::string* errorMessage);
+
+ virtual void OnServeStart();
+ virtual void StartShutDown();
+
+ virtual bool OnSignal(int signum);
+ uv_loop_t* GetLoop();
+
+ void OnDisconnect(cmConnection* pConnection);
+
+protected:
+ std::vector<std::unique_ptr<cmConnection> > Connections;
+
+ bool ServeThreadRunning = false;
+ uv_thread_t ServeThread;
+
+ uv_loop_t Loop;
+
+ uv_signal_t SIGINTHandler;
+ uv_signal_t SIGHUPHandler;
+};
+
+class cmServer : public cmServerBase
{
CM_DISABLE_COPY(cmServer)
public:
class DebugInfo;
- cmServer(cmServerConnection* conn, bool supportExperimental);
- ~cmServer();
+ cmServer(cmConnection* conn, bool supportExperimental);
+ ~cmServer() override;
- bool Serve(std::string* errorMessage);
+ bool Serve(std::string* errorMessage) override;
cmFileMonitor* FileMonitor() const;
@@ -34,9 +91,20 @@ private:
void RegisterProtocol(cmServerProtocol* protocol);
// Callbacks from cmServerConnection:
- void PopOne();
- void QueueRequest(const std::string& request);
+ void ProcessRequest(cmConnection* connection,
+ const std::string& request) override;
+ std::shared_ptr<cmFileMonitor> fileMonitor;
+
+public:
+ void OnServeStart() override;
+
+ void StartShutDown() override;
+
+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);
@@ -44,36 +112,37 @@ private:
// Handle requests:
cmServerResponse SetProtocolVersion(const cmServerRequest& request);
- void PrintHello() const;
+ void PrintHello(cmConnection* connection) const;
// Write responses:
void WriteProgress(const cmServerRequest& request, int min, int current,
int max, const std::string& message) const;
void WriteMessage(const cmServerRequest& request, const std::string& message,
const std::string& title) const;
- void WriteResponse(const cmServerResponse& response,
+ void WriteResponse(cmConnection* connection,
+ const cmServerResponse& response,
const DebugInfo* debug) const;
- void WriteParseError(const std::string& message) const;
+ void WriteParseError(cmConnection* connection,
+ const std::string& message) const;
void WriteSignal(const std::string& name, const Json::Value& obj) const;
void WriteJsonObject(Json::Value const& jsonValue,
const DebugInfo* debug) const;
+ void WriteJsonObject(cmConnection* connection, Json::Value const& jsonValue,
+ const DebugInfo* debug) const;
+
static cmServerProtocol* FindMatchingProtocol(
const std::vector<cmServerProtocol*>& protocols, int major, int minor);
- cmServerConnection* Connection = nullptr;
const bool SupportExperimental;
cmServerProtocol* Protocol = nullptr;
std::vector<cmServerProtocol*> SupportedProtocols;
- std::vector<std::string> Queue;
std::string DataBuffer;
std::string JsonData;
- uv_loop_t* Loop = nullptr;
-
typedef union
{
uv_tty_t tty;
@@ -87,7 +156,6 @@ private:
mutable bool Writing = false;
- friend class cmServerConnection;
friend class cmServerProtocol;
friend class cmServerRequest;
};
diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx
index 36312ed..4891131 100644
--- a/Source/cmServerConnection.cxx
+++ b/Source/cmServerConnection.cxx
@@ -2,376 +2,123 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmServerConnection.h"
-#include "cmFileMonitor.h"
#include "cmServer.h"
#include "cmServerDictionary.h"
-#include <assert.h>
-#include <string.h>
-
-namespace {
-
-struct write_req_t
+cmStdIoConnection::cmStdIoConnection(
+ cmConnectionBufferStrategy* bufferStrategy)
+ : cmEventBasedConnection(bufferStrategy)
+ , Input()
+ , Output()
{
- uv_write_t req;
- uv_buf_t buf;
-};
-
-void on_alloc_buffer(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf)
-{
- (void)(handle);
- char* rawBuffer = new char[suggested_size];
- *buf = uv_buf_init(rawBuffer, static_cast<unsigned int>(suggested_size));
-}
-
-void on_read(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf)
-{
- auto conn = reinterpret_cast<cmServerConnection*>(stream->data);
- if (nread >= 0) {
- conn->ReadData(std::string(buf->base, buf->base + nread));
- } else {
- conn->TriggerShutdown();
- }
-
- delete[](buf->base);
}
-void on_write(uv_write_t* req, int status)
+void cmStdIoConnection::SetServer(cmServerBase* s)
{
- (void)(status);
- auto conn = reinterpret_cast<cmServerConnection*>(req->data);
-
- // Free req and buffer
- write_req_t* wr = reinterpret_cast<write_req_t*>(req);
- delete[](wr->buf.base);
- delete wr;
+ cmConnection::SetServer(s);
- conn->ProcessNextRequest();
-}
+ if (uv_guess_handle(1) == UV_TTY) {
+ usesTty = true;
-void on_new_connection(uv_stream_t* stream, int status)
-{
- (void)(status);
- auto conn = reinterpret_cast<cmServerConnection*>(stream->data);
- conn->Connect(stream);
-}
+ this->Input.tty = new uv_tty_t();
+ uv_tty_init(this->Server->GetLoop(), this->Input.tty, 0, 1);
+ uv_tty_set_mode(this->Input.tty, UV_TTY_MODE_NORMAL);
+ this->Input.tty->data = static_cast<cmEventBasedConnection*>(this);
+ this->ReadStream = reinterpret_cast<uv_stream_t*>(this->Input.tty);
-void on_signal(uv_signal_t* signal, int signum)
-{
- auto conn = reinterpret_cast<cmServerConnection*>(signal->data);
- (void)(signum);
- conn->TriggerShutdown();
-}
+ this->Output.tty = new uv_tty_t();
+ uv_tty_init(this->Server->GetLoop(), this->Output.tty, 1, 0);
+ uv_tty_set_mode(this->Output.tty, UV_TTY_MODE_NORMAL);
+ this->Output.tty->data = static_cast<cmEventBasedConnection*>(this);
+ this->WriteStream = reinterpret_cast<uv_stream_t*>(this->Output.tty);
+ } else {
+ usesTty = false;
-void on_signal_close(uv_handle_t* handle)
-{
- delete reinterpret_cast<uv_signal_t*>(handle);
-}
+ this->Input.pipe = new uv_pipe_t();
+ uv_pipe_init(this->Server->GetLoop(), this->Input.pipe, 0);
+ uv_pipe_open(this->Input.pipe, 0);
+ this->Input.pipe->data = static_cast<cmEventBasedConnection*>(this);
+ this->ReadStream = reinterpret_cast<uv_stream_t*>(this->Input.pipe);
-void on_pipe_close(uv_handle_t* handle)
-{
- delete reinterpret_cast<uv_pipe_t*>(handle);
+ this->Output.pipe = new uv_pipe_t();
+ uv_pipe_init(this->Server->GetLoop(), this->Output.pipe, 0);
+ uv_pipe_open(this->Output.pipe, 1);
+ this->Output.pipe->data = static_cast<cmEventBasedConnection*>(this);
+ this->WriteStream = reinterpret_cast<uv_stream_t*>(this->Output.pipe);
+ }
}
-void on_tty_close(uv_handle_t* handle)
+bool cmStdIoConnection::OnServeStart(std::string* pString)
{
- delete reinterpret_cast<uv_tty_t*>(handle);
+ uv_read_start(this->ReadStream, on_alloc_buffer, on_read);
+ Server->OnConnected(this);
+ return cmConnection::OnServeStart(pString);
}
-} // namespace
-
-class LoopGuard
+bool cmStdIoConnection::OnConnectionShuttingDown()
{
-public:
- LoopGuard(cmServerConnection* connection)
- : Connection(connection)
- {
- this->Connection->mLoop = uv_default_loop();
- if (!this->Connection->mLoop) {
- return;
- }
- this->Connection->mFileMonitor =
- new cmFileMonitor(this->Connection->mLoop);
- }
-
- ~LoopGuard()
- {
- if (!this->Connection->mLoop) {
- return;
- }
+ cmEventBasedConnection::OnConnectionShuttingDown();
- if (this->Connection->mFileMonitor) {
- delete this->Connection->mFileMonitor;
- }
- uv_loop_close(this->Connection->mLoop);
- this->Connection->mLoop = nullptr;
+ if (usesTty) {
+ uv_read_stop(reinterpret_cast<uv_stream_t*>(this->Input.tty));
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Input.tty),
+ &on_close_delete);
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Output.tty),
+ &on_close_delete);
+ } else {
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Input.pipe),
+ &on_close_delete);
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Output.pipe),
+ &on_close_delete);
}
-private:
- cmServerConnection* Connection;
-};
+ return true;
+}
-cmServerConnection::cmServerConnection()
+cmServerPipeConnection::cmServerPipeConnection(const std::string& name)
+ : cmPipeConnection(name, new cmServerBufferStrategy)
{
}
-cmServerConnection::~cmServerConnection()
+cmServerStdIoConnection::cmServerStdIoConnection()
+ : cmStdIoConnection(new cmServerBufferStrategy)
{
}
-void cmServerConnection::SetServer(cmServer* s)
+cmConnectionBufferStrategy::~cmConnectionBufferStrategy()
{
- this->Server = s;
}
-bool cmServerConnection::ProcessEvents(std::string* errorMessage)
+void cmConnectionBufferStrategy::clear()
{
- assert(this->Server);
- errorMessage->clear();
-
- this->RawReadBuffer.clear();
- this->RequestBuffer.clear();
-
- LoopGuard guard(this);
- (void)(guard);
- if (!this->mLoop) {
- *errorMessage = "Internal Error: Failed to create event loop.";
- return false;
- }
-
- this->SIGINTHandler = new uv_signal_t;
- uv_signal_init(this->mLoop, this->SIGINTHandler);
- this->SIGINTHandler->data = static_cast<void*>(this);
- uv_signal_start(this->SIGINTHandler, &on_signal, SIGINT);
-
- this->SIGHUPHandler = new uv_signal_t;
- uv_signal_init(this->mLoop, this->SIGHUPHandler);
- this->SIGHUPHandler->data = static_cast<void*>(this);
- uv_signal_start(this->SIGHUPHandler, &on_signal, SIGHUP);
-
- if (!DoSetup(errorMessage)) {
- return false;
- }
-
- if (uv_run(this->mLoop, UV_RUN_DEFAULT) != 0) {
- *errorMessage = "Internal Error: Event loop stopped in unclean state.";
- return false;
- }
-
- // These need to be cleaned up by now:
- assert(!this->ReadStream);
- assert(!this->WriteStream);
-
- this->RawReadBuffer.clear();
- this->RequestBuffer.clear();
-
- return true;
}
-void cmServerConnection::ReadData(const std::string& data)
+std::string cmServerBufferStrategy::BufferMessage(std::string& RawReadBuffer)
{
- this->RawReadBuffer += data;
-
for (;;) {
- auto needle = this->RawReadBuffer.find('\n');
+ auto needle = RawReadBuffer.find('\n');
if (needle == std::string::npos) {
- return;
+ return "";
}
- std::string line = this->RawReadBuffer.substr(0, needle);
+ std::string line = RawReadBuffer.substr(0, needle);
const auto ls = line.size();
if (ls > 1 && line.at(ls - 1) == '\r') {
line.erase(ls - 1, 1);
}
- this->RawReadBuffer.erase(this->RawReadBuffer.begin(),
- this->RawReadBuffer.begin() +
- static_cast<long>(needle) + 1);
+ RawReadBuffer.erase(RawReadBuffer.begin(),
+ RawReadBuffer.begin() + static_cast<long>(needle) + 1);
if (line == kSTART_MAGIC) {
- this->RequestBuffer.clear();
+ RequestBuffer.clear();
continue;
}
if (line == kEND_MAGIC) {
- this->Server->QueueRequest(this->RequestBuffer);
- this->RequestBuffer.clear();
- } else {
- this->RequestBuffer += line;
- this->RequestBuffer += "\n";
+ std::string rtn;
+ rtn.swap(this->RequestBuffer);
+ return rtn;
}
- }
-}
-void cmServerConnection::TriggerShutdown()
-{
- this->FileMonitor()->StopMonitoring();
-
- uv_signal_stop(this->SIGINTHandler);
- uv_signal_stop(this->SIGHUPHandler);
-
- uv_close(reinterpret_cast<uv_handle_t*>(this->SIGINTHandler),
- &on_signal_close); // delete handle
- uv_close(reinterpret_cast<uv_handle_t*>(this->SIGHUPHandler),
- &on_signal_close); // delete handle
-
- this->SIGINTHandler = nullptr;
- this->SIGHUPHandler = nullptr;
-
- this->TearDown();
-}
-
-void cmServerConnection::WriteData(const std::string& data)
-{
- assert(this->WriteStream);
-
- auto ds = data.size();
-
- write_req_t* req = new write_req_t;
- req->req.data = this;
- req->buf = uv_buf_init(new char[ds], static_cast<unsigned int>(ds));
- memcpy(req->buf.base, data.c_str(), ds);
-
- uv_write(reinterpret_cast<uv_write_t*>(req),
- static_cast<uv_stream_t*>(this->WriteStream), &req->buf, 1,
- on_write);
-}
-
-void cmServerConnection::ProcessNextRequest()
-{
- Server->PopOne();
-}
-
-void cmServerConnection::SendGreetings()
-{
- Server->PrintHello();
-}
-
-cmServerStdIoConnection::cmServerStdIoConnection()
-{
- this->Input.tty = nullptr;
- this->Output.tty = nullptr;
-}
-
-bool cmServerStdIoConnection::DoSetup(std::string* errorMessage)
-{
- (void)(errorMessage);
-
- if (uv_guess_handle(1) == UV_TTY) {
- usesTty = true;
- this->Input.tty = new uv_tty_t;
- uv_tty_init(this->Loop(), this->Input.tty, 0, 1);
- uv_tty_set_mode(this->Input.tty, UV_TTY_MODE_NORMAL);
- Input.tty->data = this;
- this->ReadStream = reinterpret_cast<uv_stream_t*>(this->Input.tty);
-
- this->Output.tty = new uv_tty_t;
- uv_tty_init(this->Loop(), this->Output.tty, 1, 0);
- uv_tty_set_mode(this->Output.tty, UV_TTY_MODE_NORMAL);
- Output.tty->data = this;
- this->WriteStream = reinterpret_cast<uv_stream_t*>(this->Output.tty);
- } else {
- usesTty = false;
- this->Input.pipe = new uv_pipe_t;
- uv_pipe_init(this->Loop(), this->Input.pipe, 0);
- uv_pipe_open(this->Input.pipe, 0);
- Input.pipe->data = this;
- this->ReadStream = reinterpret_cast<uv_stream_t*>(this->Input.pipe);
-
- this->Output.pipe = new uv_pipe_t;
- uv_pipe_init(this->Loop(), this->Output.pipe, 0);
- uv_pipe_open(this->Output.pipe, 1);
- Output.pipe->data = this;
- this->WriteStream = reinterpret_cast<uv_stream_t*>(this->Output.pipe);
+ this->RequestBuffer += line;
+ this->RequestBuffer += "\n";
}
-
- SendGreetings();
- uv_read_start(this->ReadStream, on_alloc_buffer, on_read);
-
- return true;
-}
-
-void cmServerStdIoConnection::TearDown()
-{
- if (usesTty) {
- uv_close(reinterpret_cast<uv_handle_t*>(this->Input.tty), &on_tty_close);
- uv_close(reinterpret_cast<uv_handle_t*>(this->Output.tty), &on_tty_close);
- this->Input.tty = nullptr;
- this->Output.tty = nullptr;
- } else {
- uv_close(reinterpret_cast<uv_handle_t*>(this->Input.pipe), &on_pipe_close);
- uv_close(reinterpret_cast<uv_handle_t*>(this->Output.pipe),
- &on_pipe_close);
- this->Input.pipe = nullptr;
- this->Input.pipe = nullptr;
- }
- this->ReadStream = nullptr;
- this->WriteStream = nullptr;
-}
-
-cmServerPipeConnection::cmServerPipeConnection(const std::string& name)
- : PipeName(name)
-{
-}
-
-bool cmServerPipeConnection::DoSetup(std::string* errorMessage)
-{
- this->ServerPipe = new uv_pipe_t;
- uv_pipe_init(this->Loop(), this->ServerPipe, 0);
- this->ServerPipe->data = this;
-
- int r;
- if ((r = uv_pipe_bind(this->ServerPipe, this->PipeName.c_str())) != 0) {
- *errorMessage = std::string("Internal Error with ") + this->PipeName +
- ": " + uv_err_name(r);
- return false;
- }
- auto serverStream = reinterpret_cast<uv_stream_t*>(this->ServerPipe);
- if ((r = uv_listen(serverStream, 1, on_new_connection)) != 0) {
- *errorMessage = std::string("Internal Error listening on ") +
- this->PipeName + ": " + uv_err_name(r);
- return false;
- }
-
- return true;
-}
-
-void cmServerPipeConnection::TearDown()
-{
- if (this->ClientPipe) {
- uv_close(reinterpret_cast<uv_handle_t*>(this->ClientPipe), &on_pipe_close);
- this->WriteStream->data = nullptr;
- }
- uv_close(reinterpret_cast<uv_handle_t*>(this->ServerPipe), &on_pipe_close);
-
- this->ClientPipe = nullptr;
- this->ServerPipe = nullptr;
- this->WriteStream = nullptr;
- this->ReadStream = nullptr;
-}
-
-void cmServerPipeConnection::Connect(uv_stream_t* server)
-{
- if (this->ClientPipe) {
- // Accept and close all pipes but the first:
- uv_pipe_t* rejectPipe = new uv_pipe_t;
-
- uv_pipe_init(this->Loop(), rejectPipe, 0);
- auto rejecter = reinterpret_cast<uv_stream_t*>(rejectPipe);
- uv_accept(server, rejecter);
- uv_close(reinterpret_cast<uv_handle_t*>(rejecter), &on_pipe_close);
- return;
- }
-
- this->ClientPipe = new uv_pipe_t;
- uv_pipe_init(this->Loop(), this->ClientPipe, 0);
- this->ClientPipe->data = this;
- auto client = reinterpret_cast<uv_stream_t*>(this->ClientPipe);
- if (uv_accept(server, client) != 0) {
- uv_close(reinterpret_cast<uv_handle_t*>(client), nullptr);
- return;
- }
- this->ReadStream = client;
- this->WriteStream = client;
-
- uv_read_start(this->ReadStream, on_alloc_buffer, on_read);
-
- this->SendGreetings();
}
diff --git a/Source/cmServerConnection.h b/Source/cmServerConnection.h
index b96bf3c..df404ce 100644
--- a/Source/cmServerConnection.h
+++ b/Source/cmServerConnection.h
@@ -2,68 +2,47 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#pragma once
-#include "cmConfigure.h"
-
-#include "cm_uv.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
-class cmFileMonitor;
-class cmServer;
+#include "cmConnection.h"
+#include "cmPipeConnection.h"
+#include "cm_uv.h"
-class cmServerConnection
-{
- CM_DISABLE_COPY(cmServerConnection)
+class cmServerBase;
+/***
+ * This connection buffer strategy accepts messages in the form of
+ * [== "CMake Server" ==[
+{
+ ... some JSON message ...
+}
+]== "CMake Server" ==]
+ * and only passes on the core json; it discards the envelope.
+ */
+class cmServerBufferStrategy : public cmConnectionBufferStrategy
+{
public:
- cmServerConnection();
- virtual ~cmServerConnection();
-
- void SetServer(cmServer* s);
-
- bool ProcessEvents(std::string* errorMessage);
-
- void ReadData(const std::string& data);
- void TriggerShutdown();
- void WriteData(const std::string& data);
- void ProcessNextRequest();
-
- virtual void Connect(uv_stream_t* server) { (void)(server); }
-
- cmFileMonitor* FileMonitor() const { return this->mFileMonitor; }
-
-protected:
- virtual bool DoSetup(std::string* errorMessage) = 0;
- virtual void TearDown() = 0;
-
- void SendGreetings();
-
- uv_loop_t* Loop() const { return mLoop; }
-
-protected:
- std::string RawReadBuffer;
- std::string RequestBuffer;
-
- uv_stream_t* ReadStream = nullptr;
- uv_stream_t* WriteStream = nullptr;
+ std::string BufferMessage(std::string& rawBuffer) override;
private:
- uv_loop_t* mLoop = nullptr;
- cmFileMonitor* mFileMonitor = nullptr;
- cmServer* Server = nullptr;
- uv_signal_t* SIGINTHandler = nullptr;
- uv_signal_t* SIGHUPHandler = nullptr;
-
- friend class LoopGuard;
+ std::string RequestBuffer;
};
-class cmServerStdIoConnection : public cmServerConnection
+/***
+ * Generic connection over std io interfaces -- tty
+ */
+class cmStdIoConnection : public cmEventBasedConnection
{
public:
- cmServerStdIoConnection();
- bool DoSetup(std::string* errorMessage) override;
+ cmStdIoConnection(cmConnectionBufferStrategy* bufferStrategy);
- void TearDown() override;
+ void SetServer(cmServerBase* s) override;
+
+ bool OnConnectionShuttingDown() override;
+
+ bool OnServeStart(std::string* pString) override;
private:
typedef union
@@ -78,18 +57,18 @@ private:
InOutUnion Output;
};
-class cmServerPipeConnection : public cmServerConnection
+/***
+ * These specific connections use the cmake server
+ * buffering strategy.
+ */
+class cmServerStdIoConnection : public cmStdIoConnection
{
public:
- cmServerPipeConnection(const std::string& name);
- bool DoSetup(std::string* errorMessage) override;
-
- void TearDown() override;
-
- void Connect(uv_stream_t* server) override;
+ cmServerStdIoConnection();
+};
-private:
- const std::string PipeName;
- uv_pipe_t* ServerPipe = nullptr;
- uv_pipe_t* ClientPipe = nullptr;
+class cmServerPipeConnection : public cmPipeConnection
+{
+public:
+ cmServerPipeConnection(const std::string& name);
};
diff --git a/Source/cmServerDictionary.h b/Source/cmServerDictionary.h
index e6a7ae6..405ff6b 100644
--- a/Source/cmServerDictionary.h
+++ b/Source/cmServerDictionary.h
@@ -89,6 +89,11 @@ static const std::string kWARN_UNUSED_KEY = "warnUnused";
static const std::string kWATCHED_DIRECTORIES_KEY = "watchedDirectories";
static const std::string kWATCHED_FILES_KEY = "watchedFiles";
+static const std::string kTARGET_CROSS_REFERENCES_KEY = "crossReferences";
+static const std::string kLINE_NUMBER_KEY = "line";
+static const std::string kBACKTRACE_KEY = "backtrace";
+static const std::string kRELATED_STATEMENTS_KEY = "relatedStatements";
+
static const std::string kSTART_MAGIC = "[== \"CMake Server\" ==[";
static const std::string kEND_MAGIC = "]== \"CMake Server\" ==]";
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index c5b7f60..2bcfefd 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -2,12 +2,14 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmServerProtocol.h"
+#include "cmAlgorithms.h"
#include "cmExternalMakefileProjectGenerator.h"
#include "cmFileMonitor.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmLinkLineComputer.h"
+#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmServer.h"
@@ -18,6 +20,7 @@
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
+#include "cmTarget.h"
#include "cm_uv.h"
#include "cmake.h"
@@ -125,11 +128,13 @@ void getCMakeInputs(const cmGlobalGenerator* gg, const std::string& sourceDir,
} // namespace
-cmServerRequest::cmServerRequest(cmServer* server, const std::string& t,
- const std::string& c, const Json::Value& d)
+cmServerRequest::cmServerRequest(cmServer* server, cmConnection* connection,
+ const std::string& t, const std::string& c,
+ const Json::Value& d)
: Type(t)
, Cookie(c)
, Data(d)
+ , Connection(connection)
, m_Server(server)
{
}
@@ -215,10 +220,10 @@ bool cmServerProtocol::Activate(cmServer* server,
{
assert(server);
this->m_Server = server;
- this->m_CMakeInstance = std::make_unique<cmake>(cmake::RoleProject);
+ this->m_CMakeInstance = cm::make_unique<cmake>(cmake::RoleProject);
const bool result = this->DoActivate(request, errorMessage);
if (!result) {
- this->m_CMakeInstance = CM_NULLPTR;
+ this->m_CMakeInstance = nullptr;
}
return result;
}
@@ -247,9 +252,9 @@ bool cmServerProtocol::DoActivate(const cmServerRequest& /*request*/,
return true;
}
-std::pair<int, int> cmServerProtocol1_0::ProtocolVersion() const
+std::pair<int, int> cmServerProtocol1::ProtocolVersion() const
{
- return std::make_pair(1, 0);
+ return std::make_pair(1, 1);
}
static void setErrorMessage(std::string* errorMessage, const std::string& text)
@@ -264,6 +269,10 @@ static bool testHomeDirectory(cmState* state, std::string& value,
{
const std::string cachedValue =
std::string(state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"));
+ if (value.empty()) {
+ value = cachedValue;
+ return true;
+ }
const std::string suffix = "/CMakeLists.txt";
const std::string cachedValueCML = cachedValue + suffix;
const std::string valueCML = value + suffix;
@@ -274,9 +283,6 @@ static bool testHomeDirectory(cmState* state, std::string& value,
"source directory value."));
return false;
}
- if (value.empty()) {
- value = cachedValue;
- }
return true;
}
@@ -287,20 +293,20 @@ static bool testValue(cmState* state, const std::string& key,
const char* entry = state->GetCacheEntryValue(key);
const std::string cachedValue =
entry == nullptr ? std::string() : std::string(entry);
- if (!cachedValue.empty() && !value.empty() && cachedValue != value) {
+ if (value.empty()) {
+ value = cachedValue;
+ }
+ if (!cachedValue.empty() && cachedValue != value) {
setErrorMessage(errorMessage, std::string("\"") + key +
"\" is set but incompatible with configured " +
keyDescription + " value.");
return false;
}
- if (value.empty()) {
- value = cachedValue;
- }
return true;
}
-bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request,
- std::string* errorMessage)
+bool cmServerProtocol1::DoActivate(const cmServerRequest& request,
+ std::string* errorMessage)
{
std::string sourceDirectory = request.Data[kSOURCE_DIRECTORY_KEY].asString();
const std::string buildDirectory =
@@ -419,8 +425,8 @@ bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request,
return true;
}
-void cmServerProtocol1_0::HandleCMakeFileChanges(const std::string& path,
- int event, int status)
+void cmServerProtocol1::HandleCMakeFileChanges(const std::string& path,
+ int event, int status)
{
assert(status == 0);
static_cast<void>(status);
@@ -443,7 +449,7 @@ void cmServerProtocol1_0::HandleCMakeFileChanges(const std::string& path,
SendSignal(kFILE_CHANGE_SIGNAL, obj);
}
-const cmServerResponse cmServerProtocol1_0::Process(
+const cmServerResponse cmServerProtocol1::Process(
const cmServerRequest& request)
{
assert(this->m_State >= STATE_ACTIVE);
@@ -476,18 +482,14 @@ const cmServerResponse cmServerProtocol1_0::Process(
return request.ReportError("Unknown command!");
}
-bool cmServerProtocol1_0::IsExperimental() const
+bool cmServerProtocol1::IsExperimental() const
{
return true;
}
-cmServerResponse cmServerProtocol1_0::ProcessCache(
+cmServerResponse cmServerProtocol1::ProcessCache(
const cmServerRequest& request)
{
- if (this->m_State < STATE_CONFIGURED) {
- return request.ReportError("This project was not configured yet.");
- }
-
cmState* state = this->CMakeInstance()->GetState();
Json::Value result = Json::objectValue;
@@ -530,7 +532,7 @@ cmServerResponse cmServerProtocol1_0::ProcessCache(
return request.Reply(result);
}
-cmServerResponse cmServerProtocol1_0::ProcessCMakeInputs(
+cmServerResponse cmServerProtocol1::ProcessCMakeInputs(
const cmServerRequest& request)
{
if (this->m_State < STATE_CONFIGURED) {
@@ -731,6 +733,37 @@ static Json::Value DumpSourceFilesList(
return result;
}
+static Json::Value DumpBacktrace(const cmListFileBacktrace& backtrace)
+{
+ Json::Value result = Json::arrayValue;
+
+ cmListFileBacktrace backtraceCopy = backtrace;
+ while (!backtraceCopy.Top().FilePath.empty()) {
+ Json::Value entry = Json::objectValue;
+ entry[kPATH_KEY] = backtraceCopy.Top().FilePath;
+ if (backtraceCopy.Top().Line) {
+ entry[kLINE_NUMBER_KEY] = static_cast<int>(backtraceCopy.Top().Line);
+ }
+ if (!backtraceCopy.Top().Name.empty()) {
+ entry[kNAME_KEY] = backtraceCopy.Top().Name;
+ }
+ result.append(entry);
+ backtraceCopy = backtraceCopy.Pop();
+ }
+ return result;
+}
+
+static void DumpBacktraceRange(Json::Value& result, const std::string& type,
+ cmBacktraceRange range)
+{
+ for (const auto& bt : range) {
+ Json::Value obj = Json::objectValue;
+ obj[kTYPE_KEY] = type;
+ obj[kBACKTRACE_KEY] = DumpBacktrace(bt);
+ result.append(obj);
+ }
+}
+
static Json::Value DumpTarget(cmGeneratorTarget* target,
const std::string& config)
{
@@ -765,6 +798,22 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
result[kFULL_NAME_KEY] = target->GetFullName(config);
+ Json::Value crossRefs = Json::objectValue;
+ crossRefs[kBACKTRACE_KEY] = DumpBacktrace(target->Target->GetBacktrace());
+
+ Json::Value statements = Json::arrayValue;
+ DumpBacktraceRange(statements, "target_compile_definitions",
+ target->Target->GetCompileDefinitionsBacktraces());
+ DumpBacktraceRange(statements, "target_include_directories",
+ target->Target->GetIncludeDirectoriesBacktraces());
+ DumpBacktraceRange(statements, "target_compile_options",
+ target->Target->GetCompileOptionsBacktraces());
+ DumpBacktraceRange(statements, "target_link_libraries",
+ target->Target->GetLinkImplementationBacktraces());
+
+ crossRefs[kRELATED_STATEMENTS_KEY] = std::move(statements);
+ result[kTARGET_CROSS_REFERENCES_KEY] = std::move(crossRefs);
+
if (target->HaveWellDefinedOutputFiles()) {
Json::Value artifacts = Json::arrayValue;
artifacts.append(
@@ -854,7 +903,7 @@ static Json::Value DumpTargetsList(
std::vector<cmGeneratorTarget*> targetList;
for (const auto& lgIt : generators) {
- auto list = lgIt->GetGeneratorTargets();
+ const auto& list = lgIt->GetGeneratorTargets();
targetList.insert(targetList.end(), list.begin(), list.end());
}
std::sort(targetList.begin(), targetList.end());
@@ -917,7 +966,7 @@ static Json::Value DumpConfigurationsList(const cmake* cm)
return result;
}
-cmServerResponse cmServerProtocol1_0::ProcessCodeModel(
+cmServerResponse cmServerProtocol1::ProcessCodeModel(
const cmServerRequest& request)
{
if (this->m_State != STATE_COMPUTED) {
@@ -929,7 +978,7 @@ cmServerResponse cmServerProtocol1_0::ProcessCodeModel(
return request.Reply(result);
}
-cmServerResponse cmServerProtocol1_0::ProcessCompute(
+cmServerResponse cmServerProtocol1::ProcessCompute(
const cmServerRequest& request)
{
if (this->m_State > STATE_CONFIGURED) {
@@ -949,7 +998,7 @@ cmServerResponse cmServerProtocol1_0::ProcessCompute(
return request.Reply(Json::Value());
}
-cmServerResponse cmServerProtocol1_0::ProcessConfigure(
+cmServerResponse cmServerProtocol1::ProcessConfigure(
const cmServerRequest& request)
{
if (this->m_State == STATE_INACTIVE) {
@@ -1055,7 +1104,7 @@ cmServerResponse cmServerProtocol1_0::ProcessConfigure(
return request.Reply(Json::Value());
}
-cmServerResponse cmServerProtocol1_0::ProcessGlobalSettings(
+cmServerResponse cmServerProtocol1::ProcessGlobalSettings(
const cmServerRequest& request)
{
cmake* cm = this->CMakeInstance();
@@ -1091,7 +1140,7 @@ static void setBool(const cmServerRequest& request, const std::string& key,
setter(request.Data[key].asBool());
}
-cmServerResponse cmServerProtocol1_0::ProcessSetGlobalSettings(
+cmServerResponse cmServerProtocol1::ProcessSetGlobalSettings(
const cmServerRequest& request)
{
const std::vector<std::string> boolValues = {
@@ -1123,7 +1172,7 @@ cmServerResponse cmServerProtocol1_0::ProcessSetGlobalSettings(
return request.Reply(Json::Value());
}
-cmServerResponse cmServerProtocol1_0::ProcessFileSystemWatchers(
+cmServerResponse cmServerProtocol1::ProcessFileSystemWatchers(
const cmServerRequest& request)
{
const cmFileMonitor* const fm = FileMonitor();
@@ -1142,7 +1191,7 @@ cmServerResponse cmServerProtocol1_0::ProcessFileSystemWatchers(
return request.Reply(result);
}
-cmServerProtocol1_0::GeneratorInformation::GeneratorInformation(
+cmServerProtocol1::GeneratorInformation::GeneratorInformation(
const std::string& generatorName, const std::string& extraGeneratorName,
const std::string& toolset, const std::string& platform,
const std::string& sourceDirectory, const std::string& buildDirectory)
@@ -1155,7 +1204,7 @@ cmServerProtocol1_0::GeneratorInformation::GeneratorInformation(
{
}
-void cmServerProtocol1_0::GeneratorInformation::SetupGenerator(
+void cmServerProtocol1::GeneratorInformation::SetupGenerator(
cmake* cm, std::string* errorMessage)
{
const std::string fullGeneratorName =
diff --git a/Source/cmServerProtocol.h b/Source/cmServerProtocol.h
index 83b3d58..124ac7f 100644
--- a/Source/cmServerProtocol.h
+++ b/Source/cmServerProtocol.h
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#pragma once
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cm_jsoncpp_value.h"
#include "cmake.h"
@@ -11,6 +11,7 @@
#include <string>
#include <utility>
+class cmConnection;
class cmFileMonitor;
class cmServer;
class cmServerRequest;
@@ -52,9 +53,11 @@ public:
const std::string Type;
const std::string Cookie;
const Json::Value Data;
+ cmConnection* Connection;
private:
- cmServerRequest(cmServer* server, const std::string& t, const std::string& c,
+ cmServerRequest(cmServer* server, cmConnection* connection,
+ const std::string& t, const std::string& c,
const Json::Value& d);
void ReportProgress(int min, int current, int max,
@@ -98,7 +101,7 @@ private:
friend class cmServer;
};
-class cmServerProtocol1_0 : public cmServerProtocol
+class cmServerProtocol1 : public cmServerProtocol
{
public:
std::pair<int, int> ProtocolVersion() const override;
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 820e7f6..b32cda3 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -61,7 +61,7 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
// SET (VAR PARENT_SCOPE) // Removes the definition of VAR
// in the parent scope.
if (args.size() == 2 && args[args.size() - 1] == "PARENT_SCOPE") {
- this->Makefile->RaiseScope(variable, CM_NULLPTR);
+ this->Makefile->RaiseScope(variable, nullptr);
return true;
}
@@ -75,8 +75,8 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
bool force = false; // optional
bool parentScope = false;
cmStateEnums::CacheEntryType type =
- cmStateEnums::STRING; // required if cache
- const char* docstring = CM_NULLPTR; // required if cache
+ cmStateEnums::STRING; // required if cache
+ const char* docstring = nullptr; // required if cache
unsigned int ignoreLastArgs = 0;
// look for PARENT_SCOPE argument
diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h
index c0858b1..3faec6f 100644
--- a/Source/cmSetCommand.h
+++ b/Source/cmSetCommand.h
@@ -3,7 +3,7 @@
#ifndef cmSetCommand_h
#define cmSetCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmSetDirectoryPropertiesCommand.h b/Source/cmSetDirectoryPropertiesCommand.h
index 8832b33..16a07da 100644
--- a/Source/cmSetDirectoryPropertiesCommand.h
+++ b/Source/cmSetDirectoryPropertiesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmSetDirectoryPropertiesCommand_h
#define cmSetDirectoryPropertiesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index b57f62a..338fcea 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -141,7 +141,7 @@ bool cmSetPropertyCommand::HandleGlobalMode()
std::string const& name = this->PropertyName;
const char* value = this->PropertyValue.c_str();
if (this->Remove) {
- value = CM_NULLPTR;
+ value = nullptr;
}
if (this->AppendMode) {
cm->AppendProperty(name, value ? value : "", this->AppendAsString);
@@ -191,7 +191,7 @@ bool cmSetPropertyCommand::HandleDirectoryMode()
std::string const& name = this->PropertyName;
const char* value = this->PropertyValue.c_str();
if (this->Remove) {
- value = CM_NULLPTR;
+ value = nullptr;
}
if (this->AppendMode) {
mf->AppendProperty(name, value ? value : "", this->AppendAsString);
@@ -232,7 +232,7 @@ bool cmSetPropertyCommand::HandleTarget(cmTarget* target)
std::string const& name = this->PropertyName;
const char* value = this->PropertyValue.c_str();
if (this->Remove) {
- value = CM_NULLPTR;
+ value = nullptr;
}
if (this->AppendMode) {
target->AppendProperty(name, value, this->AppendAsString);
@@ -271,7 +271,7 @@ bool cmSetPropertyCommand::HandleSource(cmSourceFile* sf)
std::string const& name = this->PropertyName;
const char* value = this->PropertyValue.c_str();
if (this->Remove) {
- value = CM_NULLPTR;
+ value = nullptr;
}
if (this->AppendMode) {
@@ -319,7 +319,7 @@ bool cmSetPropertyCommand::HandleTest(cmTest* test)
std::string const& name = this->PropertyName;
const char* value = this->PropertyValue.c_str();
if (this->Remove) {
- value = CM_NULLPTR;
+ value = nullptr;
}
if (this->AppendMode) {
test->AppendProperty(name, value, this->AppendAsString);
diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h
index 0815824..4d3d996 100644
--- a/Source/cmSetPropertyCommand.h
+++ b/Source/cmSetPropertyCommand.h
@@ -3,7 +3,7 @@
#ifndef cmSetsPropertiesCommand_h
#define cmSetsPropertiesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <set>
#include <string>
diff --git a/Source/cmSetSourceFilesPropertiesCommand.h b/Source/cmSetSourceFilesPropertiesCommand.h
index 2e22dc9..ca3d74d 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.h
+++ b/Source/cmSetSourceFilesPropertiesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmSetSourceFilesPropertiesCommand_h
#define cmSetSourceFilesPropertiesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h
index 4256181..de20a7b 100644
--- a/Source/cmSetTargetPropertiesCommand.h
+++ b/Source/cmSetTargetPropertiesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmSetTargetsPropertiesCommand_h
#define cmSetTargetsPropertiesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmSetTestsPropertiesCommand.h b/Source/cmSetTestsPropertiesCommand.h
index 90f004c..cd9f486 100644
--- a/Source/cmSetTestsPropertiesCommand.h
+++ b/Source/cmSetTestsPropertiesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmSetTestsPropertiesCommand_h
#define cmSetTestsPropertiesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index 7eace26..d2e83a6 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -52,8 +52,8 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args,
// try to find the hostname for this computer
if (!cmSystemTools::IsOff(hostname_cmd.c_str())) {
std::string host;
- cmSystemTools::RunSingleCommand(hostname_cmd.c_str(), &host, CM_NULLPTR,
- CM_NULLPTR, CM_NULLPTR,
+ cmSystemTools::RunSingleCommand(hostname_cmd.c_str(), &host, nullptr,
+ nullptr, nullptr,
cmSystemTools::OUTPUT_NONE);
// got the hostname
diff --git a/Source/cmSiteNameCommand.h b/Source/cmSiteNameCommand.h
index 6c65480..c042a13 100644
--- a/Source/cmSiteNameCommand.h
+++ b/Source/cmSiteNameCommand.h
@@ -3,7 +3,7 @@
#ifndef cmSiteNameCommand_h
#define cmSiteNameCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 5c4f18b..6d2b98d 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -15,15 +15,13 @@
cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name)
: Location(mf, name)
{
- this->CustomCommand = CM_NULLPTR;
+ this->CustomCommand = nullptr;
this->FindFullPathFailed = false;
- this->IsUiFile = (".ui" == cmSystemTools::GetFilenameLastExtension(
- this->Location.GetName()));
}
cmSourceFile::~cmSourceFile()
{
- this->SetCustomCommand(CM_NULLPTR);
+ this->SetCustomCommand(nullptr);
}
std::string const& cmSourceFile::GetExtension() const
@@ -131,17 +129,17 @@ bool cmSourceFile::FindFullPath(std::string* error)
// The file is not generated. It must exist on disk.
cmMakefile const* mf = this->Location.GetMakefile();
- const char* tryDirs[3] = { CM_NULLPTR, CM_NULLPTR, CM_NULLPTR };
+ const char* tryDirs[3] = { nullptr, nullptr, nullptr };
if (this->Location.DirectoryIsAmbiguous()) {
tryDirs[0] = mf->GetCurrentSourceDirectory();
tryDirs[1] = mf->GetCurrentBinaryDirectory();
} else {
tryDirs[0] = "";
}
- const std::vector<std::string>& srcExts =
- mf->GetCMakeInstance()->GetSourceExtensions();
- std::vector<std::string> hdrExts =
- mf->GetCMakeInstance()->GetHeaderExtensions();
+
+ 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()) {
@@ -245,13 +243,6 @@ bool cmSourceFile::Matches(cmSourceFileLocation const& loc)
void cmSourceFile::SetProperty(const std::string& prop, const char* value)
{
this->Properties.SetProperty(prop, value);
-
- if (this->IsUiFile) {
- cmMakefile const* mf = this->Location.GetMakefile();
- if (prop == "AUTOUIC_OPTIONS") {
- const_cast<cmMakefile*>(mf)->AddQtUiFileWithOptions(this);
- }
- }
}
void cmSourceFile::AppendProperty(const std::string& prop, const char* value,
@@ -290,7 +281,7 @@ const char* cmSourceFile::GetProperty(const std::string& prop) const
// Check for computed properties.
if (prop == "LOCATION") {
if (this->FullPath.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
return this->FullPath.c_str();
}
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 0be659c..c2105d2 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -3,7 +3,7 @@
#ifndef cmSourceFile_h
#define cmSourceFile_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmPropertyMap.h"
#include "cmSourceFileLocation.h"
@@ -57,7 +57,7 @@ public:
* horrible interface, but is necessary for backwards
* compatibility).
*/
- std::string const& GetFullPath(std::string* error = CM_NULLPTR);
+ std::string const& GetFullPath(std::string* error = nullptr);
std::string const& GetFullPath() const;
/**
@@ -107,7 +107,6 @@ private:
std::string ObjectLibrary;
std::vector<std::string> Depends;
bool FindFullPathFailed;
- bool IsUiFile;
bool FindFullPath(std::string* error);
bool TryFullPath(const std::string& path, const std::string& ext);
@@ -120,4 +119,10 @@ private:
// TODO: Factor out into platform information modules.
#define CM_HEADER_REGEX "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$"
+#define CM_SOURCE_REGEX \
+ "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp|ftn|m|mm|rc|def|r|odl|idl|hpj" \
+ "|bat)$"
+
+#define CM_RESOURCE_REGEX "\\.(pdf|plist|png|jpeg|jpg|storyboard|xcassets)$"
+
#endif
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index 86711d7..727adeb 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -2,8 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmSourceFileLocation.h"
-#include "cmConfigure.h"
-
#include "cmAlgorithms.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
@@ -15,7 +13,7 @@
#include <vector>
cmSourceFileLocation::cmSourceFileLocation()
- : Makefile(CM_NULLPTR)
+ : Makefile(nullptr)
, AmbiguousDirectory(true)
, AmbiguousExtension(true)
{
diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx
index 104e959..fba4c31 100644
--- a/Source/cmSourceGroup.cxx
+++ b/Source/cmSourceGroup.cxx
@@ -114,7 +114,7 @@ cmSourceGroup* cmSourceGroup::LookupChild(const char* name) const
}
// if no child with this name was found return NULL
- return CM_NULLPTR;
+ return nullptr;
}
cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const char* name)
@@ -134,7 +134,7 @@ cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const char* name)
return result;
}
}
- return CM_NULLPTR;
+ return nullptr;
}
cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const char* name)
@@ -155,7 +155,7 @@ cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const char* name)
return this;
}
- return CM_NULLPTR;
+ return nullptr;
}
std::vector<cmSourceGroup> const& cmSourceGroup::GetGroupChildren() const
diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h
index 97affed..e8bd697 100644
--- a/Source/cmSourceGroup.h
+++ b/Source/cmSourceGroup.h
@@ -3,7 +3,7 @@
#ifndef cmSourceGroup_h
#define cmSourceGroup_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmsys/RegularExpression.hxx"
#include <set>
@@ -27,7 +27,7 @@ class cmSourceGroup
{
public:
cmSourceGroup(const char* name, const char* regex,
- const char* parentName = CM_NULLPTR);
+ const char* parentName = nullptr);
cmSourceGroup(cmSourceGroup const& r);
~cmSourceGroup();
cmSourceGroup& operator=(cmSourceGroup const&);
diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx
index a966300..77fde7b 100644
--- a/Source/cmSourceGroupCommand.cxx
+++ b/Source/cmSourceGroupCommand.cxx
@@ -71,7 +71,7 @@ cmSourceGroup* addSourceGroup(const std::vector<std::string>& tokenizedPath,
makefile.AddSourceGroup(tokenizedPath);
sg = makefile.GetSourceGroup(tokenizedPath);
if (!sg) {
- return CM_NULLPTR;
+ return nullptr;
}
}
@@ -166,7 +166,7 @@ bool cmSourceGroupCommand::InitialPass(std::vector<std::string> const& args,
std::vector<std::string> folders =
cmSystemTools::tokenize(args[0], delimiter);
- cmSourceGroup* sg = CM_NULLPTR;
+ cmSourceGroup* sg = nullptr;
sg = this->Makefile->GetSourceGroup(folders);
if (!sg) {
this->Makefile->AddSourceGroup(folders);
diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h
index 7d56b0d..1af5274 100644
--- a/Source/cmSourceGroupCommand.h
+++ b/Source/cmSourceGroupCommand.h
@@ -3,7 +3,7 @@
#ifndef cmSourceGroupCommand_h
#define cmSourceGroupCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 92e47f7..90d8b7b 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -63,12 +63,12 @@ const char* cmState::GetTargetTypeName(cmStateEnums::TargetType targetType)
return "UNKNOWN_LIBRARY";
}
assert(false && "Unexpected target type");
- return CM_NULLPTR;
+ return nullptr;
}
const char* cmCacheEntryTypes[] = { "BOOL", "PATH", "FILEPATH",
"STRING", "INTERNAL", "STATIC",
- "UNINITIALIZED", CM_NULLPTR };
+ "UNINITIALIZED", nullptr };
const char* cmState::CacheEntryTypeToString(cmStateEnums::CacheEntryType type)
{
@@ -132,7 +132,7 @@ const char* cmState::GetCacheEntryValue(std::string const& key) const
{
cmCacheManager::CacheEntry* e = this->CacheManager->GetCacheEntry(key);
if (!e) {
- return CM_NULLPTR;
+ return nullptr;
}
return e->Value.c_str();
}
@@ -188,7 +188,7 @@ const char* cmState::GetCacheEntryProperty(std::string const& key,
cmCacheManager::CacheIterator it =
this->CacheManager->GetCacheIterator(key.c_str());
if (!it.PropertyExists(propertyName)) {
- return CM_NULLPTR;
+ return nullptr;
}
return it.GetProperty(propertyName);
}
@@ -224,7 +224,7 @@ void cmState::RemoveCacheEntryProperty(std::string const& key,
std::string const& propertyName)
{
this->CacheManager->GetCacheIterator(key.c_str())
- .SetProperty(propertyName, (void*)CM_NULLPTR);
+ .SetProperty(propertyName, nullptr);
}
cmStateSnapshot cmState::Reset()
@@ -303,7 +303,7 @@ cmPropertyDefinition const* cmState::GetPropertyDefinition(
this->PropertyDefinitions.find(scope)->second;
return &defs.find(name)->second;
}
- return CM_NULLPTR;
+ return nullptr;
}
bool cmState::IsPropertyDefined(const std::string& name,
@@ -436,7 +436,7 @@ cmCommand* cmState::GetCommand(std::string const& name) const
if (pos != this->BuiltinCommands.end()) {
return pos->second;
}
- return CM_NULLPTR;
+ return nullptr;
}
std::vector<std::string> cmState::GetCommandNames() const
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index 77413c7..bdef3e5 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -220,7 +220,7 @@ void cmStateSnapshot::SetDefinition(std::string const& name,
void cmStateSnapshot::RemoveDefinition(std::string const& name)
{
- this->Position->Vars->Set(name, CM_NULLPTR);
+ this->Position->Vars->Set(name, nullptr);
}
std::vector<std::string> cmStateSnapshot::UnusedKeys() const
diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h
index 6293803..94d6274 100644
--- a/Source/cmStateSnapshot.h
+++ b/Source/cmStateSnapshot.h
@@ -19,7 +19,7 @@ class cmStateDirectory;
class cmStateSnapshot
{
public:
- cmStateSnapshot(cmState* state = CM_NULLPTR);
+ cmStateSnapshot(cmState* state = nullptr);
cmStateSnapshot(cmState* state, cmStateDetail::PositionType position);
const char* GetDefinition(std::string const& name) const;
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 7a097ba..592f66e 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -62,6 +62,9 @@ bool cmStringCommand::InitialPass(std::vector<std::string> const& args,
if (subCommand == "APPEND") {
return this->HandleAppendCommand(args);
}
+ if (subCommand == "PREPEND") {
+ return this->HandlePrependCommand(args);
+ }
if (subCommand == "CONCAT") {
return this->HandleConcatCommand(args);
}
@@ -309,6 +312,7 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args)
std::string output;
const char* p = input.c_str();
while (re.find(p)) {
+ this->Makefile->ClearMatches();
this->Makefile->StoreMatches(re);
std::string::size_type l = re.start();
std::string::size_type r = re.end();
@@ -391,6 +395,7 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args)
std::string output;
std::string::size_type base = 0;
while (re.find(input.c_str() + base)) {
+ this->Makefile->ClearMatches();
this->Makefile->StoreMatches(re);
std::string::size_type l2 = re.start();
std::string::size_type r = re.end();
@@ -641,6 +646,30 @@ bool cmStringCommand::HandleAppendCommand(std::vector<std::string> const& args)
return true;
}
+bool cmStringCommand::HandlePrependCommand(
+ std::vector<std::string> const& args)
+{
+ if (args.size() < 2) {
+ this->SetError("sub-command PREPEND requires at least one argument.");
+ return false;
+ }
+
+ // Skip if nothing to prepend.
+ if (args.size() < 3) {
+ return true;
+ }
+
+ const std::string& variable = args[1];
+
+ std::string value = cmJoin(cmMakeRange(args).advance(2), std::string());
+ const char* oldValue = this->Makefile->GetDefinition(variable);
+ if (oldValue) {
+ value += oldValue;
+ }
+ this->Makefile->AddDefinition(variable, value.c_str());
+ return true;
+}
+
bool cmStringCommand::HandleConcatCommand(std::vector<std::string> const& args)
{
if (args.size() < 2) {
@@ -789,7 +818,7 @@ bool cmStringCommand::HandleRandomCommand(std::vector<std::string> const& args)
const char* alphaPtr = alphabet.c_str();
int cc;
for (cc = 0; cc < length; cc++) {
- int idx = (int)(sizeofAlphabet * rand() / (RAND_MAX + 1.0));
+ int idx = static_cast<int>(sizeofAlphabet * rand() / (RAND_MAX + 1.0));
result.push_back(*(alphaPtr + idx));
}
result.push_back(0);
diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h
index 88015ad..f19f871 100644
--- a/Source/cmStringCommand.h
+++ b/Source/cmStringCommand.h
@@ -3,7 +3,7 @@
#ifndef cmStringCommand_h
#define cmStringCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
@@ -46,6 +46,7 @@ protected:
bool HandleLengthCommand(std::vector<std::string> const& args);
bool HandleSubstringCommand(std::vector<std::string> const& args);
bool HandleAppendCommand(std::vector<std::string> const& args);
+ bool HandlePrependCommand(std::vector<std::string> const& args);
bool HandleConcatCommand(std::vector<std::string> const& args);
bool HandleStripCommand(std::vector<std::string> const& args);
bool HandleRandomCommand(std::vector<std::string> const& args);
diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h
index a2af0fd..e5fbb7d 100644
--- a/Source/cmSubdirCommand.h
+++ b/Source/cmSubdirCommand.h
@@ -3,7 +3,7 @@
#ifndef cmSubdirCommand_h
#define cmSubdirCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h
index d8ea928..bcda82e 100644
--- a/Source/cmSubdirDependsCommand.h
+++ b/Source/cmSubdirDependsCommand.h
@@ -3,7 +3,7 @@
#ifndef cmSubdirDependsCommand_h
#define cmSubdirDependsCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index f7192e0..5c63d98 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -654,7 +654,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
a != command.end(); ++a) {
argv.push_back(a->c_str());
}
- argv.push_back(CM_NULLPTR);
+ argv.push_back(nullptr);
cmsysProcess* cp = cmsysProcess_New();
cmsysProcess_SetCommand(cp, &*argv.begin());
@@ -666,12 +666,12 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
if (outputflag == OUTPUT_PASSTHROUGH) {
cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDOUT, 1);
cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDERR, 1);
- captureStdOut = CM_NULLPTR;
- captureStdErr = CM_NULLPTR;
+ captureStdOut = nullptr;
+ captureStdErr = nullptr;
} else if (outputflag == OUTPUT_MERGE ||
(captureStdErr && captureStdErr == captureStdOut)) {
cmsysProcess_SetOption(cp, cmsysProcess_Option_MergeOutput, 1);
- captureStdErr = CM_NULLPTR;
+ captureStdErr = nullptr;
}
assert(!captureStdErr || captureStdErr != captureStdOut);
@@ -687,7 +687,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
std::string strdata;
if (outputflag != OUTPUT_PASSTHROUGH &&
(captureStdOut || captureStdErr || outputflag != OUTPUT_NONE)) {
- while ((pipe = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) >
+ while ((pipe = cmsysProcess_WaitForData(cp, &data, &length, nullptr)) >
0) {
// Translate NULL characters in the output into valid text.
for (int i = 0; i < length; ++i) {
@@ -727,7 +727,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
}
}
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
if (captureStdOut) {
captureStdOut->assign(tempStdOut.begin(), tempStdOut.end());
@@ -934,19 +934,17 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
#endif
}
-bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out)
+std::string cmSystemTools::ComputeFileHash(const std::string& source,
+ cmCryptoHash::Algo algo)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
- cmCryptoHash md5(cmCryptoHash::AlgoMD5);
- std::string const str = md5.HashFile(source);
- strncpy(md5out, str.c_str(), 32);
- return !str.empty();
+ cmCryptoHash hash(algo);
+ return hash.HashFile(source);
#else
(void)source;
- (void)md5out;
- cmSystemTools::Message("md5sum not supported in bootstrapping mode",
+ cmSystemTools::Message("hashsum not supported in bootstrapping mode",
"Error");
- return false;
+ return std::string();
#endif
}
@@ -1520,22 +1518,22 @@ void list_item_verbose(FILE* out, struct archive_entry* entry)
/* Use uname if it's present, else uid. */
p = archive_entry_uname(entry);
- if ((p == CM_NULLPTR) || (*p == '\0')) {
- sprintf(tmp, "%lu ", (unsigned long)archive_entry_uid(entry));
+ if ((p == nullptr) || (*p == '\0')) {
+ sprintf(tmp, "%lu ", static_cast<unsigned long>(archive_entry_uid(entry)));
p = tmp;
}
w = strlen(p);
if (w > u_width) {
u_width = w;
}
- fprintf(out, "%-*s ", (int)u_width, p);
+ fprintf(out, "%-*s ", static_cast<int>(u_width), p);
/* Use gname if it's present, else gid. */
p = archive_entry_gname(entry);
- if (p != CM_NULLPTR && p[0] != '\0') {
+ if (p != nullptr && p[0] != '\0') {
fprintf(out, "%s", p);
w = strlen(p);
} else {
- sprintf(tmp, "%lu", (unsigned long)archive_entry_gid(entry));
+ sprintf(tmp, "%lu", static_cast<unsigned long>(archive_entry_gid(entry)));
w = strlen(tmp);
fprintf(out, "%s", tmp);
}
@@ -1547,8 +1545,9 @@ void list_item_verbose(FILE* out, struct archive_entry* entry)
*/
if (archive_entry_filetype(entry) == AE_IFCHR ||
archive_entry_filetype(entry) == AE_IFBLK) {
- sprintf(tmp, "%lu,%lu", (unsigned long)archive_entry_rdevmajor(entry),
- (unsigned long)archive_entry_rdevminor(entry));
+ unsigned long rdevmajor = archive_entry_rdevmajor(entry);
+ unsigned long rdevminor = archive_entry_rdevminor(entry);
+ sprintf(tmp, "%lu,%lu", rdevmajor, rdevminor);
} else {
/*
* Note the use of platform-dependent macros to format
@@ -1556,12 +1555,12 @@ void list_item_verbose(FILE* out, struct archive_entry* entry)
* corresponding type for the cast.
*/
sprintf(tmp, BSDTAR_FILESIZE_PRINTF,
- (BSDTAR_FILESIZE_TYPE)archive_entry_size(entry));
+ static_cast<BSDTAR_FILESIZE_TYPE>(archive_entry_size(entry)));
}
if (w + strlen(tmp) >= gs_width) {
gs_width = w + strlen(tmp) + 1;
}
- fprintf(out, "%*s", (int)(gs_width - w), tmp);
+ fprintf(out, "%*s", static_cast<int>(gs_width - w), tmp);
/* Format the time using 'ls -l' conventions. */
tim = archive_entry_mtime(entry);
@@ -1973,7 +1972,7 @@ unsigned int cmSystemTools::RandomSeed()
// Try using a real random source.
cmsys::ifstream fin;
- fin.rdbuf()->pubsetbuf(CM_NULLPTR, 0); // Unbuffered read.
+ fin.rdbuf()->pubsetbuf(nullptr, 0); // Unbuffered read.
fin.open("/dev/urandom");
if (fin.good() && fin.read(seed.bytes, sizeof(seed)) &&
fin.gcount() == sizeof(seed)) {
@@ -1982,7 +1981,7 @@ unsigned int cmSystemTools::RandomSeed()
// Fall back to the time and pid.
struct timeval t;
- gettimeofday(&t, CM_NULLPTR);
+ gettimeofday(&t, nullptr);
unsigned int pid = static_cast<unsigned int>(getpid());
unsigned int tv_sec = static_cast<unsigned int>(t.tv_sec);
unsigned int tv_usec = static_cast<unsigned int>(t.tv_usec);
@@ -2298,8 +2297,8 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
// Get the RPATH and RUNPATH entries from it.
int se_count = 0;
- cmELF::StringEntry const* se[2] = { CM_NULLPTR, CM_NULLPTR };
- const char* se_name[2] = { CM_NULLPTR, CM_NULLPTR };
+ cmELF::StringEntry const* se[2] = { nullptr, nullptr };
+ const char* se_name[2] = { nullptr, nullptr };
if (cmELF::StringEntry const* se_rpath = elf.GetRPath()) {
se[se_count] = se_rpath;
se_name[se_count] = "RPATH";
@@ -2612,7 +2611,7 @@ bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
// Get the RPATH and RUNPATH entries from it and sort them by index
// in the dynamic section header.
int se_count = 0;
- cmELF::StringEntry const* se[2] = { CM_NULLPTR, CM_NULLPTR };
+ cmELF::StringEntry const* se[2] = { nullptr, nullptr };
if (cmELF::StringEntry const* se_rpath = elf.GetRPath()) {
se[se_count++] = se_rpath;
}
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 9de7967..9bec361 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -3,8 +3,9 @@
#ifndef cmSystemTools_h
#define cmSystemTools_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmCryptoHash.h"
#include "cmProcessOutput.h"
#include "cmsys/Process.h"
#include "cmsys/SystemTools.hxx" // IWYU pragma: export
@@ -61,34 +62,34 @@ public:
* set to false, will disable furthur messages (cancel).
*/
static void SetMessageCallback(MessageCallback f,
- void* clientData = CM_NULLPTR);
+ void* clientData = nullptr);
/**
* Display an error message.
*/
- static void Error(const char* m, const char* m2 = CM_NULLPTR,
- const char* m3 = CM_NULLPTR, const char* m4 = CM_NULLPTR);
+ static void Error(const char* m, const char* m2 = nullptr,
+ const char* m3 = nullptr, const char* m4 = nullptr);
/**
* Display a message.
*/
- static void Message(const char* m, const char* title = CM_NULLPTR);
+ static void Message(const char* m, const char* title = nullptr);
typedef void (*OutputCallback)(const char*, size_t length, void*);
///! Send a string to stdout
static void Stdout(const char* s);
static void Stdout(const char* s, size_t length);
- static void SetStdoutCallback(OutputCallback, void* clientData = CM_NULLPTR);
+ static void SetStdoutCallback(OutputCallback, void* clientData = nullptr);
///! Send a string to stderr
static void Stderr(const char* s);
static void Stderr(const char* s, size_t length);
- static void SetStderrCallback(OutputCallback, void* clientData = CM_NULLPTR);
+ static void SetStderrCallback(OutputCallback, void* clientData = nullptr);
typedef bool (*InterruptCallback)(void*);
static void SetInterruptCallback(InterruptCallback f,
- void* clientData = CM_NULLPTR);
+ void* clientData = nullptr);
static bool GetInterruptFlag();
///! Return true if there was an error at any point.
@@ -179,8 +180,9 @@ public:
if possible). */
static bool RenameFile(const char* oldname, const char* newname);
- ///! Compute the md5sum of a file
- static bool ComputeFileMD5(const std::string& source, char* md5out);
+ ///! Compute the hash of a file
+ static std::string ComputeFileHash(const std::string& source,
+ cmCryptoHash::Algo algo);
/** Compute the md5sum of a string. */
static std::string ComputeStringMD5(const std::string& input);
@@ -218,10 +220,10 @@ public:
OUTPUT_PASSTHROUGH
};
static bool RunSingleCommand(const char* command,
- std::string* captureStdOut = CM_NULLPTR,
- std::string* captureStdErr = CM_NULLPTR,
- int* retVal = CM_NULLPTR,
- const char* dir = CM_NULLPTR,
+ std::string* captureStdOut = nullptr,
+ std::string* captureStdErr = nullptr,
+ int* retVal = nullptr,
+ const char* dir = nullptr,
OutputOption outputflag = OUTPUT_MERGE,
double timeout = 0.0);
/**
@@ -230,10 +232,10 @@ public:
* be in comand[1]...command[command.size()]
*/
static bool RunSingleCommand(std::vector<std::string> const& command,
- std::string* captureStdOut = CM_NULLPTR,
- std::string* captureStdErr = CM_NULLPTR,
- int* retVal = CM_NULLPTR,
- const char* dir = CM_NULLPTR,
+ std::string* captureStdOut = nullptr,
+ std::string* captureStdErr = nullptr,
+ int* retVal = nullptr,
+ const char* dir = nullptr,
OutputOption outputflag = OUTPUT_MERGE,
double timeout = 0.0,
Encoding encoding = cmProcessOutput::Auto);
@@ -461,13 +463,12 @@ public:
/** Try to set the RPATH in an ELF binary. */
static bool ChangeRPath(std::string const& file, std::string const& oldRPath,
std::string const& newRPath,
- std::string* emsg = CM_NULLPTR,
- bool* changed = CM_NULLPTR);
+ std::string* emsg = nullptr,
+ bool* changed = nullptr);
/** Try to remove the RPATH from an ELF binary. */
- static bool RemoveRPath(std::string const& file,
- std::string* emsg = CM_NULLPTR,
- bool* removed = CM_NULLPTR);
+ static bool RemoveRPath(std::string const& file, std::string* emsg = nullptr,
+ bool* removed = nullptr);
/** Check whether the RPATH in an ELF binary contains the path
given. */
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c95a3ca..d4a0bf5 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -9,6 +9,7 @@
#include <set>
#include <sstream>
#include <string.h>
+#include <unordered_set>
#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
@@ -26,7 +27,6 @@
#include "cmStateSnapshot.h"
#include "cmSystemTools.h"
#include "cmTargetPropertyComputer.h"
-#include "cm_unordered_set.hxx"
#include "cmake.h"
template <>
@@ -75,7 +75,7 @@ const char* cmTargetPropertyComputer::GetSources<cmTarget>(
{
cmStringRange entries = tgt->GetSourceEntries();
if (entries.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
std::ostringstream ss;
@@ -211,77 +211,79 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
// Setup default property values.
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
this->GetType() != cmStateEnums::UTILITY) {
- this->SetPropertyDefault("ANDROID_API", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_API_MIN", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_ARCH", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_STL_TYPE", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_SKIP_ANT_STEP", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_PROCESS_MAX", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_PROGUARD", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_PROGUARD_CONFIG_PATH", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_SECURE_PROPS_PATH", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_NATIVE_LIB_DIRECTORIES", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_NATIVE_LIB_DEPENDENCIES", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_JAVA_SOURCE_DIR", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_JAR_DIRECTORIES", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_JAR_DEPENDENCIES", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_ASSETS_DIRECTORIES", CM_NULLPTR);
- this->SetPropertyDefault("ANDROID_ANT_ADDITIONAL_OPTIONS", CM_NULLPTR);
- this->SetPropertyDefault("BUILD_RPATH", CM_NULLPTR);
- this->SetPropertyDefault("INSTALL_NAME_DIR", CM_NULLPTR);
+ this->SetPropertyDefault("ANDROID_API", nullptr);
+ this->SetPropertyDefault("ANDROID_API_MIN", nullptr);
+ this->SetPropertyDefault("ANDROID_ARCH", nullptr);
+ this->SetPropertyDefault("ANDROID_STL_TYPE", nullptr);
+ this->SetPropertyDefault("ANDROID_SKIP_ANT_STEP", nullptr);
+ this->SetPropertyDefault("ANDROID_PROCESS_MAX", nullptr);
+ this->SetPropertyDefault("ANDROID_PROGUARD", nullptr);
+ this->SetPropertyDefault("ANDROID_PROGUARD_CONFIG_PATH", nullptr);
+ this->SetPropertyDefault("ANDROID_SECURE_PROPS_PATH", nullptr);
+ this->SetPropertyDefault("ANDROID_NATIVE_LIB_DIRECTORIES", nullptr);
+ this->SetPropertyDefault("ANDROID_NATIVE_LIB_DEPENDENCIES", nullptr);
+ this->SetPropertyDefault("ANDROID_JAVA_SOURCE_DIR", nullptr);
+ this->SetPropertyDefault("ANDROID_JAR_DIRECTORIES", nullptr);
+ this->SetPropertyDefault("ANDROID_JAR_DEPENDENCIES", nullptr);
+ this->SetPropertyDefault("ANDROID_ASSETS_DIRECTORIES", nullptr);
+ this->SetPropertyDefault("ANDROID_ANT_ADDITIONAL_OPTIONS", nullptr);
+ this->SetPropertyDefault("BUILD_RPATH", nullptr);
+ this->SetPropertyDefault("INSTALL_NAME_DIR", nullptr);
this->SetPropertyDefault("INSTALL_RPATH", "");
this->SetPropertyDefault("INSTALL_RPATH_USE_LINK_PATH", "OFF");
- this->SetPropertyDefault("INTERPROCEDURAL_OPTIMIZATION", CM_NULLPTR);
+ this->SetPropertyDefault("INTERPROCEDURAL_OPTIMIZATION", nullptr);
this->SetPropertyDefault("SKIP_BUILD_RPATH", "OFF");
this->SetPropertyDefault("BUILD_WITH_INSTALL_RPATH", "OFF");
- this->SetPropertyDefault("ARCHIVE_OUTPUT_DIRECTORY", CM_NULLPTR);
- this->SetPropertyDefault("LIBRARY_OUTPUT_DIRECTORY", CM_NULLPTR);
- this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", CM_NULLPTR);
- this->SetPropertyDefault("PDB_OUTPUT_DIRECTORY", CM_NULLPTR);
- this->SetPropertyDefault("COMPILE_PDB_OUTPUT_DIRECTORY", CM_NULLPTR);
- this->SetPropertyDefault("Fortran_FORMAT", CM_NULLPTR);
- this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", CM_NULLPTR);
- this->SetPropertyDefault("GNUtoMS", CM_NULLPTR);
- this->SetPropertyDefault("OSX_ARCHITECTURES", CM_NULLPTR);
- this->SetPropertyDefault("IOS_INSTALL_COMBINED", CM_NULLPTR);
- this->SetPropertyDefault("AUTOMOC", CM_NULLPTR);
- this->SetPropertyDefault("AUTOUIC", CM_NULLPTR);
- this->SetPropertyDefault("AUTORCC", CM_NULLPTR);
- this->SetPropertyDefault("AUTOMOC_DEPEND_FILTERS", CM_NULLPTR);
- this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", CM_NULLPTR);
- this->SetPropertyDefault("AUTOUIC_OPTIONS", CM_NULLPTR);
- this->SetPropertyDefault("AUTOUIC_SEARCH_PATHS", CM_NULLPTR);
- this->SetPropertyDefault("AUTORCC_OPTIONS", CM_NULLPTR);
- this->SetPropertyDefault("LINK_DEPENDS_NO_SHARED", CM_NULLPTR);
- this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", CM_NULLPTR);
- this->SetPropertyDefault("WIN32_EXECUTABLE", CM_NULLPTR);
- this->SetPropertyDefault("MACOSX_BUNDLE", CM_NULLPTR);
- this->SetPropertyDefault("MACOSX_RPATH", CM_NULLPTR);
- this->SetPropertyDefault("BUILD_WITH_INSTALL_NAME_DIR", CM_NULLPTR);
- this->SetPropertyDefault("C_CLANG_TIDY", CM_NULLPTR);
- this->SetPropertyDefault("C_COMPILER_LAUNCHER", CM_NULLPTR);
- this->SetPropertyDefault("C_CPPLINT", CM_NULLPTR);
- this->SetPropertyDefault("C_INCLUDE_WHAT_YOU_USE", CM_NULLPTR);
- this->SetPropertyDefault("LINK_WHAT_YOU_USE", CM_NULLPTR);
- this->SetPropertyDefault("C_STANDARD", CM_NULLPTR);
- this->SetPropertyDefault("C_STANDARD_REQUIRED", CM_NULLPTR);
- this->SetPropertyDefault("C_EXTENSIONS", CM_NULLPTR);
- this->SetPropertyDefault("CXX_CLANG_TIDY", CM_NULLPTR);
- this->SetPropertyDefault("CXX_COMPILER_LAUNCHER", CM_NULLPTR);
- this->SetPropertyDefault("CXX_CPPLINT", CM_NULLPTR);
- this->SetPropertyDefault("CXX_INCLUDE_WHAT_YOU_USE", CM_NULLPTR);
- this->SetPropertyDefault("CXX_STANDARD", CM_NULLPTR);
- this->SetPropertyDefault("CXX_STANDARD_REQUIRED", CM_NULLPTR);
- this->SetPropertyDefault("CXX_EXTENSIONS", CM_NULLPTR);
- this->SetPropertyDefault("CUDA_STANDARD", CM_NULLPTR);
- this->SetPropertyDefault("CUDA_STANDARD_REQUIRED", CM_NULLPTR);
- this->SetPropertyDefault("CUDA_EXTENSIONS", CM_NULLPTR);
- this->SetPropertyDefault("LINK_SEARCH_START_STATIC", CM_NULLPTR);
- this->SetPropertyDefault("LINK_SEARCH_END_STATIC", CM_NULLPTR);
+ this->SetPropertyDefault("ARCHIVE_OUTPUT_DIRECTORY", nullptr);
+ this->SetPropertyDefault("LIBRARY_OUTPUT_DIRECTORY", nullptr);
+ this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", nullptr);
+ this->SetPropertyDefault("PDB_OUTPUT_DIRECTORY", nullptr);
+ this->SetPropertyDefault("COMPILE_PDB_OUTPUT_DIRECTORY", nullptr);
+ this->SetPropertyDefault("Fortran_FORMAT", nullptr);
+ this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", nullptr);
+ this->SetPropertyDefault("GNUtoMS", nullptr);
+ this->SetPropertyDefault("OSX_ARCHITECTURES", nullptr);
+ this->SetPropertyDefault("IOS_INSTALL_COMBINED", nullptr);
+ this->SetPropertyDefault("AUTOMOC", nullptr);
+ this->SetPropertyDefault("AUTOUIC", nullptr);
+ this->SetPropertyDefault("AUTORCC", nullptr);
+ this->SetPropertyDefault("AUTOMOC_DEPEND_FILTERS", nullptr);
+ this->SetPropertyDefault("AUTOMOC_MACRO_NAMES", nullptr);
+ this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", nullptr);
+ this->SetPropertyDefault("AUTOUIC_OPTIONS", nullptr);
+ this->SetPropertyDefault("AUTOUIC_SEARCH_PATHS", nullptr);
+ this->SetPropertyDefault("AUTORCC_OPTIONS", nullptr);
+ this->SetPropertyDefault("LINK_DEPENDS_NO_SHARED", nullptr);
+ this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", nullptr);
+ this->SetPropertyDefault("WIN32_EXECUTABLE", nullptr);
+ this->SetPropertyDefault("MACOSX_BUNDLE", nullptr);
+ this->SetPropertyDefault("MACOSX_RPATH", nullptr);
+ this->SetPropertyDefault("BUILD_WITH_INSTALL_NAME_DIR", nullptr);
+ this->SetPropertyDefault("C_CLANG_TIDY", nullptr);
+ this->SetPropertyDefault("C_COMPILER_LAUNCHER", nullptr);
+ this->SetPropertyDefault("C_CPPLINT", nullptr);
+ this->SetPropertyDefault("C_INCLUDE_WHAT_YOU_USE", nullptr);
+ this->SetPropertyDefault("LINK_WHAT_YOU_USE", nullptr);
+ this->SetPropertyDefault("C_STANDARD", nullptr);
+ this->SetPropertyDefault("C_STANDARD_REQUIRED", nullptr);
+ this->SetPropertyDefault("C_EXTENSIONS", nullptr);
+ this->SetPropertyDefault("CXX_CLANG_TIDY", nullptr);
+ this->SetPropertyDefault("CXX_COMPILER_LAUNCHER", nullptr);
+ this->SetPropertyDefault("CXX_CPPLINT", nullptr);
+ this->SetPropertyDefault("CXX_INCLUDE_WHAT_YOU_USE", nullptr);
+ this->SetPropertyDefault("CXX_STANDARD", nullptr);
+ this->SetPropertyDefault("CXX_STANDARD_REQUIRED", nullptr);
+ this->SetPropertyDefault("CXX_EXTENSIONS", nullptr);
+ this->SetPropertyDefault("CUDA_STANDARD", nullptr);
+ this->SetPropertyDefault("CUDA_STANDARD_REQUIRED", nullptr);
+ this->SetPropertyDefault("CUDA_EXTENSIONS", nullptr);
+ this->SetPropertyDefault("CUDA_COMPILER_LAUNCHER", nullptr);
+ this->SetPropertyDefault("LINK_SEARCH_START_STATIC", nullptr);
+ this->SetPropertyDefault("LINK_SEARCH_END_STATIC", nullptr);
}
if (this->GetType() != cmStateEnums::UTILITY) {
- this->SetPropertyDefault("NO_SYSTEM_FROM_IMPORTED", CM_NULLPTR);
+ this->SetPropertyDefault("NO_SYSTEM_FROM_IMPORTED", nullptr);
}
// Collect the set of configuration types.
@@ -295,7 +297,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
"ARCHIVE_OUTPUT_DIRECTORY_", "LIBRARY_OUTPUT_DIRECTORY_",
"RUNTIME_OUTPUT_DIRECTORY_", "PDB_OUTPUT_DIRECTORY_",
"COMPILE_PDB_OUTPUT_DIRECTORY_", "MAP_IMPORTED_CONFIG_",
- "INTERPROCEDURAL_OPTIMIZATION_", CM_NULLPTR
+ "INTERPROCEDURAL_OPTIMIZATION_", nullptr
};
for (std::vector<std::string>::iterator ci = configNames.begin();
ci != configNames.end(); ++ci) {
@@ -309,7 +311,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
}
std::string property = *p;
property += configUpper;
- this->SetPropertyDefault(property, CM_NULLPTR);
+ this->SetPropertyDefault(property, nullptr);
}
// Initialize per-configuration name postfix property from the
@@ -321,7 +323,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->TargetTypeValue != cmStateEnums::INTERFACE_LIBRARY) {
std::string property = cmSystemTools::UpperCase(*ci);
property += "_POSTFIX";
- this->SetPropertyDefault(property, CM_NULLPTR);
+ this->SetPropertyDefault(property, nullptr);
}
}
}
@@ -365,16 +367,16 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
this->GetType() != cmStateEnums::UTILITY) {
- this->SetPropertyDefault("C_VISIBILITY_PRESET", CM_NULLPTR);
- this->SetPropertyDefault("CXX_VISIBILITY_PRESET", CM_NULLPTR);
- this->SetPropertyDefault("CUDA_VISIBILITY_PRESET", CM_NULLPTR);
- this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", CM_NULLPTR);
+ this->SetPropertyDefault("C_VISIBILITY_PRESET", nullptr);
+ this->SetPropertyDefault("CXX_VISIBILITY_PRESET", nullptr);
+ this->SetPropertyDefault("CUDA_VISIBILITY_PRESET", nullptr);
+ this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", nullptr);
}
if (this->TargetTypeValue == cmStateEnums::EXECUTABLE) {
- this->SetPropertyDefault("ANDROID_GUI", CM_NULLPTR);
- this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", CM_NULLPTR);
- this->SetPropertyDefault("ENABLE_EXPORTS", CM_NULLPTR);
+ this->SetPropertyDefault("ANDROID_GUI", nullptr);
+ this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", nullptr);
+ this->SetPropertyDefault("ENABLE_EXPORTS", nullptr);
}
if (this->TargetTypeValue == cmStateEnums::SHARED_LIBRARY ||
this->TargetTypeValue == cmStateEnums::MODULE_LIBRARY) {
@@ -382,12 +384,12 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
}
if (this->TargetTypeValue == cmStateEnums::SHARED_LIBRARY ||
this->TargetTypeValue == cmStateEnums::EXECUTABLE) {
- this->SetPropertyDefault("WINDOWS_EXPORT_ALL_SYMBOLS", CM_NULLPTR);
+ this->SetPropertyDefault("WINDOWS_EXPORT_ALL_SYMBOLS", nullptr);
}
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
this->GetType() != cmStateEnums::UTILITY) {
- this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", CM_NULLPTR);
+ this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", nullptr);
}
// Record current policies for later use.
@@ -403,8 +405,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
this->GetType() != cmStateEnums::UTILITY) {
- this->SetPropertyDefault("JOB_POOL_COMPILE", CM_NULLPTR);
- this->SetPropertyDefault("JOB_POOL_LINK", CM_NULLPTR);
+ this->SetPropertyDefault("JOB_POOL_COMPILE", nullptr);
+ this->SetPropertyDefault("JOB_POOL_LINK", nullptr);
}
}
@@ -427,7 +429,7 @@ cmListFileBacktrace const* cmTarget::GetUtilityBacktrace(
std::map<std::string, cmListFileBacktrace>::const_iterator i =
this->UtilityBacktraces.find(u);
if (i == this->UtilityBacktraces.end()) {
- return CM_NULLPTR;
+ return nullptr;
}
return &i->second;
@@ -545,7 +547,7 @@ cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s)
{
std::string src = this->ProcessSourceItemCMP0049(s);
if (!s.empty() && src.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
return this->AddSource(src);
}
@@ -616,7 +618,7 @@ cmSourceFile* cmTarget::AddSource(const std::string& src)
this->Internal->SourceBacktraces.push_back(lfbt);
}
if (cmGeneratorExpression::Find(src) != std::string::npos) {
- return CM_NULLPTR;
+ return nullptr;
}
return this->Makefile->GetOrCreateSource(src);
}
@@ -1178,7 +1180,7 @@ const char* cmTarget::GetComputedProperty(
const char* cmTarget::GetProperty(const std::string& prop) const
{
- static CM_UNORDERED_SET<std::string> specialProps;
+ static std::unordered_set<std::string> specialProps;
#define MAKE_STATIC_PROP(PROP) static const std::string prop##PROP = #PROP
MAKE_STATIC_PROP(LINK_LIBRARIES);
MAKE_STATIC_PROP(TYPE);
@@ -1210,7 +1212,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const
if (specialProps.count(prop)) {
if (prop == propLINK_LIBRARIES) {
if (this->Internal->LinkImplementationPropertyEntries.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
static std::string output;
@@ -1223,7 +1225,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const
}
if (prop == propINCLUDE_DIRECTORIES) {
if (this->Internal->IncludeDirectoriesEntries.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
static std::string output;
@@ -1232,7 +1234,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const
}
if (prop == propCOMPILE_FEATURES) {
if (this->Internal->CompileFeaturesEntries.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
static std::string output;
@@ -1241,7 +1243,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const
}
if (prop == propCOMPILE_OPTIONS) {
if (this->Internal->CompileOptionsEntries.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
static std::string output;
@@ -1250,7 +1252,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const
}
if (prop == propCOMPILE_DEFINITIONS) {
if (this->Internal->CompileDefinitionsEntries.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
static std::string output;
@@ -1259,7 +1261,7 @@ const char* cmTarget::GetProperty(const std::string& prop) const
}
if (prop == propMANUALLY_ADDED_DEPENDENCIES) {
if (this->Utilities.empty()) {
- return CM_NULLPTR;
+ return nullptr;
}
static std::string output;
@@ -1397,8 +1399,8 @@ std::string cmTarget::ImportedGetFullPath(
std::string result;
- const char* loc = CM_NULLPTR;
- const char* imp = CM_NULLPTR;
+ const char* loc = nullptr;
+ const char* imp = nullptr;
std::string suffix;
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 1f00c01..c335c81 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -9,6 +9,7 @@
#include <map>
#include <set>
#include <string>
+#include <unordered_map>
#include <utility>
#include <vector>
@@ -19,7 +20,6 @@
#include "cmPropertyMap.h"
#include "cmStateTypes.h"
#include "cmTargetLinkLibraryType.h"
-#include "cm_unordered_map.hxx"
class cmGlobalGenerator;
class cmMakefile;
@@ -184,7 +184,7 @@ public:
* name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE
* commands. It is not a full path nor does it have an extension.
*/
- void AddUtility(const std::string& u, cmMakefile* makefile = CM_NULLPTR);
+ void AddUtility(const std::string& u, cmMakefile* makefile = nullptr);
///! Get the utilities used by this target
std::set<std::string> const& GetUtilities() const { return this->Utilities; }
cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const;
@@ -323,7 +323,7 @@ private:
cmListFileBacktrace Backtrace;
};
-typedef CM_UNORDERED_MAP<std::string, cmTarget> cmTargets;
+typedef std::unordered_map<std::string, cmTarget> cmTargets;
class cmTargetSet : public std::set<std::string>
{
diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h
index 11abf57..957123a 100644
--- a/Source/cmTargetCompileDefinitionsCommand.h
+++ b/Source/cmTargetCompileDefinitionsCommand.h
@@ -3,7 +3,7 @@
#ifndef cmTargetCompileDefinitionsCommand_h
#define cmTargetCompileDefinitionsCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmTargetCompileFeaturesCommand.h b/Source/cmTargetCompileFeaturesCommand.h
index 9908680..d28cf62 100644
--- a/Source/cmTargetCompileFeaturesCommand.h
+++ b/Source/cmTargetCompileFeaturesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmTargetCompileFeaturesCommand_h
#define cmTargetCompileFeaturesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmTargetCompileOptionsCommand.h b/Source/cmTargetCompileOptionsCommand.h
index b5408f7..7786896 100644
--- a/Source/cmTargetCompileOptionsCommand.h
+++ b/Source/cmTargetCompileOptionsCommand.h
@@ -3,7 +3,7 @@
#ifndef cmTargetCompileOptionsCommand_h
#define cmTargetCompileOptionsCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h
index 374a867..96eedc8 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.h
+++ b/Source/cmTargetIncludeDirectoriesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmTargetIncludeDirectoriesCommand_h
#define cmTargetIncludeDirectoriesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index e173036..bfae53c 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -95,7 +95,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
if (this->Target->GetType() == cmStateEnums::UTILITY) {
std::ostringstream e;
- const char* modal = CM_NULLPTR;
+ const char* modal = nullptr;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0039)) {
case cmPolicies::WARN:
@@ -311,7 +311,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
if (!this->Target->PushTLLCommandTrace(
sig, this->Makefile->GetExecutionContext())) {
std::ostringstream e;
- const char* modal = CM_NULLPTR;
+ const char* modal = nullptr;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0023)) {
case cmPolicies::WARN:
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index 3fd20ac..333ab07 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmTargetLinkLibrariesCommand_h
#define cmTargetLinkLibrariesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx
index a57bc5a..3a3c165 100644
--- a/Source/cmTargetPropertyComputer.cxx
+++ b/Source/cmTargetPropertyComputer.cxx
@@ -4,11 +4,11 @@
#include "cmTargetPropertyComputer.h"
#include <sstream>
+#include <unordered_set>
#include "cmMessenger.h"
#include "cmPolicies.h"
#include "cmStateSnapshot.h"
-#include "cm_unordered_set.hxx"
#include "cmake.h"
bool cmTargetPropertyComputer::HandleLocationPropertyPolicy(
@@ -16,7 +16,7 @@ bool cmTargetPropertyComputer::HandleLocationPropertyPolicy(
cmListFileBacktrace const& context)
{
std::ostringstream e;
- const char* modal = CM_NULLPTR;
+ const char* modal = nullptr;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch (context.GetBottom().GetPolicy(cmPolicies::CMP0026)) {
case cmPolicies::WARN:
@@ -49,7 +49,7 @@ bool cmTargetPropertyComputer::WhiteListedInterfaceProperty(
if (cmHasLiteralPrefix(prop, "INTERFACE_")) {
return true;
}
- static CM_UNORDERED_SET<std::string> builtIns;
+ static std::unordered_set<std::string> builtIns;
if (builtIns.empty()) {
builtIns.insert("COMPATIBLE_INTERFACE_BOOL");
builtIns.insert("COMPATIBLE_INTERFACE_NUMBER_MAX");
diff --git a/Source/cmTargetPropertyComputer.h b/Source/cmTargetPropertyComputer.h
index 94688e3..97e4fba 100644
--- a/Source/cmTargetPropertyComputer.h
+++ b/Source/cmTargetPropertyComputer.h
@@ -26,12 +26,12 @@ public:
return loc;
}
if (cmSystemTools::GetFatalErrorOccured()) {
- return CM_NULLPTR;
+ return nullptr;
}
if (prop == "SOURCES") {
return GetSources(tgt, messenger, context);
}
- return CM_NULLPTR;
+ return nullptr;
}
static bool WhiteListedInterfaceProperty(const std::string& prop);
@@ -69,7 +69,7 @@ private:
if (!tgt->IsImported() &&
!HandleLocationPropertyPolicy(tgt->GetName(), messenger,
context)) {
- return CM_NULLPTR;
+ return nullptr;
}
return ComputeLocationForBuild(tgt);
}
@@ -79,7 +79,7 @@ private:
if (!tgt->IsImported() &&
!HandleLocationPropertyPolicy(tgt->GetName(), messenger,
context)) {
- return CM_NULLPTR;
+ return nullptr;
}
const char* configName = prop.c_str() + 9;
return ComputeLocation(tgt, configName);
@@ -93,13 +93,13 @@ private:
if (!tgt->IsImported() &&
!HandleLocationPropertyPolicy(tgt->GetName(), messenger,
context)) {
- return CM_NULLPTR;
+ return nullptr;
}
return ComputeLocation(tgt, configName);
}
}
}
- return CM_NULLPTR;
+ return nullptr;
}
template <typename Target>
diff --git a/Source/cmTargetSourcesCommand.h b/Source/cmTargetSourcesCommand.h
index 09ba729..b4e08e4 100644
--- a/Source/cmTargetSourcesCommand.h
+++ b/Source/cmTargetSourcesCommand.h
@@ -3,7 +3,7 @@
#ifndef cmTargetSourcesCommand_h
#define cmTargetSourcesCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index be4b378..85d4b97 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -23,7 +23,7 @@ cmTestGenerator::cmTestGenerator(
{
this->ActionsPerConfig = !test->GetOldStyle();
this->TestGenerated = false;
- this->LG = CM_NULLPTR;
+ this->LG = nullptr;
}
cmTestGenerator::~cmTestGenerator()
@@ -80,7 +80,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
// Prepend with the emulator when cross compiling if required.
const char* emulator = target->GetProperty("CROSSCOMPILING_EMULATOR");
- if (emulator != CM_NULLPTR) {
+ if (emulator != nullptr) {
std::vector<std::string> emulatorWithArgs;
cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs);
std::string emulatorExe(emulatorWithArgs[0]);
diff --git a/Source/cmTestGenerator.h b/Source/cmTestGenerator.h
index b227305..ab0f635 100644
--- a/Source/cmTestGenerator.h
+++ b/Source/cmTestGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmTestGenerator_h
#define cmTestGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmScriptGenerator.h"
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index 4b97188..4dea24c 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmTimestamp.h"
-#include "cmConfigure.h"
#include <cstring>
#include <sstream>
#include <stdlib.h>
@@ -12,7 +11,7 @@
std::string cmTimestamp::CurrentTime(const std::string& formatString,
bool utcFlag)
{
- time_t currentTimeT = time(CM_NULLPTR);
+ time_t currentTimeT = time(nullptr);
std::string source_date_epoch;
cmSystemTools::GetEnv("SOURCE_DATE_EPOCH", source_date_epoch);
if (!source_date_epoch.empty()) {
@@ -56,14 +55,14 @@ std::string cmTimestamp::CreateTimestampFromTimeT(time_t timeT,
struct tm timeStruct;
memset(&timeStruct, 0, sizeof(timeStruct));
- struct tm* ptr = (struct tm*)CM_NULLPTR;
+ struct tm* ptr = nullptr;
if (utcFlag) {
ptr = gmtime(&timeT);
} else {
ptr = localtime(&timeT);
}
- if (ptr == CM_NULLPTR) {
+ if (ptr == nullptr) {
return std::string();
}
diff --git a/Source/cmTryCompileCommand.h b/Source/cmTryCompileCommand.h
index 4836548..b1f0da9 100644
--- a/Source/cmTryCompileCommand.h
+++ b/Source/cmTryCompileCommand.h
@@ -3,7 +3,7 @@
#ifndef cmTryCompileCommand_h
#define cmTryCompileCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 07e20e6..cc93b03 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -125,9 +125,8 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv,
std::string runOutputContents;
if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING") &&
!this->Makefile->IsDefinitionSet("CMAKE_CROSSCOMPILING_EMULATOR")) {
- this->DoNotRunExecutable(runArgs, argv[3], captureRunOutput
- ? &runOutputContents
- : CM_NULLPTR);
+ this->DoNotRunExecutable(
+ runArgs, argv[3], captureRunOutput ? &runOutputContents : nullptr);
} else {
this->RunExecutable(runArgs, &runOutputContents);
}
@@ -189,7 +188,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs,
}
int timeout = 0;
bool worked = cmSystemTools::RunSingleCommand(
- finalCommand.c_str(), out, out, &retVal, CM_NULLPTR,
+ finalCommand.c_str(), out, out, &retVal, nullptr,
cmSystemTools::OUTPUT_NONE, timeout);
// set the run var
char retChar[1000];
@@ -233,7 +232,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
this->RunResultVariable + "__TRYRUN_OUTPUT";
bool error = false;
- if (this->Makefile->GetDefinition(this->RunResultVariable) == CM_NULLPTR) {
+ if (this->Makefile->GetDefinition(this->RunResultVariable) == nullptr) {
// if the variables doesn't exist, create it with a helpful error text
// and mark it as advanced
std::string comment;
@@ -255,8 +254,8 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
}
// is the output from the executable used ?
- if (out != CM_NULLPTR) {
- if (this->Makefile->GetDefinition(internalRunOutputName) == CM_NULLPTR) {
+ if (out != nullptr) {
+ if (this->Makefile->GetDefinition(internalRunOutputName) == nullptr) {
// if the variables doesn't exist, create it with a helpful error text
// and mark it as advanced
std::string comment;
@@ -304,7 +303,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
comment += " to\n"
" the exit code (in many cases 0 for success), otherwise "
"enter \"FAILED_TO_RUN\".\n";
- if (out != CM_NULLPTR) {
+ if (out != nullptr) {
comment += internalRunOutputName;
comment +=
"\n contains the text the executable "
@@ -335,7 +334,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
<< this->Makefile->GetDefinition(this->RunResultVariable)
<< "\"\n CACHE STRING \"Result from TRY_RUN\" FORCE)\n\n";
- if (out != CM_NULLPTR) {
+ if (out != nullptr) {
file << "set( " << internalRunOutputName << " \n \""
<< this->Makefile->GetDefinition(internalRunOutputName)
<< "\"\n CACHE STRING \"Output from TRY_RUN\" FORCE)\n\n";
@@ -348,7 +347,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
"please set the following cache variables "
"appropriately:\n";
errorMessage += " " + this->RunResultVariable + " (advanced)\n";
- if (out != CM_NULLPTR) {
+ if (out != nullptr) {
errorMessage += " " + internalRunOutputName + " (advanced)\n";
}
errorMessage += detailsString;
@@ -356,7 +355,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
return;
}
- if (out != CM_NULLPTR) {
+ if (out != nullptr) {
(*out) = this->Makefile->GetDefinition(internalRunOutputName);
}
}
diff --git a/Source/cmTryRunCommand.h b/Source/cmTryRunCommand.h
index c27b026..732dff1 100644
--- a/Source/cmTryRunCommand.h
+++ b/Source/cmTryRunCommand.h
@@ -3,7 +3,7 @@
#ifndef cmTryRunCommand_h
#define cmTryRunCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmUnexpectedCommand.h b/Source/cmUnexpectedCommand.h
index 995d8a5..5e3ac74 100644
--- a/Source/cmUnexpectedCommand.h
+++ b/Source/cmUnexpectedCommand.h
@@ -3,7 +3,7 @@
#ifndef cmUnexpectedCommand_h
#define cmUnexpectedCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx
index 31525ba..18bbdd7 100644
--- a/Source/cmUnsetCommand.cxx
+++ b/Source/cmUnsetCommand.cxx
@@ -46,7 +46,7 @@ bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
}
// unset(VAR PARENT_SCOPE)
if ((args.size() == 2) && (args[1] == "PARENT_SCOPE")) {
- this->Makefile->RaiseScope(variable, CM_NULLPTR);
+ this->Makefile->RaiseScope(variable, nullptr);
return true;
}
// ERROR: second argument isn't CACHE or PARENT_SCOPE
diff --git a/Source/cmUnsetCommand.h b/Source/cmUnsetCommand.h
index 2a1f3f0..96d7010 100644
--- a/Source/cmUnsetCommand.h
+++ b/Source/cmUnsetCommand.h
@@ -3,7 +3,7 @@
#ifndef cmUnsetCommand_h
#define cmUnsetCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h
index 5118829..86ebbf1 100644
--- a/Source/cmUseMangledMesaCommand.h
+++ b/Source/cmUseMangledMesaCommand.h
@@ -3,7 +3,7 @@
#ifndef cmUseMangledMesaCommand_h
#define cmUseMangledMesaCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index eabd7ef..0ce437c 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -33,7 +33,7 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args,
bool haveCacheValue = false;
if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING")) {
- haveCacheValue = (cacheValue != CM_NULLPTR);
+ haveCacheValue = (cacheValue != nullptr);
if (!haveCacheValue) {
std::string msg = "UTILITY_SOURCE is used in cross compiling mode for ";
msg += cacheEntry;
@@ -45,7 +45,7 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args,
} else {
cmState* state = this->Makefile->GetState();
haveCacheValue =
- (cacheValue && (strstr(cacheValue, "(IntDir)") == CM_NULLPTR ||
+ (cacheValue && (strstr(cacheValue, "(IntDir)") == nullptr ||
(intDir && strcmp(intDir, "$(IntDir)") == 0)) &&
(state->GetCacheMajorVersion() != 0 &&
state->GetCacheMinorVersion() != 0));
diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h
index a95b48d..404ef3e 100644
--- a/Source/cmUtilitySourceCommand.h
+++ b/Source/cmUtilitySourceCommand.h
@@ -3,7 +3,7 @@
#ifndef cmUtilitySourceCommand_h
#define cmUtilitySourceCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmVS10CLFlagTable.h b/Source/cmVS10CLFlagTable.h
index dbd760e..df4d58c 100644
--- a/Source/cmVS10CLFlagTable.h
+++ b/Source/cmVS10CLFlagTable.h
@@ -70,7 +70,8 @@ static cmVS7FlagTable cmVS10CLFlagTable[] = {
cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
{ "PrecompiledHeader", "Yu", "Use", "Use",
cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "", "Not Using Precompiled Headers", "NotUsing", 0 },
+ { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing",
+ 0 },
{ "AssemblerOutput", "", "No Listing", "NoListing", 0 },
{ "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 },
diff --git a/Source/cmVS10CSharpFlagTable.h b/Source/cmVS10CSharpFlagTable.h
index 493ec2b..18d587c 100644
--- a/Source/cmVS10CSharpFlagTable.h
+++ b/Source/cmVS10CSharpFlagTable.h
@@ -25,7 +25,8 @@ static cmVS7FlagTable cmVS10CSharpFlagTable[] = {
{ "ApplicationIcon", "win32icon", "", "",
cmIDEFlagTable::UserValueRequired },
- { "Win32Manifest", "win32manifest:", "", "true", 0 },
+ { "ApplicationManifest", "win32manifest:", "", "",
+ cmIDEFlagTable::UserValueRequired },
{ "NoWin32Manifest", "nowin32manifest", "", "true", 0 },
diff --git a/Source/cmVS11CLFlagTable.h b/Source/cmVS11CLFlagTable.h
index 7531709..d156938 100644
--- a/Source/cmVS11CLFlagTable.h
+++ b/Source/cmVS11CLFlagTable.h
@@ -74,7 +74,8 @@ static cmVS7FlagTable cmVS11CLFlagTable[] = {
cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
{ "PrecompiledHeader", "Yu", "Use", "Use",
cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "", "Not Using Precompiled Headers", "NotUsing", 0 },
+ { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing",
+ 0 },
{ "AssemblerOutput", "", "No Listing", "NoListing", 0 },
{ "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 },
diff --git a/Source/cmVS11CSharpFlagTable.h b/Source/cmVS11CSharpFlagTable.h
index 71870b6..e3ba83c 100644
--- a/Source/cmVS11CSharpFlagTable.h
+++ b/Source/cmVS11CSharpFlagTable.h
@@ -25,7 +25,8 @@ static cmVS7FlagTable cmVS11CSharpFlagTable[] = {
{ "ApplicationIcon", "win32icon", "", "",
cmIDEFlagTable::UserValueRequired },
- { "Win32Manifest", "win32manifest:", "", "true", 0 },
+ { "ApplicationManifest", "win32manifest:", "", "",
+ cmIDEFlagTable::UserValueRequired },
{ "NoWin32Manifest", "nowin32manifest", "", "true", 0 },
diff --git a/Source/cmVS12CLFlagTable.h b/Source/cmVS12CLFlagTable.h
index 9515c91..a4f2518 100644
--- a/Source/cmVS12CLFlagTable.h
+++ b/Source/cmVS12CLFlagTable.h
@@ -78,7 +78,8 @@ static cmVS7FlagTable cmVS12CLFlagTable[] = {
cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
{ "PrecompiledHeader", "Yu", "Use", "Use",
cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "", "Not Using Precompiled Headers", "NotUsing", 0 },
+ { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing",
+ 0 },
{ "AssemblerOutput", "", "No Listing", "NoListing", 0 },
{ "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 },
diff --git a/Source/cmVS12CSharpFlagTable.h b/Source/cmVS12CSharpFlagTable.h
index f98b184..f8db636 100644
--- a/Source/cmVS12CSharpFlagTable.h
+++ b/Source/cmVS12CSharpFlagTable.h
@@ -25,7 +25,8 @@ static cmVS7FlagTable cmVS12CSharpFlagTable[] = {
{ "ApplicationIcon", "win32icon", "", "",
cmIDEFlagTable::UserValueRequired },
- { "Win32Manifest", "win32manifest:", "", "true", 0 },
+ { "ApplicationManifest", "win32manifest:", "", "",
+ cmIDEFlagTable::UserValueRequired },
{ "NoWin32Manifest", "nowin32manifest", "", "true", 0 },
diff --git a/Source/cmVS140CLFlagTable.h b/Source/cmVS140CLFlagTable.h
index 60b4379..2b89042 100644
--- a/Source/cmVS140CLFlagTable.h
+++ b/Source/cmVS140CLFlagTable.h
@@ -80,7 +80,8 @@ static cmVS7FlagTable cmVS140CLFlagTable[] = {
cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
{ "PrecompiledHeader", "Yu", "Use", "Use",
cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "", "Not Using Precompiled Headers", "NotUsing", 0 },
+ { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing",
+ 0 },
{ "AssemblerOutput", "", "No Listing", "NoListing", 0 },
{ "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 },
diff --git a/Source/cmVS140CSharpFlagTable.h b/Source/cmVS140CSharpFlagTable.h
index 256c35f..055d5cb 100644
--- a/Source/cmVS140CSharpFlagTable.h
+++ b/Source/cmVS140CSharpFlagTable.h
@@ -25,7 +25,8 @@ static cmVS7FlagTable cmVS140CSharpFlagTable[] = {
{ "ApplicationIcon", "win32icon", "", "",
cmIDEFlagTable::UserValueRequired },
- { "Win32Manifest", "win32manifest:", "", "true", 0 },
+ { "ApplicationManifest", "win32manifest:", "", "",
+ cmIDEFlagTable::UserValueRequired },
{ "NoWin32Manifest", "nowin32manifest", "", "true", 0 },
diff --git a/Source/cmVS141CLFlagTable.h b/Source/cmVS141CLFlagTable.h
index f751fc8..e8b8f5c 100644
--- a/Source/cmVS141CLFlagTable.h
+++ b/Source/cmVS141CLFlagTable.h
@@ -87,7 +87,8 @@ static cmVS7FlagTable cmVS141CLFlagTable[] = {
cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
{ "PrecompiledHeader", "Yu", "Use", "Use",
cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "", "Not Using Precompiled Headers", "NotUsing", 0 },
+ { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing",
+ 0 },
{ "AssemblerOutput", "", "No Listing", "NoListing", 0 },
{ "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 },
diff --git a/Source/cmVS141CSharpFlagTable.h b/Source/cmVS141CSharpFlagTable.h
index 8508581..5de9bf3 100644
--- a/Source/cmVS141CSharpFlagTable.h
+++ b/Source/cmVS141CSharpFlagTable.h
@@ -25,7 +25,8 @@ static cmVS7FlagTable cmVS141CSharpFlagTable[] = {
{ "ApplicationIcon", "win32icon", "", "",
cmIDEFlagTable::UserValueRequired },
- { "Win32Manifest", "win32manifest:", "", "true", 0 },
+ { "ApplicationManifest", "win32manifest:", "", "",
+ cmIDEFlagTable::UserValueRequired },
{ "NoWin32Manifest", "nowin32manifest", "", "true", 0 },
diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h
index 9808d5f..811e02e 100644
--- a/Source/cmVariableRequiresCommand.h
+++ b/Source/cmVariableRequiresCommand.h
@@ -3,7 +3,7 @@
#ifndef cmVariableRequiresCommand_h
#define cmVariableRequiresCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h
index a575afe..05a0a56 100644
--- a/Source/cmVariableWatch.h
+++ b/Source/cmVariableWatch.h
@@ -31,10 +31,9 @@ public:
* Add watch to the variable
*/
bool AddWatch(const std::string& variable, WatchMethod method,
- void* client_data = CM_NULLPTR,
- DeleteData delete_data = CM_NULLPTR);
+ void* client_data = nullptr, DeleteData delete_data = nullptr);
void RemoveWatch(const std::string& variable, WatchMethod method,
- void* client_data = CM_NULLPTR);
+ void* client_data = nullptr);
/**
* This method is called when variable is accessed
@@ -67,9 +66,9 @@ protected:
void* ClientData;
DeleteData DeleteDataCall;
Pair()
- : Method(CM_NULLPTR)
- , ClientData(CM_NULLPTR)
- , DeleteDataCall(CM_NULLPTR)
+ : Method(nullptr)
+ , ClientData(nullptr)
+ , DeleteDataCall(nullptr)
{
}
~Pair()
diff --git a/Source/cmVariableWatchCommand.h b/Source/cmVariableWatchCommand.h
index 9f04391..59baa4d 100644
--- a/Source/cmVariableWatchCommand.h
+++ b/Source/cmVariableWatchCommand.h
@@ -3,7 +3,7 @@
#ifndef cmVariableWatchCommand_h
#define cmVariableWatchCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <set>
#include <string>
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 88fa19c..0e73806 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -25,6 +25,12 @@ static std::string cmVS10EscapeXML(std::string arg)
return arg;
}
+static std::string cmVS10EscapeQuotes(std::string arg)
+{
+ cmSystemTools::ReplaceString(arg, "\"", "&quot;");
+ return arg;
+}
+
static std::string cmVS10EscapeComment(std::string comment)
{
// MSBuild takes the CDATA of a <Message></Message> element and just
@@ -79,7 +85,7 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator(
this->LocalGenerator =
(cmLocalVisualStudio7Generator*)this->GeneratorTarget->GetLocalGenerator();
this->Name = this->GeneratorTarget->GetName();
- this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str());
+ this->GUID = this->GlobalGenerator->GetGUID(this->Name);
this->Platform = gg->GetPlatformName();
this->NsightTegra = gg->IsNsightTegra();
for (int i = 0; i < 4; ++i) {
@@ -144,7 +150,7 @@ void cmVisualStudio10TargetGenerator::WritePlatformConfigTag(
(*stream) << config << "|" << this->Platform;
(*stream) << "'";
// handle special case for 32 bit C# targets
- if (csproj == this->ProjectType && this->Platform == "Win32") {
+ if (this->ProjectType == csproj && this->Platform == "Win32") {
(*stream) << " Or ";
(*stream) << "'$(Configuration)|$(Platform)'=='";
(*stream) << config << "|x86";
@@ -292,7 +298,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString("</PropertyGroup>\n", 1);
}
- if (csproj != this->ProjectType) {
+ if (this->ProjectType != csproj) {
this->WriteProjectConfigurations();
}
this->WriteString("<PropertyGroup Label=\"Globals\">\n", 1);
@@ -309,7 +315,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->GeneratorTarget->GetProperty("VS_GLOBAL_PROJECT_TYPES");
if (vsProjectTypes) {
std::string tagName = "ProjectTypes";
- if (csproj == this->ProjectType) {
+ if (this->ProjectType == csproj) {
tagName = "ProjectTypeGuids";
}
this->WriteString("", 2);
@@ -405,7 +411,7 @@ void cmVisualStudio10TargetGenerator::Generate()
globalKey == "ROOTNAMESPACE" || globalKey == "KEYWORD") {
continue;
}
- const char* value = this->GeneratorTarget->GetProperty(keyIt->c_str());
+ const char* value = this->GeneratorTarget->GetProperty(*keyIt);
if (!value)
continue;
this->WriteString("<", 2);
@@ -463,7 +469,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteProjectConfigurationValues();
- if (vcxproj == this->ProjectType) {
+ if (this->ProjectType == vcxproj) {
this->WriteString("<Import Project=\"" VS10_CXX_PROPS "\" />\n", 1);
}
this->WriteString("<ImportGroup Label=\"ExtensionSettings\">\n", 1);
@@ -566,7 +572,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString(import.c_str(), 2);
}
this->WriteString("</ImportGroup>\n", 1);
- if (csproj == this->ProjectType) {
+ if (this->ProjectType == csproj) {
for (std::vector<std::string>::const_iterator i =
this->Configurations.begin();
i != this->Configurations.end(); ++i) {
@@ -576,6 +582,18 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteEvents(*i);
this->WriteString("</PropertyGroup>\n", 1);
}
+ // make sure custom commands are executed before build (if necessary)
+ this->WriteString("<PropertyGroup>\n", 1);
+ this->WriteString("<BuildDependsOn>\n", 2);
+ for (std::set<std::string>::const_iterator i =
+ this->CSharpCustomCommandNames.begin();
+ i != this->CSharpCustomCommandNames.end(); ++i) {
+ this->WriteString(i->c_str(), 3);
+ (*this->BuildFileStream) << ";\n";
+ }
+ this->WriteString("$(BuildDependsOn)\n", 3);
+ this->WriteString("</BuildDependsOn>\n", 2);
+ this->WriteString("</PropertyGroup>\n", 1);
}
this->WriteString("</Project>", 0);
// The groups are stored in a separate file for VS 10
@@ -657,9 +675,39 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReference(
this->WriteString("<HintPath>", 3);
(*this->BuildFileStream) << hint << "</HintPath>\n";
}
+ this->WriteDotNetReferenceCustomTags(ref);
this->WriteString("</Reference>\n", 2);
}
+void cmVisualStudio10TargetGenerator::WriteDotNetReferenceCustomTags(
+ std::string const& ref)
+{
+
+ static const std::string refpropPrefix = "VS_DOTNET_REFERENCEPROP_";
+ static const std::string refpropInfix = "_TAG_";
+ const std::string refPropFullPrefix = refpropPrefix + ref + refpropInfix;
+ typedef std::map<std::string, std::string> CustomTags;
+ CustomTags tags;
+ cmPropertyMap const& props = this->GeneratorTarget->Target->GetProperties();
+ for (cmPropertyMap::const_iterator i = props.begin(); i != props.end();
+ ++i) {
+ if (i->first.find(refPropFullPrefix) == 0) {
+ std::string refTag = i->first.substr(refPropFullPrefix.length());
+ std::string refVal = i->second.GetValue();
+ if (!refTag.empty() && !refVal.empty()) {
+ tags[refTag] = refVal;
+ }
+ }
+ }
+ for (CustomTags::const_iterator tag = tags.begin(); tag != tags.end();
+ ++tag) {
+ this->WriteString("<", 3);
+ (*this->BuildFileStream) << tag->first << ">"
+ << cmVS10EscapeXML(tag->second) << "</"
+ << tag->first << ">\n";
+ }
+}
+
void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
{
std::vector<cmSourceFile const*> resxObjs;
@@ -675,7 +723,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
this->WriteString("<EmbeddedResource Include=\"", 2);
this->ConvertToWindowsSlash(obj);
bool useRelativePath = false;
- if (csproj == this->ProjectType && this->InSourceBuild) {
+ if (this->ProjectType == csproj && this->InSourceBuild) {
// If we do an in-source build and the resource file is in a
// subdirectory
// of the .csproj file, we have to use relative pathnames, otherwise
@@ -688,7 +736,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
}
(*this->BuildFileStream) << obj << "\">\n";
- if (csproj != this->ProjectType) {
+ if (this->ProjectType != csproj) {
this->WriteString("<DependentUpon>", 3);
std::string hFileName = obj.substr(0, obj.find_last_of(".")) + ".h";
(*this->BuildFileStream) << hFileName << "</DependentUpon>\n";
@@ -696,7 +744,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
for (std::vector<std::string>::const_iterator i =
this->Configurations.begin();
i != this->Configurations.end(); ++i) {
- this->WritePlatformConfigTag("LogicalName", i->c_str(), 3);
+ this->WritePlatformConfigTag("LogicalName", *i, 3);
if (this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE") ||
// Handle variant of VS_GLOBAL_<variable> for RootNamespace.
this->GeneratorTarget->GetProperty("VS_GLOBAL_RootNamespace")) {
@@ -758,7 +806,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
for (cmPropertyMap::const_iterator p = props.begin(); p != props.end();
++p) {
static const std::string propNamePrefix = "VS_CSHARP_";
- if (p->first.find(propNamePrefix.c_str()) == 0) {
+ if (p->first.find(propNamePrefix) == 0) {
std::string tagName = p->first.substr(propNamePrefix.length());
if (!tagName.empty()) {
std::string value = props.GetPropertyValue(p->first);
@@ -798,7 +846,7 @@ void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup()
}
this->WriteSource(xamlType, *oi, ">\n");
- if (csproj == this->ProjectType && !this->InSourceBuild) {
+ if (this->ProjectType == csproj && !this->InSourceBuild) {
// add <Link> tag to written XAML source if necessary
const std::string srcDir = this->Makefile->GetCurrentSourceDirectory();
const std::string binDir = this->Makefile->GetCurrentBinaryDirectory();
@@ -914,10 +962,10 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
for (std::vector<std::string>::const_iterator i =
this->Configurations.begin();
i != this->Configurations.end(); ++i) {
- this->WritePlatformConfigTag("PropertyGroup", i->c_str(), 1,
+ this->WritePlatformConfigTag("PropertyGroup", *i, 1,
" Label=\"Configuration\"", "\n");
- if (csproj != this->ProjectType) {
+ if (this->ProjectType != csproj) {
std::string configType = "<ConfigurationType>";
if (const char* vsConfigurationType =
this->GeneratorTarget->GetProperty("VS_CONFIGURATION_TYPE")) {
@@ -1038,8 +1086,7 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
this->WriteString("<DefineDebug>true</DefineDebug>\n", 2);
}
- std::string outDir =
- this->GeneratorTarget->GetDirectory(config.c_str()) + "/";
+ std::string outDir = this->GeneratorTarget->GetDirectory(config) + "/";
this->ConvertToWindowsSlash(outDir);
this->WriteString("<OutputPath>", 2);
(*this->BuildFileStream) << cmVS10EscapeXML(outDir) << "</OutputPath>\n";
@@ -1119,6 +1166,7 @@ void cmVisualStudio10TargetGenerator::WriteNsightTegraConfigurationValues(
void cmVisualStudio10TargetGenerator::WriteCustomCommands()
{
this->SourcesVisited.clear();
+ this->CSharpCustomCommandNames.clear();
std::vector<cmSourceFile const*> customCommands;
this->GeneratorTarget->GetCustomCommands(customCommands, "");
for (std::vector<cmSourceFile const*>::const_iterator si =
@@ -1140,9 +1188,14 @@ void cmVisualStudio10TargetGenerator::WriteCustomCommand(
}
}
if (cmCustomCommand const* command = sf->GetCustomCommand()) {
- this->WriteString("<ItemGroup>\n", 1);
+ // C# projects write their <Target> within WriteCustomRule()
+ if (this->ProjectType != csproj) {
+ this->WriteString("<ItemGroup>\n", 1);
+ }
this->WriteCustomRule(sf, *command);
- this->WriteString("</ItemGroup>\n", 1);
+ if (this->ProjectType != csproj) {
+ this->WriteString("</ItemGroup>\n", 1);
+ }
}
}
}
@@ -1177,8 +1230,20 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
}
cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
- this->WriteSource("CustomBuild", source, ">\n");
-
+ if (this->ProjectType != csproj) {
+ this->WriteSource("CustomBuild", source, ">\n");
+ } else {
+ this->WriteString("<ItemGroup>\n", 1);
+ std::string link;
+ this->GetCSharpSourceLink(source, link);
+ this->WriteSource("None", source, ">\n");
+ if (!link.empty()) {
+ this->WriteString("<Link>", 3);
+ (*this->BuildFileStream) << link << "</Link>\n";
+ }
+ this->WriteString("</None>\n", 2);
+ this->WriteString("</ItemGroup>\n", 1);
+ }
for (std::vector<std::string>::const_iterator i =
this->Configurations.begin();
i != this->Configurations.end(); ++i) {
@@ -1186,41 +1251,90 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
std::string comment = lg->ConstructComment(ccg);
comment = cmVS10EscapeComment(comment);
std::string script = cmVS10EscapeXML(lg->ConstructScript(ccg));
- this->WritePlatformConfigTag("Message", i->c_str(), 3);
- (*this->BuildFileStream) << cmVS10EscapeXML(comment) << "</Message>\n";
- this->WritePlatformConfigTag("Command", i->c_str(), 3);
- (*this->BuildFileStream) << script << "</Command>\n";
- this->WritePlatformConfigTag("AdditionalInputs", i->c_str(), 3);
-
- (*this->BuildFileStream) << cmVS10EscapeXML(source->GetFullPath());
+ // input files for custom command
+ std::stringstream inputs;
+ inputs << cmVS10EscapeXML(source->GetFullPath());
for (std::vector<std::string>::const_iterator d = ccg.GetDepends().begin();
d != ccg.GetDepends().end(); ++d) {
std::string dep;
- if (this->LocalGenerator->GetRealDependency(d->c_str(), i->c_str(),
- dep)) {
+ if (this->LocalGenerator->GetRealDependency(*d, *i, dep)) {
this->ConvertToWindowsSlash(dep);
- (*this->BuildFileStream) << ";" << cmVS10EscapeXML(dep);
+ inputs << ";" << cmVS10EscapeXML(dep);
}
}
- (*this->BuildFileStream) << ";%(AdditionalInputs)</AdditionalInputs>\n";
- this->WritePlatformConfigTag("Outputs", i->c_str(), 3);
+ // output files for custom command
+ std::stringstream outputs;
const char* sep = "";
for (std::vector<std::string>::const_iterator o = ccg.GetOutputs().begin();
o != ccg.GetOutputs().end(); ++o) {
std::string out = *o;
this->ConvertToWindowsSlash(out);
- (*this->BuildFileStream) << sep << cmVS10EscapeXML(out);
+ outputs << sep << cmVS10EscapeXML(out);
sep = ";";
}
- (*this->BuildFileStream) << "</Outputs>\n";
- if (this->LocalGenerator->GetVersion() >
- cmGlobalVisualStudioGenerator::VS10) {
- // VS >= 11 let us turn off linking of custom command outputs.
- this->WritePlatformConfigTag("LinkObjects", i->c_str(), 3);
- (*this->BuildFileStream) << "false</LinkObjects>\n";
+ if (this->ProjectType == csproj) {
+ std::string name = "CustomCommand_" + *i + "_" +
+ cmSystemTools::ComputeStringMD5(sourcePath);
+ std::string inputs_s = inputs.str();
+ std::string outputs_s = outputs.str();
+ comment = cmVS10EscapeQuotes(comment);
+ script = cmVS10EscapeQuotes(script);
+ inputs_s = cmVS10EscapeQuotes(inputs_s);
+ outputs_s = cmVS10EscapeQuotes(outputs_s);
+ this->WriteCustomRuleCSharp(*i, name, script, inputs_s, outputs_s,
+ comment);
+ } else {
+ this->WriteCustomRuleCpp(*i, script, inputs.str(), outputs.str(),
+ comment);
}
}
- this->WriteString("</CustomBuild>\n", 2);
+ if (this->ProjectType != csproj) {
+ this->WriteString("</CustomBuild>\n", 2);
+ }
+}
+
+void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp(
+ std::string const& config, std::string const& script,
+ std::string const& inputs, std::string const& outputs,
+ std::string const& comment)
+{
+ this->WritePlatformConfigTag("Message", config, 3);
+ (*this->BuildFileStream) << cmVS10EscapeXML(comment) << "</Message>\n";
+ this->WritePlatformConfigTag("Command", config, 3);
+ (*this->BuildFileStream) << script << "</Command>\n";
+ this->WritePlatformConfigTag("AdditionalInputs", config, 3);
+ (*this->BuildFileStream) << inputs;
+ (*this->BuildFileStream) << ";%(AdditionalInputs)</AdditionalInputs>\n";
+ this->WritePlatformConfigTag("Outputs", config, 3);
+ (*this->BuildFileStream) << outputs << "</Outputs>\n";
+ if (this->LocalGenerator->GetVersion() >
+ cmGlobalVisualStudioGenerator::VS10) {
+ // VS >= 11 let us turn off linking of custom command outputs.
+ this->WritePlatformConfigTag("LinkObjects", config, 3);
+ (*this->BuildFileStream) << "false</LinkObjects>\n";
+ }
+}
+
+void cmVisualStudio10TargetGenerator::WriteCustomRuleCSharp(
+ std::string const& config, std::string const& name,
+ std::string const& script, std::string const& inputs,
+ std::string const& outputs, std::string const& comment)
+{
+ this->CSharpCustomCommandNames.insert(name);
+ std::stringstream attributes;
+ attributes << "\n Name=\"" << name << "\"";
+ attributes << "\n Inputs=\"" << inputs << "\"";
+ attributes << "\n Outputs=\"" << outputs << "\"";
+ this->WritePlatformConfigTag("Target", config, 1, attributes.str().c_str(),
+ "\n");
+ if (!comment.empty()) {
+ this->WriteString("<Exec Command=\"", 2);
+ (*this->BuildFileStream) << "echo " << cmVS10EscapeXML(comment)
+ << "\" />\n";
+ }
+ this->WriteString("<Exec Command=\"", 2);
+ (*this->BuildFileStream) << script << "\" />\n";
+ this->WriteString("</Target>\n", 1);
}
std::string cmVisualStudio10TargetGenerator::ConvertPath(
@@ -1243,7 +1357,7 @@ void cmVisualStudio10TargetGenerator::ConvertToWindowsSlash(std::string& s)
}
void cmVisualStudio10TargetGenerator::WriteGroups()
{
- if (csproj == this->ProjectType) {
+ if (this->ProjectType == csproj) {
return;
}
@@ -1355,7 +1469,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
std::string guidName = "SG_Filter_";
guidName += name;
this->WriteString("<UniqueIdentifier>", 3);
- std::string guid = this->GlobalGenerator->GetGUID(guidName.c_str());
+ std::string guid = this->GlobalGenerator->GetGUID(guidName);
(*this->BuildFileStream) << "{" << guid << "}"
<< "</UniqueIdentifier>\n";
this->WriteString("</Filter>\n", 2);
@@ -1366,7 +1480,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
this->WriteString("<Filter Include=\"Resource Files\">\n", 2);
std::string guidName = "SG_Filter_Resource Files";
this->WriteString("<UniqueIdentifier>", 3);
- std::string guid = this->GlobalGenerator->GetGUID(guidName.c_str());
+ std::string guid = this->GlobalGenerator->GetGUID(guidName);
(*this->BuildFileStream) << "{" << guid << "}"
<< "</UniqueIdentifier>\n";
this->WriteString("<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;", 3);
@@ -1485,7 +1599,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
std::string copyToOutDir;
std::string includeInVsix;
std::string ext = cmSystemTools::LowerCase(sf->GetExtension());
- if (csproj == this->ProjectType) {
+ if (this->ProjectType == csproj) {
// EVERY extra source file must have a <Link>, otherwise it might not
// be visible in Visual Studio at all. The path relative to current
// source- or binary-dir is used within the link, if the file is
@@ -1564,6 +1678,10 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
toolHasSettings = true;
}
+ // Collect VS_CSHARP_* property values (if some are set)
+ std::map<std::string, std::string> sourceFileTags;
+ this->GetCSharpSourceProperties(sf, sourceFileTags);
+
if (this->NsightTegra) {
// Nsight Tegra needs specific file types to check up-to-dateness.
std::string name = cmSystemTools::LowerCase(sf->GetLocation().GetName());
@@ -1680,7 +1798,8 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
(*this->BuildFileStream) << cmVS10EscapeXML(includeInVsix)
<< "</IncludeInVSIX>\n";
}
-
+ // write source file specific tags
+ this->WriteCSharpSourceProperties(sourceFileTags);
this->WriteString("</", 2);
(*this->BuildFileStream) << tool << ">\n";
} else {
@@ -1929,7 +2048,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
std::string configDefines = defines;
std::string defPropName = "COMPILE_DEFINITIONS_";
defPropName += configUpper;
- if (const char* ccdefs = sf.GetProperty(defPropName.c_str())) {
+ if (const char* ccdefs = sf.GetProperty(defPropName)) {
if (!configDefines.empty()) {
configDefines += ";";
}
@@ -1944,7 +2063,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
hasFlags = true;
cmGlobalVisualStudio10Generator* gg =
static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator);
- cmIDEFlagTable const* flagtable = CM_NULLPTR;
+ cmIDEFlagTable const* flagtable = nullptr;
const std::string& srclang = source->GetLanguage();
if (srclang == "C" || srclang == "CXX") {
flagtable = gg->GetClFlagTable();
@@ -2002,48 +2121,23 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
std::string xamlFileName = fileName.substr(0, fileName.find_last_of("."));
(*this->BuildFileStream) << xamlFileName << "</DependentUpon>\n";
}
- if (csproj == this->ProjectType) {
+ if (this->ProjectType == csproj) {
std::string f = source->GetFullPath();
typedef std::map<std::string, std::string> CsPropMap;
CsPropMap sourceFileTags;
// set <Link> tag if necessary
- if (!this->InSourceBuild) {
- const std::string stripFromPath =
- this->Makefile->GetCurrentSourceDirectory();
- if (f.find(stripFromPath) != std::string::npos) {
- std::string link = f.substr(stripFromPath.length() + 1);
- this->ConvertToWindowsSlash(link);
- sourceFileTags["Link"] = link;
- }
- }
- const cmPropertyMap& props = sf.GetProperties();
- for (cmPropertyMap::const_iterator p = props.begin(); p != props.end();
- ++p) {
- static const std::string propNamePrefix = "VS_CSHARP_";
- if (p->first.find(propNamePrefix.c_str()) == 0) {
- std::string tagName = p->first.substr(propNamePrefix.length());
- if (!tagName.empty()) {
- const std::string val = props.GetPropertyValue(p->first);
- if (!val.empty()) {
- sourceFileTags[tagName] = val;
- } else {
- sourceFileTags.erase(tagName);
- }
- }
- }
+ std::string link;
+ this->GetCSharpSourceLink(source, link);
+ if (!link.empty()) {
+ sourceFileTags["Link"] = link;
}
+ this->GetCSharpSourceProperties(&sf, sourceFileTags);
// write source file specific tags
if (!sourceFileTags.empty()) {
hasFlags = true;
(*this->BuildFileStream) << firstString;
firstString = "";
- for (CsPropMap::const_iterator i = sourceFileTags.begin();
- i != sourceFileTags.end(); ++i) {
- this->WriteString("<", 3);
- (*this->BuildFileStream)
- << i->first << ">" << cmVS10EscapeXML(i->second) << "</" << i->first
- << ">\n";
- }
+ this->WriteCSharpSourceProperties(sourceFileTags);
}
}
@@ -2069,7 +2163,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
if (ttype > cmStateEnums::GLOBAL_TARGET) {
return;
}
- if (csproj == this->ProjectType) {
+ if (this->ProjectType == csproj) {
return;
}
@@ -2081,7 +2175,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
this->Configurations.begin();
config != this->Configurations.end(); ++config) {
if (ttype >= cmStateEnums::UTILITY) {
- this->WritePlatformConfigTag("IntDir", config->c_str(), 2);
+ this->WritePlatformConfigTag("IntDir", *config, 2);
*this->BuildFileStream
<< "$(Platform)\\$(Configuration)\\$(ProjectName)\\"
<< "</IntDir>\n";
@@ -2098,30 +2192,30 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
targetNameFull = this->GeneratorTarget->GetName();
targetNameFull += ".lib";
} else {
- outDir = this->GeneratorTarget->GetDirectory(config->c_str()) + "/";
- targetNameFull = this->GeneratorTarget->GetFullName(config->c_str());
+ outDir = this->GeneratorTarget->GetDirectory(*config) + "/";
+ targetNameFull = this->GeneratorTarget->GetFullName(*config);
}
this->ConvertToWindowsSlash(intermediateDir);
this->ConvertToWindowsSlash(outDir);
- this->WritePlatformConfigTag("OutDir", config->c_str(), 2);
+ this->WritePlatformConfigTag("OutDir", *config, 2);
*this->BuildFileStream << cmVS10EscapeXML(outDir) << "</OutDir>\n";
- this->WritePlatformConfigTag("IntDir", config->c_str(), 2);
+ this->WritePlatformConfigTag("IntDir", *config, 2);
*this->BuildFileStream << cmVS10EscapeXML(intermediateDir)
<< "</IntDir>\n";
if (const char* workingDir = this->GeneratorTarget->GetProperty(
"VS_DEBUGGER_WORKING_DIRECTORY")) {
- this->WritePlatformConfigTag("LocalDebuggerWorkingDirectory",
- config->c_str(), 2);
+ this->WritePlatformConfigTag("LocalDebuggerWorkingDirectory", *config,
+ 2);
*this->BuildFileStream << cmVS10EscapeXML(workingDir)
<< "</LocalDebuggerWorkingDirectory>\n";
}
std::string name =
cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
- this->WritePlatformConfigTag("TargetName", config->c_str(), 2);
+ this->WritePlatformConfigTag("TargetName", *config, 2);
*this->BuildFileStream << cmVS10EscapeXML(name) << "</TargetName>\n";
std::string ext =
@@ -2131,7 +2225,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
// A single "." appears to be treated as an empty extension.
ext = ".";
}
- this->WritePlatformConfigTag("TargetExt", config->c_str(), 2);
+ this->WritePlatformConfigTag("TargetExt", *config, 2);
*this->BuildFileStream << cmVS10EscapeXML(ext) << "</TargetExt>\n";
this->OutputLinkIncremental(*config);
@@ -2146,7 +2240,7 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
if (!this->MSTools) {
return;
}
- if (csproj == this->ProjectType) {
+ if (this->ProjectType == csproj) {
return;
}
// static libraries and things greater than modules do not need
@@ -2158,13 +2252,13 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
Options& linkOptions = *(this->LinkOptions[configName]);
const char* incremental = linkOptions.GetFlag("LinkIncremental");
- this->WritePlatformConfigTag("LinkIncremental", configName.c_str(), 2);
+ this->WritePlatformConfigTag("LinkIncremental", configName, 2);
*this->BuildFileStream << (incremental ? incremental : "true")
<< "</LinkIncremental>\n";
linkOptions.RemoveFlag("LinkIncremental");
const char* manifest = linkOptions.GetFlag("GenerateManifest");
- this->WritePlatformConfigTag("GenerateManifest", configName.c_str(), 2);
+ this->WritePlatformConfigTag("GenerateManifest", configName, 2);
*this->BuildFileStream << (manifest ? manifest : "true")
<< "</GenerateManifest>\n";
linkOptions.RemoveFlag("GenerateManifest");
@@ -2175,7 +2269,7 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
for (const char** f = flags; *f; ++f) {
const char* flag = *f;
if (const char* value = linkOptions.GetFlag(flag)) {
- this->WritePlatformConfigTag(flag, configName.c_str(), 2);
+ this->WritePlatformConfigTag(flag, configName, 2);
*this->BuildFileStream << value << "</" << flag << ">\n";
linkOptions.RemoveFlag(flag);
}
@@ -2219,7 +2313,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
std::string flags;
const std::string& linkLanguage =
- this->GeneratorTarget->GetLinkerLanguage(configName.c_str());
+ this->GeneratorTarget->GetLinkerLanguage(configName);
if (linkLanguage.empty()) {
cmSystemTools::Error(
"CMake can not determine linker language for target: ",
@@ -2250,13 +2344,13 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
baseFlagVar += "_FLAGS";
flags =
this->GeneratorTarget->Target->GetMakefile()->GetRequiredDefinition(
- baseFlagVar.c_str());
+ baseFlagVar);
std::string flagVar =
baseFlagVar + std::string("_") + cmSystemTools::UpperCase(configName);
flags += " ";
flags +=
this->GeneratorTarget->Target->GetMakefile()->GetRequiredDefinition(
- flagVar.c_str());
+ flagVar);
this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
langForClCompile, configName);
}
@@ -2275,7 +2369,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
std::string defineFlags =
this->GeneratorTarget->Target->GetMakefile()->GetDefineFlags();
if (this->MSTools) {
- if (vcxproj == this->ProjectType) {
+ if (this->ProjectType == vcxproj) {
clOptions.FixExceptionHandlingDefault();
clOptions.AddFlag("PrecompiledHeader", "NotUsing");
std::string asmLocation = configName + "/";
@@ -2287,12 +2381,12 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
std::vector<std::string> targetDefines;
switch (this->ProjectType) {
case vcxproj:
- this->GeneratorTarget->GetCompileDefinitions(targetDefines,
- configName.c_str(), "CXX");
+ this->GeneratorTarget->GetCompileDefinitions(targetDefines, configName,
+ "CXX");
break;
case csproj:
- this->GeneratorTarget->GetCompileDefinitions(
- targetDefines, configName.c_str(), "CSharp");
+ this->GeneratorTarget->GetCompileDefinitions(targetDefines, configName,
+ "CSharp");
break;
}
clOptions.AddDefines(targetDefines);
@@ -2332,7 +2426,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
}
}
- if (csproj != this->ProjectType && clOptions.IsManaged()) {
+ if (this->ProjectType != csproj && clOptions.IsManaged()) {
this->Managed = true;
std::string managedType = clOptions.GetFlag("CompileAsManaged");
if (managedType == "Safe") {
@@ -2340,6 +2434,12 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
clOptions.AddFlag("CallingConvention", "");
}
}
+ if (this->ProjectType == csproj) {
+ // /nowin32manifest overrides /win32manifest: parameter
+ if (clOptions.HasFlag("NoWin32Manifest")) {
+ clOptions.RemoveFlag("ApplicationManifest");
+ }
+ }
this->ClOptions[configName] = pOptions.release();
return true;
@@ -2392,8 +2492,7 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
}
// Specify the compiler program database file if configured.
- std::string pdb =
- this->GeneratorTarget->GetCompilePDBPath(configName.c_str());
+ std::string pdb = this->GeneratorTarget->GetCompilePDBPath(configName);
if (!pdb.empty()) {
this->ConvertToWindowsSlash(pdb);
this->WriteString("<ProgramDataBaseFileName>", 3);
@@ -2535,8 +2634,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
cudaOptions.FixCudaCodeGeneration();
std::vector<std::string> targetDefines;
- this->GeneratorTarget->GetCompileDefinitions(targetDefines,
- configName.c_str(), "CUDA");
+ this->GeneratorTarget->GetCompileDefinitions(targetDefines, configName,
+ "CUDA");
cudaOptions.AddDefines(targetDefines);
// Add a definition for the configuration name.
@@ -3006,11 +3105,11 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
linkFlagVarBase += "_LINKER_FLAGS";
flags += " ";
flags += this->GeneratorTarget->Target->GetMakefile()->GetRequiredDefinition(
- linkFlagVarBase.c_str());
+ linkFlagVarBase);
std::string linkFlagVar = linkFlagVarBase + "_" + CONFIG;
flags += " ";
flags += this->GeneratorTarget->Target->GetMakefile()->GetRequiredDefinition(
- linkFlagVar.c_str());
+ linkFlagVar);
const char* targetLinkFlags =
this->GeneratorTarget->GetProperty("LINK_FLAGS");
if (targetLinkFlags) {
@@ -3020,13 +3119,13 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
std::string flagsProp = "LINK_FLAGS_";
flagsProp += CONFIG;
if (const char* flagsConfig =
- this->GeneratorTarget->GetProperty(flagsProp.c_str())) {
+ this->GeneratorTarget->GetProperty(flagsProp)) {
flags += " ";
flags += flagsConfig;
}
cmComputeLinkInformation* pcli =
- this->GeneratorTarget->GetLinkInformation(config.c_str());
+ this->GeneratorTarget->GetLinkInformation(config);
if (!pcli) {
cmSystemTools::Error(
"CMake can not compute cmComputeLinkInformation for target: ",
@@ -3054,8 +3153,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
std::string standardLibsVar = "CMAKE_";
standardLibsVar += linkLanguage;
standardLibsVar += "_STANDARD_LIBRARIES";
- std::string const libs =
- this->Makefile->GetSafeDefinition(standardLibsVar.c_str());
+ std::string const libs = this->Makefile->GetSafeDefinition(standardLibsVar);
cmSystemTools::ParseWindowsCommandLine(libs.c_str(), libVec);
linkOptions.AddFlag("AdditionalDependencies", libVec);
@@ -3083,13 +3181,12 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
std::string targetNameImport;
std::string targetNamePDB;
if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) {
- this->GeneratorTarget->GetExecutableNames(targetName, targetNameFull,
- targetNameImport, targetNamePDB,
- config.c_str());
+ this->GeneratorTarget->GetExecutableNames(
+ targetName, targetNameFull, targetNameImport, targetNamePDB, config);
} else {
this->GeneratorTarget->GetLibraryNames(targetName, targetNameSO,
targetNameFull, targetNameImport,
- targetNamePDB, config.c_str());
+ targetNamePDB, config);
}
if (this->MSTools) {
@@ -3130,11 +3227,11 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
linkOptions.AddFlag("GenerateDebugInformation", "false");
- std::string pdb = this->GeneratorTarget->GetPDBDirectory(config.c_str());
+ std::string pdb = this->GeneratorTarget->GetPDBDirectory(config);
pdb += "/";
pdb += targetNamePDB;
std::string imLib = this->GeneratorTarget->GetDirectory(
- config.c_str(), cmStateEnums::ImportLibraryArtifact);
+ config, cmStateEnums::ImportLibraryArtifact);
imLib += "/";
imLib += targetNameImport;
@@ -3209,7 +3306,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLibOptions(
std::string const& config)
{
cmComputeLinkInformation* pcli =
- this->GeneratorTarget->GetLinkInformation(config.c_str());
+ this->GeneratorTarget->GetLinkInformation(config);
if (!pcli) {
cmSystemTools::Error(
"CMake can not compute cmComputeLinkInformation for target: ",
@@ -3224,8 +3321,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLibOptions(
this->LocalGenerator->GetCurrentBinaryDirectory();
for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
if (l->IsPath && cmVS10IsTargetsFile(l->Value)) {
- std::string path = this->LocalGenerator->ConvertToRelativePath(
- currentBinDir, l->Value.c_str());
+ std::string path =
+ this->LocalGenerator->ConvertToRelativePath(currentBinDir, l->Value);
this->ConvertToWindowsSlash(path);
this->AddTargetsFileAndConfigPair(path, config);
}
@@ -3241,7 +3338,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(
this->GeneratorTarget->GetType() > cmStateEnums::MODULE_LIBRARY) {
return;
}
- if (csproj == this->ProjectType) {
+ if (this->ProjectType == csproj) {
return;
}
Options& linkOptions = *(this->LinkOptions[config]);
@@ -3270,8 +3367,8 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
this->LocalGenerator->GetCurrentBinaryDirectory();
for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
if (l->IsPath) {
- std::string path = this->LocalGenerator->ConvertToRelativePath(
- currentBinDir, l->Value.c_str());
+ std::string path =
+ this->LocalGenerator->ConvertToRelativePath(currentBinDir, l->Value);
this->ConvertToWindowsSlash(path);
if (cmVS10IsTargetsFile(l->Value)) {
vsTargetVec.push_back(path);
@@ -3311,7 +3408,7 @@ void cmVisualStudio10TargetGenerator::WriteMidlOptions(
if (!this->MSTools) {
return;
}
- if (csproj == this->ProjectType) {
+ if (this->ProjectType == csproj) {
return;
}
@@ -3353,17 +3450,20 @@ void cmVisualStudio10TargetGenerator::WriteMidlOptions(
void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
{
+ if (this->ProjectType == csproj) {
+ return;
+ }
for (std::vector<std::string>::const_iterator i =
this->Configurations.begin();
i != this->Configurations.end(); ++i) {
std::vector<std::string> includes;
this->LocalGenerator->GetIncludeDirectories(
- includes, this->GeneratorTarget, "C", i->c_str());
+ includes, this->GeneratorTarget, "C", *i);
for (std::vector<std::string>::iterator ii = includes.begin();
ii != includes.end(); ++ii) {
this->ConvertToWindowsSlash(*ii);
}
- this->WritePlatformConfigTag("ItemDefinitionGroup", i->c_str(), 1);
+ this->WritePlatformConfigTag("ItemDefinitionGroup", *i, 1);
*this->BuildFileStream << "\n";
// output cl compile flags <ClCompile></ClCompile>
if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
@@ -3377,7 +3477,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
// output midl flags <Midl></Midl>
this->WriteMidlOptions(*i, includes);
// write events
- if (csproj != this->ProjectType) {
+ if (this->ProjectType != csproj) {
this->WriteEvents(*i);
}
// output link flags <Link></Link>
@@ -3443,17 +3543,21 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
script += cmVS10EscapeXML(lg->ConstructScript(ccg));
}
comment = cmVS10EscapeComment(comment);
- if (csproj != this->ProjectType) {
+ if (this->ProjectType != csproj) {
this->WriteString("<Message>", 3);
(*this->BuildFileStream) << cmVS10EscapeXML(comment) << "</Message>\n";
this->WriteString("<Command>", 3);
} else {
- if (!comment.empty()) {
+ std::string strippedComment = comment;
+ strippedComment.erase(
+ std::remove(strippedComment.begin(), strippedComment.end(), '\t'),
+ strippedComment.end());
+ if (!comment.empty() && !strippedComment.empty()) {
(*this->BuildFileStream) << "echo " << cmVS10EscapeXML(comment) << "\n";
}
}
(*this->BuildFileStream) << script;
- if (csproj != this->ProjectType) {
+ if (this->ProjectType != csproj) {
(*this->BuildFileStream) << "</Command>";
}
(*this->BuildFileStream) << "\n";
@@ -3497,11 +3601,12 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
this->ConvertToWindowsSlash(path);
(*this->BuildFileStream) << cmVS10EscapeXML(path) << "\">\n";
this->WriteString("<Project>", 3);
- (*this->BuildFileStream)
- << "{" << this->GlobalGenerator->GetGUID(name.c_str()) << "}";
+ (*this->BuildFileStream) << "{" << this->GlobalGenerator->GetGUID(name)
+ << "}";
(*this->BuildFileStream) << "</Project>\n";
this->WriteString("<Name>", 3);
(*this->BuildFileStream) << name << "</Name>\n";
+ this->WriteDotNetReferenceCustomTags(name);
this->WriteString("</ProjectReference>\n", 2);
}
this->WriteString("</ItemGroup>\n", 1);
@@ -3593,10 +3698,10 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences()
this->WriteSingleSDKReference("WindowsIoT", iotExtensionsVersion);
}
}
+ }
- if (hasWrittenItemGroup) {
- this->WriteString("</ItemGroup>\n", 1);
- }
+ if (hasWrittenItemGroup) {
+ this->WriteString("</ItemGroup>\n", 1);
}
}
@@ -3770,7 +3875,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
this->WriteString("<XapOutputs>true</XapOutputs>\n", 2);
this->WriteString("<XapFilename>", 2);
(*this->BuildFileStream)
- << cmVS10EscapeXML(this->Name.c_str())
+ << cmVS10EscapeXML(this->Name)
<< "_$(Configuration)_$(Platform).xap</XapFilename>\n";
}
}
@@ -4289,6 +4394,59 @@ bool cmVisualStudio10TargetGenerator::ForceOld(const std::string& source) const
return true;
}
+void cmVisualStudio10TargetGenerator::GetCSharpSourceProperties(
+ cmSourceFile const* sf, std::map<std::string, std::string>& tags)
+{
+ if (this->ProjectType == csproj) {
+ const cmPropertyMap& props = sf->GetProperties();
+ for (cmPropertyMap::const_iterator p = props.begin(); p != props.end();
+ ++p) {
+ static const std::string propNamePrefix = "VS_CSHARP_";
+ if (p->first.find(propNamePrefix) == 0) {
+ std::string tagName = p->first.substr(propNamePrefix.length());
+ if (!tagName.empty()) {
+ const std::string val = props.GetPropertyValue(p->first);
+ if (!val.empty()) {
+ tags[tagName] = val;
+ } else {
+ tags.erase(tagName);
+ }
+ }
+ }
+ }
+ }
+}
+
+void cmVisualStudio10TargetGenerator::WriteCSharpSourceProperties(
+ const std::map<std::string, std::string>& tags)
+{
+ if (!tags.empty()) {
+ for (std::map<std::string, std::string>::const_iterator i = tags.begin();
+ i != tags.end(); ++i) {
+ this->WriteString("<", 3);
+ (*this->BuildFileStream) << i->first << ">" << cmVS10EscapeXML(i->second)
+ << "</" << i->first << ">\n";
+ }
+ }
+}
+
+void cmVisualStudio10TargetGenerator::GetCSharpSourceLink(
+ cmSourceFile const* sf, std::string& link)
+{
+ std::string f = sf->GetFullPath();
+ if (!this->InSourceBuild) {
+ const std::string stripFromPath =
+ this->Makefile->GetCurrentSourceDirectory();
+ if (f.find(stripFromPath) != std::string::npos) {
+ link = f.substr(stripFromPath.length() + 1);
+ if (const char* l = sf->GetProperty("VS_CSHARP_Link")) {
+ link = l;
+ }
+ this->ConvertToWindowsSlash(link);
+ }
+ }
+}
+
std::string cmVisualStudio10TargetGenerator::GetCMakeFilePath(
const char* relativeFilePath) const
{
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 6106615..fb24f1a 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -3,7 +3,7 @@
#ifndef cmVisualStudioTargetGenerator_h
#define cmVisualStudioTargetGenerator_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <map>
@@ -66,6 +66,7 @@ private:
void WriteAllSources();
void WriteDotNetReferences();
void WriteDotNetReference(std::string const& ref, std::string const& hint);
+ void WriteDotNetReferenceCustomTags(std::string const& ref);
void WriteEmbeddedResourceGroup();
void WriteWinRTReferences();
void WriteWinRTPackageCertificateKeyFile();
@@ -126,6 +127,16 @@ private:
void OutputLinkIncremental(std::string const& configName);
void WriteCustomRule(cmSourceFile const* source,
cmCustomCommand const& command);
+ void WriteCustomRuleCpp(std::string const& config, std::string const& script,
+ std::string const& inputs,
+ std::string const& outputs,
+ std::string const& comment);
+ void WriteCustomRuleCSharp(std::string const& config,
+ std::string const& commandName,
+ std::string const& script,
+ std::string const& inputs,
+ std::string const& outputs,
+ std::string const& comment);
void WriteCustomCommands();
void WriteCustomCommand(cmSourceFile const* sf);
void WriteGroups();
@@ -153,6 +164,12 @@ private:
bool ForceOld(const std::string& source) const;
+ void GetCSharpSourceProperties(cmSourceFile const* sf,
+ std::map<std::string, std::string>& tags);
+ void WriteCSharpSourceProperties(
+ const std::map<std::string, std::string>& tags);
+ void GetCSharpSourceLink(cmSourceFile const* sf, std::string& link);
+
private:
typedef cmVisualStudioGeneratorOptions Options;
typedef std::map<std::string, Options*> OptionsMap;
@@ -187,6 +204,7 @@ private:
cmGeneratedFileStream* BuildFileStream;
cmLocalVisualStudio7Generator* LocalGenerator;
std::set<cmSourceFile const*> SourcesVisited;
+ std::set<std::string> CSharpCustomCommandNames;
bool IsMissingFiles;
std::vector<std::string> AddedFiles;
std::string DefaultArtifactDir;
diff --git a/Source/cmVisualStudio10ToolsetOptions.h b/Source/cmVisualStudio10ToolsetOptions.h
index 4233337..c736a49 100644
--- a/Source/cmVisualStudio10ToolsetOptions.h
+++ b/Source/cmVisualStudio10ToolsetOptions.h
@@ -3,7 +3,7 @@
#ifndef cmVisualStudio10ToolsetOptions_h
#define cmVisualStudio10ToolsetOptions_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 1f808c8..51944fa 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -89,7 +89,7 @@ void cmVisualStudioGeneratorOptions::AddTable(cmVS7FlagTable const* table)
void cmVisualStudioGeneratorOptions::ClearTables()
{
for (int i = 0; i < FlagTableCount; ++i) {
- this->FlagTable[i] = CM_NULLPTR;
+ this->FlagTable[i] = nullptr;
}
}
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 44d2719..8d7942b 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -3,7 +3,7 @@
#ifndef cmVisualStudioGeneratorOptions_h
#define cmVisualStudioGeneratorOptions_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <string>
diff --git a/Source/cmVisualStudioSlnData.h b/Source/cmVisualStudioSlnData.h
index e12047f..9c1dffc 100644
--- a/Source/cmVisualStudioSlnData.h
+++ b/Source/cmVisualStudioSlnData.h
@@ -3,7 +3,7 @@
#ifndef cmVisualStudioSlnData_h
#define cmVisualStudioSlnData_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
#include <string>
diff --git a/Source/cmVisualStudioSlnParser.h b/Source/cmVisualStudioSlnParser.h
index d517324..d6345a8 100644
--- a/Source/cmVisualStudioSlnParser.h
+++ b/Source/cmVisualStudioSlnParser.h
@@ -3,7 +3,7 @@
#ifndef cmVisualStudioSlnParser_h
#define cmVisualStudioSlnParser_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <bitset>
#include <iosfwd>
diff --git a/Source/cmVisualStudioWCEPlatformParser.h b/Source/cmVisualStudioWCEPlatformParser.h
index 75c3d1a..c19691a 100644
--- a/Source/cmVisualStudioWCEPlatformParser.h
+++ b/Source/cmVisualStudioWCEPlatformParser.h
@@ -3,7 +3,7 @@
#ifndef cmVisualStudioWCEPlatformParser_h
#define cmVisualStudioWCEPlatformParser_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
#include <stddef.h>
diff --git a/Source/cmWhileCommand.h b/Source/cmWhileCommand.h
index a95e4c3..dfd5afc 100644
--- a/Source/cmWhileCommand.h
+++ b/Source/cmWhileCommand.h
@@ -3,7 +3,7 @@
#ifndef cmWhileCommand_h
#define cmWhileCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmWriteFileCommand.h b/Source/cmWriteFileCommand.h
index 19922cd..36a08a4 100644
--- a/Source/cmWriteFileCommand.h
+++ b/Source/cmWriteFileCommand.h
@@ -3,7 +3,7 @@
#ifndef cmWriteFileCommand_h
#define cmWriteFileCommand_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index 5c22531..bca39af 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -10,13 +10,12 @@
#include "cmGeneratorTarget.h"
#include "cmXMLSafe.h"
-cmXCodeScheme::cmXCodeScheme(cmXCodeObject* xcObj,
+cmXCodeScheme::cmXCodeScheme(cmXCodeObject* xcObj, const TestObjects& tests,
const std::vector<std::string>& configList,
unsigned int xcVersion)
: Target(xcObj)
+ , Tests(tests)
, TargetName(xcObj->GetTarget()->GetName())
- , BuildableName(xcObj->GetTarget()->GetFullName())
- , TargetId(xcObj->GetId())
, ConfigList(configList)
, XcodeVersion(xcVersion)
{
@@ -58,7 +57,7 @@ void cmXCodeScheme::WriteXCodeXCScheme(std::ostream& fout,
xout.Attribute("version", "1.3");
WriteBuildAction(xout, container);
- WriteTestAction(xout, FindConfiguration("Debug"));
+ WriteTestAction(xout, FindConfiguration("Debug"), container);
WriteLaunchAction(xout, FindConfiguration("Debug"), container);
WriteProfileAction(xout, FindConfiguration("Release"));
WriteAnalyzeAction(xout, FindConfiguration("Debug"));
@@ -84,14 +83,7 @@ void cmXCodeScheme::WriteBuildAction(cmXMLWriter& xout,
xout.Attribute("buildForArchiving", "YES");
xout.Attribute("buildForAnalyzing", "YES");
- xout.StartElement("BuildableReference");
- xout.BreakAttributes();
- xout.Attribute("BuildableIdentifier", "primary");
- xout.Attribute("BlueprintIdentifier", this->TargetId);
- xout.Attribute("BuildableName", this->BuildableName);
- xout.Attribute("BlueprintName", this->TargetName);
- xout.Attribute("ReferencedContainer", "container:" + container);
- xout.EndElement();
+ WriteBuildableReference(xout, this->Target, container);
xout.EndElement(); // BuildActionEntry
xout.EndElement(); // BuildActionEntries
@@ -99,7 +91,8 @@ void cmXCodeScheme::WriteBuildAction(cmXMLWriter& xout,
}
void cmXCodeScheme::WriteTestAction(cmXMLWriter& xout,
- std::string configuration)
+ std::string configuration,
+ const std::string& container)
{
xout.StartElement("TestAction");
xout.BreakAttributes();
@@ -111,8 +104,22 @@ void cmXCodeScheme::WriteTestAction(cmXMLWriter& xout,
xout.Attribute("shouldUseLaunchSchemeArgsEnv", "YES");
xout.StartElement("Testables");
+ for (TestObjects::const_iterator it = this->Tests.begin();
+ it != this->Tests.end(); ++it) {
+ xout.StartElement("TestableReference");
+ xout.BreakAttributes();
+ xout.Attribute("skipped", "NO");
+ WriteBuildableReference(xout, *it, container);
+ xout.EndElement(); // TestableReference
+ }
xout.EndElement();
+ if (IsTestable()) {
+ xout.StartElement("MacroExpansion");
+ WriteBuildableReference(xout, this->Target, container);
+ xout.EndElement(); // MacroExpansion
+ }
+
xout.StartElement("AdditionalOptions");
xout.EndElement();
@@ -146,14 +153,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
xout.StartElement("MacroExpansion");
}
- xout.StartElement("BuildableReference");
- xout.BreakAttributes();
- xout.Attribute("BuildableIdentifier", "primary");
- xout.Attribute("BlueprintIdentifier", this->TargetId);
- xout.Attribute("BuildableName", this->BuildableName);
- xout.Attribute("BlueprintName", this->TargetName);
- xout.Attribute("ReferencedContainer", "container:" + container);
- xout.EndElement();
+ WriteBuildableReference(xout, this->Target, container);
xout.EndElement(); // MacroExpansion
@@ -195,6 +195,20 @@ void cmXCodeScheme::WriteArchiveAction(cmXMLWriter& xout,
xout.EndElement();
}
+void cmXCodeScheme::WriteBuildableReference(cmXMLWriter& xout,
+ const cmXCodeObject* xcObj,
+ const std::string& container)
+{
+ xout.StartElement("BuildableReference");
+ xout.BreakAttributes();
+ xout.Attribute("BuildableIdentifier", "primary");
+ xout.Attribute("BlueprintIdentifier", xcObj->GetId());
+ xout.Attribute("BuildableName", xcObj->GetTarget()->GetFullName());
+ xout.Attribute("BlueprintName", xcObj->GetTarget()->GetName());
+ xout.Attribute("ReferencedContainer", "container:" + container);
+ xout.EndElement();
+}
+
std::string cmXCodeScheme::WriteVersionString()
{
std::ostringstream v;
@@ -215,6 +229,11 @@ std::string cmXCodeScheme::FindConfiguration(const std::string& name)
return name;
}
+bool cmXCodeScheme::IsTestable() const
+{
+ return !this->Tests.empty() || IsExecutable(this->Target);
+}
+
bool cmXCodeScheme::IsExecutable(const cmXCodeObject* target)
{
cmGeneratorTarget* gt = target->GetTarget();
diff --git a/Source/cmXCodeScheme.h b/Source/cmXCodeScheme.h
index 379afed..def75b1 100644
--- a/Source/cmXCodeScheme.h
+++ b/Source/cmXCodeScheme.h
@@ -5,6 +5,8 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <vector>
+
#include "cmGlobalXCodeGenerator.h"
#include "cmSystemTools.h"
#include "cmXCodeObject.h"
@@ -16,7 +18,9 @@
class cmXCodeScheme
{
public:
- cmXCodeScheme(cmXCodeObject* xcObj,
+ typedef std::vector<const cmXCodeObject*> TestObjects;
+
+ cmXCodeScheme(cmXCodeObject* xcObj, const TestObjects& tests,
const std::vector<std::string>& configList,
unsigned int xcVersion);
@@ -25,25 +29,30 @@ public:
private:
const cmXCodeObject* const Target;
+ const TestObjects Tests;
const std::string& TargetName;
- const std::string BuildableName;
- const std::string& TargetId;
const std::vector<std::string>& ConfigList;
const unsigned int XcodeVersion;
void WriteXCodeXCScheme(std::ostream& fout, const std::string& container);
void WriteBuildAction(cmXMLWriter& xout, const std::string& container);
- void WriteTestAction(cmXMLWriter& xout, std::string configuration);
+ void WriteTestAction(cmXMLWriter& xout, std::string configuration,
+ const std::string& container);
void WriteLaunchAction(cmXMLWriter& xout, std::string configuration,
const std::string& container);
void WriteProfileAction(cmXMLWriter& xout, std::string configuration);
void WriteAnalyzeAction(cmXMLWriter& xout, std::string configuration);
void WriteArchiveAction(cmXMLWriter& xout, std::string configuration);
+ void WriteBuildableReference(cmXMLWriter& xout, const cmXCodeObject* xcObj,
+ const std::string& container);
+
std::string WriteVersionString();
std::string FindConfiguration(const std::string& name);
+ bool IsTestable() const;
+
static bool IsExecutable(const cmXCodeObject* target);
};
diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx
index 18afbf3..920e3a5 100644
--- a/Source/cmXMLParser.cxx
+++ b/Source/cmXMLParser.cxx
@@ -11,10 +11,10 @@
cmXMLParser::cmXMLParser()
{
- this->Parser = CM_NULLPTR;
+ this->Parser = nullptr;
this->ParseError = 0;
- this->ReportCallback = CM_NULLPTR;
- this->ReportCallbackData = CM_NULLPTR;
+ this->ReportCallback = nullptr;
+ this->ReportCallbackData = nullptr;
}
cmXMLParser::~cmXMLParser()
@@ -26,7 +26,7 @@ cmXMLParser::~cmXMLParser()
int cmXMLParser::Parse(const char* string)
{
- return (int)this->InitializeParser() &&
+ return this->InitializeParser() &&
this->ParseChunk(string, strlen(string)) && this->CleanupParser();
}
@@ -55,7 +55,7 @@ int cmXMLParser::InitializeParser()
}
// Create the expat XML parser.
- this->Parser = XML_ParserCreate(CM_NULLPTR);
+ this->Parser = XML_ParserCreate(nullptr);
XML_SetElementHandler(static_cast<XML_Parser>(this->Parser),
&cmXMLParserStartElement, &cmXMLParserEndElement);
XML_SetCharacterDataHandler(static_cast<XML_Parser>(this->Parser),
@@ -99,7 +99,7 @@ int cmXMLParser::CleanupParser()
// Clean up the parser.
XML_ParserFree(static_cast<XML_Parser>(this->Parser));
- this->Parser = CM_NULLPTR;
+ this->Parser = nullptr;
return result;
}
@@ -156,7 +156,7 @@ const char* cmXMLParser::FindAttribute(const char** atts,
}
}
}
- return CM_NULLPTR;
+ return nullptr;
}
void cmXMLParserStartElement(void* parser, const char* name, const char** atts)
diff --git a/Source/cmXMLWriter.h b/Source/cmXMLWriter.h
index ed76a88..9d89fec 100644
--- a/Source/cmXMLWriter.h
+++ b/Source/cmXMLWriter.h
@@ -3,7 +3,7 @@
#ifndef cmXMLWiter_h
#define cmXMLWiter_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmXMLSafe.h"
diff --git a/Source/cm_auto_ptr.hxx b/Source/cm_auto_ptr.hxx
index 773602a..1ac9220 100644
--- a/Source/cm_auto_ptr.hxx
+++ b/Source/cm_auto_ptr.hxx
@@ -112,7 +112,7 @@ public:
*
* auto_ptr<X> ptr(new X());
*/
- explicit auto_ptr(X* p = CM_NULLPTR) throw()
+ explicit auto_ptr(X* p = nullptr) throw()
: x_(p)
{
}
@@ -154,7 +154,7 @@ public:
X* release() throw()
{
X* x = this->x_;
- this->x_ = CM_NULLPTR;
+ this->x_ = nullptr;
return x;
}
diff --git a/Source/cm_sys_stat.h b/Source/cm_sys_stat.h
index 26e4baa..796f027 100644
--- a/Source/cm_sys_stat.h
+++ b/Source/cm_sys_stat.h
@@ -7,6 +7,11 @@
typedef unsigned short mode_t;
#endif
+#if defined(WIN32)
+typedef unsigned short uid_t;
+typedef unsigned short gid_t;
+#endif
+
#include <sys/types.h>
// include sys/stat.h after sys/types.h
#include <sys/stat.h>
diff --git a/Source/cm_unordered_map.hxx b/Source/cm_unordered_map.hxx
deleted file mode 100644
index bf38903..0000000
--- a/Source/cm_unordered_map.hxx
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef CM_UNORDERED_MAP_HXX
-#define CM_UNORDERED_MAP_HXX
-
-#include "cmConfigure.h"
-
-#if defined(CMake_HAVE_CXX_UNORDERED_MAP)
-
-#include <unordered_map>
-#define CM_UNORDERED_MAP std::unordered_map
-
-#elif defined(CMAKE_BUILD_WITH_CMAKE)
-
-#include "cmsys/hash_map.hxx"
-#define CM_UNORDERED_MAP cmsys::hash_map
-
-#else
-
-#include <map>
-#define CM_UNORDERED_MAP std::map
-
-#endif
-
-#endif
diff --git a/Source/cm_unordered_set.hxx b/Source/cm_unordered_set.hxx
deleted file mode 100644
index dd1a9a1..0000000
--- a/Source/cm_unordered_set.hxx
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef CM_UNORDERED_SET_HXX
-#define CM_UNORDERED_SET_HXX
-
-#include "cmConfigure.h"
-
-#if defined(CMake_HAVE_CXX_UNORDERED_SET)
-
-#include <unordered_set>
-#define CM_UNORDERED_SET std::unordered_set
-
-#elif defined(CMAKE_BUILD_WITH_CMAKE)
-
-#include "cmsys/hash_set.hxx"
-#define CM_UNORDERED_SET cmsys::hash_set
-
-#else
-
-#include <set>
-#define CM_UNORDERED_SET std::set
-
-#endif
-
-#endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 6894393..425e221 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -32,7 +32,7 @@
#include "cmGraphVizWriter.h"
#include "cmVariableWatch.h"
-#include "cm_unordered_map.hxx"
+#include <unordered_map>
#endif
// only build kdevelop generator on non-windows platforms
@@ -120,7 +120,7 @@
namespace {
#if defined(CMAKE_BUILD_WITH_CMAKE)
-typedef CM_UNORDERED_MAP<std::string, Json::Value> JsonValueMapType;
+typedef std::unordered_map<std::string, Json::Value> JsonValueMapType;
#endif
} // namespace
@@ -163,9 +163,9 @@ cmake::cmake(Role role)
}
#endif
- this->GlobalGenerator = CM_NULLPTR;
- this->ProgressCallback = CM_NULLPTR;
- this->ProgressCallbackClientData = CM_NULLPTR;
+ this->GlobalGenerator = nullptr;
+ this->ProgressCallback = nullptr;
+ this->ProgressCallbackClientData = nullptr;
this->CurrentWorkingMode = NORMAL_MODE;
#ifdef CMAKE_BUILD_WITH_CMAKE
@@ -215,7 +215,7 @@ cmake::~cmake()
delete this->Messenger;
if (this->GlobalGenerator) {
delete this->GlobalGenerator;
- this->GlobalGenerator = CM_NULLPTR;
+ this->GlobalGenerator = nullptr;
}
cmDeleteAll(this->Generators);
#ifdef CMAKE_BUILD_WITH_CMAKE
@@ -555,7 +555,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
gg->CreateGenerationObjects();
cmLocalGenerator* lg = gg->LocalGenerators[0];
std::string includeFlags =
- lg->GetIncludeFlags(includeDirs, CM_NULLPTR, language);
+ lg->GetIncludeFlags(includeDirs, nullptr, language);
std::string definitions = mf->GetSafeDefinition("PACKAGE_DEFINITIONS");
printf("%s %s\n", includeFlags.c_str(), definitions.c_str());
@@ -983,7 +983,7 @@ createExtraGenerator(
}
}
return std::make_pair(
- static_cast<cmExternalMakefileProjectGenerator*>(CM_NULLPTR), name);
+ static_cast<cmExternalMakefileProjectGenerator*>(nullptr), name);
}
cmGlobalGenerator* cmake::CreateGlobalGenerator(const std::string& gname)
@@ -993,7 +993,7 @@ cmGlobalGenerator* cmake::CreateGlobalGenerator(const std::string& gname)
cmExternalMakefileProjectGenerator* extraGenerator = extra.first;
const std::string name = extra.second;
- cmGlobalGenerator* generator = CM_NULLPTR;
+ cmGlobalGenerator* generator = nullptr;
for (RegisteredGeneratorsVector::const_iterator i = this->Generators.begin();
i != this->Generators.end(); ++i) {
generator = (*i)->CreateGlobalGenerator(name, this);
@@ -2127,7 +2127,7 @@ cmInstalledFile const* cmake::GetInstalledFile(const std::string& name) const
cmInstalledFile const& file = i->second;
return &file;
}
- return CM_NULLPTR;
+ return nullptr;
}
int cmake::GetSystemInformation(std::vector<std::string>& args)
diff --git a/Source/cmake.h b/Source/cmake.h
index 4ddacf7..a2054ef 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -3,7 +3,7 @@
#ifndef cmake_h
#define cmake_h
-#include "cmConfigure.h"
+#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
#include <set>
@@ -268,8 +268,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 = CM_NULLPTR);
+ void SetProgressCallback(ProgressCallbackType f, void* clientData = nullptr);
///! this is called by generators to update the progress
void UpdateProgress(const char* msg, float prog);
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index da1fe6d..e6f88a7 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -1,7 +1,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmConfigure.h"
+#include "cmake.h"
#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
#include "cmGlobalGenerator.h"
@@ -9,12 +9,16 @@
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
-#include "cmake.h"
#include "cmcmd.h"
#ifdef CMAKE_BUILD_WITH_CMAKE
#include "cmDocumentation.h"
#include "cmDynamicLoader.h"
+#ifdef _WIN32
+#include <fcntl.h> /* _O_TEXT */
+#include <stdlib.h> /* _set_fmode, _fmode */
+#endif
+#include "cm_uv.h"
#endif
#include "cmsys/Encoding.hxx"
@@ -26,33 +30,24 @@
#include <string>
#include <vector>
-#ifdef CMAKE_USE_LIBUV
-#ifdef _WIN32
-#include <fcntl.h> /* _O_TEXT */
-#include <stdlib.h> /* _set_fmode, _fmode */
-#endif
-#include "cm_uv.h"
-#endif
-
#ifdef CMAKE_BUILD_WITH_CMAKE
static const char* cmDocumentationName[][2] = {
- { CM_NULLPTR, " cmake - Cross-Platform Makefile Generator." },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, " cmake - Cross-Platform Makefile Generator." },
+ { nullptr, nullptr }
};
static const char* cmDocumentationUsage[][2] = {
- { CM_NULLPTR, " cmake [options] <path-to-source>\n"
- " cmake [options] <path-to-existing-build>" },
- { CM_NULLPTR,
- "Specify a source directory to (re-)generate a build system for "
- "it in the current working directory. Specify an existing build "
- "directory to re-generate its build system." },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, " cmake [options] <path-to-source>\n"
+ " cmake [options] <path-to-existing-build>" },
+ { nullptr, "Specify a source directory to (re-)generate a build system for "
+ "it in the current working directory. Specify an existing build "
+ "directory to re-generate its build system." },
+ { nullptr, nullptr }
};
static const char* cmDocumentationUsageNote[][2] = {
- { CM_NULLPTR, "Run 'cmake --help' for more information." },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, "Run 'cmake --help' for more information." },
+ { nullptr, nullptr }
};
#define CMAKE_BUILD_OPTIONS \
@@ -88,7 +83,7 @@ static const char* cmDocumentationOptions[][2] = {
{ "--no-warn-unused-cli", "Don't warn about command line options." },
{ "--check-system-vars", "Find problems with variable usage in system "
"files." },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, nullptr }
};
#endif
@@ -107,14 +102,14 @@ static int do_build(int ac, char const* const* av);
static cmMakefile* cmakemainGetMakefile(void* clientdata)
{
- cmake* cm = (cmake*)clientdata;
+ cmake* cm = reinterpret_cast<cmake*>(clientdata);
if (cm && cm->GetDebugOutput()) {
cmGlobalGenerator* gg = cm->GetGlobalGenerator();
if (gg) {
return gg->GetCurrentMakefile();
}
}
- return CM_NULLPTR;
+ return nullptr;
}
static std::string cmakemainGetStack(void* clientdata)
@@ -172,7 +167,7 @@ int main(int ac, char const* const* av)
ac = args.argc();
av = args.argv();
-#if defined(CMAKE_USE_LIBUV) && defined(_WIN32)
+#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32)
// Perform libuv one-time initialization now, and then un-do its
// global _fmode setting so that using libuv does not change the
// default file text/binary mode. See libuv issue 840.
@@ -197,8 +192,6 @@ int main(int ac, char const* const* av)
int ret = do_cmake(ac, av);
#ifdef CMAKE_BUILD_WITH_CMAKE
cmDynamicLoader::FlushCache();
-#endif
-#ifdef CMAKE_USE_LIBUV
uv_loop_close(uv_default_loop());
#endif
return ret;
@@ -310,8 +303,8 @@ int do_cmake(int ac, char const* const* av)
cmake cm(role);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
- cmSystemTools::SetMessageCallback(cmakemainMessageCallback, (void*)&cm);
- cm.SetProgressCallback(cmakemainProgressCallback, (void*)&cm);
+ cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm);
+ cm.SetProgressCallback(cmakemainProgressCallback, &cm);
cm.SetWorkingMode(workingMode);
int res = cm.Run(args, view_only);
@@ -426,8 +419,8 @@ static int do_build(int ac, char const* const* av)
}
cmake cm(cmake::RoleInternal);
- cmSystemTools::SetMessageCallback(cmakemainMessageCallback, (void*)&cm);
- cm.SetProgressCallback(cmakemainProgressCallback, (void*)&cm);
+ cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm);
+ cm.SetProgressCallback(cmakemainProgressCallback, &cm);
return cm.Build(dir, target, config, nativeOptions, clean);
#endif
}
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index d5b0861..bf5479c 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -15,13 +15,10 @@
#include "cm_auto_ptr.hxx"
#include "cmake.h"
-#if defined(HAVE_SERVER_MODE) && HAVE_SERVER_MODE
-#include "cmServer.h"
-#include "cmServerConnection.h"
-#endif
-
#if defined(CMAKE_BUILD_WITH_CMAKE)
#include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback.
+#include "cmServer.h"
+#include "cmServerConnection.h"
#endif
#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32)
@@ -32,7 +29,6 @@
#include "cmVisualStudioWCEPlatformParser.h"
#endif
-#include "cmConfigure.h"
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
#include "cmsys/Process.h"
@@ -44,6 +40,8 @@
#include <stdlib.h>
#include <time.h>
+class cmConnection;
+
int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
std::vector<std::string>::const_iterator argEnd);
int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
@@ -88,6 +86,11 @@ void CMakeCommandUsage(const char* program)
<< " environment - display the current environment\n"
<< " make_directory <dir>... - create parent and <dir> directories\n"
<< " md5sum <file>... - create MD5 checksum of files\n"
+ << " sha1sum <file>... - create SHA1 checksum of files\n"
+ << " sha224sum <file>... - create SHA224 checksum of files\n"
+ << " sha256sum <file>... - create SHA256 checksum of files\n"
+ << " sha384sum <file>... - create SHA384 checksum of files\n"
+ << " sha512sum <file>... - create SHA512 checksum of files\n"
<< " remove [-f] <file>... - remove the file(s), use -f to force "
"it\n"
<< " remove_directory dir - remove a directory and its contents\n"
@@ -342,8 +345,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Run the iwyu command line. Capture its stderr and hide its stdout.
// Ignore its return code because the tool always returns non-zero.
std::string stdErr;
- if (!cmSystemTools::RunSingleCommand(iwyu_cmd, CM_NULLPTR, &stdErr,
- &ret, CM_NULLPTR,
+ if (!cmSystemTools::RunSingleCommand(iwyu_cmd, nullptr, &stdErr, &ret,
+ nullptr,
cmSystemTools::OUTPUT_NONE)) {
std::cerr << "Error running '" << iwyu_cmd[0] << "': " << stdErr
<< "\n";
@@ -373,7 +376,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
std::string stdOut;
std::string stdErr;
if (!cmSystemTools::RunSingleCommand(tidy_cmd, &stdOut, &stdErr, &ret,
- CM_NULLPTR,
+ nullptr,
cmSystemTools::OUTPUT_NONE)) {
std::cerr << "Error running '" << tidy_cmd[0] << "': " << stdErr
<< "\n";
@@ -403,7 +406,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
std::string stdOut;
std::string stdErr;
if (!cmSystemTools::RunSingleCommand(lwyu_cmd, &stdOut, &stdErr, &ret,
- CM_NULLPTR,
+ nullptr,
cmSystemTools::OUTPUT_NONE)) {
std::cerr << "Error running '" << lwyu_cmd[0] << "': " << stdErr
<< "\n";
@@ -426,7 +429,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Run the cpplint command line. Capture its output.
std::string stdOut;
if (!cmSystemTools::RunSingleCommand(cpplint_cmd, &stdOut, &stdOut,
- &ret, CM_NULLPTR,
+ &ret, nullptr,
cmSystemTools::OUTPUT_NONE)) {
std::cerr << "Error running '" << cpplint_cmd[0] << "': " << stdOut
<< "\n";
@@ -446,7 +449,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Now run the real compiler command and return its result value.
if (lwyu.empty() &&
!cmSystemTools::RunSingleCommand(
- orig_cmd, CM_NULLPTR, CM_NULLPTR, &ret, CM_NULLPTR,
+ orig_cmd, nullptr, nullptr, &ret, nullptr,
cmSystemTools::OUTPUT_PASSTHROUGH)) {
std::cerr << "Error running '" << orig_cmd[0] << "'\n";
return 1;
@@ -497,8 +500,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Execute command from remaining arguments.
std::vector<std::string> cmd(ai, ae);
int retval;
- if (cmSystemTools::RunSingleCommand(cmd, CM_NULLPTR, CM_NULLPTR, &retval,
- CM_NULLPTR,
+ if (cmSystemTools::RunSingleCommand(cmd, nullptr, nullptr, &retval,
+ nullptr,
cmSystemTools::OUTPUT_PASSTHROUGH)) {
return retval;
}
@@ -584,7 +587,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
return 1;
}
cmake cm(cmake::RoleInternal);
-#if defined(HAVE_SERVER_MODE) && HAVE_SERVER_MODE
+#if defined(CMAKE_BUILD_WITH_CMAKE)
std::cout << cm.ReportCapabilities(true);
#else
std::cout << cm.ReportCapabilities(false);
@@ -623,7 +626,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
time(&time_start);
clock_start = clock();
int ret = 0;
- cmSystemTools::RunSingleCommand(command, CM_NULLPTR, CM_NULLPTR, &ret);
+ cmSystemTools::RunSingleCommand(command, nullptr, nullptr, &ret);
clock_finish = clock();
time(&time_finish);
@@ -641,24 +644,28 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Command to calculate the md5sum of a file
if (args[1] == "md5sum" && args.size() >= 3) {
- char md5out[32];
- int retval = 0;
- for (std::string::size_type cc = 2; cc < args.size(); cc++) {
- const char* filename = args[cc].c_str();
- // Cannot compute md5sum of a directory
- if (cmSystemTools::FileIsDirectory(filename)) {
- std::cerr << "Error: " << filename << " is a directory" << std::endl;
- retval++;
- } else if (!cmSystemTools::ComputeFileMD5(filename, md5out)) {
- // To mimic md5sum behavior in a shell:
- std::cerr << filename << ": No such file or directory" << std::endl;
- retval++;
- } else {
- std::cout << std::string(md5out, 32) << " " << filename
- << std::endl;
- }
- }
- return retval;
+ return HashSumFile(args, cmCryptoHash::AlgoMD5);
+ }
+
+ // Command to calculate the sha1sum of a file
+ if (args[1] == "sha1sum" && args.size() >= 3) {
+ return HashSumFile(args, cmCryptoHash::AlgoSHA1);
+ }
+
+ if (args[1] == "sha224sum" && args.size() >= 3) {
+ return HashSumFile(args, cmCryptoHash::AlgoSHA224);
+ }
+
+ if (args[1] == "sha256sum" && args.size() >= 3) {
+ return HashSumFile(args, cmCryptoHash::AlgoSHA256);
+ }
+
+ if (args[1] == "sha384sum" && args.size() >= 3) {
+ return HashSumFile(args, cmCryptoHash::AlgoSHA384);
+ }
+
+ if (args[1] == "sha512sum" && args.size() >= 3) {
+ return HashSumFile(args, cmCryptoHash::AlgoSHA512);
}
// Command to change directory and run a program.
@@ -675,8 +682,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
int retval = 0;
int timeout = 0;
if (cmSystemTools::RunSingleCommand(
- command.c_str(), CM_NULLPTR, CM_NULLPTR, &retval,
- directory.c_str(), cmSystemTools::OUTPUT_PASSTHROUGH, timeout)) {
+ command.c_str(), nullptr, nullptr, &retval, directory.c_str(),
+ cmSystemTools::OUTPUT_PASSTHROUGH, timeout)) {
return retval;
}
@@ -1012,8 +1019,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
return 1;
}
}
-#if defined(HAVE_SERVER_MODE) && HAVE_SERVER_MODE
- cmServerConnection* conn;
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ cmConnection* conn;
if (isDebug) {
conn = new cmServerStdIoConnection;
} else {
@@ -1074,6 +1081,33 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
return 1;
}
+int cmcmd::HashSumFile(std::vector<std::string>& args, cmCryptoHash::Algo algo)
+{
+ if (args.size() < 3) {
+ return -1;
+ }
+ int retval = 0;
+
+ for (std::string::size_type cc = 2; cc < args.size(); cc++) {
+ const char* filename = args[cc].c_str();
+ // Cannot compute sum of a directory
+ if (cmSystemTools::FileIsDirectory(filename)) {
+ std::cerr << "Error: " << filename << " is a directory" << std::endl;
+ retval++;
+ } else {
+ std::string value = cmSystemTools::ComputeFileHash(filename, algo);
+ if (value.empty()) {
+ // To mimic "md5sum/shasum" behavior in a shell:
+ std::cerr << filename << ": No such file or directory" << std::endl;
+ retval++;
+ } else {
+ std::cout << value << " " << filename << std::endl;
+ }
+ }
+ }
+ return retval;
+}
+
int cmcmd::SymlinkLibrary(std::vector<std::string>& args)
{
int result = 0;
@@ -1277,7 +1311,7 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string>& args)
}
// Setup this command line.
- const char* cmd[2] = { command.c_str(), CM_NULLPTR };
+ const char* cmd[2] = { command.c_str(), nullptr };
cmsysProcess_SetCommand(cp, cmd);
// Report the command if verbose output is enabled.
@@ -1287,7 +1321,7 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string>& args)
// Run the command and wait for it to exit.
cmsysProcess_Execute(cp);
- cmsysProcess_WaitForExit(cp, CM_NULLPTR);
+ cmsysProcess_WaitForExit(cp, nullptr);
// Report failure if any.
switch (cmsysProcess_GetState(cp)) {
@@ -1404,7 +1438,7 @@ int cmcmd::VisualStudioLink(std::vector<std::string>& args, int type)
}
static bool RunCommand(const char* comment, std::vector<std::string>& command,
- bool verbose, int* retCodeOut = CM_NULLPTR)
+ bool verbose, int* retCodeOut = nullptr)
{
if (verbose) {
std::cout << comment << ":\n";
@@ -1413,9 +1447,8 @@ static bool RunCommand(const char* comment, std::vector<std::string>& command,
std::string output;
int retCode = 0;
// use rc command to create .res file
- bool res =
- cmSystemTools::RunSingleCommand(command, &output, &output, &retCode,
- CM_NULLPTR, cmSystemTools::OUTPUT_NONE);
+ bool res = cmSystemTools::RunSingleCommand(
+ command, &output, &output, &retCode, nullptr, cmSystemTools::OUTPUT_NONE);
// always print the output of the command, unless
// it is the dumb rc command banner, but if the command
// returned an error code then print the output anyway as
diff --git a/Source/cmcmd.h b/Source/cmcmd.h
index 929f1ae..faac1d2 100644
--- a/Source/cmcmd.h
+++ b/Source/cmcmd.h
@@ -4,6 +4,7 @@
#define cmcmd_h
#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmCryptoHash.h"
#include <string>
#include <vector>
@@ -18,6 +19,8 @@ public:
static int ExecuteCMakeCommand(std::vector<std::string>&);
protected:
+ static int HashSumFile(std::vector<std::string>& args,
+ cmCryptoHash::Algo algo);
static int SymlinkLibrary(std::vector<std::string>& args);
static int SymlinkExecutable(std::vector<std::string>& args);
static bool SymlinkInternal(std::string const& file,
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 84e815d..fe24a72 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -1,6 +1,5 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmConfigure.h"
#include "CTest/cmCTestLaunch.h"
#include "CTest/cmCTestScriptHandler.h"
@@ -18,13 +17,13 @@
#include <vector>
static const char* cmDocumentationName[][2] = {
- { CM_NULLPTR, " ctest - Testing driver provided by CMake." },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, " ctest - Testing driver provided by CMake." },
+ { nullptr, nullptr }
};
-static const char* cmDocumentationUsage[][2] = { { CM_NULLPTR,
+static const char* cmDocumentationUsage[][2] = { { nullptr,
" ctest [options]" },
- { CM_NULLPTR, CM_NULLPTR } };
+ { nullptr, nullptr } };
static const char* cmDocumentationOptions[][2] = {
{ "-C <cfg>, --build-config <cfg>", "Choose configuration to test." },
@@ -83,6 +82,8 @@ static const char* cmDocumentationOptions[][2] = {
{ "--max-width <width>", "Set the max width for a test name to output" },
{ "--interactive-debug-mode [0|1]", "Set the interactive mode to 0 or 1." },
{ "--no-label-summary", "Disable timing summary information for labels." },
+ { "--no-subproject-summary", "Disable timing summary information for "
+ "subprojects." },
{ "--build-and-test", "Configure, build and run a test." },
{ "--build-target", "Specify a specific target to build." },
{ "--build-nocmake", "Run the build without running cmake first." },
@@ -118,7 +119,7 @@ static const char* cmDocumentationOptions[][2] = {
{ "--http1.0", "Submit using HTTP 1.0." },
{ "--no-compress-output", "Do not compress test output when submitting." },
{ "--print-labels", "Print all available test labels." },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, nullptr }
};
// this is a test driver program for cmCTest.
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index e915b1a..d7d0c51 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -20,6 +20,21 @@
# KWSYS_HEADER_ROOT = The directory into which to generate the kwsys headers.
# A directory called "${KWSYS_NAMESPACE}" will be
# created under this root directory to hold the files.
+# KWSYS_SPLIT_OBJECTS_FROM_INTERFACE
+# = Instead of creating a single ${KWSYS_NAMESPACE} library
+# target, create three separate targets:
+# ${KWSYS_NAMESPACE}
+# - An INTERFACE library only containing usage
+# requirements.
+# ${KWSYS_NAMESPACE}_objects
+# - An OBJECT library for the built kwsys objects.
+# Note: This is omitted from the install rules
+# ${KWSYS_NAMESPACE}_private
+# - An INTERFACE library combining both that is
+# appropriate for use with PRIVATE linking in
+# target_link_libraries. Because of how interface
+# properties propagate, this target is not suitable
+# for use with PUBLIC or INTERFACE linking.
#
# Example:
#
@@ -79,6 +94,10 @@ FOREACH(p
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.
# This should be the case only when kwsys is not included inside
@@ -430,6 +449,11 @@ SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c System.c PROPERTIES
COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}"
)
+IF(DEFINED KWSYS_PROCESS_USE_SELECT)
+ GET_PROPERTY(ProcessUNIX_FLAGS SOURCE ProcessUNIX.c PROPERTY COMPILE_FLAGS)
+ SET_PROPERTY(SOURCE ProcessUNIX.c PROPERTY COMPILE_FLAGS "${ProcessUNIX_FLAGS} -DKWSYSPE_USE_SELECT=${KWSYSPE_USE_SELECT}")
+ENDIF()
+
IF(KWSYS_USE_DynamicLoader)
GET_PROPERTY(KWSYS_SUPPORTS_SHARED_LIBS GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
IF(KWSYS_SUPPORTS_SHARED_LIBS)
@@ -795,68 +819,144 @@ ENDFOREACH()
#-----------------------------------------------------------------------------
# Add the library with the configured name and list of sources.
IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS)
- ADD_LIBRARY(${KWSYS_NAMESPACE} ${KWSYS_LIBRARY_TYPE}
- ${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS})
- SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY C_CLANG_TIDY "")
- SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY CXX_CLANG_TIDY "")
- SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY C_INCLUDE_WHAT_YOU_USE "")
- SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY CXX_INCLUDE_WHAT_YOU_USE "")
- SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY LABELS ${KWSYS_LABELS_LIB})
+ IF(KWSYS_SPLIT_OBJECTS_FROM_INTERFACE)
+ SET(KWSYS_TARGET_INTERFACE ${KWSYS_NAMESPACE})
+ SET(KWSYS_TARGET_OBJECT ${KWSYS_NAMESPACE}_objects)
+ SET(KWSYS_TARGET_LINK ${KWSYS_NAMESPACE}_private)
+ SET(KWSYS_TARGET_INSTALL ${KWSYS_TARGET_INTERFACE} ${KWSYS_TARGET_LINK})
+ SET(KWSYS_LINK_DEPENDENCY INTERFACE)
+ ADD_LIBRARY(${KWSYS_TARGET_OBJECT} OBJECT
+ ${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS})
+ IF(KWSYS_BUILD_SHARED)
+ SET_PROPERTY(TARGET ${KWSYS_TARGET_OBJECT} PROPERTY
+ POSITION_INDEPENDENT_CODE TRUE)
+ ENDIF()
+ ADD_LIBRARY(${KWSYS_TARGET_INTERFACE} INTERFACE)
+ ADD_LIBRARY(${KWSYS_TARGET_LINK} INTERFACE)
+ TARGET_LINK_LIBRARIES(${KWSYS_TARGET_LINK} INTERFACE
+ ${KWSYS_TARGET_INTERFACE})
+ TARGET_SOURCES(${KWSYS_TARGET_LINK} INTERFACE
+ $<TARGET_OBJECTS:${KWSYS_TARGET_OBJECT}>)
+ ELSE()
+ SET(KWSYS_TARGET_INTERFACE ${KWSYS_NAMESPACE})
+ SET(KWSYS_TARGET_OBJECT ${KWSYS_NAMESPACE})
+ SET(KWSYS_TARGET_LINK ${KWSYS_NAMESPACE})
+ set(KWSYS_TARGET_INSTALL ${KWSYS_TARGET_LINK})
+ SET(KWSYS_LINK_DEPENDENCY PUBLIC)
+ ADD_LIBRARY(${KWSYS_TARGET_INTERFACE} ${KWSYS_LIBRARY_TYPE}
+ ${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS})
+ ENDIF()
+ SET_TARGET_PROPERTIES(${KWSYS_TARGET_OBJECT} PROPERTIES
+ C_CLANG_TIDY ""
+ CXX_CLANG_TIDY ""
+ C_INCLUDE_WHAT_YOU_USE ""
+ CXX_INCLUDE_WHAT_YOU_USE ""
+ LABELS "${KWSYS_LABELS_LIB}")
IF(KWSYS_USE_DynamicLoader)
IF(UNIX)
- TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${CMAKE_DL_LIBS})
+ TARGET_LINK_LIBRARIES(${KWSYS_TARGET_INTERFACE} ${KWSYS_LINK_DEPENDENCY}
+ ${CMAKE_DL_LIBS})
ENDIF()
ENDIF()
IF(KWSYS_USE_SystemInformation)
IF(WIN32)
- TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ws2_32)
+ TARGET_LINK_LIBRARIES(${KWSYS_TARGET_INTERFACE} ${KWSYS_LINK_DEPENDENCY} ws2_32)
IF(KWSYS_SYS_HAS_PSAPI)
- TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} Psapi)
+ TARGET_LINK_LIBRARIES(${KWSYS_TARGET_INTERFACE} ${KWSYS_LINK_DEPENDENCY}
+ Psapi)
ENDIF()
ELSEIF(UNIX)
IF (EXECINFO_LIB AND KWSYS_CXX_HAS_BACKTRACE)
# backtrace on FreeBSD is not in libc
- TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${EXECINFO_LIB})
+ TARGET_LINK_LIBRARIES(${KWSYS_TARGET_INTERFACE} ${KWSYS_LINK_DEPENDENCY}
+ ${EXECINFO_LIB})
ENDIF()
IF (KWSYS_CXX_HAS_DLADDR)
# for symbol lookup using dladdr
- TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${CMAKE_DL_LIBS})
+ TARGET_LINK_LIBRARIES(${KWSYS_TARGET_INTERFACE} ${KWSYS_LINK_DEPENDENCY}
+ ${CMAKE_DL_LIBS})
ENDIF()
IF (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
- TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} socket)
+ TARGET_LINK_LIBRARIES(${KWSYS_TARGET_INTERFACE} ${KWSYS_LINK_DEPENDENCY}
+ socket)
ENDIF()
ENDIF()
ENDIF()
# Apply user-defined target properties to the library.
IF(KWSYS_PROPERTIES_CXX)
- SET_TARGET_PROPERTIES(${KWSYS_NAMESPACE} PROPERTIES
- ${KWSYS_PROPERTIES_CXX}
- )
+ SET_TARGET_PROPERTIES(${KWSYS_TARGET_INTERFACE} PROPERTIES
+ ${KWSYS_PROPERTIES_CXX})
+ ENDIF()
+
+ # Set up include usage requirement
+ IF(COMMAND TARGET_INCLUDE_DIRECTORIES)
+ TARGET_INCLUDE_DIRECTORIES(${KWSYS_TARGET_INTERFACE} INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+ IF(KWSYS_INSTALL_INCLUDE_DIR)
+ TARGET_INCLUDE_DIRECTORIES(${KWSYS_TARGET_INTERFACE} INTERFACE
+ $<INSTALL_INTERFACE:${KWSYS_INSTALL_INCLUDE_DIR}>)
+ ENDIF()
ENDIF()
# Create an install target for the library.
IF(KWSYS_INSTALL_LIBRARY_RULE)
- INSTALL(TARGETS ${KWSYS_NAMESPACE} ${KWSYS_INSTALL_LIBRARY_RULE})
+ INSTALL(TARGETS ${KWSYS_TARGET_INSTALL} ${KWSYS_INSTALL_LIBRARY_RULE})
ENDIF()
ENDIF()
# Add a C-only library if requested.
IF(KWSYS_ENABLE_C AND KWSYS_C_SRCS)
- ADD_LIBRARY(${KWSYS_NAMESPACE}_c ${KWSYS_LIBRARY_TYPE} ${KWSYS_C_SRCS})
- SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}_c PROPERTY LABELS ${KWSYS_LABELS_LIB})
+ IF(KWSYS_SPLIT_OBJECTS_FROM_INTERFACE)
+ SET(KWSYS_TARGET_C_INTERFACE ${KWSYS_NAMESPACE}_c)
+ SET(KWSYS_TARGET_C_OBJECT ${KWSYS_NAMESPACE}_c_objects)
+ SET(KWSYS_TARGET_C_LINK ${KWSYS_NAMESPACE}_c_private)
+ SET(KWSYS_TARGET_C_INSTALL
+ ${KWSYS_TARGET_C_INTERFACE} ${KWSYS_TARGET_C_LINK})
+ SET(KWSYS_LINK_DEPENDENCY INTERFACE)
+ ADD_LIBRARY(${KWSYS_TARGET_C_OBJECT} OBJECT ${KWSYS_C_SRCS})
+ IF(KWSYS_BUILD_SHARED)
+ SET_PROPERTY(TARGET ${KWSYS_TARGET_C_OBJECT} PROPERTY
+ POSITION_INDEPENDENT_CODE TRUE)
+ ENDIF()
+ ADD_LIBRARY(${KWSYS_TARGET_C_INTERFACE} INTERFACE)
+ ADD_LIBRARY(${KWSYS_TARGET_C_LINK} INTERFACE)
+ TARGET_LINK_LIBRARIES(${KWSYS_TARGET_C_LINK} INTERFACE
+ ${KWSYS_TARGET_C_INTERFACE})
+ TARGET_SOURCES(${KWSYS_TARGET_C_LINK} INTERFACE
+ $<TARGET_OBJECTS:${KWSYS_TARGET_C_OBJECT}>)
+ ELSE()
+ SET(KWSYS_TARGET_C_INTERFACE ${KWSYS_NAMESPACE}_c)
+ SET(KWSYS_TARGET_C_OBJECT ${KWSYS_NAMESPACE}_c)
+ SET(KWSYS_TARGET_C_LINK ${KWSYS_NAMESPACE}_c)
+ SET(KWSYS_TARGET_C_INSTALL ${KWSYS_TARGET_C_LINK})
+ SET(KWSYS_LINK_DEPENDENCY PUBLIC)
+ ADD_LIBRARY(${KWSYS_TARGET_C_INTERFACE} ${KWSYS_LIBRARY_TYPE}
+ ${KWSYS_C_SRCS})
+ ENDIF()
+ SET_TARGET_PROPERTIES(${KWSYS_TARGET_C_OBJECT} PROPERTIES
+ LABELS "${KWSYS_LABELS_LIB}")
# Apply user-defined target properties to the library.
IF(KWSYS_PROPERTIES_C)
- SET_TARGET_PROPERTIES(${KWSYS_NAMESPACE}_c PROPERTIES
- ${KWSYS_PROPERTIES_C}
- )
+ SET_TARGET_PROPERTIES(${KWSYS_TARGET_C_INTERFACE} PROPERTIES
+ ${KWSYS_PROPERTIES_C})
+ ENDIF()
+
+ # Set up include usage requirement
+ IF(COMMAND TARGET_INCLUDE_DIRECTORIES)
+ TARGET_INCLUDE_DIRECTORIES(${KWSYS_TARGET_C_INTERFACE} INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+ IF(KWSYS_INSTALL_INCLUDE_DIR)
+ TARGET_INCLUDE_DIRECTORIES(${KWSYS_TARGET_C_INTERFACE} INTERFACE
+ $<INSTALL_INTERFACE:${KWSYS_INSTALL_INCLUDE_DIR}>)
+ ENDIF()
ENDIF()
# Create an install target for the library.
IF(KWSYS_INSTALL_LIBRARY_RULE)
- INSTALL(TARGETS ${KWSYS_NAMESPACE}_c ${KWSYS_INSTALL_LIBRARY_RULE})
+ INSTALL(TARGETS ${KWSYS_TARGET_C_INSTALL})
ENDIF()
ENDIF()
@@ -915,7 +1015,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
)
ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestsC ${KWSYS_C_TEST_SRCS})
SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsC PROPERTY LABELS ${KWSYS_LABELS_EXE})
- TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestsC ${KWSYS_NAMESPACE}_c)
+ TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestsC ${KWSYS_TARGET_C_LINK})
FOREACH(test ${KWSYS_C_TESTS})
ADD_TEST(kwsys.${test} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsC ${test} ${KWSYS_TEST_ARGS_${test}})
SET_PROPERTY(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST})
@@ -950,7 +1050,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET_PROPERTY(TARGET testConsoleBufChild PROPERTY C_INCLUDE_WHAT_YOU_USE "")
SET_PROPERTY(TARGET testConsoleBufChild PROPERTY CXX_INCLUDE_WHAT_YOU_USE "")
SET_PROPERTY(TARGET testConsoleBufChild PROPERTY LABELS ${KWSYS_LABELS_EXE})
- TARGET_LINK_LIBRARIES(testConsoleBufChild ${KWSYS_NAMESPACE})
+ TARGET_LINK_LIBRARIES(testConsoleBufChild ${KWSYS_TARGET_LINK})
SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS}
testConsoleBuf
)
@@ -969,7 +1069,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
# If kwsys contains the DynamicLoader, need extra library
ADD_LIBRARY(${KWSYS_NAMESPACE}TestDynload MODULE testDynload.c)
SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestDynload PROPERTY LABELS ${KWSYS_LABELS_LIB})
- ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestDynload ${KWSYS_NAMESPACE})
+ ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestDynload ${KWSYS_TARGET_INTERFACE})
ENDIF()
CREATE_TEST_SOURCELIST(
KWSYS_CXX_TEST_SRCS ${KWSYS_NAMESPACE}TestsCxx.cxx
@@ -981,7 +1081,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsCxx PROPERTY C_INCLUDE_WHAT_YOU_USE "")
SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsCxx PROPERTY CXX_INCLUDE_WHAT_YOU_USE "")
SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsCxx PROPERTY LABELS ${KWSYS_LABELS_EXE})
- TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestsCxx ${KWSYS_NAMESPACE})
+ TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestsCxx ${KWSYS_TARGET_LINK})
SET(TEST_SYSTEMTOOLS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
SET(TEST_SYSTEMTOOLS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
@@ -1032,7 +1132,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
# Process tests.
ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestProcess testProcess.c)
SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestProcess PROPERTY LABELS ${KWSYS_LABELS_EXE})
- TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestProcess ${KWSYS_NAMESPACE}_c)
+ TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestProcess ${KWSYS_TARGET_C_LINK})
IF(NOT CYGWIN)
SET(KWSYS_TEST_PROCESS_7 7)
ENDIF()
@@ -1060,7 +1160,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestSharedForward
${PROJECT_BINARY_DIR}/testSharedForward.c)
SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestSharedForward PROPERTY LABELS ${KWSYS_LABELS_EXE})
- ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestSharedForward ${KWSYS_NAMESPACE}_c)
+ ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestSharedForward ${KWSYS_TARGET_C_LINK})
ADD_TEST(kwsys.testSharedForward ${EXEC_DIR}/${KWSYS_NAMESPACE}TestSharedForward 1)
SET_PROPERTY(TEST kwsys.testSharedForward PROPERTY LABELS ${KWSYS_LABELS_TEST})
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index 9ebcfce..3b32ca7 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -99,7 +99,8 @@ static inline void kwsysProcess_usleep(unsigned int msec)
* pipes' file handles to be non-blocking and just poll them directly
* without select().
*/
-#if !defined(__BEOS__) && !defined(__VMS) && !defined(__MINT__)
+#if !defined(__BEOS__) && !defined(__VMS) && !defined(__MINT__) && \
+ !defined(KWSYSPE_USE_SELECT)
#define KWSYSPE_USE_SELECT 1
#endif
diff --git a/Source/kwsys/RegularExpression.cxx b/Source/kwsys/RegularExpression.cxx
index 6d7f832..26e84e0 100644
--- a/Source/kwsys/RegularExpression.cxx
+++ b/Source/kwsys/RegularExpression.cxx
@@ -258,11 +258,6 @@ const unsigned char MAGIC = 0234;
#define UCHARAT(p) (reinterpret_cast<const unsigned char*>(p))[0]
-#define FAIL(m) \
- { \
- regerror(m); \
- return (0); \
- }
#define ISMULT(c) ((c) == '*' || (c) == '+' || (c) == '?')
#define META "^$.[()|?+*\\"
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 1c4fe33..11f3b81 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -22,7 +22,6 @@
#include KWSYS_HEADER(FStream.hxx)
#include KWSYS_HEADER(Encoding.hxx)
-#include <algorithm>
#include <fstream>
#include <iostream>
#include <set>
@@ -848,6 +847,8 @@ void SystemTools::ReplaceString(std::string& source, const char* replace,
free(orig);
}
+#if defined(_WIN32) && !defined(__CYGWIN__)
+
#if defined(KEY_WOW64_32KEY) && defined(KEY_WOW64_64KEY)
#define KWSYS_ST_KEY_WOW64_32KEY KEY_WOW64_32KEY
#define KWSYS_ST_KEY_WOW64_64KEY KEY_WOW64_64KEY
@@ -856,7 +857,6 @@ void SystemTools::ReplaceString(std::string& source, const char* replace,
#define KWSYS_ST_KEY_WOW64_64KEY 0x0100
#endif
-#if defined(_WIN32) && !defined(__CYGWIN__)
static bool SystemToolsParseRegistryKey(const std::string& key,
HKEY& primaryKey, std::string& second,
std::string& valuename)
@@ -3709,16 +3709,6 @@ std::string SystemTools::JoinPath(
return result;
}
-void SystemTools::RemoveEmptyPathElements(std::vector<std::string>& path)
-{
- if (path.empty()) {
- return;
- }
-
- path.erase(std::remove(path.begin() + 1, path.end(), std::string("")),
- path.end());
-}
-
bool SystemTools::ComparePath(const std::string& c1, const std::string& c2)
{
#if defined(_WIN32) || defined(__APPLE__)
@@ -3807,11 +3797,7 @@ std::string SystemTools::GetFilenamePath(const std::string& filename)
*/
std::string SystemTools::GetFilenameName(const std::string& filename)
{
-#if defined(_WIN32)
std::string::size_type slash_pos = filename.find_last_of("/\\");
-#else
- std::string::size_type slash_pos = filename.rfind('/');
-#endif
if (slash_pos != std::string::npos) {
return filename.substr(slash_pos + 1);
} else {
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index 5e091c2..1672e92 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -461,6 +461,10 @@ public:
* produce the original path. Home directory references are
* automatically expanded if expand_home_dir is true and this
* platform supports them.
+ *
+ * This does *not* normalize the input path. All components are
+ * preserved, including empty ones. Typically callers should use
+ * this only on paths that have already been normalized.
*/
static void SplitPath(const std::string& p,
std::vector<std::string>& components,
@@ -469,15 +473,15 @@ public:
/**
* Join components of a path name into a single string. See
* SplitPath for the format of the components.
+ *
+ * This does *not* normalize the input path. All components are
+ * preserved, including empty ones. Typically callers should use
+ * this only on paths that have already been normalized.
*/
static std::string JoinPath(const std::vector<std::string>& components);
static std::string JoinPath(std::vector<std::string>::const_iterator first,
std::vector<std::string>::const_iterator last);
- /** Removes empty components from path.
- */
- static void RemoveEmptyPathElements(std::vector<std::string>& path);
-
/**
* Compare a path or components of a path.
*/
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index e6fbf6c..1871f5d 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -758,6 +758,30 @@ static bool CheckGetPath()
return res;
}
+static bool CheckGetFilenameName()
+{
+ const char* windowsFilepath = "C:\\somewhere\\something";
+ const char* unixFilepath = "/somewhere/something";
+
+ std::string expectedFilename = "something";
+
+ bool res = true;
+ std::string filename = kwsys::SystemTools::GetFilenameName(windowsFilepath);
+ if (filename != expectedFilename) {
+ std::cerr << "GetFilenameName(" << windowsFilepath << ") yielded "
+ << filename << " instead of " << expectedFilename << std::endl;
+ res = false;
+ }
+
+ filename = kwsys::SystemTools::GetFilenameName(unixFilepath);
+ if (filename != expectedFilename) {
+ std::cerr << "GetFilenameName(" << unixFilepath << ") yielded " << filename
+ << " instead of " << expectedFilename << std::endl;
+ res = false;
+ }
+ return res;
+}
+
static bool CheckFind()
{
bool res = true;
@@ -875,5 +899,7 @@ int testSystemTools(int, char* [])
res &= CheckGetLineFromStream();
+ res &= CheckGetFilenameName();
+
return res ? 0 : 1;
}
diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt
index e156420..fc70135 100644
--- a/Tests/AliasTarget/CMakeLists.txt
+++ b/Tests/AliasTarget/CMakeLists.txt
@@ -4,13 +4,6 @@ project(AliasTarget)
set(CMAKE_CXX_STANDARD 98)
-# Those versions of the HP compiler that need a flag to get proper C++98
-# template support also need a flag to use the newer C++ library.
-if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
- CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
- string(APPEND CMAKE_CXX_FLAGS " -AA")
-endif ()
-
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx
index 46431bc..0d692ca 100644
--- a/Tests/CMakeLib/run_compile_commands.cxx
+++ b/Tests/CMakeLib/run_compile_commands.cxx
@@ -1,4 +1,4 @@
-#include <cmConfigure.h>
+#include "cmConfigure.h" // IWYU pragma: keep
#include "cmsys/FStream.hxx"
#include <iostream>
@@ -150,8 +150,7 @@ int main()
it != end; ++it) {
std::vector<std::string> command;
cmSystemTools::ParseUnixCommandLine(it->at("command").c_str(), command);
- if (!cmSystemTools::RunSingleCommand(command, CM_NULLPTR, CM_NULLPTR,
- CM_NULLPTR,
+ if (!cmSystemTools::RunSingleCommand(command, nullptr, nullptr, nullptr,
it->at("directory").c_str())) {
std::cout << "ERROR: Failed to run command \"" << command[0] << "\""
<< std::endl;
diff --git a/Tests/CMakeLib/testUTF8.cxx b/Tests/CMakeLib/testUTF8.cxx
index fb5f3d8..c99c46d 100644
--- a/Tests/CMakeLib/testUTF8.cxx
+++ b/Tests/CMakeLib/testUTF8.cxx
@@ -8,8 +8,9 @@ typedef char test_utf8_char[5];
static void test_utf8_char_print(test_utf8_char const c)
{
unsigned char const* d = reinterpret_cast<unsigned char const*>(c);
- printf("[0x%02X,0x%02X,0x%02X,0x%02X]", (int)d[0], (int)d[1], (int)d[2],
- (int)d[3]);
+ printf("[0x%02X,0x%02X,0x%02X,0x%02X]", static_cast<int>(d[0]),
+ static_cast<int>(d[1]), static_cast<int>(d[2]),
+ static_cast<int>(d[3]));
}
struct test_utf8_entry
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/.gitattributes b/Tests/CMakeLib/testVisualStudioSlnParser_data/.gitattributes
index 5be3dc5..08b4ac4 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/.gitattributes
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/.gitattributes
@@ -1 +1 @@
-*.sln-file -crlf whitespace=cr-at-eol
+*.sln-file eol=crlf
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/bom.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/bom.sln-file
index 52c2483..f8c432f 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/bom.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/bom.sln-file
@@ -1,2 +1,2 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-data.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-data.sln-file
index bd66ed4..4656046 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-data.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-data.sln-file
@@ -1,6 +1,6 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
-EndProject
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
+EndProject
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-global.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-global.sln-file
index 32176b8..d65d82a 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-global.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-global.sln-file
@@ -1,9 +1,9 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Global
-EndGlobalSection
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Global
+EndGlobalSection
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-header.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-header.sln-file
index f838a71..cc6d1b8 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-header.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-header.sln-file
@@ -1,4 +1,4 @@
-Microsoft Visual Studio Solution2 File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
-EndProject
+Microsoft Visual Studio Solution2 File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
+EndProject
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectArgs.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectArgs.sln-file
index 3e8d35a..31ed7b8 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectArgs.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectArgs.sln-file
@@ -1,4 +1,4 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj"
-EndProject
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj"
+EndProject
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectContents.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectContents.sln-file
index e0d58c9..a2eb7ba 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectContents.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectContents.sln-file
@@ -1,6 +1,6 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
- Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous2", "Continuous2.vcxproj", "{E5071091-DBFB-49E2-AF0F-E8B0FDEF6C89}"
- EndProject
-EndProject
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous2", "Continuous2.vcxproj", "{E5071091-DBFB-49E2-AF0F-E8B0FDEF6C89}"
+ EndProject
+EndProject
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectSection.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectSection.sln-file
index ed0aa02..8688e75 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectSection.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectSection.sln-file
@@ -1,11 +1,11 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{90BC31D7-A3E8-4F04-8049-2236C239A044}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProject
-EndProject
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{90BC31D7-A3E8-4F04-8049-2236C239A044}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProject
+EndProject
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayParen.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayParen.sln-file
index d2bb9e3..f2a3ea1 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayParen.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayParen.sln-file
@@ -1,4 +1,4 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}" = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
-EndProject
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}" = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
+EndProject
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote.sln-file
index 3c1a2ec..b91dae3 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote.sln-file
@@ -1,4 +1,4 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}
-EndProject
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}
+EndProject
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote2.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote2.sln-file
index db8bbcf..1d01fda 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote2.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote2.sln-file
@@ -1,4 +1,4 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}) = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
-EndProject
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}) = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
+EndProject
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-topLevel.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-topLevel.sln-file
index 1727bf3..c406974 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-topLevel.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-topLevel.sln-file
@@ -1,4 +1,4 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-GlobalSection(ExtensibilityGlobals) = postSolution
-EndGlobalSection
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+GlobalSection(ExtensibilityGlobals) = postSolution
+EndGlobalSection
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-unclosed.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-unclosed.sln-file
index 4e6909e..d814bf4 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-unclosed.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-unclosed.sln-file
@@ -1,5 +1,5 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Global
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Global
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/nobom.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/nobom.sln-file
index fc1e4e9..8168b6b 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/nobom.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/nobom.sln-file
@@ -1,2 +1,2 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/valid.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/valid.sln-file
index 7ba28a2..395b953 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser_data/valid.sln-file
+++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/valid.sln-file
@@ -1,680 +1,680 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", "ALL_BUILD.vcxproj", "{BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}"
- ProjectSection(ProjectDependencies) = postProject
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
- {B025BD09-8389-4D9F-9150-F33418A664B1} = {B025BD09-8389-4D9F-9150-F33418A664B1}
- {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8} = {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}
- {1002C8FC-7242-4A69-AF51-C59BB10BA6D8} = {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}
- {0283B293-0067-4D02-ADA6-892704398F48} = {0283B293-0067-4D02-ADA6-892704398F48}
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B} = {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}
- {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8} = {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
- {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84} = {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}
- {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {29D5FCAF-20D0-4DEF-8529-F035C249E996}
- {A0421DCA-AC3E-42D0-94AC-379A21A1E591} = {A0421DCA-AC3E-42D0-94AC-379A21A1E591}
- {C6AF7E57-CE57-4462-AE1D-BF520701480E} = {C6AF7E57-CE57-4462-AE1D-BF520701480E}
- {F2CAAAB3-9568-4284-B8E3-13955183A6D7} = {F2CAAAB3-9568-4284-B8E3-13955183A6D7}
- {D8294E4A-03C5-43D7-AE35-15603F502DC0} = {D8294E4A-03C5-43D7-AE35-15603F502DC0}
- {A4921D15-411F-436A-B6F3-F8381652A8E1} = {A4921D15-411F-436A-B6F3-F8381652A8E1}
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}
- {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C} = {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
- {0E9E295F-3854-415B-AE9F-7B62F17932F5} = {0E9E295F-3854-415B-AE9F-7B62F17932F5}
- {4BFA4D7C-C6F7-4270-9E87-B922DCE05644} = {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}
- {F77AD922-B4BC-43D7-B268-865312085495} = {F77AD922-B4BC-43D7-B268-865312085495}
- {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88} = {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}
- {1DFA0599-77CC-4768-B47A-107EEE86C20C} = {1DFA0599-77CC-4768-B47A-107EEE86C20C}
- {0E45A3EF-8636-46CF-94A3-7B5CE875DE48} = {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}
- {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C} = {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CMakeLib", "Source\CMakeLib.vcxproj", "{59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CMakeLibTests", "Tests\CMakeLib\CMakeLibTests.vcxproj", "{B025BD09-8389-4D9F-9150-F33418A664B1}"
- ProjectSection(ProjectDependencies) = postProject
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CPackLib", "Source\CPackLib.vcxproj", "{94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}"
- ProjectSection(ProjectDependencies) = postProject
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CTestLib", "Source\CTestLib.vcxproj", "{1002C8FC-7242-4A69-AF51-C59BB10BA6D8}"
- ProjectSection(ProjectDependencies) = postProject
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Experimental", "Experimental.vcxproj", "{B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INSTALL", "INSTALL.vcxproj", "{3B126B2D-DEAA-4CDF-9F44-28D3600F5754}"
- ProjectSection(ProjectDependencies) = postProject
- {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C} = {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LIBCURL", "Utilities\cmcurl\LIBCURL.vcxproj", "{0283B293-0067-4D02-ADA6-892704398F48}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Nightly", "Nightly.vcxproj", "{7BAF09E0-DCD4-4567-9486-79E1E5F18333}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NightlyMemoryCheck", "NightlyMemoryCheck.vcxproj", "{D0413FDA-31C5-41C2-A53A-C1B87061EC96}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PACKAGE", "PACKAGE.vcxproj", "{4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}"
- ProjectSection(ProjectDependencies) = postProject
- {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C} = {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RUN_TESTS", "RUN_TESTS.vcxproj", "{D87B08A8-638E-43FA-96C2-404B41363D3B}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{90BC31D7-A3E8-4F04-8049-2236C239A044}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmIML_test", "Utilities\KWIML\test\cmIML_test.vcxproj", "{48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmake", "Source\cmake.vcxproj", "{6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}"
- ProjectSection(ProjectDependencies) = postProject
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmbzip2", "Utilities\cmbzip2\cmbzip2.vcxproj", "{1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmcldeps", "Source\cmcldeps.vcxproj", "{A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}"
- ProjectSection(ProjectDependencies) = postProject
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmcompress", "Utilities\cmcompress\cmcompress.vcxproj", "{561AD1BB-6DD3-466D-B270-3696DEE8C26C}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmcurl", "Utilities\cmcurl\cmcurl.vcxproj", "{1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmexpat", "Utilities\cmexpat\cmexpat.vcxproj", "{459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmlibarchive", "Utilities\cmlibarchive\libarchive\cmlibarchive.vcxproj", "{25A91A7A-9C4E-420C-98BD-2D1F0165DA54}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsys", "Source\kwsys\cmsys.vcxproj", "{BDB424DC-15B3-4A06-A1E2-3D61380F359F}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}
- {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {29D5FCAF-20D0-4DEF-8529-F035C249E996}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysEncodeExecutable", "Source\kwsys\cmsysEncodeExecutable.vcxproj", "{4810B052-899E-4CA5-A0BC-2E383F8AEFAE}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysProcessFwd9x", "Source\kwsys\cmsysProcessFwd9x.vcxproj", "{29D5FCAF-20D0-4DEF-8529-F035C249E996}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestDynload", "Source\kwsys\cmsysTestDynload.vcxproj", "{A0421DCA-AC3E-42D0-94AC-379A21A1E591}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestProcess", "Source\kwsys\cmsysTestProcess.vcxproj", "{C6AF7E57-CE57-4462-AE1D-BF520701480E}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestSharedForward", "Source\kwsys\cmsysTestSharedForward.vcxproj", "{F2CAAAB3-9568-4284-B8E3-13955183A6D7}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestsC", "Source\kwsys\cmsysTestsC.vcxproj", "{D8294E4A-03C5-43D7-AE35-15603F502DC0}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestsCxx", "Source\kwsys\cmsysTestsCxx.vcxproj", "{A4921D15-411F-436A-B6F3-F8381652A8E1}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsys_c", "Source\kwsys\cmsys_c.vcxproj", "{60BEB3AF-B4EF-4363-8747-C40177BC2D9C}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}
- {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {29D5FCAF-20D0-4DEF-8529-F035C249E996}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmw9xcom", "Source\cmw9xcom.vcxproj", "{ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}"
- ProjectSection(ProjectDependencies) = postProject
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmzlib", "Utilities\cmzlib\cmzlib.vcxproj", "{0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpack", "Source\cpack.vcxproj", "{0E9E295F-3854-415B-AE9F-7B62F17932F5}"
- ProjectSection(ProjectDependencies) = postProject
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
- {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8} = {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ctest", "Source\ctest.vcxproj", "{4BFA4D7C-C6F7-4270-9E87-B922DCE05644}"
- ProjectSection(ProjectDependencies) = postProject
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
- {1002C8FC-7242-4A69-AF51-C59BB10BA6D8} = {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "documentation", "Utilities\documentation.vcxproj", "{F77AD922-B4BC-43D7-B268-865312085495}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8} = {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}
- {0E9E295F-3854-415B-AE9F-7B62F17932F5} = {0E9E295F-3854-415B-AE9F-7B62F17932F5}
- {4BFA4D7C-C6F7-4270-9E87-B922DCE05644} = {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memcheck_fail", "Tests\CTestTestMemcheck\memcheck_fail.vcxproj", "{8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pseudo_BC", "Tests\CTestTestMemcheck\pseudo_BC.vcxproj", "{1DFA0599-77CC-4768-B47A-107EEE86C20C}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pseudo_purify", "Tests\CTestTestMemcheck\pseudo_purify.vcxproj", "{0E45A3EF-8636-46CF-94A3-7B5CE875DE48}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pseudo_valgrind", "Tests\CTestTestMemcheck\pseudo_valgrind.vcxproj", "{CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_clean", "Tests\test_clean.vcxproj", "{02D16A66-6D59-4A0E-ABB3-BD12926934FE}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uninstall", "uninstall.vcxproj", "{B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}"
- ProjectSection(ProjectDependencies) = postProject
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CMakePredefinedTargets", "CMakePredefinedTargets", "{31CE49D7-85CA-41E2-83D2-CC6962519DB6}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CTestDashboardTargets", "CTestDashboardTargets", "{BD073C58-BAED-420E-80EA-DC9F52E21AF7}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{8ECAB3CD-B434-426B-B63A-115919D393BC}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{964DC7DE-990A-4CA4-8395-10D9F9CB2A23}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{7E002D15-21D1-4927-B486-82E496444441}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rdParty", "Utilities\3rdParty", "{0984A63C-130E-4B62-9A94-AAC28A88C137}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KWSys", "Utilities\KWSys", "{EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Win9xCompat", "Utilities\Win9xCompat", "{2485E202-B981-41E0-98CA-CF363437A4E4}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x64 = Debug|x64
- Release|x64 = Release|x64
- MinSizeRel|x64 = MinSizeRel|x64
- RelWithDebInfo|x64 = RelWithDebInfo|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Debug|x64.ActiveCfg = Debug|x64
- {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Debug|x64.Build.0 = Debug|x64
- {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Release|x64.ActiveCfg = Release|x64
- {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Release|x64.Build.0 = Release|x64
- {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Debug|x64.ActiveCfg = Debug|x64
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Debug|x64.Build.0 = Debug|x64
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Release|x64.ActiveCfg = Release|x64
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Release|x64.Build.0 = Release|x64
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {B025BD09-8389-4D9F-9150-F33418A664B1}.Debug|x64.ActiveCfg = Debug|x64
- {B025BD09-8389-4D9F-9150-F33418A664B1}.Debug|x64.Build.0 = Debug|x64
- {B025BD09-8389-4D9F-9150-F33418A664B1}.Release|x64.ActiveCfg = Release|x64
- {B025BD09-8389-4D9F-9150-F33418A664B1}.Release|x64.Build.0 = Release|x64
- {B025BD09-8389-4D9F-9150-F33418A664B1}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {B025BD09-8389-4D9F-9150-F33418A664B1}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {B025BD09-8389-4D9F-9150-F33418A664B1}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {B025BD09-8389-4D9F-9150-F33418A664B1}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Debug|x64.ActiveCfg = Debug|x64
- {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Debug|x64.Build.0 = Debug|x64
- {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Release|x64.ActiveCfg = Release|x64
- {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Release|x64.Build.0 = Release|x64
- {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Debug|x64.ActiveCfg = Debug|x64
- {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Debug|x64.Build.0 = Debug|x64
- {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Release|x64.ActiveCfg = Release|x64
- {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Release|x64.Build.0 = Release|x64
- {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.Debug|x64.ActiveCfg = Debug|x64
- {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.Release|x64.ActiveCfg = Release|x64
- {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.Debug|x64.ActiveCfg = Debug|x64
- {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.Release|x64.ActiveCfg = Release|x64
- {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.Debug|x64.ActiveCfg = Debug|x64
- {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.Release|x64.ActiveCfg = Release|x64
- {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {0283B293-0067-4D02-ADA6-892704398F48}.Debug|x64.ActiveCfg = Debug|x64
- {0283B293-0067-4D02-ADA6-892704398F48}.Debug|x64.Build.0 = Debug|x64
- {0283B293-0067-4D02-ADA6-892704398F48}.Release|x64.ActiveCfg = Release|x64
- {0283B293-0067-4D02-ADA6-892704398F48}.Release|x64.Build.0 = Release|x64
- {0283B293-0067-4D02-ADA6-892704398F48}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {0283B293-0067-4D02-ADA6-892704398F48}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {0283B293-0067-4D02-ADA6-892704398F48}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {0283B293-0067-4D02-ADA6-892704398F48}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.Debug|x64.ActiveCfg = Debug|x64
- {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.Release|x64.ActiveCfg = Release|x64
- {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.Debug|x64.ActiveCfg = Debug|x64
- {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.Release|x64.ActiveCfg = Release|x64
- {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.Debug|x64.ActiveCfg = Debug|x64
- {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.Release|x64.ActiveCfg = Release|x64
- {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {D87B08A8-638E-43FA-96C2-404B41363D3B}.Debug|x64.ActiveCfg = Debug|x64
- {D87B08A8-638E-43FA-96C2-404B41363D3B}.Release|x64.ActiveCfg = Release|x64
- {D87B08A8-638E-43FA-96C2-404B41363D3B}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {D87B08A8-638E-43FA-96C2-404B41363D3B}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {90BC31D7-A3E8-4F04-8049-2236C239A044}.Debug|x64.ActiveCfg = Debug|x64
- {90BC31D7-A3E8-4F04-8049-2236C239A044}.Debug|x64.Build.0 = Debug|x64
- {90BC31D7-A3E8-4F04-8049-2236C239A044}.Release|x64.ActiveCfg = Release|x64
- {90BC31D7-A3E8-4F04-8049-2236C239A044}.Release|x64.Build.0 = Release|x64
- {90BC31D7-A3E8-4F04-8049-2236C239A044}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {90BC31D7-A3E8-4F04-8049-2236C239A044}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {90BC31D7-A3E8-4F04-8049-2236C239A044}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {90BC31D7-A3E8-4F04-8049-2236C239A044}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Debug|x64.ActiveCfg = Debug|x64
- {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Debug|x64.Build.0 = Debug|x64
- {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Release|x64.ActiveCfg = Release|x64
- {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Release|x64.Build.0 = Release|x64
- {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Debug|x64.ActiveCfg = Debug|x64
- {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Debug|x64.Build.0 = Debug|x64
- {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Release|x64.ActiveCfg = Release|x64
- {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Release|x64.Build.0 = Release|x64
- {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Debug|x64.ActiveCfg = Debug|x64
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Debug|x64.Build.0 = Debug|x64
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Release|x64.ActiveCfg = Release|x64
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Release|x64.Build.0 = Release|x64
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Debug|x64.ActiveCfg = Debug|x64
- {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Debug|x64.Build.0 = Debug|x64
- {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Release|x64.ActiveCfg = Release|x64
- {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Release|x64.Build.0 = Release|x64
- {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Debug|x64.ActiveCfg = Debug|x64
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Debug|x64.Build.0 = Debug|x64
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Release|x64.ActiveCfg = Release|x64
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Release|x64.Build.0 = Release|x64
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Debug|x64.ActiveCfg = Debug|x64
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Debug|x64.Build.0 = Debug|x64
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Release|x64.ActiveCfg = Release|x64
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Release|x64.Build.0 = Release|x64
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Debug|x64.ActiveCfg = Debug|x64
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Debug|x64.Build.0 = Debug|x64
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Release|x64.ActiveCfg = Release|x64
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Release|x64.Build.0 = Release|x64
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Debug|x64.ActiveCfg = Debug|x64
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Debug|x64.Build.0 = Debug|x64
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Release|x64.ActiveCfg = Release|x64
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Release|x64.Build.0 = Release|x64
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Debug|x64.ActiveCfg = Debug|x64
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Debug|x64.Build.0 = Debug|x64
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Release|x64.ActiveCfg = Release|x64
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Release|x64.Build.0 = Release|x64
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Debug|x64.ActiveCfg = Debug|x64
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Debug|x64.Build.0 = Debug|x64
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Release|x64.ActiveCfg = Release|x64
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Release|x64.Build.0 = Release|x64
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Debug|x64.ActiveCfg = Debug|x64
- {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Debug|x64.Build.0 = Debug|x64
- {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Release|x64.ActiveCfg = Release|x64
- {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Release|x64.Build.0 = Release|x64
- {29D5FCAF-20D0-4DEF-8529-F035C249E996}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {29D5FCAF-20D0-4DEF-8529-F035C249E996}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {29D5FCAF-20D0-4DEF-8529-F035C249E996}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {29D5FCAF-20D0-4DEF-8529-F035C249E996}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Debug|x64.ActiveCfg = Debug|x64
- {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Debug|x64.Build.0 = Debug|x64
- {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Release|x64.ActiveCfg = Release|x64
- {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Release|x64.Build.0 = Release|x64
- {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Debug|x64.ActiveCfg = Debug|x64
- {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Debug|x64.Build.0 = Debug|x64
- {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Release|x64.ActiveCfg = Release|x64
- {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Release|x64.Build.0 = Release|x64
- {C6AF7E57-CE57-4462-AE1D-BF520701480E}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {C6AF7E57-CE57-4462-AE1D-BF520701480E}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {C6AF7E57-CE57-4462-AE1D-BF520701480E}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {C6AF7E57-CE57-4462-AE1D-BF520701480E}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Debug|x64.ActiveCfg = Debug|x64
- {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Debug|x64.Build.0 = Debug|x64
- {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Release|x64.ActiveCfg = Release|x64
- {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Release|x64.Build.0 = Release|x64
- {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Debug|x64.ActiveCfg = Debug|x64
- {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Debug|x64.Build.0 = Debug|x64
- {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Release|x64.ActiveCfg = Release|x64
- {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Release|x64.Build.0 = Release|x64
- {D8294E4A-03C5-43D7-AE35-15603F502DC0}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {D8294E4A-03C5-43D7-AE35-15603F502DC0}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {D8294E4A-03C5-43D7-AE35-15603F502DC0}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {D8294E4A-03C5-43D7-AE35-15603F502DC0}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {A4921D15-411F-436A-B6F3-F8381652A8E1}.Debug|x64.ActiveCfg = Debug|x64
- {A4921D15-411F-436A-B6F3-F8381652A8E1}.Debug|x64.Build.0 = Debug|x64
- {A4921D15-411F-436A-B6F3-F8381652A8E1}.Release|x64.ActiveCfg = Release|x64
- {A4921D15-411F-436A-B6F3-F8381652A8E1}.Release|x64.Build.0 = Release|x64
- {A4921D15-411F-436A-B6F3-F8381652A8E1}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {A4921D15-411F-436A-B6F3-F8381652A8E1}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {A4921D15-411F-436A-B6F3-F8381652A8E1}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {A4921D15-411F-436A-B6F3-F8381652A8E1}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Debug|x64.ActiveCfg = Debug|x64
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Debug|x64.Build.0 = Debug|x64
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Release|x64.ActiveCfg = Release|x64
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Release|x64.Build.0 = Release|x64
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Debug|x64.ActiveCfg = Debug|x64
- {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Debug|x64.Build.0 = Debug|x64
- {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Release|x64.ActiveCfg = Release|x64
- {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Release|x64.Build.0 = Release|x64
- {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Debug|x64.ActiveCfg = Debug|x64
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Debug|x64.Build.0 = Debug|x64
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Release|x64.ActiveCfg = Release|x64
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Release|x64.Build.0 = Release|x64
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Debug|x64.ActiveCfg = Debug|x64
- {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Debug|x64.Build.0 = Debug|x64
- {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Release|x64.ActiveCfg = Release|x64
- {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Release|x64.Build.0 = Release|x64
- {0E9E295F-3854-415B-AE9F-7B62F17932F5}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {0E9E295F-3854-415B-AE9F-7B62F17932F5}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {0E9E295F-3854-415B-AE9F-7B62F17932F5}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {0E9E295F-3854-415B-AE9F-7B62F17932F5}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Debug|x64.ActiveCfg = Debug|x64
- {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Debug|x64.Build.0 = Debug|x64
- {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Release|x64.ActiveCfg = Release|x64
- {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Release|x64.Build.0 = Release|x64
- {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {F77AD922-B4BC-43D7-B268-865312085495}.Debug|x64.ActiveCfg = Debug|x64
- {F77AD922-B4BC-43D7-B268-865312085495}.Debug|x64.Build.0 = Debug|x64
- {F77AD922-B4BC-43D7-B268-865312085495}.Release|x64.ActiveCfg = Release|x64
- {F77AD922-B4BC-43D7-B268-865312085495}.Release|x64.Build.0 = Release|x64
- {F77AD922-B4BC-43D7-B268-865312085495}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {F77AD922-B4BC-43D7-B268-865312085495}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {F77AD922-B4BC-43D7-B268-865312085495}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {F77AD922-B4BC-43D7-B268-865312085495}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Debug|x64.ActiveCfg = Debug|x64
- {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Debug|x64.Build.0 = Debug|x64
- {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Release|x64.ActiveCfg = Release|x64
- {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Release|x64.Build.0 = Release|x64
- {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Debug|x64.ActiveCfg = Debug|x64
- {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Debug|x64.Build.0 = Debug|x64
- {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Release|x64.ActiveCfg = Release|x64
- {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Release|x64.Build.0 = Release|x64
- {1DFA0599-77CC-4768-B47A-107EEE86C20C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {1DFA0599-77CC-4768-B47A-107EEE86C20C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {1DFA0599-77CC-4768-B47A-107EEE86C20C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {1DFA0599-77CC-4768-B47A-107EEE86C20C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Debug|x64.ActiveCfg = Debug|x64
- {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Debug|x64.Build.0 = Debug|x64
- {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Release|x64.ActiveCfg = Release|x64
- {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Release|x64.Build.0 = Release|x64
- {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Debug|x64.ActiveCfg = Debug|x64
- {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Debug|x64.Build.0 = Debug|x64
- {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Release|x64.ActiveCfg = Release|x64
- {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Release|x64.Build.0 = Release|x64
- {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
- {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
- {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.Debug|x64.ActiveCfg = Debug|x64
- {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.Release|x64.ActiveCfg = Release|x64
- {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.Debug|x64.ActiveCfg = Debug|x64
- {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.Release|x64.ActiveCfg = Release|x64
- {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
- {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {3B126B2D-DEAA-4CDF-9F44-28D3600F5754} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6}
- {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6}
- {D87B08A8-638E-43FA-96C2-404B41363D3B} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6}
- {90BC31D7-A3E8-4F04-8049-2236C239A044} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6}
- {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7}
- {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7}
- {7BAF09E0-DCD4-4567-9486-79E1E5F18333} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7}
- {D0413FDA-31C5-41C2-A53A-C1B87061EC96} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7}
- {F77AD922-B4BC-43D7-B268-865312085495} = {8ECAB3CD-B434-426B-B63A-115919D393BC}
- {B025BD09-8389-4D9F-9150-F33418A664B1} = {964DC7DE-990A-4CA4-8395-10D9F9CB2A23}
- {0984A63C-130E-4B62-9A94-AAC28A88C137} = {7E002D15-21D1-4927-B486-82E496444441}
- {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} = {7E002D15-21D1-4927-B486-82E496444441}
- {2485E202-B981-41E0-98CA-CF363437A4E4} = {7E002D15-21D1-4927-B486-82E496444441}
- {0283B293-0067-4D02-ADA6-892704398F48} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
- {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
- {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
- {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
- {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
- {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
- {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
- {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
- {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
- {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
- {A0421DCA-AC3E-42D0-94AC-379A21A1E591} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
- {C6AF7E57-CE57-4462-AE1D-BF520701480E} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
- {F2CAAAB3-9568-4284-B8E3-13955183A6D7} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
- {D8294E4A-03C5-43D7-AE35-15603F502DC0} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
- {A4921D15-411F-436A-B6F3-F8381652A8E1} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
- {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
- {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C} = {2485E202-B981-41E0-98CA-CF363437A4E4}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", "ALL_BUILD.vcxproj", "{BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}"
+ ProjectSection(ProjectDependencies) = postProject
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
+ {B025BD09-8389-4D9F-9150-F33418A664B1} = {B025BD09-8389-4D9F-9150-F33418A664B1}
+ {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8} = {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}
+ {1002C8FC-7242-4A69-AF51-C59BB10BA6D8} = {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}
+ {0283B293-0067-4D02-ADA6-892704398F48} = {0283B293-0067-4D02-ADA6-892704398F48}
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B} = {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}
+ {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8} = {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
+ {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84} = {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {29D5FCAF-20D0-4DEF-8529-F035C249E996}
+ {A0421DCA-AC3E-42D0-94AC-379A21A1E591} = {A0421DCA-AC3E-42D0-94AC-379A21A1E591}
+ {C6AF7E57-CE57-4462-AE1D-BF520701480E} = {C6AF7E57-CE57-4462-AE1D-BF520701480E}
+ {F2CAAAB3-9568-4284-B8E3-13955183A6D7} = {F2CAAAB3-9568-4284-B8E3-13955183A6D7}
+ {D8294E4A-03C5-43D7-AE35-15603F502DC0} = {D8294E4A-03C5-43D7-AE35-15603F502DC0}
+ {A4921D15-411F-436A-B6F3-F8381652A8E1} = {A4921D15-411F-436A-B6F3-F8381652A8E1}
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}
+ {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C} = {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
+ {0E9E295F-3854-415B-AE9F-7B62F17932F5} = {0E9E295F-3854-415B-AE9F-7B62F17932F5}
+ {4BFA4D7C-C6F7-4270-9E87-B922DCE05644} = {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}
+ {F77AD922-B4BC-43D7-B268-865312085495} = {F77AD922-B4BC-43D7-B268-865312085495}
+ {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88} = {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}
+ {1DFA0599-77CC-4768-B47A-107EEE86C20C} = {1DFA0599-77CC-4768-B47A-107EEE86C20C}
+ {0E45A3EF-8636-46CF-94A3-7B5CE875DE48} = {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}
+ {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C} = {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CMakeLib", "Source\CMakeLib.vcxproj", "{59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CMakeLibTests", "Tests\CMakeLib\CMakeLibTests.vcxproj", "{B025BD09-8389-4D9F-9150-F33418A664B1}"
+ ProjectSection(ProjectDependencies) = postProject
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CPackLib", "Source\CPackLib.vcxproj", "{94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}"
+ ProjectSection(ProjectDependencies) = postProject
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CTestLib", "Source\CTestLib.vcxproj", "{1002C8FC-7242-4A69-AF51-C59BB10BA6D8}"
+ ProjectSection(ProjectDependencies) = postProject
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Experimental", "Experimental.vcxproj", "{B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INSTALL", "INSTALL.vcxproj", "{3B126B2D-DEAA-4CDF-9F44-28D3600F5754}"
+ ProjectSection(ProjectDependencies) = postProject
+ {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C} = {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LIBCURL", "Utilities\cmcurl\LIBCURL.vcxproj", "{0283B293-0067-4D02-ADA6-892704398F48}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Nightly", "Nightly.vcxproj", "{7BAF09E0-DCD4-4567-9486-79E1E5F18333}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NightlyMemoryCheck", "NightlyMemoryCheck.vcxproj", "{D0413FDA-31C5-41C2-A53A-C1B87061EC96}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PACKAGE", "PACKAGE.vcxproj", "{4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}"
+ ProjectSection(ProjectDependencies) = postProject
+ {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C} = {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RUN_TESTS", "RUN_TESTS.vcxproj", "{D87B08A8-638E-43FA-96C2-404B41363D3B}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{90BC31D7-A3E8-4F04-8049-2236C239A044}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmIML_test", "Utilities\KWIML\test\cmIML_test.vcxproj", "{48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmake", "Source\cmake.vcxproj", "{6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}"
+ ProjectSection(ProjectDependencies) = postProject
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmbzip2", "Utilities\cmbzip2\cmbzip2.vcxproj", "{1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmcldeps", "Source\cmcldeps.vcxproj", "{A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}"
+ ProjectSection(ProjectDependencies) = postProject
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmcompress", "Utilities\cmcompress\cmcompress.vcxproj", "{561AD1BB-6DD3-466D-B270-3696DEE8C26C}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmcurl", "Utilities\cmcurl\cmcurl.vcxproj", "{1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmexpat", "Utilities\cmexpat\cmexpat.vcxproj", "{459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmlibarchive", "Utilities\cmlibarchive\libarchive\cmlibarchive.vcxproj", "{25A91A7A-9C4E-420C-98BD-2D1F0165DA54}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsys", "Source\kwsys\cmsys.vcxproj", "{BDB424DC-15B3-4A06-A1E2-3D61380F359F}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {29D5FCAF-20D0-4DEF-8529-F035C249E996}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysEncodeExecutable", "Source\kwsys\cmsysEncodeExecutable.vcxproj", "{4810B052-899E-4CA5-A0BC-2E383F8AEFAE}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysProcessFwd9x", "Source\kwsys\cmsysProcessFwd9x.vcxproj", "{29D5FCAF-20D0-4DEF-8529-F035C249E996}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestDynload", "Source\kwsys\cmsysTestDynload.vcxproj", "{A0421DCA-AC3E-42D0-94AC-379A21A1E591}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestProcess", "Source\kwsys\cmsysTestProcess.vcxproj", "{C6AF7E57-CE57-4462-AE1D-BF520701480E}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestSharedForward", "Source\kwsys\cmsysTestSharedForward.vcxproj", "{F2CAAAB3-9568-4284-B8E3-13955183A6D7}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestsC", "Source\kwsys\cmsysTestsC.vcxproj", "{D8294E4A-03C5-43D7-AE35-15603F502DC0}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestsCxx", "Source\kwsys\cmsysTestsCxx.vcxproj", "{A4921D15-411F-436A-B6F3-F8381652A8E1}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsys_c", "Source\kwsys\cmsys_c.vcxproj", "{60BEB3AF-B4EF-4363-8747-C40177BC2D9C}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {29D5FCAF-20D0-4DEF-8529-F035C249E996}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmw9xcom", "Source\cmw9xcom.vcxproj", "{ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}"
+ ProjectSection(ProjectDependencies) = postProject
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C}
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmzlib", "Utilities\cmzlib\cmzlib.vcxproj", "{0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpack", "Source\cpack.vcxproj", "{0E9E295F-3854-415B-AE9F-7B62F17932F5}"
+ ProjectSection(ProjectDependencies) = postProject
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
+ {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8} = {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ctest", "Source\ctest.vcxproj", "{4BFA4D7C-C6F7-4270-9E87-B922DCE05644}"
+ ProjectSection(ProjectDependencies) = postProject
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}
+ {1002C8FC-7242-4A69-AF51-C59BB10BA6D8} = {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "documentation", "Utilities\documentation.vcxproj", "{F77AD922-B4BC-43D7-B268-865312085495}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8} = {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}
+ {0E9E295F-3854-415B-AE9F-7B62F17932F5} = {0E9E295F-3854-415B-AE9F-7B62F17932F5}
+ {4BFA4D7C-C6F7-4270-9E87-B922DCE05644} = {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memcheck_fail", "Tests\CTestTestMemcheck\memcheck_fail.vcxproj", "{8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pseudo_BC", "Tests\CTestTestMemcheck\pseudo_BC.vcxproj", "{1DFA0599-77CC-4768-B47A-107EEE86C20C}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pseudo_purify", "Tests\CTestTestMemcheck\pseudo_purify.vcxproj", "{0E45A3EF-8636-46CF-94A3-7B5CE875DE48}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pseudo_valgrind", "Tests\CTestTestMemcheck\pseudo_valgrind.vcxproj", "{CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_clean", "Tests\test_clean.vcxproj", "{02D16A66-6D59-4A0E-ABB3-BD12926934FE}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uninstall", "uninstall.vcxproj", "{B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}"
+ ProjectSection(ProjectDependencies) = postProject
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044}
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CMakePredefinedTargets", "CMakePredefinedTargets", "{31CE49D7-85CA-41E2-83D2-CC6962519DB6}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CTestDashboardTargets", "CTestDashboardTargets", "{BD073C58-BAED-420E-80EA-DC9F52E21AF7}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{8ECAB3CD-B434-426B-B63A-115919D393BC}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{964DC7DE-990A-4CA4-8395-10D9F9CB2A23}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{7E002D15-21D1-4927-B486-82E496444441}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rdParty", "Utilities\3rdParty", "{0984A63C-130E-4B62-9A94-AAC28A88C137}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KWSys", "Utilities\KWSys", "{EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Win9xCompat", "Utilities\Win9xCompat", "{2485E202-B981-41E0-98CA-CF363437A4E4}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Release|x64 = Release|x64
+ MinSizeRel|x64 = MinSizeRel|x64
+ RelWithDebInfo|x64 = RelWithDebInfo|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Debug|x64.ActiveCfg = Debug|x64
+ {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Debug|x64.Build.0 = Debug|x64
+ {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Release|x64.ActiveCfg = Release|x64
+ {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Release|x64.Build.0 = Release|x64
+ {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Debug|x64.ActiveCfg = Debug|x64
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Debug|x64.Build.0 = Debug|x64
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Release|x64.ActiveCfg = Release|x64
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Release|x64.Build.0 = Release|x64
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {B025BD09-8389-4D9F-9150-F33418A664B1}.Debug|x64.ActiveCfg = Debug|x64
+ {B025BD09-8389-4D9F-9150-F33418A664B1}.Debug|x64.Build.0 = Debug|x64
+ {B025BD09-8389-4D9F-9150-F33418A664B1}.Release|x64.ActiveCfg = Release|x64
+ {B025BD09-8389-4D9F-9150-F33418A664B1}.Release|x64.Build.0 = Release|x64
+ {B025BD09-8389-4D9F-9150-F33418A664B1}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {B025BD09-8389-4D9F-9150-F33418A664B1}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {B025BD09-8389-4D9F-9150-F33418A664B1}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {B025BD09-8389-4D9F-9150-F33418A664B1}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Debug|x64.ActiveCfg = Debug|x64
+ {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Debug|x64.Build.0 = Debug|x64
+ {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Release|x64.ActiveCfg = Release|x64
+ {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Release|x64.Build.0 = Release|x64
+ {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Debug|x64.ActiveCfg = Debug|x64
+ {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Debug|x64.Build.0 = Debug|x64
+ {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Release|x64.ActiveCfg = Release|x64
+ {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Release|x64.Build.0 = Release|x64
+ {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.Debug|x64.ActiveCfg = Debug|x64
+ {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.Release|x64.ActiveCfg = Release|x64
+ {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.Debug|x64.ActiveCfg = Debug|x64
+ {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.Release|x64.ActiveCfg = Release|x64
+ {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.Debug|x64.ActiveCfg = Debug|x64
+ {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.Release|x64.ActiveCfg = Release|x64
+ {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {0283B293-0067-4D02-ADA6-892704398F48}.Debug|x64.ActiveCfg = Debug|x64
+ {0283B293-0067-4D02-ADA6-892704398F48}.Debug|x64.Build.0 = Debug|x64
+ {0283B293-0067-4D02-ADA6-892704398F48}.Release|x64.ActiveCfg = Release|x64
+ {0283B293-0067-4D02-ADA6-892704398F48}.Release|x64.Build.0 = Release|x64
+ {0283B293-0067-4D02-ADA6-892704398F48}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {0283B293-0067-4D02-ADA6-892704398F48}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {0283B293-0067-4D02-ADA6-892704398F48}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {0283B293-0067-4D02-ADA6-892704398F48}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.Debug|x64.ActiveCfg = Debug|x64
+ {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.Release|x64.ActiveCfg = Release|x64
+ {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.Debug|x64.ActiveCfg = Debug|x64
+ {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.Release|x64.ActiveCfg = Release|x64
+ {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.Debug|x64.ActiveCfg = Debug|x64
+ {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.Release|x64.ActiveCfg = Release|x64
+ {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {D87B08A8-638E-43FA-96C2-404B41363D3B}.Debug|x64.ActiveCfg = Debug|x64
+ {D87B08A8-638E-43FA-96C2-404B41363D3B}.Release|x64.ActiveCfg = Release|x64
+ {D87B08A8-638E-43FA-96C2-404B41363D3B}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {D87B08A8-638E-43FA-96C2-404B41363D3B}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {90BC31D7-A3E8-4F04-8049-2236C239A044}.Debug|x64.ActiveCfg = Debug|x64
+ {90BC31D7-A3E8-4F04-8049-2236C239A044}.Debug|x64.Build.0 = Debug|x64
+ {90BC31D7-A3E8-4F04-8049-2236C239A044}.Release|x64.ActiveCfg = Release|x64
+ {90BC31D7-A3E8-4F04-8049-2236C239A044}.Release|x64.Build.0 = Release|x64
+ {90BC31D7-A3E8-4F04-8049-2236C239A044}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {90BC31D7-A3E8-4F04-8049-2236C239A044}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {90BC31D7-A3E8-4F04-8049-2236C239A044}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {90BC31D7-A3E8-4F04-8049-2236C239A044}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Debug|x64.ActiveCfg = Debug|x64
+ {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Debug|x64.Build.0 = Debug|x64
+ {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Release|x64.ActiveCfg = Release|x64
+ {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Release|x64.Build.0 = Release|x64
+ {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Debug|x64.ActiveCfg = Debug|x64
+ {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Debug|x64.Build.0 = Debug|x64
+ {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Release|x64.ActiveCfg = Release|x64
+ {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Release|x64.Build.0 = Release|x64
+ {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Debug|x64.ActiveCfg = Debug|x64
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Debug|x64.Build.0 = Debug|x64
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Release|x64.ActiveCfg = Release|x64
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Release|x64.Build.0 = Release|x64
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Debug|x64.ActiveCfg = Debug|x64
+ {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Debug|x64.Build.0 = Debug|x64
+ {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Release|x64.ActiveCfg = Release|x64
+ {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Release|x64.Build.0 = Release|x64
+ {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Debug|x64.ActiveCfg = Debug|x64
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Debug|x64.Build.0 = Debug|x64
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Release|x64.ActiveCfg = Release|x64
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Release|x64.Build.0 = Release|x64
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Debug|x64.ActiveCfg = Debug|x64
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Debug|x64.Build.0 = Debug|x64
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Release|x64.ActiveCfg = Release|x64
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Release|x64.Build.0 = Release|x64
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Debug|x64.ActiveCfg = Debug|x64
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Debug|x64.Build.0 = Debug|x64
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Release|x64.ActiveCfg = Release|x64
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Release|x64.Build.0 = Release|x64
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Debug|x64.ActiveCfg = Debug|x64
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Debug|x64.Build.0 = Debug|x64
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Release|x64.ActiveCfg = Release|x64
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Release|x64.Build.0 = Release|x64
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Debug|x64.ActiveCfg = Debug|x64
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Debug|x64.Build.0 = Debug|x64
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Release|x64.ActiveCfg = Release|x64
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Release|x64.Build.0 = Release|x64
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Debug|x64.ActiveCfg = Debug|x64
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Debug|x64.Build.0 = Debug|x64
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Release|x64.ActiveCfg = Release|x64
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Release|x64.Build.0 = Release|x64
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Debug|x64.ActiveCfg = Debug|x64
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Debug|x64.Build.0 = Debug|x64
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Release|x64.ActiveCfg = Release|x64
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Release|x64.Build.0 = Release|x64
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Debug|x64.ActiveCfg = Debug|x64
+ {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Debug|x64.Build.0 = Debug|x64
+ {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Release|x64.ActiveCfg = Release|x64
+ {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Release|x64.Build.0 = Release|x64
+ {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Debug|x64.ActiveCfg = Debug|x64
+ {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Debug|x64.Build.0 = Debug|x64
+ {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Release|x64.ActiveCfg = Release|x64
+ {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Release|x64.Build.0 = Release|x64
+ {C6AF7E57-CE57-4462-AE1D-BF520701480E}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {C6AF7E57-CE57-4462-AE1D-BF520701480E}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {C6AF7E57-CE57-4462-AE1D-BF520701480E}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {C6AF7E57-CE57-4462-AE1D-BF520701480E}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Debug|x64.ActiveCfg = Debug|x64
+ {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Debug|x64.Build.0 = Debug|x64
+ {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Release|x64.ActiveCfg = Release|x64
+ {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Release|x64.Build.0 = Release|x64
+ {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Debug|x64.ActiveCfg = Debug|x64
+ {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Debug|x64.Build.0 = Debug|x64
+ {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Release|x64.ActiveCfg = Release|x64
+ {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Release|x64.Build.0 = Release|x64
+ {D8294E4A-03C5-43D7-AE35-15603F502DC0}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {D8294E4A-03C5-43D7-AE35-15603F502DC0}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {D8294E4A-03C5-43D7-AE35-15603F502DC0}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {D8294E4A-03C5-43D7-AE35-15603F502DC0}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {A4921D15-411F-436A-B6F3-F8381652A8E1}.Debug|x64.ActiveCfg = Debug|x64
+ {A4921D15-411F-436A-B6F3-F8381652A8E1}.Debug|x64.Build.0 = Debug|x64
+ {A4921D15-411F-436A-B6F3-F8381652A8E1}.Release|x64.ActiveCfg = Release|x64
+ {A4921D15-411F-436A-B6F3-F8381652A8E1}.Release|x64.Build.0 = Release|x64
+ {A4921D15-411F-436A-B6F3-F8381652A8E1}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {A4921D15-411F-436A-B6F3-F8381652A8E1}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {A4921D15-411F-436A-B6F3-F8381652A8E1}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {A4921D15-411F-436A-B6F3-F8381652A8E1}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Debug|x64.ActiveCfg = Debug|x64
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Debug|x64.Build.0 = Debug|x64
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Release|x64.ActiveCfg = Release|x64
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Release|x64.Build.0 = Release|x64
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Debug|x64.ActiveCfg = Debug|x64
+ {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Debug|x64.Build.0 = Debug|x64
+ {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Release|x64.ActiveCfg = Release|x64
+ {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Release|x64.Build.0 = Release|x64
+ {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Debug|x64.ActiveCfg = Debug|x64
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Debug|x64.Build.0 = Debug|x64
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Release|x64.ActiveCfg = Release|x64
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Release|x64.Build.0 = Release|x64
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Debug|x64.ActiveCfg = Debug|x64
+ {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Debug|x64.Build.0 = Debug|x64
+ {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Release|x64.ActiveCfg = Release|x64
+ {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Release|x64.Build.0 = Release|x64
+ {0E9E295F-3854-415B-AE9F-7B62F17932F5}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {0E9E295F-3854-415B-AE9F-7B62F17932F5}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {0E9E295F-3854-415B-AE9F-7B62F17932F5}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {0E9E295F-3854-415B-AE9F-7B62F17932F5}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Debug|x64.ActiveCfg = Debug|x64
+ {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Debug|x64.Build.0 = Debug|x64
+ {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Release|x64.ActiveCfg = Release|x64
+ {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Release|x64.Build.0 = Release|x64
+ {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {F77AD922-B4BC-43D7-B268-865312085495}.Debug|x64.ActiveCfg = Debug|x64
+ {F77AD922-B4BC-43D7-B268-865312085495}.Debug|x64.Build.0 = Debug|x64
+ {F77AD922-B4BC-43D7-B268-865312085495}.Release|x64.ActiveCfg = Release|x64
+ {F77AD922-B4BC-43D7-B268-865312085495}.Release|x64.Build.0 = Release|x64
+ {F77AD922-B4BC-43D7-B268-865312085495}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {F77AD922-B4BC-43D7-B268-865312085495}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {F77AD922-B4BC-43D7-B268-865312085495}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {F77AD922-B4BC-43D7-B268-865312085495}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Debug|x64.ActiveCfg = Debug|x64
+ {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Debug|x64.Build.0 = Debug|x64
+ {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Release|x64.ActiveCfg = Release|x64
+ {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Release|x64.Build.0 = Release|x64
+ {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Debug|x64.ActiveCfg = Debug|x64
+ {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Debug|x64.Build.0 = Debug|x64
+ {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Release|x64.ActiveCfg = Release|x64
+ {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Release|x64.Build.0 = Release|x64
+ {1DFA0599-77CC-4768-B47A-107EEE86C20C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {1DFA0599-77CC-4768-B47A-107EEE86C20C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {1DFA0599-77CC-4768-B47A-107EEE86C20C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {1DFA0599-77CC-4768-B47A-107EEE86C20C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Debug|x64.ActiveCfg = Debug|x64
+ {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Debug|x64.Build.0 = Debug|x64
+ {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Release|x64.ActiveCfg = Release|x64
+ {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Release|x64.Build.0 = Release|x64
+ {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Debug|x64.ActiveCfg = Debug|x64
+ {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Debug|x64.Build.0 = Debug|x64
+ {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Release|x64.ActiveCfg = Release|x64
+ {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Release|x64.Build.0 = Release|x64
+ {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
+ {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
+ {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.Debug|x64.ActiveCfg = Debug|x64
+ {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.Release|x64.ActiveCfg = Release|x64
+ {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.Debug|x64.ActiveCfg = Debug|x64
+ {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.Release|x64.ActiveCfg = Release|x64
+ {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
+ {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {3B126B2D-DEAA-4CDF-9F44-28D3600F5754} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6}
+ {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6}
+ {D87B08A8-638E-43FA-96C2-404B41363D3B} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6}
+ {90BC31D7-A3E8-4F04-8049-2236C239A044} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6}
+ {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7}
+ {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7}
+ {7BAF09E0-DCD4-4567-9486-79E1E5F18333} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7}
+ {D0413FDA-31C5-41C2-A53A-C1B87061EC96} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7}
+ {F77AD922-B4BC-43D7-B268-865312085495} = {8ECAB3CD-B434-426B-B63A-115919D393BC}
+ {B025BD09-8389-4D9F-9150-F33418A664B1} = {964DC7DE-990A-4CA4-8395-10D9F9CB2A23}
+ {0984A63C-130E-4B62-9A94-AAC28A88C137} = {7E002D15-21D1-4927-B486-82E496444441}
+ {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} = {7E002D15-21D1-4927-B486-82E496444441}
+ {2485E202-B981-41E0-98CA-CF363437A4E4} = {7E002D15-21D1-4927-B486-82E496444441}
+ {0283B293-0067-4D02-ADA6-892704398F48} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
+ {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
+ {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
+ {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
+ {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
+ {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
+ {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0984A63C-130E-4B62-9A94-AAC28A88C137}
+ {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
+ {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
+ {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
+ {A0421DCA-AC3E-42D0-94AC-379A21A1E591} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
+ {C6AF7E57-CE57-4462-AE1D-BF520701480E} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
+ {F2CAAAB3-9568-4284-B8E3-13955183A6D7} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
+ {D8294E4A-03C5-43D7-AE35-15603F502DC0} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
+ {A4921D15-411F-436A-B6F3-F8381652A8E1} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
+ {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}
+ {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C} = {2485E202-B981-41E0-98CA-CF363437A4E4}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/Tests/CMakeLib/testXMLSafe.cxx b/Tests/CMakeLib/testXMLSafe.cxx
index fe776c5..21bb952 100644
--- a/Tests/CMakeLib/testXMLSafe.cxx
+++ b/Tests/CMakeLib/testXMLSafe.cxx
@@ -1,7 +1,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include <cmConfigure.h>
+#include "cmConfigure.h" // IWYU pragma: keep
#include <sstream>
#include <stdio.h>
@@ -21,7 +21,7 @@ static test_pair const pairs[] = {
{ "angles <>", "angles &lt;&gt;" },
{ "ampersand &", "ampersand &amp;" },
{ "bad-byte \x80", "bad-byte [NON-UTF-8-BYTE-0x80]" },
- { CM_NULLPTR, CM_NULLPTR }
+ { nullptr, nullptr }
};
int testXMLSafe(int /*unused*/, char* /*unused*/ [])
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index d16df1c..f0e58ee 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1285,12 +1285,28 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5Autogen"
--force-new-ctest-process
--build-options ${build_options}
- -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5
+ -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+ -DQT_TEST_VERSION=5
${QtAutogen_BUILD_OPTIONS}
--test-command ${run_autogen_test}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Autogen")
+ add_test(NAME Qt5AutogenRerun COMMAND ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/QtAutogenRerun"
+ "${CMake_BINARY_DIR}/Tests/Qt5AutogenRerun"
+ ${build_generator_args}
+ --build-project QtAutogenRerun
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5AutogenRerun"
+ --force-new-ctest-process
+ --build-options ${build_options}
+ -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+ -DQT_TEST_VERSION=5
+ ${QtAutogen_BUILD_OPTIONS}
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5AutogenRerun")
+
add_test(Qt5AutoUicInterface ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/QtAutoUicInterface"
@@ -1315,12 +1331,28 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Autogen"
--force-new-ctest-process
--build-options ${build_options}
- -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4
+ -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+ -DQT_TEST_VERSION=4
${QtAutogen_BUILD_OPTIONS}
--test-command ${run_autogen_test}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Autogen")
+ add_test(NAME Qt4AutogenRerun COMMAND ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/QtAutogenRerun"
+ "${CMake_BINARY_DIR}/Tests/Qt4AutogenRerun"
+ ${build_generator_args}
+ --build-project QtAutogenRerun
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4AutogenRerun"
+ --force-new-ctest-process
+ --build-options ${build_options}
+ -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+ -DQT_TEST_VERSION=4
+ ${QtAutogen_BUILD_OPTIONS}
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4AutogenRerun")
+
add_test(Qt4AutoUicInterface ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/QtAutoUicInterface"
@@ -1330,7 +1362,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4AutoUicInterface"
--force-new-ctest-process
--build-options ${build_options}
- -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4
+ -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+ -DQT_TEST_VERSION=4
--test-command ${run_autouic_test}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4AutoUicInterface")
@@ -2082,7 +2115,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
set(reg_nasm "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]")
foreach(reg vs10 vs11 vs12 vs14 ws80 ws81 ws10_0 wp80 wp81 wince tegra nasm)
get_filename_component(r "${reg_${reg}}" ABSOLUTE)
- if(IS_DIRECTORY "${r}")
+ if(IS_DIRECTORY "${r}" AND NOT "${r}" STREQUAL "/registry")
set(${reg} 1)
else()
set(${reg} 0)
@@ -2785,13 +2818,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
ADD_TEST_MACRO(CMakeCommands.target_compile_definitions target_compile_definitions)
ADD_TEST_MACRO(CMakeCommands.target_compile_options target_compile_options)
- if(CMake_TEST_SERVER_MODE)
- # The cmake server-mode test requires python for a simple client.
- find_package(PythonInterp QUIET)
- if(PYTHON_EXECUTABLE)
- set(Server_BUILD_OPTIONS -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE})
- ADD_TEST_MACRO(Server Server)
- endif()
+ # The cmake server-mode test requires python for a simple client.
+ find_package(PythonInterp QUIET)
+ if(PYTHON_EXECUTABLE)
+ set(Server_BUILD_OPTIONS -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE})
+ ADD_TEST_MACRO(Server Server)
endif()
configure_file(
diff --git a/Tests/CMakeTests/.gitattributes b/Tests/CMakeTests/.gitattributes
index c34e350..c6148fb 100644
--- a/Tests/CMakeTests/.gitattributes
+++ b/Tests/CMakeTests/.gitattributes
@@ -1 +1 @@
-File-HASH-Input.txt crlf=input
+File-HASH-Input.txt eol=lf
diff --git a/Tests/CMakeTests/CMakeHostSystemInformationTest.cmake.in b/Tests/CMakeTests/CMakeHostSystemInformationTest.cmake.in
index 3294a2f..a3c2b05 100644
--- a/Tests/CMakeTests/CMakeHostSystemInformationTest.cmake.in
+++ b/Tests/CMakeTests/CMakeHostSystemInformationTest.cmake.in
@@ -22,6 +22,25 @@ try_and_print(TOTAL_VIRTUAL_MEMORY)
try_and_print(AVAILABLE_VIRTUAL_MEMORY)
try_and_print(TOTAL_PHYSICAL_MEMORY)
try_and_print(AVAILABLE_PHYSICAL_MEMORY)
+try_and_print(IS_64BIT)
+try_and_print(HAS_FPU)
+try_and_print(HAS_MMX)
+try_and_print(HAS_MMX_PLUS)
+try_and_print(HAS_SSE)
+try_and_print(HAS_SSE2)
+try_and_print(HAS_SSE_FP)
+try_and_print(HAS_SSE_MMX)
+try_and_print(HAS_AMD_3DNOW)
+try_and_print(HAS_AMD_3DNOW_PLUS)
+try_and_print(HAS_IA64)
+try_and_print(HAS_SERIAL_NUMBER)
+try_and_print(PROCESSOR_SERIAL_NUMBER)
+try_and_print(PROCESSOR_NAME)
+try_and_print(PROCESSOR_DESCRIPTION)
+try_and_print(OS_NAME)
+try_and_print(OS_RELEASE)
+try_and_print(OS_VERSION)
+try_and_print(OS_PLATFORM)
include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake")
diff --git a/Tests/CMakeTests/PushCheckStateTest.cmake.in b/Tests/CMakeTests/PushCheckStateTest.cmake.in
index b4c48f4..cbd879d 100644
--- a/Tests/CMakeTests/PushCheckStateTest.cmake.in
+++ b/Tests/CMakeTests/PushCheckStateTest.cmake.in
@@ -1,3 +1,4 @@
+cmake_minimum_required(VERSION 3.8)
include(CMakePushCheckState)
set(CMAKE_EXTRA_INCLUDE_FILES file1)
@@ -26,6 +27,27 @@ set(CMAKE_REQUIRED_LIBRARIES lib3)
set(CMAKE_REQUIRED_FLAGS flag3)
set(CMAKE_REQUIRED_QUIET 3)
+cmake_push_check_state(RESET)
+
+foreach(pair IN ITEMS
+ EXTRA_INCLUDE_FILES|
+ REQUIRED_INCLUDES|
+ REQUIRED_DEFINITIONS|
+ REQUIRED_LIBRARIES|
+ REQUIRED_FLAGS|
+ REQUIRED_QUIET|
+ )
+ string(REPLACE "|" ";" pair "${pair}")
+ list(GET pair 0 var)
+ list(GET pair 1 expected)
+ if (NOT "${CMAKE_${var}}" STREQUAL "${expected}")
+ set(fatal TRUE)
+ message("ERROR: CMAKE_${var} is \"${CMAKE_${var}}\" (expected \"${expected}\")" )
+ endif()
+endforeach()
+
+cmake_pop_check_state()
+
cmake_pop_check_state()
foreach(pair IN ITEMS
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 4a5558d..b560acd 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -428,6 +428,14 @@ else()
HAVE_FINAL=$<COMPILE_FEATURES:cxx_final>
HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$<COMPILE_FEATURES:cxx_inheriting_constructors,cxx_final>
)
+ if (CMAKE_CXX_STANDARD_DEFAULT)
+ target_compile_definitions(CompileFeaturesGenex PRIVATE
+ TEST_CXX_STD
+ HAVE_CXX_STD_11=$<COMPILE_FEATURES:cxx_std_11>
+ HAVE_CXX_STD_14=$<COMPILE_FEATURES:cxx_std_14>
+ HAVE_CXX_STD_17=$<COMPILE_FEATURES:cxx_std_17>
+ )
+ endif()
add_executable(CompileFeaturesGenex2 genex_test.cpp)
target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_std_11)
diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp
index 9b65b42..0de1125 100644
--- a/Tests/CompileFeatures/default_dialect.cpp
+++ b/Tests/CompileFeatures/default_dialect.cpp
@@ -2,25 +2,30 @@
template <long l>
struct Outputter;
+#if defined(_MSC_VER) && defined(_MSVC_LANG)
+#define CXX_STD _MSVC_LANG
+#else
+#define CXX_STD __cplusplus
+#endif
+
#if DEFAULT_CXX17
-#if __cplusplus <= 201402L
-Outputter<__cplusplus> o;
+#if CXX_STD <= 201402L
+Outputter<CXX_STD> o;
#endif
#elif DEFAULT_CXX14
-#if __cplusplus != 201402L
-Outputter<__cplusplus> o;
+#if CXX_STD != 201402L
+Outputter<CXX_STD> o;
#endif
#elif DEFAULT_CXX11
-#if __cplusplus != 201103L
-Outputter<__cplusplus> o;
+#if CXX_STD != 201103L
+Outputter<CXX_STD> o;
#endif
#else
#if !DEFAULT_CXX98
#error Buildsystem error
#endif
-#if __cplusplus != 199711L && __cplusplus != 1 && \
- !defined(__GXX_EXPERIMENTAL_CXX0X__)
-Outputter<__cplusplus> o;
+#if CXX_STD != 199711L && CXX_STD != 1 && !defined(__GXX_EXPERIMENTAL_CXX0X__)
+Outputter<CXX_STD> o;
#endif
#endif
diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp
index 5ae8a78..5303e73 100644
--- a/Tests/CompileFeatures/genex_test.cpp
+++ b/Tests/CompileFeatures/genex_test.cpp
@@ -11,6 +11,18 @@
#error EXPECT_OVERRIDE_CONTROL not defined
#endif
+#ifdef TEST_CXX_STD
+#if !HAVE_CXX_STD_11
+#error HAVE_CXX_STD_11 is false with CXX_STANDARD == 11
+#endif
+#if HAVE_CXX_STD_14
+#error HAVE_CXX_STD_14 is true with CXX_STANDARD == 11
+#endif
+#if HAVE_CXX_STD_17
+#error HAVE_CXX_STD_17 is true with CXX_STANDARD == 11
+#endif
+#endif
+
#if !HAVE_OVERRIDE_CONTROL
#if EXPECT_OVERRIDE_CONTROL
#error "Expect override control feature"
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 075faa7..2e41754 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -356,6 +356,8 @@ endwhile()
set(SHOULD_BE_ZERO )
set(SHOULD_BE_ONE 1)
+set(SHOULD_BE_ZERO_AND_INDENTED )
+set(SHOULD_BE_ONE_AND_INDENTED 1)
# test elseif functionality, the mess below tries to catch problem
# of clauses being executed early or late etc
@@ -438,13 +440,6 @@ set(CMAKE_CXX_STANDARD 98)
#
set(CMAKE_CXX_EXTENSIONS TRUE)
-# Those versions of the HP compiler that need a flag to get proper C++98
-# template support also need a flag to use the newer C++ library.
-if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
- CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
- string(APPEND CMAKE_CXX_FLAGS " -AA")
-endif ()
-
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx
index 3b09229..ca39870 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -261,6 +261,12 @@ int main()
cmPassed("ONE_VAR is defined.");
#endif
+#ifndef ONE_VAR_AND_INDENTED
+ cmFailed("cmakedefine is broken, ONE_VAR_AND_INDENTED is not defined.");
+#else
+ cmPassed("ONE_VAR_AND_INDENTED is defined.");
+#endif
+
#ifndef ONE_VAR_IS_DEFINED
cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, "
"ONE_VAR_IS_DEFINED is not defined.");
@@ -274,6 +280,12 @@ int main()
cmPassed("ZERO_VAR is not defined.");
#endif
+#ifdef ZERO_VAR_AND_INDENTED
+ cmFailed("cmakedefine is broken, ZERO_VAR_AND_INDENTED is defined.");
+#else
+ cmPassed("ZERO_VAR_AND_INDENTED is not defined.");
+#endif
+
#ifndef STRING_VAR
cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined.");
#else
@@ -1030,6 +1042,16 @@ int main()
} else {
cmFailed("cmakedefine01 is not working for 1");
}
+ if (SHOULD_BE_ZERO_AND_INDENTED == 0) {
+ cmPassed("cmakedefine01 is working for 0 and indented");
+ } else {
+ cmFailed("cmakedefine01 is not working for 0 and indented");
+ }
+ if (SHOULD_BE_ONE_AND_INDENTED == 1) {
+ cmPassed("cmakedefine01 is working for 1 and indented");
+ } else {
+ cmFailed("cmakedefine01 is not working for 1 and indented");
+ }
#ifdef FORCE_TEST
cmFailed("CMake SET CACHE FORCE");
#else
diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake
index 8be59be..9761986 100644
--- a/Tests/Complex/VarTests.cmake
+++ b/Tests/Complex/VarTests.cmake
@@ -2,6 +2,7 @@
# Test SET
#
set (ZERO_VAR 0)
+set (ZERO_VAR_AND_INDENTED 0)
set (ZERO_VAR2 0)
if(ZERO_VAR)
@@ -11,6 +12,7 @@ else()
endif()
set(ONE_VAR 1)
+set(ONE_VAR_AND_INDENTED 1)
set(ONE_VAR2 1)
set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in
index d7424b1..72317bc 100644
--- a/Tests/Complex/cmTestConfigure.h.in
+++ b/Tests/Complex/cmTestConfigure.h.in
@@ -1,8 +1,10 @@
// Test SET, VARIABLE_REQUIRES
#cmakedefine ONE_VAR
+# cmakedefine ONE_VAR_AND_INDENTED
#cmakedefine ONE_VAR_IS_DEFINED
#cmakedefine ZERO_VAR
+# cmakedefine ZERO_VAR_AND_INDENTED
#define STRING_VAR "${STRING_VAR}"
@@ -32,6 +34,8 @@
#cmakedefine01 SHOULD_BE_ZERO
#cmakedefine01 SHOULD_BE_ONE
+# cmakedefine01 SHOULD_BE_ZERO_AND_INDENTED
+# cmakedefine01 SHOULD_BE_ONE_AND_INDENTED
// Needed to check for files
#define BINARY_DIR "${Complex_BINARY_DIR}"
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index 1b833b2..628cd4e 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -313,6 +313,8 @@ endwhile()
set(SHOULD_BE_ZERO )
set(SHOULD_BE_ONE 1)
+set(SHOULD_BE_ZERO_AND_INDENTED )
+set(SHOULD_BE_ONE_AND_INDENTED 1)
# test elseif functionality, the mess below tries to catch problem
# of clauses being executed early or late etc
@@ -395,13 +397,6 @@ set(CMAKE_CXX_STANDARD 98)
#
set(CMAKE_CXX_EXTENSIONS TRUE)
-# Those versions of the HP compiler that need a flag to get proper C++98
-# template support also need a flag to use the newer C++ library.
-if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
- CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
- string(APPEND CMAKE_CXX_FLAGS " -AA")
-endif ()
-
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx
index 9e4eaad..9b94962 100644
--- a/Tests/ComplexOneConfig/Executable/complex.cxx
+++ b/Tests/ComplexOneConfig/Executable/complex.cxx
@@ -261,6 +261,12 @@ int main()
cmPassed("ONE_VAR is defined.");
#endif
+#ifndef ONE_VAR_AND_INDENTED
+ cmFailed("cmakedefine is broken, ONE_VAR_AND_INDENTED is not defined.");
+#else
+ cmPassed("ONE_VAR_AND_INDENTED is defined.");
+#endif
+
#ifndef ONE_VAR_IS_DEFINED
cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, "
"ONE_VAR_IS_DEFINED is not defined.");
@@ -274,6 +280,12 @@ int main()
cmPassed("ZERO_VAR is not defined.");
#endif
+#ifdef ZERO_VAR_AND_INDENTED
+ cmFailed("cmakedefine is broken, ZERO_VAR_AND_INDENTED is defined.");
+#else
+ cmPassed("ZERO_VAR_AND_INDENTED is not defined.");
+#endif
+
#ifndef STRING_VAR
cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined.");
#else
@@ -1030,6 +1042,16 @@ int main()
} else {
cmFailed("cmakedefine01 is not working for 1");
}
+ if (SHOULD_BE_ZERO_AND_INDENTED == 0) {
+ cmPassed("cmakedefine01 is working for 0 and indented");
+ } else {
+ cmFailed("cmakedefine01 is not working for 0 and indented");
+ }
+ if (SHOULD_BE_ONE_AND_INDENTED == 1) {
+ cmPassed("cmakedefine01 is working for 1 and indented");
+ } else {
+ cmFailed("cmakedefine01 is not working for 1 and indented");
+ }
#ifdef FORCE_TEST
cmFailed("CMake SET CACHE FORCE");
#else
diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake
index 7dd8519..42afd19 100644
--- a/Tests/ComplexOneConfig/VarTests.cmake
+++ b/Tests/ComplexOneConfig/VarTests.cmake
@@ -2,6 +2,7 @@
# Test SET
#
set (ZERO_VAR 0)
+set (ZERO_VAR_AND_INDENTED 0)
set (ZERO_VAR2 0)
if(ZERO_VAR)
@@ -11,6 +12,7 @@ else()
endif()
set(ONE_VAR 1)
+set(ONE_VAR_AND_INDENTED 1)
set(ONE_VAR2 1)
set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in
index d7424b1..72317bc 100644
--- a/Tests/ComplexOneConfig/cmTestConfigure.h.in
+++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in
@@ -1,8 +1,10 @@
// Test SET, VARIABLE_REQUIRES
#cmakedefine ONE_VAR
+# cmakedefine ONE_VAR_AND_INDENTED
#cmakedefine ONE_VAR_IS_DEFINED
#cmakedefine ZERO_VAR
+# cmakedefine ZERO_VAR_AND_INDENTED
#define STRING_VAR "${STRING_VAR}"
@@ -32,6 +34,8 @@
#cmakedefine01 SHOULD_BE_ZERO
#cmakedefine01 SHOULD_BE_ONE
+# cmakedefine01 SHOULD_BE_ZERO_AND_INDENTED
+# cmakedefine01 SHOULD_BE_ONE_AND_INDENTED
// Needed to check for files
#define BINARY_DIR "${Complex_BINARY_DIR}"
diff --git a/Tests/Cuda/Complex/CMakeLists.txt b/Tests/Cuda/Complex/CMakeLists.txt
index 450ef48..a7137e3 100644
--- a/Tests/Cuda/Complex/CMakeLists.txt
+++ b/Tests/Cuda/Complex/CMakeLists.txt
@@ -42,7 +42,6 @@ add_executable(CudaComplex main.cpp)
target_link_libraries(CudaComplex PUBLIC CudaComplexMixedLib)
if(APPLE)
- # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that
- # the static cuda runtime can find it at runtime.
- target_link_libraries(CudaComplex PRIVATE -Wl,-rpath,/usr/local/cuda/lib)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET CudaComplex PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
endif()
diff --git a/Tests/Cuda/ObjectLibrary/CMakeLists.txt b/Tests/Cuda/ObjectLibrary/CMakeLists.txt
index 1d93be7..276dc92 100644
--- a/Tests/Cuda/ObjectLibrary/CMakeLists.txt
+++ b/Tests/Cuda/ObjectLibrary/CMakeLists.txt
@@ -10,8 +10,8 @@ add_library(CudaMixedObjectLib OBJECT static.cu static.cpp)
add_executable(CudaObjectLibrary
main.cpp
$<TARGET_OBJECTS:CudaMixedObjectLib>)
+
if(APPLE)
- # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that
- # the static cuda runtime can find it at runtime.
- target_link_libraries(CudaObjectLibrary PRIVATE -Wl,-rpath,/usr/local/cuda/lib)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET CudaObjectLibrary PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
endif()
diff --git a/Tests/Cuda/WithC/CMakeLists.txt b/Tests/Cuda/WithC/CMakeLists.txt
index 1f25ab4..831ce12 100644
--- a/Tests/Cuda/WithC/CMakeLists.txt
+++ b/Tests/Cuda/WithC/CMakeLists.txt
@@ -6,7 +6,6 @@ string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
add_executable(CudaWithC main.c cuda.cu)
if(APPLE)
- # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that
- # the static cuda runtime can find it at runtime.
- target_link_libraries(CudaWithC PRIVATE -Wl,-rpath,/usr/local/cuda/lib)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET CudaWithC PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
endif()
diff --git a/Tests/CudaOnly/ExportPTX/CMakeLists.txt b/Tests/CudaOnly/ExportPTX/CMakeLists.txt
index 10249c6..65d5243 100644
--- a/Tests/CudaOnly/ExportPTX/CMakeLists.txt
+++ b/Tests/CudaOnly/ExportPTX/CMakeLists.txt
@@ -67,9 +67,8 @@ target_compile_definitions(CudaOnlyExportPTX PRIVATE
"CONFIG_TYPE=gen_$<LOWER_CASE:$<CONFIG>>")
if(APPLE)
- # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that
- # the static cuda runtime can find it at runtime.
- target_link_libraries(CudaOnlyExportPTX PRIVATE -Wl,-rpath,/usr/local/cuda/lib)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET CudaOnlyExportPTX PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
endif()
#Verify that we can install object targets properly
diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
index b96bb98..8d6551b 100644
--- a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
+++ b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
@@ -46,7 +46,6 @@ add_executable(CudaOnlyResolveDeviceSymbols main.cu)
target_link_libraries(CudaOnlyResolveDeviceSymbols PRIVATE CUDAResolveDeviceLib)
if(APPLE)
- # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that
- # the static cuda runtime can find it at runtime.
- target_link_libraries(CudaOnlyResolveDeviceSymbols PRIVATE -Wl,-rpath,/usr/local/cuda/lib)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET CudaOnlyResolveDeviceSymbols PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
endif()
diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
index 3d4a170..7ef626f 100644
--- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
+++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
@@ -48,8 +48,7 @@ if (CMAKE_GENERATOR MATCHES "^Visual Studio")
PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
endif()
-if (APPLE)
- # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that
- # the static cuda runtime can find it at runtime.
- target_link_libraries(CudaOnlySeparateCompilation PRIVATE -Wl,-rpath,/usr/local/cuda/lib)
+if(APPLE)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET CudaOnlySeparateCompilation PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
endif()
diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt
index e25f141..0bc4e5c 100644
--- a/Tests/CudaOnly/WithDefs/CMakeLists.txt
+++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt
@@ -37,8 +37,7 @@ target_compile_definitions(CudaOnlyWithDefs
$<$<CONFIG:RELEASE>:$<BUILD_INTERFACE:${release_compile_defs}>>
)
-#we need to add an rpath for the cuda library so that everything
-#loads properly on the mac
-if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
- set_target_properties(CudaOnlyWithDefs PROPERTIES LINK_FLAGS "-Wl,-rpath,${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}")
+if(APPLE)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET CudaOnlyWithDefs PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
endif()
diff --git a/Tests/FindProtobuf/Test/CMakeLists.txt b/Tests/FindProtobuf/Test/CMakeLists.txt
index 8b6e38a..10ce976 100644
--- a/Tests/FindProtobuf/Test/CMakeLists.txt
+++ b/Tests/FindProtobuf/Test/CMakeLists.txt
@@ -30,3 +30,5 @@ add_executable(test_var_protoc main-protoc.cxx)
target_include_directories(test_var_protoc PRIVATE ${Protobuf_INCLUDE_DIRS})
target_link_libraries(test_var_protoc PRIVATE ${Protobuf_PROTOC_LIBRARIES})
add_test(NAME test_var_protoc COMMAND test_var_protoc)
+
+add_test(NAME test_tgt_protoc_version COMMAND protobuf::protoc --version)
diff --git a/Tests/MFC/CMakeLists.txt.in b/Tests/MFC/CMakeLists.txt.in
index e6bfabd..bf98e91 100644
--- a/Tests/MFC/CMakeLists.txt.in
+++ b/Tests/MFC/CMakeLists.txt.in
@@ -45,6 +45,11 @@ set(files
set(CMAKE_MFC_FLAG "@CMAKE_MFC_FLAG_VALUE@")
+FIND_PACKAGE(MFC)
+IF (NOT MFC_FOUND)
+ MESSAGE(FATAL_ERROR "MFC Could not be found during the MFC test")
+ENDIF()
+
if("${CMAKE_MFC_FLAG}" STREQUAL "1")
msvc_link_to_static_crt()
else()
diff --git a/Tests/MFC/mfc1/.gitattributes b/Tests/MFC/mfc1/.gitattributes
deleted file mode 100644
index 59be5dc..0000000
--- a/Tests/MFC/mfc1/.gitattributes
+++ /dev/null
@@ -1,6 +0,0 @@
-.gitattributes export-ignore
-
-*.sln -crlf
-*.vcproj -crlf
-
-* -whitespace
diff --git a/Tests/MFC/mfc1/mfc1.sln b/Tests/MFC/mfc1/mfc1.sln
index 78bbe56..6f4aefe 100644
--- a/Tests/MFC/mfc1/mfc1.sln
+++ b/Tests/MFC/mfc1/mfc1.sln
@@ -1,21 +1,21 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mfc1", "mfc1.vcproj", "{06C08100-1145-4104-AEC3-6BC8C608B819}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {06C08100-1145-4104-AEC3-6BC8C608B819}.Debug.ActiveCfg = Debug|Win32
- {06C08100-1145-4104-AEC3-6BC8C608B819}.Debug.Build.0 = Debug|Win32
- {06C08100-1145-4104-AEC3-6BC8C608B819}.Release.ActiveCfg = Release|Win32
- {06C08100-1145-4104-AEC3-6BC8C608B819}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mfc1", "mfc1.vcproj", "{06C08100-1145-4104-AEC3-6BC8C608B819}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {06C08100-1145-4104-AEC3-6BC8C608B819}.Debug.ActiveCfg = Debug|Win32
+ {06C08100-1145-4104-AEC3-6BC8C608B819}.Debug.Build.0 = Debug|Win32
+ {06C08100-1145-4104-AEC3-6BC8C608B819}.Release.ActiveCfg = Release|Win32
+ {06C08100-1145-4104-AEC3-6BC8C608B819}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/Tests/MFC/mfc1/mfc1.vcproj b/Tests/MFC/mfc1/mfc1.vcproj
index 6df86e5..a04809e 100644
--- a/Tests/MFC/mfc1/mfc1.vcproj
+++ b/Tests/MFC/mfc1/mfc1.vcproj
@@ -1,216 +1,216 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="mfc1"
- ProjectGUID="{06C08100-1145-4104-AEC3-6BC8C608B819}"
- Keyword="MFCProj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
- ConfigurationType="1"
- UseOfMFC="2"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- TreatWChar_tAsBuiltInType="TRUE"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- SubSystem="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="FALSE"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"
- AdditionalIncludeDirectories="$(IntDir)"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="1"
- UseOfMFC="2"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG"
- MinimalRebuild="FALSE"
- RuntimeLibrary="2"
- TreatWChar_tAsBuiltInType="TRUE"
- UsePrecompiledHeader="3"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="FALSE"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"
- AdditionalIncludeDirectories="$(IntDir)"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath=".\ChildFrm.cpp">
- </File>
- <File
- RelativePath=".\MainFrm.cpp">
- </File>
- <File
- RelativePath=".\mfc1.cpp">
- </File>
- <File
- RelativePath=".\mfc1Doc.cpp">
- </File>
- <File
- RelativePath=".\mfc1View.cpp">
- </File>
- <File
- RelativePath=".\stdafx.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath=".\ChildFrm.h">
- </File>
- <File
- RelativePath=".\MainFrm.h">
- </File>
- <File
- RelativePath=".\mfc1.h">
- </File>
- <File
- RelativePath=".\mfc1Doc.h">
- </File>
- <File
- RelativePath=".\mfc1View.h">
- </File>
- <File
- RelativePath=".\Resource.h">
- </File>
- <File
- RelativePath=".\stdafx.h">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- <File
- RelativePath=".\res\mfc1.ico">
- </File>
- <File
- RelativePath=".\mfc1.rc">
- </File>
- <File
- RelativePath=".\res\mfc1.rc2">
- </File>
- <File
- RelativePath=".\res\mfc1Doc.ico">
- </File>
- <File
- RelativePath=".\res\Toolbar.bmp">
- </File>
- </Filter>
- <File
- RelativePath=".\res\mfc1.manifest">
- </File>
- <File
- RelativePath=".\mfc1.reg">
- </File>
- <File
- RelativePath=".\ReadMe.txt">
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="mfc1"
+ ProjectGUID="{06C08100-1145-4104-AEC3-6BC8C608B819}"
+ Keyword="MFCProj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ UseOfMFC="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ UsePrecompiledHeader="3"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ SubSystem="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="FALSE"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ UseOfMFC="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG"
+ MinimalRebuild="FALSE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ UsePrecompiledHeader="3"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="FALSE"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath=".\ChildFrm.cpp">
+ </File>
+ <File
+ RelativePath=".\MainFrm.cpp">
+ </File>
+ <File
+ RelativePath=".\mfc1.cpp">
+ </File>
+ <File
+ RelativePath=".\mfc1Doc.cpp">
+ </File>
+ <File
+ RelativePath=".\mfc1View.cpp">
+ </File>
+ <File
+ RelativePath=".\stdafx.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"/>
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ <File
+ RelativePath=".\ChildFrm.h">
+ </File>
+ <File
+ RelativePath=".\MainFrm.h">
+ </File>
+ <File
+ RelativePath=".\mfc1.h">
+ </File>
+ <File
+ RelativePath=".\mfc1Doc.h">
+ </File>
+ <File
+ RelativePath=".\mfc1View.h">
+ </File>
+ <File
+ RelativePath=".\Resource.h">
+ </File>
+ <File
+ RelativePath=".\stdafx.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ <File
+ RelativePath=".\res\mfc1.ico">
+ </File>
+ <File
+ RelativePath=".\mfc1.rc">
+ </File>
+ <File
+ RelativePath=".\res\mfc1.rc2">
+ </File>
+ <File
+ RelativePath=".\res\mfc1Doc.ico">
+ </File>
+ <File
+ RelativePath=".\res\Toolbar.bmp">
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\res\mfc1.manifest">
+ </File>
+ <File
+ RelativePath=".\mfc1.reg">
+ </File>
+ <File
+ RelativePath=".\ReadMe.txt">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
index 607dcd3..4a41a98 100644
--- a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
+++ b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
@@ -4,11 +4,12 @@ project(CheckIPOSupported-C LANGUAGES C)
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)
-check_ipo_supported(RESULT ipo_supported)
+check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output)
if(ipo_supported)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
elseif(CMake_TEST_IPO_WORKS_C)
- message(FATAL_ERROR "IPO expected to work")
+ string(REPLACE "\n" "\n " ipo_output "${ipo_output}")
+ message(FATAL_ERROR "IPO expected to work, but the check failed:\n ${ipo_output}")
endif()
add_library(foo foo.c)
diff --git a/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
index 2dede93..1bb2b84 100644
--- a/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
+++ b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
@@ -4,11 +4,12 @@ project(CheckIPOSupported-CXX LANGUAGES CXX)
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)
-check_ipo_supported(RESULT ipo_supported)
+check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output)
if(ipo_supported)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
elseif(CMake_TEST_IPO_WORKS_CXX)
- message(FATAL_ERROR "IPO expected to work")
+ string(REPLACE "\n" "\n " ipo_output "${ipo_output}")
+ message(FATAL_ERROR "IPO expected to work, but the check failed:\n ${ipo_output}")
endif()
add_library(foo foo.cpp)
diff --git a/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt b/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt
index dee5c25..3872b56 100644
--- a/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt
+++ b/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt
@@ -4,11 +4,12 @@ project(CheckIPOSupported-Fortran LANGUAGES Fortran)
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)
-check_ipo_supported(RESULT ipo_supported)
+check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output)
if(ipo_supported)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
elseif(CMake_TEST_IPO_WORKS_Fortran)
- message(FATAL_ERROR "IPO expected to work")
+ string(REPLACE "\n" "\n " ipo_output "${ipo_output}")
+ message(FATAL_ERROR "IPO expected to work, but the check failed:\n ${ipo_output}")
endif()
add_library(foo foo.f)
diff --git a/Tests/Module/ExternalData/.gitattributes b/Tests/Module/ExternalData/.gitattributes
new file mode 100644
index 0000000..516129b
--- /dev/null
+++ b/Tests/Module/ExternalData/.gitattributes
@@ -0,0 +1,5 @@
+MD5/* -text
+SHA1/* -text
+SHA224/* -text
+SHA256/* -text
+SHA3_256/* -text
diff --git a/Tests/Module/ExternalData/MD5/.gitattributes b/Tests/Module/ExternalData/MD5/.gitattributes
deleted file mode 100644
index 3e51d39..0000000
--- a/Tests/Module/ExternalData/MD5/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* -crlf
diff --git a/Tests/Module/ExternalData/SHA1/.gitattributes b/Tests/Module/ExternalData/SHA1/.gitattributes
deleted file mode 100644
index 3e51d39..0000000
--- a/Tests/Module/ExternalData/SHA1/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* -crlf
diff --git a/Tests/Module/ExternalData/SHA224/.gitattributes b/Tests/Module/ExternalData/SHA224/.gitattributes
deleted file mode 100644
index 3e51d39..0000000
--- a/Tests/Module/ExternalData/SHA224/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* -crlf
diff --git a/Tests/Module/ExternalData/SHA256/.gitattributes b/Tests/Module/ExternalData/SHA256/.gitattributes
deleted file mode 100644
index 3e51d39..0000000
--- a/Tests/Module/ExternalData/SHA256/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* -crlf
diff --git a/Tests/Module/ExternalData/SHA3_256/.gitattributes b/Tests/Module/ExternalData/SHA3_256/.gitattributes
deleted file mode 100644
index 3e51d39..0000000
--- a/Tests/Module/ExternalData/SHA3_256/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* -crlf
diff --git a/Tests/MumpsCoverage/.gitattributes b/Tests/MumpsCoverage/.gitattributes
index b680612..9fc9b0f 100644
--- a/Tests/MumpsCoverage/.gitattributes
+++ b/Tests/MumpsCoverage/.gitattributes
@@ -1,2 +1 @@
-*.cmcov -crlf -whitespace
-*.mcov -crlf -whitespace
+*.cmcov eol=crlf
diff --git a/Tests/MumpsCoverage/ZZCOVTST.cmcov b/Tests/MumpsCoverage/ZZCOVTST.cmcov
index 7a5df61..aec9336 100644
--- a/Tests/MumpsCoverage/ZZCOVTST.cmcov
+++ b/Tests/MumpsCoverage/ZZCOVTST.cmcov
@@ -1,45 +1,45 @@
-Routine,Line,RtnLine,Code
-ZZCOVTST,1,1,"ZZCOVTST;OSEHRA/JPS -- Test routine for Coverage Parsing;4/28/2014"
-,2,0," ; (tab) This is series of comments"
-,3,0," ; (tab) it should all be not executable"
-,4,0," ; (spaces) one of these sets might be a problem"
-,5,0," ; (spaces) we will have to see."
-,6,0,"EN ; This entry point shouldn't be found without fixing"
-,7,1," N D"
-,8,1," S D=1 ;An executable line"
-,9,1," D T1^ZZCOVTST"
-,10,1," I '$$T5 W ""RETURNED FROM t5"",!"
-,11,1," D T6^ZZCOVTST"
-,12,1," Q"
-,13,0," ; This line not executable"
-,14,0," ;"
-,15,0,"T1 ; This line should always be found"
-,16,1," N D"
-,17,1," S D=2"
-,18,1," W !,D,!,""This is the second entry point"",!"
-,19,1," D T2^ZZCOVTST(D)"
-,20,1," Q"
-,21,0," ;"
-,22,0,"T2(EQ) ; This is debatable and only called with ENT^ROU notation"
-,23,1," N D"
-,24,1," S D=3"
-,25,1," W !,D,!,EQ,""This is the third entry point"",!"
-,26,1," D T3^ZZCOVTST"
-,27,1," Q"
-,28,0," ;"
-,29,1,"T3 N D S D=4 W D,!,""Fourth Entry point"",! Q"
-,30,0," ;"
-,31,0,"T4 N D S D=5 W ""Shouldn't be executed"""
-,32,0," W ""Lots to not do"""
-,33,0," Q"
-,34,1,"T5(EQ) ;this entry point is called with a $$ notation"
-,35,1," W ""THIS IS THE $$ NOTATION!"",!"
-,36,1," Q 0"
-,37,0,"T6 ; An entry point to show comments inside of ""DO"" blocks"
-,38,1," D"
-,39,1," . W ""This is executable code"",!"
-,40,0," . ; This is a comment inside the do block, not executable"
-,41,1," . S ZZBLAH=""blah"""
-,42,1," W ""Ending T6"",!"
-,43,0," ;"
-Totals for ZZCOVTST,,25, \ No newline at end of file
+Routine,Line,RtnLine,Code
+ZZCOVTST,1,1,"ZZCOVTST;OSEHRA/JPS -- Test routine for Coverage Parsing;4/28/2014"
+,2,0," ; (tab) This is series of comments"
+,3,0," ; (tab) it should all be not executable"
+,4,0," ; (spaces) one of these sets might be a problem"
+,5,0," ; (spaces) we will have to see."
+,6,0,"EN ; This entry point shouldn't be found without fixing"
+,7,1," N D"
+,8,1," S D=1 ;An executable line"
+,9,1," D T1^ZZCOVTST"
+,10,1," I '$$T5 W ""RETURNED FROM t5"",!"
+,11,1," D T6^ZZCOVTST"
+,12,1," Q"
+,13,0," ; This line not executable"
+,14,0," ;"
+,15,0,"T1 ; This line should always be found"
+,16,1," N D"
+,17,1," S D=2"
+,18,1," W !,D,!,""This is the second entry point"",!"
+,19,1," D T2^ZZCOVTST(D)"
+,20,1," Q"
+,21,0," ;"
+,22,0,"T2(EQ) ; This is debatable and only called with ENT^ROU notation"
+,23,1," N D"
+,24,1," S D=3"
+,25,1," W !,D,!,EQ,""This is the third entry point"",!"
+,26,1," D T3^ZZCOVTST"
+,27,1," Q"
+,28,0," ;"
+,29,1,"T3 N D S D=4 W D,!,""Fourth Entry point"",! Q"
+,30,0," ;"
+,31,0,"T4 N D S D=5 W ""Shouldn't be executed"""
+,32,0," W ""Lots to not do"""
+,33,0," Q"
+,34,1,"T5(EQ) ;this entry point is called with a $$ notation"
+,35,1," W ""THIS IS THE $$ NOTATION!"",!"
+,36,1," Q 0"
+,37,0,"T6 ; An entry point to show comments inside of ""DO"" blocks"
+,38,1," D"
+,39,1," . W ""This is executable code"",!"
+,40,0," . ; This is a comment inside the do block, not executable"
+,41,1," . S ZZBLAH=""blah"""
+,42,1," W ""Ending T6"",!"
+,43,0," ;"
+Totals for ZZCOVTST,,25,
diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt
index 9e2b4ab..227d990 100644
--- a/Tests/Plugin/CMakeLists.txt
+++ b/Tests/Plugin/CMakeLists.txt
@@ -28,13 +28,6 @@ include_directories(
${Plugin_SOURCE_DIR}/include
)
-# Those versions of the HP compiler that need a flag to get proper C++98
-# template support also need a flag to use the newer C++ library.
-if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
- CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
- string(APPEND CMAKE_CXX_FLAGS " -AA")
-endif ()
-
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt
index ae0a02b..2ca11e4 100644
--- a/Tests/Qt4Targets/CMakeLists.txt
+++ b/Tests/Qt4Targets/CMakeLists.txt
@@ -20,6 +20,16 @@ if (WIN32)
endif()
endif()
+# Qt4 moc does not support utf8 paths in _parameter files generated by
+# qt4_wrap_cpp and qt4_generate_moc
+# https://bugreports.qt.io/browse/QTBUG-35480
+# Do a simple check if there is are non ASCII character in the build path
+string(REGEX MATCH "[^ -~]+" NON_ASCII_BDIR ${CMAKE_CURRENT_BINARY_DIR})
+if(NON_ASCII_BDIR)
+ message(WARNING "Build path contains non ASCII characters. Skipping Qt4 test.")
+ return()
+endif()
+
qt4_generate_moc(main_gen_test.cpp
"${CMAKE_CURRENT_BINARY_DIR}/main_gen_test.moc"
TARGET Qt4GenerateMacroTest
diff --git a/Tests/QtAutoUicInterface/CMakeLists.txt b/Tests/QtAutoUicInterface/CMakeLists.txt
index 3ea1294..a5c2d99 100644
--- a/Tests/QtAutoUicInterface/CMakeLists.txt
+++ b/Tests/QtAutoUicInterface/CMakeLists.txt
@@ -53,8 +53,9 @@ set_property(TARGET KI18n APPEND PROPERTY
# END upstream
-if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
-set(INC_DIR "include_${CMAKE_BUILD_TYPE}" )
+get_property(_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if(_GENERATOR_IS_MULTI_CONFIG)
+set(INC_DIR "include_$<CONFIG>" )
else()
set(INC_DIR "include" )
endif()
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 073c5fd..81ab734 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -1,14 +1,7 @@
-cmake_minimum_required(VERSION 3.7)
-
+cmake_minimum_required(VERSION 3.9)
+cmake_policy(SET CMP0071 NEW)
project(QtAutogen)
-# Tell find_package(Qt5) where to find Qt.
-if(QT_QMAKE_EXECUTABLE)
- get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
- get_filename_component(Qt_PREFIX_DIR "${Qt_BIN_DIR}" PATH)
- set(CMAKE_PREFIX_PATH ${Qt_PREFIX_DIR})
-endif()
-
if (QT_TEST_VERSION STREQUAL 4)
find_package(Qt4 REQUIRED)
@@ -22,6 +15,9 @@ if (QT_TEST_VERSION STREQUAL 4)
macro(qtx_wrap_cpp)
qt4_wrap_cpp(${ARGN})
endmacro()
+ macro(qtx_generate_moc)
+ qt4_generate_moc(${ARGN})
+ endmacro()
else()
if (NOT QT_TEST_VERSION STREQUAL 5)
@@ -41,11 +37,52 @@ else()
macro(qtx_wrap_cpp)
qt5_wrap_cpp(${ARGN})
endmacro()
+ macro(qtx_generate_moc)
+ qt5_generate_moc(${ARGN})
+ endmacro()
endif()
get_property(QT_COMPILE_FEATURES TARGET ${QT_QTCORE_TARGET} PROPERTY INTERFACE_COMPILE_FEATURES)
+# Qt4 moc does not support utf8 paths in _parameter files generated by
+# qtx_wrap_cpp
+# https://bugreports.qt.io/browse/QTBUG-35480
+# Do a simple check if there is are non ASCII character in the build path
+string(REGEX MATCH "[^ -~]+" NON_ASCII_BDIR ${CMAKE_CURRENT_BINARY_DIR})
+if((NOT NON_ASCII_BDIR) OR (NOT QT_TEST_VERSION STREQUAL 4))
+ set(ALLOW_WRAP_CPP TRUE)
+endif()
+# On windows qtx_wrap_cpp also fails in Qt5 when used on a path that
+# contains non ASCII characters
+if(NON_ASCII_BDIR AND WIN32)
+ set(ALLOW_WRAP_CPP FALSE)
+endif()
+
+# -- Test
+# MOC only
+add_executable(mocOnly mocOnlySource/main.cpp mocOnlySource/StyleA.cpp mocOnlySource/StyleB.cpp)
+set_property(TARGET mocOnly PROPERTY AUTOMOC ON)
+target_link_libraries(mocOnly ${QT_LIBRARIES})
+
+# -- Test
+# MOC AUTOMOC_MACRO_NAMES
+if (NOT QT_TEST_VERSION STREQUAL 4)
+ add_executable(mocMacroName mocMacroName/main.cpp mocMacroName/MacroName.cpp)
+ set_property(TARGET mocMacroName PROPERTY AUTOMOC ON)
+ set_property(TARGET mocMacroName PROPERTY AUTOMOC_MACRO_NAMES "QO_ALIAS")
+ target_link_libraries(mocMacroName ${QT_LIBRARIES})
+endif()
+
+# -- Test
+# UIC only
+if(ALLOW_WRAP_CPP)
+ qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h)
+ add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc})
+ set_property(TARGET uicOnly PROPERTY AUTOUIC ON)
+ target_link_libraries(uicOnly ${QT_LIBRARIES})
+endif()
+
# -- Test
# RCC only
add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc)
@@ -59,13 +96,6 @@ set_property(TARGET rccEmpty PROPERTY AUTORCC ON)
target_link_libraries(rccEmpty ${QT_QTCORE_TARGET})
# -- Test
-# UIC only
-qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h)
-add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc})
-set_property(TARGET uicOnly PROPERTY AUTOUIC ON)
-target_link_libraries(uicOnly ${QT_LIBRARIES})
-
-# -- Test
# Add not_generated_file.qrc to the source list to get the file-level
# dependency, but don't generate a c++ file from it. Disable the AUTORCC
# feature for this target. This tests that qrc files in the sources don't
@@ -80,154 +110,41 @@ set_target_properties(no_link_language PROPERTIES AUTOMOC TRUE)
target_compile_features(no_link_language PRIVATE ${QT_COMPILE_FEATURES})
target_compile_features(empty PRIVATE ${QT_COMPILE_FEATURES})
-# -- Test
-# When a file listed in a .qrc file changes the target must be rebuilt
-set(timeformat "%Y%j%H%M%S")
-set(RCC_DEPENDS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/rccDepends")
-set(RCC_DEPENDS_BIN "${CMAKE_CURRENT_BINARY_DIR}/rccDepends")
-configure_file(${RCC_DEPENDS_SRC}/res1a.qrc.in ${RCC_DEPENDS_BIN}/res1.qrc COPYONLY)
-configure_file(${RCC_DEPENDS_SRC}/res2a.qrc.in ${RCC_DEPENDS_BIN}/res2.qrc.in COPYONLY)
-try_compile(RCC_DEPENDS
- "${RCC_DEPENDS_BIN}"
- "${RCC_DEPENDS_SRC}"
- rccDepends
- CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
- "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
- "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}"
- OUTPUT_VARIABLE output
-)
-if (NOT RCC_DEPENDS)
- message(SEND_ERROR "Initial build of rccDepends failed. Output: ${output}")
-endif()
-# Get name and timestamp of the output binary
-file(STRINGS "${RCC_DEPENDS_BIN}/target.txt" targetList)
-list(GET targetList 0 rccDependsBin)
-file(TIMESTAMP "${rccDependsBin}" timeBegin "${timeformat}")
-# Sleep, touch regular qrc input file, rebuild and compare timestamp
-execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
-execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${RCC_DEPENDS_BIN}/res1/input.txt")
-execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
-if (result)
- message(SEND_ERROR "Second build of rccDepends failed.")
-endif()
-file(TIMESTAMP "${rccDependsBin}" timeStep1 "${timeformat}")
-if (NOT timeStep1 GREATER timeBegin)
- message(SEND_ERROR "File (${rccDependsBin}) should have changed in the first step!")
-endif()
-# Sleep, update regular qrc file, rebuild and compare timestamp
-execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
-configure_file(${RCC_DEPENDS_SRC}/res1b.qrc.in ${RCC_DEPENDS_BIN}/res1.qrc COPYONLY)
-execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
-if (result)
- message(SEND_ERROR "Third build of rccDepends failed.")
-endif()
-file(TIMESTAMP "${rccDependsBin}" timeStep2 "${timeformat}")
-if (NOT timeStep2 GREATER timeStep1)
- message(SEND_ERROR "File (${rccDependsBin}) should have changed in the second step!")
-endif()
-# Sleep, touch regular qrc newly added input file, rebuild and compare timestamp
-execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
-execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${RCC_DEPENDS_BIN}/res1/inputAdded.txt")
-execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
-if (result)
- message(SEND_ERROR "Fourth build of rccDepends failed.")
-endif()
-file(TIMESTAMP "${rccDependsBin}" timeStep3 "${timeformat}")
-if (NOT timeStep3 GREATER timeStep2)
- message(SEND_ERROR "File (${rccDependsBin}) should have changed in the third step!")
-endif()
-# Sleep, touch generated qrc input file, rebuild and compare timestamp
-execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
-execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${RCC_DEPENDS_BIN}/res2/input.txt")
-execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
-if (result)
- message(SEND_ERROR "Fifth build of rccDepends failed.")
-endif()
-file(TIMESTAMP "${rccDependsBin}" timeStep4 "${timeformat}")
-if (NOT timeStep4 GREATER timeStep3)
- message(SEND_ERROR "File (${rccDependsBin}) should have changed in the fourth step!")
-endif()
-# Sleep, update generated qrc file, rebuild and compare timestamp
-execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
-configure_file(${RCC_DEPENDS_SRC}/res2b.qrc.in ${RCC_DEPENDS_BIN}/res2.qrc.in COPYONLY)
-execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
-if (result)
- message(SEND_ERROR "Sixth build of rccDepends failed.")
-endif()
-file(TIMESTAMP "${rccDependsBin}" timeStep5 "${timeformat}")
-if (NOT timeStep5 GREATER timeStep4)
- message(SEND_ERROR "File (${rccDependsBin}) should have changed in the fitfh step!")
-endif()
-# Sleep, touch generated qrc newly added input file, rebuild and compare timestamp
-execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
-execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${RCC_DEPENDS_BIN}/res2/inputAdded.txt")
-execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
-if (result)
- message(SEND_ERROR "Seventh build of rccDepends failed.")
-endif()
-file(TIMESTAMP "${rccDependsBin}" timeStep6 "${timeformat}")
-if (NOT timeStep6 GREATER timeStep5)
- message(SEND_ERROR "File (${rccDependsBin}) should have changed in the sixth step!")
-endif()
-
-
-# -- Test
-# Ensure a repeated build succeeds when a header containing a QObject changes
-set(timeformat "%Y%j%H%M%S")
-configure_file(mocRerun/test1a.h.in mocRerun/test1.h COPYONLY)
-try_compile(MOC_RERUN
- "${CMAKE_CURRENT_BINARY_DIR}/mocRerun"
- "${CMAKE_CURRENT_SOURCE_DIR}/mocRerun"
- mocRerun
- CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
- "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
- "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}"
- OUTPUT_VARIABLE output
-)
-if (NOT MOC_RERUN)
- message(SEND_ERROR "Initial build of mocRerun failed. Output: ${output}")
-endif()
-# Get name and timestamp of the output binary
-file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/mocRerun/target1.txt" target1List)
-list(GET target1List 0 binFile)
-file(TIMESTAMP "${binFile}" timeBegin "${timeformat}")
-# Change file content and rebuild
-execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1)
-configure_file(mocRerun/test1b.h.in mocRerun/test1.h COPYONLY)
-execute_process(COMMAND "${CMAKE_COMMAND}" --build .
- WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mocRerun"
- RESULT_VARIABLE mocRerun_result
- )
-if (mocRerun_result)
- message(SEND_ERROR "Second build of mocRerun failed.")
-endif()
-# Compare timestamps
-file(TIMESTAMP "${binFile}" timeStep1 "${timeformat}")
-if (NOT timeStep1 GREATER timeBegin)
- message(SEND_ERROR "File (${binFile}) should have changed in the first step!")
-endif()
# -- Test
# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target
-qtx_wrap_cpp(skipMocWrapMoc
- skipSource/qItemA.hpp
- skipSource/qItemB.hpp)
-set(skipMocSources
- skipMoc.cpp
- skipSource/qItemA.cpp
- skipSource/qItemB.cpp
- skipSource/qItemC.cpp)
-set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON)
-set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON)
-# AUTOMOC enabled only
-add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc})
-set_property(TARGET skipMocA PROPERTY AUTOMOC ON)
-target_link_libraries(skipMocA ${QT_LIBRARIES})
-# AUTOMOC and AUTOUIC enabled
-add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc})
-set_property(TARGET skipMocB PROPERTY AUTOMOC ON)
-set_property(TARGET skipMocB PROPERTY AUTOUIC ON)
-target_link_libraries(skipMocB ${QT_LIBRARIES})
+if(ALLOW_WRAP_CPP)
+ # Generate header mocs manually
+ qtx_wrap_cpp(skipMocWrapMoc
+ skipSource/qItemA.hpp
+ skipSource/qItemB.hpp
+ skipSource/qItemC.hpp
+ skipSource/qItemD.hpp
+ )
+ set(skipMocSources
+ skipMoc.cpp
+ skipSource/qItemA.cpp
+ skipSource/qItemB.cpp
+ skipSource/qItemC.cpp
+ skipSource/qItemD.cpp
+ )
+ # When cpp files are skipped, the hpp won't be processed either,
+ # unless they are mentioned in the sources - which they aren't.
+ set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON)
+ set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON)
+ # When hpp files are skipped, the cpp still get processed.
+ set_property(SOURCE skipSource/qItemC.hpp PROPERTY SKIP_AUTOMOC ON)
+ set_property(SOURCE skipSource/qItemD.hpp PROPERTY SKIP_AUTOGEN ON)
+ # AUTOMOC enabled only
+ add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc})
+ set_property(TARGET skipMocA PROPERTY AUTOMOC ON)
+ target_link_libraries(skipMocA ${QT_LIBRARIES})
+ # AUTOMOC and AUTOUIC enabled
+ add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc})
+ set_property(TARGET skipMocB PROPERTY AUTOMOC ON)
+ set_property(TARGET skipMocB PROPERTY AUTOUIC ON)
+ target_link_libraries(skipMocB ${QT_LIBRARIES})
+endif()
# -- Test
# Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target
@@ -280,80 +197,15 @@ add_subdirectory(mocDepends)
# -- Test
# Tests various include moc patterns
-add_subdirectory(mocIncludeStrict)
-
-# -- Test
-# Tests various include moc patterns
-add_subdirectory(mocIncludeRelaxed)
+if(ALLOW_WRAP_CPP)
+ add_subdirectory(mocIncludeStrict)
+ add_subdirectory(mocIncludeRelaxed)
+endif()
# -- Test
-# Tests Q_PLUGIN_METADATA json file change detection
-if (NOT QT_TEST_VERSION STREQUAL 4)
- try_compile(MOC_PLUGIN
- "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin"
- "${CMAKE_CURRENT_SOURCE_DIR}/mocPlugin"
- mocPlugin
- CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
- "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}"
- OUTPUT_VARIABLE output
- )
- if (NOT MOC_PLUGIN)
- message(SEND_ERROR "Initial build of mocPlugin failed. Output: ${output}")
- endif()
-
- set(timeformat "%Y%j%H%M%S")
- set(mocPlugSrcDir "${CMAKE_CURRENT_SOURCE_DIR}/mocPlugin")
- set(mocPlugBinDir "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin")
- find_library(plAFile "PlugA" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH)
- find_library(plBFile "PlugB" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH)
- find_library(plCFile "PlugC" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH)
- find_library(plDFile "PlugD" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH)
-
- file(TIMESTAMP "${plAFile}" plABefore "${timeformat}")
- file(TIMESTAMP "${plBFile}" plBBefore "${timeformat}")
- file(TIMESTAMP "${plCFile}" plCBefore "${timeformat}")
- file(TIMESTAMP "${plDFile}" plDBefore "${timeformat}")
-
- # Ensure that the timestamp will change and change the json files
- execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1)
- configure_file("${mocPlugSrcDir}/jsonIn/StyleD.json" "${mocPlugBinDir}/jsonFiles/StyleC.json")
- configure_file("${mocPlugSrcDir}/jsonIn/StyleC.json" "${mocPlugBinDir}/jsonFiles/sub/StyleD.json")
- execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocPlugBinDir}")
-
- file(TIMESTAMP "${plAFile}" plAAfter "${timeformat}")
- file(TIMESTAMP "${plBFile}" plBAfter "${timeformat}")
- file(TIMESTAMP "${plCFile}" plCAfter "${timeformat}")
- file(TIMESTAMP "${plDFile}" plDAfter "${timeformat}")
-
- if (plAAfter GREATER plABefore)
- message(SEND_ERROR "file (${plAFile}) should not have changed!")
- endif()
- if (plBAfter GREATER plBBefore)
- message(SEND_ERROR "file (${plBFile}) should not have changed!")
- endif()
- if (NOT plCAfter GREATER plCBefore)
- message(SEND_ERROR "file (${plCFile}) should have changed!")
- endif()
- if (NOT plDAfter GREATER plDBefore)
- message(SEND_ERROR "file (${plDFile}) should have changed!")
- endif()
-
- # Test custom macro
- file(TIMESTAMP "${plCFile}" plCBefore "${timeformat}")
- file(TIMESTAMP "${plDFile}" plDBefore "${timeformat}")
- execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1)
- configure_file("${mocPlugSrcDir}/jsonIn/StyleD.json" "${mocPlugBinDir}/jsonFiles/StyleC_Custom.json")
- configure_file("${mocPlugSrcDir}/jsonIn/StyleC.json" "${mocPlugBinDir}/jsonFiles/sub/StyleD_Custom.json")
- execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocPlugBinDir}")
- file(TIMESTAMP "${plCFile}" plCAfter "${timeformat}")
- file(TIMESTAMP "${plDFile}" plDAfter "${timeformat}")
- if (NOT plCAfter GREATER plCBefore)
- message(SEND_ERROR "file (${plCFile}) should have changed!")
- endif()
- if (NOT plDAfter GREATER plDBefore)
- message(SEND_ERROR "file (${plDFile}) should have changed!")
- endif()
-
+# Tests policy 0071
+if(ALLOW_WRAP_CPP)
+ add_subdirectory(mocCMP0071)
endif()
# -- Test
@@ -361,5 +213,9 @@ endif()
add_subdirectory(uicInclude)
# -- Test
+# OBJECT libraries
+add_subdirectory(objectLibrary)
+
+# -- Test
# Complex test case
add_subdirectory(complex)
diff --git a/Tests/QtAutogen/complex/CMakeLists.txt b/Tests/QtAutogen/complex/CMakeLists.txt
index d48f6cc..2043ccf 100644
--- a/Tests/QtAutogen/complex/CMakeLists.txt
+++ b/Tests/QtAutogen/complex/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.7)
+cmake_minimum_required(VERSION 3.9)
# -- Test: AUTOMOC AUTORCC AUTOUIC
add_definitions(-DFOO -DSomeDefine="Barx")
diff --git a/Tests/QtAutogen/mocCMP0071/CMakeLists.txt b/Tests/QtAutogen/mocCMP0071/CMakeLists.txt
new file mode 100644
index 0000000..003fa08
--- /dev/null
+++ b/Tests/QtAutogen/mocCMP0071/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.9)
+project(mocCMP0071 CXX)
+add_subdirectory(OLD)
+add_subdirectory(NEW)
diff --git a/Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt b/Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt
new file mode 100644
index 0000000..0237afc
--- /dev/null
+++ b/Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.9)
+cmake_policy(SET CMP0071 NEW)
+
+# *Generate* files
+set(CSD ${CMAKE_CURRENT_SOURCE_DIR})
+set(CBD ${CMAKE_CURRENT_BINARY_DIR})
+add_custom_command(
+ OUTPUT ${CBD}/Obj_p.h ${CBD}/Obj.hpp ${CBD}/Obj.cpp ${CBD}/main.cpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj_p.h ${CBD}/Obj_p.h
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.hpp ${CBD}/Obj.hpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.cpp ${CBD}/Obj.cpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../main.cpp ${CBD}/main.cpp)
+
+add_executable(mocCMP0071New ${CBD}/Obj.cpp ${CBD}/main.cpp)
+target_link_libraries(mocCMP0071New ${QT_LIBRARIES})
+set_target_properties(mocCMP0071New PROPERTIES AUTOMOC ON)
diff --git a/Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt b/Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt
new file mode 100644
index 0000000..5699433
--- /dev/null
+++ b/Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 3.9)
+cmake_policy(SET CMP0071 OLD)
+
+# *Generate* files
+set(CSD ${CMAKE_CURRENT_SOURCE_DIR})
+set(CBD ${CMAKE_CURRENT_BINARY_DIR})
+add_custom_command(
+ OUTPUT ${CBD}/Obj_p.h ${CBD}/Obj.hpp ${CBD}/Obj.cpp ${CBD}/main.cpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj_p.h ${CBD}/Obj_p.h
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.hpp ${CBD}/Obj.hpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.cpp ${CBD}/Obj.cpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../main.cpp ${CBD}/main.cpp)
+
+# Generate moc files externally
+qtx_wrap_cpp(mocCMP0071OldMoc ${CBD}/Obj.hpp ${CBD}/Obj_p.h)
+add_executable(mocCMP0071Old ${CBD}/Obj.cpp ${CBD}/main.cpp ${mocCMP0071OldMoc})
+target_link_libraries(mocCMP0071Old ${QT_LIBRARIES})
+set_target_properties(mocCMP0071Old PROPERTIES AUTOMOC ON)
diff --git a/Tests/QtAutogen/mocCMP0071/Obj.cpp b/Tests/QtAutogen/mocCMP0071/Obj.cpp
new file mode 100644
index 0000000..1ae50ed
--- /dev/null
+++ b/Tests/QtAutogen/mocCMP0071/Obj.cpp
@@ -0,0 +1,20 @@
+#include "Obj.hpp"
+#include "Obj_p.h"
+
+ObjPrivate::ObjPrivate()
+{
+}
+
+ObjPrivate::~ObjPrivate()
+{
+}
+
+Obj::Obj()
+ : d(new ObjPrivate)
+{
+}
+
+Obj::~Obj()
+{
+ delete d;
+}
diff --git a/Tests/QtAutogen/mocCMP0071/Obj.hpp b/Tests/QtAutogen/mocCMP0071/Obj.hpp
new file mode 100644
index 0000000..f064e47
--- /dev/null
+++ b/Tests/QtAutogen/mocCMP0071/Obj.hpp
@@ -0,0 +1,19 @@
+#ifndef OBJ_HPP
+#define OBJ_HPP
+
+#include <QObject>
+
+// Object source comes without any _moc/.moc includes
+class ObjPrivate;
+class Obj : public QObject
+{
+ Q_OBJECT
+public:
+ Obj();
+ ~Obj();
+
+private:
+ ObjPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocCMP0071/Obj_p.h b/Tests/QtAutogen/mocCMP0071/Obj_p.h
new file mode 100644
index 0000000..cb1e5df
--- /dev/null
+++ b/Tests/QtAutogen/mocCMP0071/Obj_p.h
@@ -0,0 +1,14 @@
+#ifndef OBJ_P_HPP
+#define OBJ_P_HPP
+
+#include <QObject>
+
+class ObjPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ ObjPrivate();
+ ~ObjPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocCMP0071/main.cpp b/Tests/QtAutogen/mocCMP0071/main.cpp
new file mode 100644
index 0000000..3887840
--- /dev/null
+++ b/Tests/QtAutogen/mocCMP0071/main.cpp
@@ -0,0 +1,7 @@
+#include "Obj.hpp"
+
+int main(int argv, char** args)
+{
+ Obj obj;
+ return 0;
+}
diff --git a/Tests/QtAutogen/mocDepends/CMakeLists.txt b/Tests/QtAutogen/mocDepends/CMakeLists.txt
index a67dcfe..d71d740 100644
--- a/Tests/QtAutogen/mocDepends/CMakeLists.txt
+++ b/Tests/QtAutogen/mocDepends/CMakeLists.txt
@@ -1,5 +1,6 @@
-cmake_minimum_required(VERSION 3.7)
-project(mocDepends)
+cmake_minimum_required(VERSION 3.9)
+cmake_policy(SET CMP0071 NEW)
+project(mocDepends CXX)
if (QT_TEST_VERSION STREQUAL 4)
find_package(Qt4 REQUIRED)
@@ -15,33 +16,80 @@ endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})
-# -- Test 1 using generated header
-# This tests the dependency of AUTOMOC of mocDepends1 to the generated object.hpp
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/object.hpp
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/invalid.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/object.hpp
- COMMAND ${CMAKE_COMMAND} -E sleep 3
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/object.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/object.hpp
- )
-
-add_executable(mocDepends1 test1.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/object.hpp
-)
+# -- Test 1: Depend on generated header
+# The ORIGIN_autogen target must depend on the same *GENERATED* source files as
+# the ORIGIN target. This is a requirement to ensure that all files for the
+# ORIGIN target are generated before the ORIGIN_autogen target is built.
+#
+# This tests the dependency of the mocDepends1_autogen target of mocDepends1
+# to the source file test1_object.hpp, which is *GENERATED* by a custom command.
+# If mocDepends1_autogen gets built *before* or in *parallel* to the
+# custom command, the build will fail. That's because test1_object.hpp,
+# which is required by mocDepends1_autogen, is only valid after the
+# custom command has been completed.
+#
+# The sleep seconds artificially increase the build time of the custom command
+# to simulate a slow file generation process that takes longer to run than
+# the build of the mocDepends1_autogen target.
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test1_object.hpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/invalid.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/test1_object.hpp
+ COMMAND ${CMAKE_COMMAND} -E sleep 3
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/object.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/test1_object.hpp)
+
+add_executable(mocDepends1 test1.cpp ${CMAKE_CURRENT_BINARY_DIR}/test1_object.hpp)
target_link_libraries(mocDepends1 ${QT_CORE_TARGET})
set_target_properties(mocDepends1 PROPERTIES AUTOMOC TRUE)
-set_property(TARGET mocDepends1 PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
-
-# -- Test 2 using generated library
-# This tests the dependency of AUTOMOC of mocDepends2 to the
-# generated simpleLib.hpp which belongs to a linked library of mocDepends2
-add_custom_command(OUTPUT simpleLib.hpp simpleLib.cpp
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/invalid.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.hpp
- COMMAND ${CMAKE_COMMAND} -E sleep 3
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/simpleLib.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.hpp
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/simpleLib.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.cpp
- )
-add_library(SimpleLib STATIC simpleLib.hpp simpleLib.cpp)
-
-add_executable(mocDepends2 test2.cpp )
-target_link_libraries(mocDepends2 SimpleLib ${QT_CORE_TARGET})
+
+# -- Test 2: Depend on header generating target
+# The ORIGIN_autogen target must depend on the same user defined targets
+# as the ORIGIN target. This is a requirement to ensure that all files for the
+# ORIGIN target are generated before the ORIGIN_autogen target is built.
+#
+# This tests the dependency of the mocDepends2_autogen target of mocDepends2
+# to the utility target mocDepends2Object. If mocDepends2_autogen gets built
+# *before* or in *parallel* to mocDepends2Object, the build will fail. That's
+# because test2_object.hpp, which is required by mocDepends2_autogen,
+# is only valid after the mocDepends2Object build has been completed.
+#
+# The sleep seconds artificially increase the build time of mocDepends2Object
+# to simulate a slow utility target build that takes longer to run than
+# the build of the mocDepends2_autogen target.
+add_custom_target(mocDepends2Object
+ BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/test2_object.hpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/invalid.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/test2_object.hpp
+ COMMAND ${CMAKE_COMMAND} -E sleep 3
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/object.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/test2_object.hpp)
+
+add_executable(mocDepends2 test2.cpp)
+target_link_libraries(mocDepends2 ${QT_CORE_TARGET})
set_target_properties(mocDepends2 PROPERTIES AUTOMOC TRUE)
-set_property(TARGET mocDepends2 PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
+add_dependencies(mocDepends2 mocDepends2Object)
+
+# -- Test 3: Depend on generated linked library
+# The ORIGIN_autogen target must depend on the same linked libraries
+# as the ORIGIN target. This is a requirement to ensure that all files for the
+# ORIGIN target are generated before the ORIGIN_autogen target is built.
+#
+# This tests the dependency of the mocDepends3_autogen target of mocDepends3
+# to the user generated library SimpleLib, which mocDepends3 links to.
+# If mocDepends3_autogen gets built *before* or in *parallel* to SimpleLib,
+# the build will fail. That's because simpleLib.hpp, which is required by
+# mocDepends3_autogen, is only valid after the SimpleLib build has been
+# completed.
+#
+# The sleep seconds artificially increase the build time of SimpleLib
+# to simulate a slow utility library build that takes longer to run than
+# the build of the mocDepends3_autogen target.
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.hpp ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.cpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/invalid.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.hpp
+ COMMAND ${CMAKE_COMMAND} -E sleep 3
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/simpleLib.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.hpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/simpleLib.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.cpp)
+add_library(SimpleLib STATIC ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.hpp ${CMAKE_CURRENT_BINARY_DIR}/simpleLib.cpp)
+target_link_libraries(SimpleLib ${QT_CORE_TARGET})
+
+add_executable(mocDepends3 test3.cpp)
+target_link_libraries(mocDepends3 SimpleLib ${QT_CORE_TARGET})
+set_target_properties(mocDepends3 PROPERTIES AUTOMOC TRUE)
diff --git a/Tests/QtAutogen/mocDepends/simpleLib.hpp.in b/Tests/QtAutogen/mocDepends/simpleLib.hpp.in
index 758f1f6..b65b0cb 100644
--- a/Tests/QtAutogen/mocDepends/simpleLib.hpp.in
+++ b/Tests/QtAutogen/mocDepends/simpleLib.hpp.in
@@ -1,8 +1,11 @@
#ifndef SIMPLE_LIB_H
#define SIMPLE_LIB_H
-class SimpleLib
+#include <QObject>
+
+class SimpleLib : public QObject
{
+ Q_OBJECT
public:
SimpleLib();
~SimpleLib();
diff --git a/Tests/QtAutogen/mocDepends/test1.cpp b/Tests/QtAutogen/mocDepends/test1.cpp
index 92c259c..002dfd8 100644
--- a/Tests/QtAutogen/mocDepends/test1.cpp
+++ b/Tests/QtAutogen/mocDepends/test1.cpp
@@ -1,9 +1,8 @@
-#include "object.hpp"
+#include "test1_object.hpp"
int main()
{
Object obj;
-
return 0;
}
diff --git a/Tests/QtAutogen/mocDepends/test2.cpp b/Tests/QtAutogen/mocDepends/test2.cpp
index 155b19b..3fd845e 100644
--- a/Tests/QtAutogen/mocDepends/test2.cpp
+++ b/Tests/QtAutogen/mocDepends/test2.cpp
@@ -1,10 +1,9 @@
-#include "test2.hpp"
+#include "moc_test2_object.cpp"
+#include "test2_object.hpp"
int main()
{
- SimpleLib obj;
- LObject lobject;
-
+ Object obj;
return 0;
}
diff --git a/Tests/QtAutogen/mocDepends/test3.cpp b/Tests/QtAutogen/mocDepends/test3.cpp
new file mode 100644
index 0000000..a009598
--- /dev/null
+++ b/Tests/QtAutogen/mocDepends/test3.cpp
@@ -0,0 +1,12 @@
+
+#include "test3.hpp"
+
+int main()
+{
+ SimpleLib libObject;
+ LObject lobject;
+ return 0;
+}
+
+// AUTOMOC the SimpleLib header simpleLib.hpp
+#include "moc_simpleLib.cpp"
diff --git a/Tests/QtAutogen/mocDepends/test2.hpp b/Tests/QtAutogen/mocDepends/test3.hpp
index 0125f07..408335b 100644
--- a/Tests/QtAutogen/mocDepends/test2.hpp
+++ b/Tests/QtAutogen/mocDepends/test3.hpp
@@ -1,5 +1,5 @@
-#ifndef TEST2_HPP
-#define TEST2_HPP
+#ifndef TEST3_HPP
+#define TEST3_HPP
#include "simpleLib.hpp"
#include <QObject>
diff --git a/Tests/QtAutogen/mocInclude/EObjA.cpp b/Tests/QtAutogen/mocInclude/EObjA.cpp
new file mode 100644
index 0000000..ca713b2
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjA.cpp
@@ -0,0 +1,43 @@
+#include "EObjA.hpp"
+#include "EObjAExtra.hpp"
+#include "EObjA_p.hpp"
+
+class EObjALocal : public QObject
+{
+ Q_OBJECT
+public:
+ EObjALocal();
+ ~EObjALocal();
+};
+
+EObjALocal::EObjALocal()
+{
+}
+
+EObjALocal::~EObjALocal()
+{
+}
+
+EObjAPrivate::EObjAPrivate()
+{
+ EObjALocal localObj;
+ EObjAExtra extraObj;
+}
+
+EObjAPrivate::~EObjAPrivate()
+{
+}
+
+EObjA::EObjA()
+ : d(new EObjAPrivate)
+{
+}
+
+EObjA::~EObjA()
+{
+}
+
+// For EObjALocal
+#include "EObjA.moc"
+// - Not the own header
+#include "moc_EObjAExtra.cpp"
diff --git a/Tests/QtAutogen/mocInclude/EObjA.hpp b/Tests/QtAutogen/mocInclude/EObjA.hpp
new file mode 100644
index 0000000..0939ab6
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjA.hpp
@@ -0,0 +1,19 @@
+#ifndef EOBJA_HPP
+#define EOBJA_HPP
+
+#include <QObject>
+
+// Sources includes a moc_ includes of an extra object
+class EObjAPrivate;
+class EObjA : public QObject
+{
+ Q_OBJECT
+public:
+ EObjA();
+ ~EObjA();
+
+private:
+ EObjAPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/EObjAExtra.cpp b/Tests/QtAutogen/mocInclude/EObjAExtra.cpp
new file mode 100644
index 0000000..369ca8f
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjAExtra.cpp
@@ -0,0 +1,20 @@
+#include "EObjAExtra.hpp"
+#include "EObjAExtra_p.hpp"
+
+EObjAExtraPrivate::EObjAExtraPrivate()
+{
+}
+
+EObjAExtraPrivate::~EObjAExtraPrivate()
+{
+}
+
+EObjAExtra::EObjAExtra()
+ : d(new EObjAExtraPrivate)
+{
+}
+
+EObjAExtra::~EObjAExtra()
+{
+ delete d;
+}
diff --git a/Tests/QtAutogen/mocInclude/EObjAExtra.hpp b/Tests/QtAutogen/mocInclude/EObjAExtra.hpp
new file mode 100644
index 0000000..b10681d
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjAExtra.hpp
@@ -0,0 +1,18 @@
+#ifndef EOBJAEXTRA_HPP
+#define EOBJAEXTRA_HPP
+
+#include <QObject>
+
+class EObjAExtraPrivate;
+class EObjAExtra : public QObject
+{
+ Q_OBJECT
+public:
+ EObjAExtra();
+ ~EObjAExtra();
+
+private:
+ EObjAExtraPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp b/Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp
new file mode 100644
index 0000000..dea6cb5
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp
@@ -0,0 +1,12 @@
+#ifndef EOBJAEXTRA_P_HPP
+#define EOBJAEXTRA_P_HPP
+
+class EObjAExtraPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ EObjAExtraPrivate();
+ ~EObjAExtraPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/EObjA_p.hpp b/Tests/QtAutogen/mocInclude/EObjA_p.hpp
new file mode 100644
index 0000000..1e0d7e1
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjA_p.hpp
@@ -0,0 +1,12 @@
+#ifndef EOBJA_P_HPP
+#define EOBJA_P_HPP
+
+class EObjAPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ EObjAPrivate();
+ ~EObjAPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/EObjB.cpp b/Tests/QtAutogen/mocInclude/EObjB.cpp
new file mode 100644
index 0000000..d19fbfa
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjB.cpp
@@ -0,0 +1,44 @@
+#include "EObjB.hpp"
+#include "EObjB_p.hpp"
+#include "subExtra/EObjBExtra.hpp"
+
+class EObjBLocal : public QObject
+{
+ Q_OBJECT
+public:
+ EObjBLocal();
+ ~EObjBLocal();
+};
+
+EObjBLocal::EObjBLocal()
+{
+}
+
+EObjBLocal::~EObjBLocal()
+{
+}
+
+EObjBPrivate::EObjBPrivate()
+{
+ EObjBLocal localObj;
+ EObjBExtra extraObj;
+}
+
+EObjBPrivate::~EObjBPrivate()
+{
+}
+
+EObjB::EObjB()
+ : d(new EObjBPrivate)
+{
+}
+
+EObjB::~EObjB()
+{
+}
+
+// For EObjBLocal
+#include "EObjB.moc"
+// - Not the own header
+// - in a subdirectory
+#include "subExtra/moc_EObjBExtra.cpp"
diff --git a/Tests/QtAutogen/mocInclude/EObjB.hpp b/Tests/QtAutogen/mocInclude/EObjB.hpp
new file mode 100644
index 0000000..6632bdb
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjB.hpp
@@ -0,0 +1,19 @@
+#ifndef EOBJB_HPP
+#define EOBJB_HPP
+
+#include <QObject>
+
+// Sources includes a moc_ includes of an extra object in a subdirectory
+class EObjBPrivate;
+class EObjB : public QObject
+{
+ Q_OBJECT
+public:
+ EObjB();
+ ~EObjB();
+
+private:
+ EObjBPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/EObjB_p.hpp b/Tests/QtAutogen/mocInclude/EObjB_p.hpp
new file mode 100644
index 0000000..2905f28
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjB_p.hpp
@@ -0,0 +1,12 @@
+#ifndef EOBJB_P_HPP
+#define EOBJB_P_HPP
+
+class EObjBPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ EObjBPrivate();
+ ~EObjBPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/LObjA.cpp b/Tests/QtAutogen/mocInclude/LObjA.cpp
new file mode 100644
index 0000000..9aae991
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjA.cpp
@@ -0,0 +1,39 @@
+#include "LObjA.hpp"
+#include "LObjA_p.h"
+
+class LObjALocal : public QObject
+{
+ Q_OBJECT
+public:
+ LObjALocal();
+ ~LObjALocal();
+};
+
+LObjALocal::LObjALocal()
+{
+}
+
+LObjALocal::~LObjALocal()
+{
+}
+
+LObjAPrivate::LObjAPrivate()
+{
+ LObjALocal localObj;
+}
+
+LObjAPrivate::~LObjAPrivate()
+{
+}
+
+LObjA::LObjA()
+ : d(new LObjAPrivate)
+{
+}
+
+LObjA::~LObjA()
+{
+ delete d;
+}
+
+#include "LObjA.moc"
diff --git a/Tests/QtAutogen/mocInclude/LObjA.hpp b/Tests/QtAutogen/mocInclude/LObjA.hpp
new file mode 100644
index 0000000..aac670c
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjA.hpp
@@ -0,0 +1,19 @@
+#ifndef LOBJA_HPP
+#define LOBJA_HPP
+
+#include <QObject>
+
+// Object source comes with a .moc include
+class LObjAPrivate;
+class LObjA : public QObject
+{
+ Q_OBJECT
+public:
+ LObjA();
+ ~LObjA();
+
+private:
+ LObjAPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/LObjA_p.h b/Tests/QtAutogen/mocInclude/LObjA_p.h
new file mode 100644
index 0000000..ebe8395
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjA_p.h
@@ -0,0 +1,12 @@
+#ifndef LOBJA_P_HPP
+#define LOBJA_P_HPP
+
+class LObjAPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ LObjAPrivate();
+ ~LObjAPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/LObjB.cpp b/Tests/QtAutogen/mocInclude/LObjB.cpp
new file mode 100644
index 0000000..7485d8f
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjB.cpp
@@ -0,0 +1,40 @@
+#include "LObjB.hpp"
+#include "LObjB_p.h"
+
+class LObjBLocal : public QObject
+{
+ Q_OBJECT
+public:
+ LObjBLocal();
+ ~LObjBLocal();
+};
+
+LObjBLocal::LObjBLocal()
+{
+}
+
+LObjBLocal::~LObjBLocal()
+{
+}
+
+LObjBPrivate::LObjBPrivate()
+{
+ LObjBLocal localObj;
+}
+
+LObjBPrivate::~LObjBPrivate()
+{
+}
+
+LObjB::LObjB()
+ : d(new LObjBPrivate)
+{
+}
+
+LObjB::~LObjB()
+{
+ delete d;
+}
+
+#include "LObjB.moc"
+#include "moc_LObjB.cpp"
diff --git a/Tests/QtAutogen/mocInclude/LObjB.hpp b/Tests/QtAutogen/mocInclude/LObjB.hpp
new file mode 100644
index 0000000..eb4e58d
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjB.hpp
@@ -0,0 +1,19 @@
+#ifndef LLObjB_HPP
+#define LLObjB_HPP
+
+#include <QObject>
+
+// Object source comes with a .moc and a _moc include
+class LObjBPrivate;
+class LObjB : public QObject
+{
+ Q_OBJECT
+public:
+ LObjB();
+ ~LObjB();
+
+private:
+ LObjBPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/LObjB_p.h b/Tests/QtAutogen/mocInclude/LObjB_p.h
new file mode 100644
index 0000000..b871f2d
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjB_p.h
@@ -0,0 +1,12 @@
+#ifndef LOBJB_P_HPP
+#define LOBJB_P_HPP
+
+class LObjBPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ LObjBPrivate();
+ ~LObjBPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/ObjA.cpp b/Tests/QtAutogen/mocInclude/ObjA.cpp
index 1b0311d..6f6b90e 100644
--- a/Tests/QtAutogen/mocInclude/ObjA.cpp
+++ b/Tests/QtAutogen/mocInclude/ObjA.cpp
@@ -1,24 +1,20 @@
#include "ObjA.hpp"
+#include "ObjA_p.h"
-class SubObjA : public QObject
+ObjAPrivate::ObjAPrivate()
{
- Q_OBJECT
-
-public:
- SubObjA() {}
- ~SubObjA() {}
-
- Q_SLOT
- void aSlot();
-};
+}
-void SubObjA::aSlot()
+ObjAPrivate::~ObjAPrivate()
{
}
-void ObjA::go()
+ObjA::ObjA()
+ : d(new ObjAPrivate)
{
- SubObjA subObj;
}
-#include "ObjA.moc"
+ObjA::~ObjA()
+{
+ delete d;
+}
diff --git a/Tests/QtAutogen/mocInclude/ObjA.hpp b/Tests/QtAutogen/mocInclude/ObjA.hpp
index 281e90d..f16c924 100644
--- a/Tests/QtAutogen/mocInclude/ObjA.hpp
+++ b/Tests/QtAutogen/mocInclude/ObjA.hpp
@@ -3,11 +3,17 @@
#include <QObject>
+// Object source comes without any _moc/.moc includes
+class ObjAPrivate;
class ObjA : public QObject
{
Q_OBJECT
- Q_SLOT
- void go();
+public:
+ ObjA();
+ ~ObjA();
+
+private:
+ ObjAPrivate* const d;
};
#endif
diff --git a/Tests/QtAutogen/mocInclude/ObjA_p.h b/Tests/QtAutogen/mocInclude/ObjA_p.h
new file mode 100644
index 0000000..eb60c98
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/ObjA_p.h
@@ -0,0 +1,12 @@
+#ifndef OBJA_P_HPP
+#define OBJA_P_HPP
+
+class ObjAPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ ObjAPrivate();
+ ~ObjAPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/ObjB.cpp b/Tests/QtAutogen/mocInclude/ObjB.cpp
index 5ff315d..a6f2509 100644
--- a/Tests/QtAutogen/mocInclude/ObjB.cpp
+++ b/Tests/QtAutogen/mocInclude/ObjB.cpp
@@ -1,25 +1,22 @@
#include "ObjB.hpp"
+#include "ObjB_p.h"
-class SubObjB : public QObject
+ObjBPrivate::ObjBPrivate()
{
- Q_OBJECT
-
-public:
- SubObjB() {}
- ~SubObjB() {}
+}
- Q_SLOT
- void aSlot();
-};
+ObjBPrivate::~ObjBPrivate()
+{
+}
-void SubObjB::aSlot()
+ObjB::ObjB()
+ : d(new ObjBPrivate)
{
}
-void ObjB::go()
+ObjB::~ObjB()
{
- SubObjB subObj;
+ delete d;
}
-#include "ObjB.moc"
#include "moc_ObjB.cpp"
diff --git a/Tests/QtAutogen/mocInclude/ObjB.hpp b/Tests/QtAutogen/mocInclude/ObjB.hpp
index 94f3d49..2ac8d17 100644
--- a/Tests/QtAutogen/mocInclude/ObjB.hpp
+++ b/Tests/QtAutogen/mocInclude/ObjB.hpp
@@ -1,13 +1,19 @@
-#ifndef OBJB_HPP
-#define OBJB_HPP
+#ifndef ObjB_HPP
+#define ObjB_HPP
#include <QObject>
+// Object source comes with a _moc include
+class ObjBPrivate;
class ObjB : public QObject
{
Q_OBJECT
- Q_SLOT
- void go();
+public:
+ ObjB();
+ ~ObjB();
+
+private:
+ ObjBPrivate* const d;
};
#endif
diff --git a/Tests/QtAutogen/mocInclude/ObjB_p.h b/Tests/QtAutogen/mocInclude/ObjB_p.h
new file mode 100644
index 0000000..418da65
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/ObjB_p.h
@@ -0,0 +1,12 @@
+#ifndef OBJB_P_HPP
+#define OBJB_P_HPP
+
+class ObjBPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ ObjBPrivate();
+ ~ObjBPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/ObjC.cpp b/Tests/QtAutogen/mocInclude/ObjC.cpp
deleted file mode 100644
index 8ca34cb..0000000
--- a/Tests/QtAutogen/mocInclude/ObjC.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "ObjC.hpp"
-
-class SubObjC : public QObject
-{
- Q_OBJECT
-
-public:
- SubObjC() {}
- ~SubObjC() {}
-
- Q_SLOT
- void aSlot();
-};
-
-void SubObjC::aSlot()
-{
-}
-
-void ObjC::go()
-{
- SubObjC subObj;
-}
-
-#include "ObjC.moc"
-// Not the own header
-#include "moc_ObjD.cpp"
diff --git a/Tests/QtAutogen/mocInclude/ObjC.hpp b/Tests/QtAutogen/mocInclude/ObjC.hpp
deleted file mode 100644
index a8e98eb..0000000
--- a/Tests/QtAutogen/mocInclude/ObjC.hpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef OBJC_HPP
-#define OBJC_HPP
-
-#include <QObject>
-
-class ObjC : public QObject
-{
- Q_OBJECT
- Q_SLOT
- void go();
-};
-
-#endif
diff --git a/Tests/QtAutogen/mocInclude/ObjD.cpp b/Tests/QtAutogen/mocInclude/ObjD.cpp
deleted file mode 100644
index c18aec1..0000000
--- a/Tests/QtAutogen/mocInclude/ObjD.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "ObjD.hpp"
-
-class SubObjD : public QObject
-{
- Q_OBJECT
-
-public:
- SubObjD() {}
- ~SubObjD() {}
-
- Q_SLOT
- void aSlot();
-};
-
-void SubObjD::aSlot()
-{
-}
-
-void ObjD::go()
-{
- SubObjD subObj;
-}
-
-#include "ObjD.moc"
-// Header in subdirectory
-#include "subA/moc_SubObjA.cpp"
diff --git a/Tests/QtAutogen/mocInclude/ObjD.hpp b/Tests/QtAutogen/mocInclude/ObjD.hpp
deleted file mode 100644
index b6ee098..0000000
--- a/Tests/QtAutogen/mocInclude/ObjD.hpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef OBJD_HPP
-#define OBJD_HPP
-
-#include <QObject>
-
-class ObjD : public QObject
-{
- Q_OBJECT
- Q_SLOT
- void go();
-};
-
-#endif
diff --git a/Tests/QtAutogen/mocInclude/SObjA.cpp b/Tests/QtAutogen/mocInclude/SObjA.cpp
new file mode 100644
index 0000000..7e75bf9
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjA.cpp
@@ -0,0 +1,11 @@
+#include "SObjA.hpp"
+
+SObjA::SObjA()
+{
+}
+
+SObjA::~SObjA()
+{
+}
+
+#include "SObjA.moc"
diff --git a/Tests/QtAutogen/mocInclude/SObjA.hpp b/Tests/QtAutogen/mocInclude/SObjA.hpp
new file mode 100644
index 0000000..1436abc
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjA.hpp
@@ -0,0 +1,15 @@
+#ifndef SOBJA_HPP
+#define SOBJA_HPP
+
+#include <QObject>
+
+// Object source includes externally generated .moc file
+class SObjA : public QObject
+{
+ Q_OBJECT
+public:
+ SObjA();
+ ~SObjA();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/SObjB.cpp.in b/Tests/QtAutogen/mocInclude/SObjB.cpp.in
new file mode 100644
index 0000000..b1cc12a
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjB.cpp.in
@@ -0,0 +1,11 @@
+#include "SObjB.hpp"
+
+SObjB::SObjB()
+{
+}
+
+SObjB::~SObjB()
+{
+}
+
+#include "SObjB.moc"
diff --git a/Tests/QtAutogen/mocInclude/SObjB.hpp.in b/Tests/QtAutogen/mocInclude/SObjB.hpp.in
new file mode 100644
index 0000000..5e396ae
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjB.hpp.in
@@ -0,0 +1,15 @@
+#ifndef SOBJB_HPP
+#define SOBJB_HPP
+
+#include <QObject>
+
+// Object source includes externally generated .moc file
+class SObjB : public QObject
+{
+ Q_OBJECT
+public:
+ SObjB();
+ ~SObjB();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/SObjC.cpp b/Tests/QtAutogen/mocInclude/SObjC.cpp
new file mode 100644
index 0000000..1e8d397
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjC.cpp
@@ -0,0 +1,35 @@
+#include "SObjC.hpp"
+
+void SObjCLocalFunction();
+
+class SObjCLocal : public QObject
+{
+ Q_OBJECT
+
+public:
+ SObjCLocal();
+ ~SObjCLocal();
+};
+
+SObjCLocal::SObjCLocal()
+{
+}
+
+SObjCLocal::~SObjCLocal()
+{
+}
+
+SObjC::SObjC()
+{
+ SObjCLocal localObject;
+ SObjCLocalFunction();
+}
+
+SObjC::~SObjC()
+{
+}
+
+#include "SObjC.moc"
+#include "moc_SObjC.cpp"
+// Include moc_ file for which the header is SKIP_AUTOMOC enabled
+#include "moc_SObjCExtra.cpp"
diff --git a/Tests/QtAutogen/mocInclude/SObjC.hpp b/Tests/QtAutogen/mocInclude/SObjC.hpp
new file mode 100644
index 0000000..def0f9d
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjC.hpp
@@ -0,0 +1,15 @@
+#ifndef SOBJC_HPP
+#define SOBJC_HPP
+
+#include <QObject>
+
+// Object source includes externally generated .moc file
+class SObjC : public QObject
+{
+ Q_OBJECT
+public:
+ SObjC();
+ ~SObjC();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/SObjCExtra.cpp b/Tests/QtAutogen/mocInclude/SObjCExtra.cpp
new file mode 100644
index 0000000..55dd1c3
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjCExtra.cpp
@@ -0,0 +1,31 @@
+#include "SObjCExtra.hpp"
+
+class SObjCLocalExtra : public QObject
+{
+ Q_OBJECT
+
+public:
+ SObjCLocalExtra();
+ ~SObjCLocalExtra();
+};
+
+SObjCLocalExtra::SObjCLocalExtra()
+{
+}
+
+SObjCLocalExtra::~SObjCLocalExtra()
+{
+}
+
+SObjCExtra::SObjCExtra()
+{
+}
+
+SObjCExtra::~SObjCExtra()
+{
+}
+
+// Externally generated header moc
+#include "SObjCExtra_extMoc.cpp"
+// AUTOMOC generated source moc
+#include "SObjCExtra.moc"
diff --git a/Tests/QtAutogen/mocInclude/SObjCExtra.hpp b/Tests/QtAutogen/mocInclude/SObjCExtra.hpp
new file mode 100644
index 0000000..08545ac
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjCExtra.hpp
@@ -0,0 +1,15 @@
+#ifndef SOBJCEXTRA_HPP
+#define SOBJCEXTRA_HPP
+
+#include <QObject>
+
+// Object source includes externally generated .moc file
+class SObjCExtra : public QObject
+{
+ Q_OBJECT
+public:
+ SObjCExtra();
+ ~SObjCExtra();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/SObjCExtra.moc.in b/Tests/QtAutogen/mocInclude/SObjCExtra.moc.in
new file mode 100644
index 0000000..00fc4aa
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjCExtra.moc.in
@@ -0,0 +1,4 @@
+
+void SObjCLocalFunction()
+{
+}
diff --git a/Tests/QtAutogen/mocInclude/shared.cmake b/Tests/QtAutogen/mocInclude/shared.cmake
new file mode 100644
index 0000000..d05f27c
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/shared.cmake
@@ -0,0 +1,71 @@
+# Test moc include patterns
+include_directories("../mocInclude")
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+# Generate .moc file externally and enabled SKIP_AUTOMOC on the file
+qtx_generate_moc(
+ ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjA.hpp
+ ${CMAKE_CURRENT_BINARY_DIR}/SObjA.moc)
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjA.cpp PROPERTY SKIP_AUTOMOC ON)
+
+# Generate .moc file externally from generated source file
+# and enabled SKIP_AUTOMOC on the source file
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjB.hpp.in
+ ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp)
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjB.cpp.in
+ ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp)
+qtx_generate_moc(
+ ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp
+ ${CMAKE_CURRENT_BINARY_DIR}/SObjB.moc)
+set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp PROPERTY SKIP_AUTOMOC ON)
+
+# Generate moc file externally and enabled SKIP_AUTOMOC on the header
+qtx_generate_moc(
+ ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjCExtra.hpp
+ ${CMAKE_CURRENT_BINARY_DIR}/SObjCExtra_extMoc.cpp)
+set_property(
+ SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjCExtra.hpp
+ PROPERTY SKIP_AUTOMOC ON)
+# Custom target to depend on
+set(SOBJC_MOC ${CMAKE_CURRENT_BINARY_DIR}/moc_SObjCExtra.cpp)
+add_custom_target("${MOC_INCLUDE_NAME}_SOBJC"
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/SObjCExtra_extMoc.cpp
+ BYPRODUCTS ${SOBJC_MOC}
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjCExtra.moc.in
+ ${SOBJC_MOC})
+
+# MOC_INCLUDE_NAME must be defined by the includer
+add_executable(${MOC_INCLUDE_NAME}
+ # Common sources
+ ../mocInclude/ObjA.cpp
+ ../mocInclude/ObjB.cpp
+
+ ../mocInclude/LObjA.cpp
+ ../mocInclude/LObjB.cpp
+
+ ../mocInclude/EObjA.cpp
+ ../mocInclude/EObjAExtra.cpp
+ ../mocInclude/EObjB.cpp
+ ../mocInclude/subExtra/EObjBExtra.cpp
+
+ ../mocInclude/SObjA.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/SObjA.moc
+ ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/SObjB.moc
+ ../mocInclude/SObjC.cpp
+ ../mocInclude/SObjCExtra.hpp
+ ../mocInclude/SObjCExtra.cpp
+
+ ../mocInclude/subGlobal/GObj.cpp
+ main.cpp
+)
+add_dependencies(${MOC_INCLUDE_NAME} "${MOC_INCLUDE_NAME}_SOBJC")
+target_link_libraries(${MOC_INCLUDE_NAME} ${QT_LIBRARIES})
+set_target_properties(${MOC_INCLUDE_NAME} PROPERTIES AUTOMOC ON)
diff --git a/Tests/QtAutogen/mocInclude/subA/SubObjA.cpp b/Tests/QtAutogen/mocInclude/subA/SubObjA.cpp
deleted file mode 100644
index a05f6e3..0000000
--- a/Tests/QtAutogen/mocInclude/subA/SubObjA.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "SubObjA.hpp"
-
-namespace subA {
-
-class SubObjA : public QObject
-{
- Q_OBJECT
-
-public:
- SubObjA() {}
- ~SubObjA() {}
-
- Q_SLOT
- void aSlot();
-};
-
-void SubObjA::aSlot()
-{
-}
-
-void ObjA::go()
-{
- SubObjA subObj;
-}
-}
-
-#include "SubObjA.moc"
diff --git a/Tests/QtAutogen/mocInclude/subA/SubObjA.hpp b/Tests/QtAutogen/mocInclude/subA/SubObjA.hpp
deleted file mode 100644
index 31a18b6..0000000
--- a/Tests/QtAutogen/mocInclude/subA/SubObjA.hpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef SUBOBJA_HPP
-#define SUBOBJA_HPP
-
-#include <QObject>
-
-namespace subA {
-
-class ObjA : public QObject
-{
- Q_OBJECT
- Q_SLOT
- void go();
-};
-}
-
-#endif
diff --git a/Tests/QtAutogen/mocInclude/subB/SubObjB.cpp b/Tests/QtAutogen/mocInclude/subB/SubObjB.cpp
deleted file mode 100644
index 1e77639..0000000
--- a/Tests/QtAutogen/mocInclude/subB/SubObjB.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "SubObjB.hpp"
-
-namespace subB {
-
-class SubObjB : public QObject
-{
- Q_OBJECT
-
-public:
- SubObjB() {}
- ~SubObjB() {}
-
- Q_SLOT
- void aSlot();
-};
-
-void SubObjB::aSlot()
-{
-}
-
-void ObjB::go()
-{
- SubObjB subObj;
-}
-}
-
-#include "SubObjB.moc"
diff --git a/Tests/QtAutogen/mocInclude/subB/SubObjB.hpp b/Tests/QtAutogen/mocInclude/subB/SubObjB.hpp
deleted file mode 100644
index 3f29fa2..0000000
--- a/Tests/QtAutogen/mocInclude/subB/SubObjB.hpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef SUBOBJB_HPP
-#define SUBOBJB_HPP
-
-#include <QObject>
-
-namespace subB {
-
-class ObjB : public QObject
-{
- Q_OBJECT
- Q_SLOT
- void go();
-};
-}
-
-#endif
diff --git a/Tests/QtAutogen/mocInclude/subC/SubObjC.cpp b/Tests/QtAutogen/mocInclude/subC/SubObjC.cpp
deleted file mode 100644
index c2d94ef..0000000
--- a/Tests/QtAutogen/mocInclude/subC/SubObjC.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "SubObjC.hpp"
-
-namespace subC {
-
-class SubObjC : public QObject
-{
- Q_OBJECT
-
-public:
- SubObjC() {}
- ~SubObjC() {}
-
- Q_SLOT
- void aSlot();
-};
-
-void SubObjC::aSlot()
-{
-}
-
-void ObjC::go()
-{
- SubObjC subObj;
-}
-}
-
-#include "SubObjC.moc"
diff --git a/Tests/QtAutogen/mocInclude/subC/SubObjC.hpp b/Tests/QtAutogen/mocInclude/subC/SubObjC.hpp
deleted file mode 100644
index dc251fd..0000000
--- a/Tests/QtAutogen/mocInclude/subC/SubObjC.hpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef SUBOBJC_HPP
-#define SUBOBJC_HPP
-
-#include <QObject>
-
-namespace subC {
-
-class ObjC : public QObject
-{
- Q_OBJECT
- Q_SLOT
- void go();
-};
-}
-
-#endif
diff --git a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp
new file mode 100644
index 0000000..c697866
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp
@@ -0,0 +1,20 @@
+#include "EObjBExtra.hpp"
+#include "EObjBExtra_p.hpp"
+
+EObjBExtraPrivate::EObjBExtraPrivate()
+{
+}
+
+EObjBExtraPrivate::~EObjBExtraPrivate()
+{
+}
+
+EObjBExtra::EObjBExtra()
+ : d(new EObjBExtraPrivate)
+{
+}
+
+EObjBExtra::~EObjBExtra()
+{
+ delete d;
+}
diff --git a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp
new file mode 100644
index 0000000..3798d7f
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp
@@ -0,0 +1,18 @@
+#ifndef EOBJBEXTRA_HPP
+#define EOBJBEXTRA_HPP
+
+#include <QObject>
+
+class EObjBExtraPrivate;
+class EObjBExtra : public QObject
+{
+ Q_OBJECT
+public:
+ EObjBExtra();
+ ~EObjBExtra();
+
+private:
+ EObjBExtraPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp
new file mode 100644
index 0000000..db8a096
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp
@@ -0,0 +1,12 @@
+#ifndef EOBJBEXTRA_P_HPP
+#define EOBJBEXTRA_P_HPP
+
+class EObjBExtraPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ EObjBExtraPrivate();
+ ~EObjBExtraPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp b/Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp
new file mode 100644
index 0000000..6b92f21
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp
@@ -0,0 +1,41 @@
+#include "GObj.hpp"
+#include "GObj_p.hpp"
+
+namespace subGlobal {
+
+class GObjLocal : public QObject
+{
+ Q_OBJECT
+public:
+ GObjLocal();
+ ~GObjLocal();
+};
+
+GObjLocal::GObjLocal()
+{
+}
+
+GObjLocal::~GObjLocal()
+{
+}
+
+GObjPrivate::GObjPrivate()
+{
+}
+
+GObjPrivate::~GObjPrivate()
+{
+}
+
+GObj::GObj()
+{
+ GObjLocal localObj;
+}
+
+GObj::~GObj()
+{
+}
+}
+
+// For the local QObject
+#include "GObj.moc"
diff --git a/Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp b/Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp
new file mode 100644
index 0000000..2f9ee82
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp
@@ -0,0 +1,17 @@
+#ifndef GOBJ_HPP
+#define GOBJ_HPP
+
+#include <QObject>
+
+namespace subGlobal {
+
+class GObj : public QObject
+{
+ Q_OBJECT
+public:
+ GObj();
+ ~GObj();
+};
+}
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp b/Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp
new file mode 100644
index 0000000..7b37dfd
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp
@@ -0,0 +1,15 @@
+#ifndef GOBJ_P_HPP
+#define GOBJ_P_HPP
+
+namespace subGlobal {
+
+class GObjPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ GObjPrivate();
+ ~GObjPrivate();
+};
+}
+
+#endif
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt b/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt
index 6a0829d..97ba1df 100644
--- a/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt
+++ b/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt
@@ -2,17 +2,16 @@
set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
-include_directories("../mocInclude")
+# Shared executable
+set(MOC_INCLUDE_NAME "mocIncludeRelaxed")
+include(${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/shared.cmake)
-add_executable(mocIncludeRelaxed
- ../mocInclude/ObjA.cpp
- ../mocInclude/ObjB.cpp
- ../mocInclude/ObjC.cpp
- ../mocInclude/ObjD.cpp
- ../mocInclude/subA/SubObjA.cpp
- ../mocInclude/subB/SubObjB.cpp
- ../mocInclude/subC/SubObjC.cpp
- main.cpp
+# Relaxed ony executable
+add_executable(mocIncludeRelaxedOnly
+ RObjA.cpp
+ RObjB.cpp
+ RObjC.cpp
+ RMain.cpp
)
-target_link_libraries(mocIncludeRelaxed ${QT_LIBRARIES})
-set_target_properties(mocIncludeRelaxed PROPERTIES AUTOMOC ON)
+target_link_libraries(mocIncludeRelaxedOnly ${QT_LIBRARIES})
+set_target_properties(mocIncludeRelaxedOnly PROPERTIES AUTOMOC ON)
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp
new file mode 100644
index 0000000..5b2c070
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp
@@ -0,0 +1,12 @@
+// Relaxed AUTOMOC objects
+#include "RObjA.hpp"
+#include "RObjB.hpp"
+#include "RObjC.hpp"
+
+int main(int argv, char** args)
+{
+ RObjA rObjA;
+ RObjB rObjB;
+ RObjC rObjC;
+ return 0;
+}
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp
new file mode 100644
index 0000000..2e2cf6a
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp
@@ -0,0 +1,12 @@
+#include "RObjA.hpp"
+
+RObjA::RObjA()
+{
+}
+
+RObjA::~RObjA()
+{
+}
+
+// Relaxed include should moc the header instead
+#include "RObjA.moc"
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp
new file mode 100644
index 0000000..5974187
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp
@@ -0,0 +1,14 @@
+#ifndef ROBJA_HPP
+#define ROBJA_HPP
+
+#include <QObject>
+
+class RObjA : public QObject
+{
+ Q_OBJECT
+public:
+ RObjA();
+ ~RObjA();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp
new file mode 100644
index 0000000..c56d10f
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp
@@ -0,0 +1,22 @@
+#include "RObjB.hpp"
+#include "RObjBExtra.hpp"
+
+RObjBExtra::RObjBExtra()
+{
+}
+
+RObjBExtra::~RObjBExtra()
+{
+}
+
+RObjB::RObjB()
+{
+ RObjBExtra extraObject;
+}
+
+RObjB::~RObjB()
+{
+}
+
+// Relaxed mode should run moc on RObjBExtra.hpp instead
+#include "RObjBExtra.moc"
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp
new file mode 100644
index 0000000..d6d0474
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp
@@ -0,0 +1,14 @@
+#ifndef ROBJB_HPP
+#define ROBJB_HPP
+
+#include <QObject>
+
+class RObjB : public QObject
+{
+ Q_OBJECT
+public:
+ RObjB();
+ ~RObjB();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp
new file mode 100644
index 0000000..5d6be75
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp
@@ -0,0 +1,14 @@
+#ifndef ROBJBEXTRA_HPP
+#define ROBJBEXTRA_HPP
+
+#include <QObject>
+
+class RObjBExtra : public QObject
+{
+ Q_OBJECT
+public:
+ RObjBExtra();
+ ~RObjBExtra();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp
new file mode 100644
index 0000000..4ba32f5
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp
@@ -0,0 +1,30 @@
+#include "RObjC.hpp"
+#include <QObject>
+
+class RObjCPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ RObjCPrivate();
+ ~RObjCPrivate();
+};
+
+RObjCPrivate::RObjCPrivate()
+{
+}
+
+RObjCPrivate::~RObjCPrivate()
+{
+}
+
+RObjC::RObjC()
+{
+ RObjCPrivate privateObject;
+}
+
+RObjC::~RObjC()
+{
+}
+
+// Relaxed include should moc this source instead of the header
+#include "moc_RObjC.cpp"
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp
new file mode 100644
index 0000000..5552ede
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp
@@ -0,0 +1,14 @@
+#ifndef ROBJC_HPP
+#define ROBJC_HPP
+
+#include <QObject>
+
+class RObjC : public QObject
+{
+ Q_OBJECT
+public:
+ RObjC();
+ ~RObjC();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/main.cpp b/Tests/QtAutogen/mocIncludeRelaxed/main.cpp
index 142d59e..5a3148d 100644
--- a/Tests/QtAutogen/mocIncludeRelaxed/main.cpp
+++ b/Tests/QtAutogen/mocIncludeRelaxed/main.cpp
@@ -1,14 +1,26 @@
+#include "EObjA.hpp"
+#include "EObjB.hpp"
+#include "LObjA.hpp"
+#include "LObjB.hpp"
#include "ObjA.hpp"
#include "ObjB.hpp"
-#include "ObjC.hpp"
+#include "SObjA.hpp"
+#include "SObjB.hpp"
+#include "subGlobal/GObj.hpp"
int main(int argv, char** args)
{
+ subGlobal::GObj gObj;
ObjA objA;
ObjB objB;
- ObjC objC;
+ LObjA lObjA;
+ LObjB lObjB;
+ EObjA eObjA;
+ EObjB eObjB;
+ SObjA sObjA;
+ SObjB sObjB;
return 0;
}
// Header in global subdirectory
-#include "subB/moc_SubObjB.cpp"
+#include "subGlobal/moc_GObj.cpp"
diff --git a/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt b/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt
index 22e93a8..789354a 100644
--- a/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt
+++ b/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt
@@ -1,18 +1,6 @@
# Test moc include patterns
set(CMAKE_AUTOMOC_RELAXED_MODE FALSE)
+set(MOC_INCLUDE_NAME "mocIncludeStrict")
-include_directories("../mocInclude")
-
-add_executable(mocIncludeStrict
- ../mocInclude/ObjA.cpp
- ../mocInclude/ObjB.cpp
- ../mocInclude/ObjC.cpp
- ../mocInclude/ObjD.cpp
- ../mocInclude/subA/SubObjA.cpp
- ../mocInclude/subB/SubObjB.cpp
- ../mocInclude/subC/SubObjC.cpp
- main.cpp
-)
-target_link_libraries(mocIncludeStrict ${QT_LIBRARIES})
-set_target_properties(mocIncludeStrict PROPERTIES AUTOMOC ON)
+include(${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/shared.cmake)
diff --git a/Tests/QtAutogen/mocIncludeStrict/main.cpp b/Tests/QtAutogen/mocIncludeStrict/main.cpp
index 142d59e..5a3148d 100644
--- a/Tests/QtAutogen/mocIncludeStrict/main.cpp
+++ b/Tests/QtAutogen/mocIncludeStrict/main.cpp
@@ -1,14 +1,26 @@
+#include "EObjA.hpp"
+#include "EObjB.hpp"
+#include "LObjA.hpp"
+#include "LObjB.hpp"
#include "ObjA.hpp"
#include "ObjB.hpp"
-#include "ObjC.hpp"
+#include "SObjA.hpp"
+#include "SObjB.hpp"
+#include "subGlobal/GObj.hpp"
int main(int argv, char** args)
{
+ subGlobal::GObj gObj;
ObjA objA;
ObjB objB;
- ObjC objC;
+ LObjA lObjA;
+ LObjB lObjB;
+ EObjA eObjA;
+ EObjB eObjB;
+ SObjA sObjA;
+ SObjB sObjB;
return 0;
}
// Header in global subdirectory
-#include "subB/moc_SubObjB.cpp"
+#include "subGlobal/moc_GObj.cpp"
diff --git a/Tests/QtAutogen/mocMacroName/MacroAlias.hpp b/Tests/QtAutogen/mocMacroName/MacroAlias.hpp
new file mode 100644
index 0000000..cf06f2a
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/MacroAlias.hpp
@@ -0,0 +1,7 @@
+#ifndef MACROALIAS_HPP
+#define MACROALIAS_HPP
+
+#include <QObject>
+#define QO_ALIAS Q_OBJECT
+
+#endif
diff --git a/Tests/QtAutogen/mocMacroName/MacroName.cpp b/Tests/QtAutogen/mocMacroName/MacroName.cpp
new file mode 100644
index 0000000..78d04a8
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/MacroName.cpp
@@ -0,0 +1,9 @@
+#include "MacroName.hpp"
+
+MacroName::MacroName()
+{
+}
+
+void MacroName::aSlot()
+{
+}
diff --git a/Tests/QtAutogen/mocMacroName/MacroName.hpp b/Tests/QtAutogen/mocMacroName/MacroName.hpp
new file mode 100644
index 0000000..b6c7306
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/MacroName.hpp
@@ -0,0 +1,20 @@
+#ifndef MACRONAME_HPP
+#define MACRONAME_HPP
+
+#include "MacroAlias.hpp"
+
+// Test Qt object macro hidden in a macro (AUTOMOC_MACRO_NAMES)
+class MacroName : public QObject
+{
+ QO_ALIAS
+public:
+ MacroName();
+
+signals:
+ void aSignal();
+
+public slots:
+ void aSlot();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocMacroName/main.cpp b/Tests/QtAutogen/mocMacroName/main.cpp
new file mode 100644
index 0000000..67ee81f
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/main.cpp
@@ -0,0 +1,7 @@
+#include "MacroName.hpp"
+
+int main(int argv, char** args)
+{
+ MacroName macroName;
+ return 0;
+}
diff --git a/Tests/QtAutogen/mocOnlySource/StyleA.cpp b/Tests/QtAutogen/mocOnlySource/StyleA.cpp
new file mode 100644
index 0000000..ced1dd1
--- /dev/null
+++ b/Tests/QtAutogen/mocOnlySource/StyleA.cpp
@@ -0,0 +1,5 @@
+#include "StyleA.hpp"
+
+StyleA::StyleA()
+{
+}
diff --git a/Tests/QtAutogen/mocOnlySource/StyleA.hpp b/Tests/QtAutogen/mocOnlySource/StyleA.hpp
new file mode 100644
index 0000000..66735b6
--- /dev/null
+++ b/Tests/QtAutogen/mocOnlySource/StyleA.hpp
@@ -0,0 +1,15 @@
+#ifndef STYLEA_HPP
+#define STYLEA_HPP
+
+#include <QObject>
+
+/// Q_OBJECT on a single new line
+///
+class StyleA : public QObject
+{
+ Q_OBJECT
+public:
+ StyleA();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocOnlySource/StyleB.cpp b/Tests/QtAutogen/mocOnlySource/StyleB.cpp
new file mode 100644
index 0000000..bec6c1c
--- /dev/null
+++ b/Tests/QtAutogen/mocOnlySource/StyleB.cpp
@@ -0,0 +1,5 @@
+#include "StyleB.hpp"
+
+StyleB::StyleB()
+{
+}
diff --git a/Tests/QtAutogen/mocOnlySource/StyleB.hpp b/Tests/QtAutogen/mocOnlySource/StyleB.hpp
new file mode 100644
index 0000000..425daf8
--- /dev/null
+++ b/Tests/QtAutogen/mocOnlySource/StyleB.hpp
@@ -0,0 +1,16 @@
+#ifndef STYLEB_HPP
+#define STYLEB_HPP
+
+#include <QObject>
+
+/* clang-format off */
+/// Q_OBJECT behind a brace
+///
+class StyleB : public QObject
+{ Q_OBJECT
+public:
+ StyleB();
+};
+/* clang-format on */
+
+#endif
diff --git a/Tests/QtAutogen/mocOnlySource/main.cpp b/Tests/QtAutogen/mocOnlySource/main.cpp
new file mode 100644
index 0000000..06f8d81
--- /dev/null
+++ b/Tests/QtAutogen/mocOnlySource/main.cpp
@@ -0,0 +1,9 @@
+#include "StyleA.hpp"
+#include "StyleB.hpp"
+
+int main(int argv, char** args)
+{
+ StyleA styleA;
+ StyleB styleB;
+ return 0;
+}
diff --git a/Tests/QtAutogen/objectLibrary/CMakeLists.txt b/Tests/QtAutogen/objectLibrary/CMakeLists.txt
new file mode 100644
index 0000000..9b29a40
--- /dev/null
+++ b/Tests/QtAutogen/objectLibrary/CMakeLists.txt
@@ -0,0 +1,14 @@
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_AUTOMOC ON)
+
+# Object library a defined in a subdirectory
+add_subdirectory(a)
+
+# Object library b defined locally
+include_directories(b)
+add_library(b OBJECT b/classb.cpp)
+target_compile_features(b PRIVATE ${QT_COMPILE_FEATURES})
+
+# Executable with OBJECT library generator expressions
+add_executable(someProgram main.cpp $<TARGET_OBJECTS:a> $<TARGET_OBJECTS:b>)
+target_link_libraries(someProgram ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/objectLibrary/a/CMakeLists.txt b/Tests/QtAutogen/objectLibrary/a/CMakeLists.txt
new file mode 100644
index 0000000..fe76ac3
--- /dev/null
+++ b/Tests/QtAutogen/objectLibrary/a/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(a OBJECT classa.cpp)
+target_compile_features(a PRIVATE ${QT_COMPILE_FEATURES})
diff --git a/Tests/QtAutogen/objectLibrary/a/classa.cpp b/Tests/QtAutogen/objectLibrary/a/classa.cpp
new file mode 100644
index 0000000..4f08fda
--- /dev/null
+++ b/Tests/QtAutogen/objectLibrary/a/classa.cpp
@@ -0,0 +1,7 @@
+#include "classa.h"
+#include <QDebug>
+
+void ClassA::slotDoSomething()
+{
+ qDebug() << m_member;
+}
diff --git a/Tests/QtAutogen/objectLibrary/a/classa.h b/Tests/QtAutogen/objectLibrary/a/classa.h
new file mode 100644
index 0000000..fa5fed9
--- /dev/null
+++ b/Tests/QtAutogen/objectLibrary/a/classa.h
@@ -0,0 +1,23 @@
+#ifndef CLASSA_H
+#define CLASSA_H
+
+#include <QObject>
+#include <QString>
+
+class ClassA : public QObject
+{
+ Q_OBJECT
+public:
+ ClassA()
+ : m_member("Hello A")
+ {
+ }
+
+public slots:
+ void slotDoSomething();
+
+private:
+ QString m_member;
+};
+
+#endif
diff --git a/Tests/QtAutogen/objectLibrary/b/classb.cpp b/Tests/QtAutogen/objectLibrary/b/classb.cpp
new file mode 100644
index 0000000..26e0926
--- /dev/null
+++ b/Tests/QtAutogen/objectLibrary/b/classb.cpp
@@ -0,0 +1,7 @@
+#include "classb.h"
+#include <QDebug>
+
+void ClassB::slotDoSomething()
+{
+ qDebug() << m_member;
+}
diff --git a/Tests/QtAutogen/objectLibrary/b/classb.h b/Tests/QtAutogen/objectLibrary/b/classb.h
new file mode 100644
index 0000000..783bb48
--- /dev/null
+++ b/Tests/QtAutogen/objectLibrary/b/classb.h
@@ -0,0 +1,23 @@
+#ifndef CLASSB_H
+#define CLASSB_H
+
+#include <QObject>
+#include <QString>
+
+class ClassB : public QObject
+{
+ Q_OBJECT
+public:
+ ClassB()
+ : m_member("Hello B")
+ {
+ }
+
+public slots:
+ void slotDoSomething();
+
+private:
+ QString m_member;
+};
+
+#endif
diff --git a/Tests/QtAutogen/objectLibrary/main.cpp b/Tests/QtAutogen/objectLibrary/main.cpp
new file mode 100644
index 0000000..cacf0fd
--- /dev/null
+++ b/Tests/QtAutogen/objectLibrary/main.cpp
@@ -0,0 +1,13 @@
+#include "a/classa.h"
+#include "b/classb.h"
+
+int main(int argc, char** argv)
+{
+ ClassA a;
+ a.slotDoSomething();
+
+ ClassB b;
+ b.slotDoSomething();
+
+ return 0;
+}
diff --git a/Tests/QtAutogen/skipMoc.cpp b/Tests/QtAutogen/skipMoc.cpp
index 85305f5..d6b292f 100644
--- a/Tests/QtAutogen/skipMoc.cpp
+++ b/Tests/QtAutogen/skipMoc.cpp
@@ -2,12 +2,14 @@
#include "skipSource/qItemA.hpp"
#include "skipSource/qItemB.hpp"
#include "skipSource/qItemC.hpp"
+#include "skipSource/qItemD.hpp"
int main(int, char**)
{
QItemA itemA;
- QItemA itemB;
- QItemA itemC;
+ QItemB itemB;
+ QItemC itemC;
+ QItemD itemD;
// Fails to link if the symbol is not present.
return 0;
diff --git a/Tests/QtAutogen/skipSource/qItemC.cpp b/Tests/QtAutogen/skipSource/qItemC.cpp
index 700abd6..622f282 100644
--- a/Tests/QtAutogen/skipSource/qItemC.cpp
+++ b/Tests/QtAutogen/skipSource/qItemC.cpp
@@ -1,5 +1,17 @@
#include "qItemC.hpp"
+class QItemC_Local : public QObject
+{
+ Q_OBJECT
+public:
+ QItemC_Local(){};
+ ~QItemC_Local(){};
+};
+
void QItemC::go()
{
+ QItemC_Local localObject;
}
+
+// We need AUTOMOC processing
+#include "qItemC.moc"
diff --git a/Tests/QtAutogen/skipSource/qItemD.cpp b/Tests/QtAutogen/skipSource/qItemD.cpp
new file mode 100644
index 0000000..fe0f4e4
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemD.cpp
@@ -0,0 +1,17 @@
+#include "qItemD.hpp"
+
+class QItemD_Local : public QObject
+{
+ Q_OBJECT
+public:
+ QItemD_Local(){};
+ ~QItemD_Local(){};
+};
+
+void QItemD::go()
+{
+ QItemD_Local localObject;
+}
+
+// We need AUTOMOC processing
+#include "qItemD.moc"
diff --git a/Tests/QtAutogen/skipSource/qItemD.hpp b/Tests/QtAutogen/skipSource/qItemD.hpp
new file mode 100644
index 0000000..99e0acb
--- /dev/null
+++ b/Tests/QtAutogen/skipSource/qItemD.hpp
@@ -0,0 +1,13 @@
+#ifndef QITEMD_HPP
+#define QITEMD_HPP
+
+#include <QObject>
+
+class QItemD : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+
+#endif
diff --git a/Tests/QtAutogen/uicInclude/PageC2.ui b/Tests/QtAutogen/uicInclude/PageC2.ui
new file mode 100644
index 0000000..daab868
--- /dev/null
+++ b/Tests/QtAutogen/uicInclude/PageC2.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PageC2</class>
+ <widget class="QWidget" name="PageC2">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui b/Tests/QtAutogen/uicInclude/dirB/PageB.ui
index fa6dfa6..fa6dfa6 100644
--- a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui
+++ b/Tests/QtAutogen/uicInclude/dirB/PageB.ui
diff --git a/Tests/QtAutogen/uicInclude/dirB/PageB2.ui b/Tests/QtAutogen/uicInclude/dirB/PageB2.ui
new file mode 100644
index 0000000..2225150
--- /dev/null
+++ b/Tests/QtAutogen/uicInclude/dirB/PageB2.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PageB2</class>
+ <widget class="QWidget" name="PageB2">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui b/Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui
new file mode 100644
index 0000000..873016e
--- /dev/null
+++ b/Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PageBsub</class>
+ <widget class="QWidget" name="PageBsub">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/QtAutogen/uicInclude/main.cpp b/Tests/QtAutogen/uicInclude/main.cpp
index 4ca66a7..c8e7609 100644
--- a/Tests/QtAutogen/uicInclude/main.cpp
+++ b/Tests/QtAutogen/uicInclude/main.cpp
@@ -6,5 +6,13 @@ int main(int argv, char** args)
return 0;
}
-#include "sub/ui_PageB.h"
+// .ui files in CMAKE_AUTOUIC_SEARCH_PATHS
+#include "ui_PageA.h"
+// .ui files in AUTOUIC_SEARCH_PATHS
+#include "sub/gen/deep/ui_PageB2.h"
+#include "subB/ui_PageBsub.h"
+#include "ui_PageB.h"
+// .ui files in source's vicinity
+#include "sub/gen/deep/ui_PageC2.h"
+#include "subC/ui_PageCsub.h"
#include "ui_PageC.h"
diff --git a/Tests/QtAutogen/uicInclude/subC/PageCsub.ui b/Tests/QtAutogen/uicInclude/subC/PageCsub.ui
new file mode 100644
index 0000000..0268326
--- /dev/null
+++ b/Tests/QtAutogen/uicInclude/subC/PageCsub.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PageCsub</class>
+ <widget class="QWidget" name="PageCsub">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/QtAutogenRerun/CMakeLists.txt b/Tests/QtAutogenRerun/CMakeLists.txt
new file mode 100644
index 0000000..088025f
--- /dev/null
+++ b/Tests/QtAutogenRerun/CMakeLists.txt
@@ -0,0 +1,239 @@
+cmake_minimum_required(VERSION 3.9)
+cmake_policy(SET CMP0071 NEW)
+project(QtAutogenRerun)
+
+# Tell find_package(Qt5) where to find Qt.
+if(QT_QMAKE_EXECUTABLE)
+ get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
+ get_filename_component(Qt_PREFIX_DIR "${Qt_BIN_DIR}" PATH)
+ set(CMAKE_PREFIX_PATH ${Qt_PREFIX_DIR})
+endif()
+
+if (QT_TEST_VERSION STREQUAL 4)
+ find_package(Qt4 REQUIRED)
+
+ # Include this directory before using the UseQt4 file.
+ add_subdirectory(defines_test)
+
+ include(UseQt4)
+
+ set(QT_QTCORE_TARGET Qt4::QtCore)
+
+else()
+ if (NOT QT_TEST_VERSION STREQUAL 5)
+ message(SEND_ERROR "Invalid Qt version specified.")
+ endif()
+ find_package(Qt5Widgets REQUIRED)
+
+ set(QT_QTCORE_TARGET Qt5::Core)
+
+ include_directories(${Qt5Widgets_INCLUDE_DIRS})
+ set(QT_LIBRARIES Qt5::Widgets)
+
+ if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
+ add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC})
+ endif()
+
+endif()
+
+# -- Test
+# Dummy test to generate clean target
+add_executable(dummy dummy.cpp)
+
+# -- Test
+# When a file listed in a .qrc file changes the target must be rebuilt
+set(timeformat "%Y%j%H%M%S")
+set(RCC_DEPENDS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/rccDepends")
+set(RCC_DEPENDS_BIN "${CMAKE_CURRENT_BINARY_DIR}/rccDepends")
+configure_file(${RCC_DEPENDS_SRC}/res1a.qrc.in ${RCC_DEPENDS_BIN}/res1.qrc COPYONLY)
+configure_file(${RCC_DEPENDS_SRC}/res2a.qrc.in ${RCC_DEPENDS_BIN}/res2.qrc.in COPYONLY)
+try_compile(RCC_DEPENDS
+ "${RCC_DEPENDS_BIN}"
+ "${RCC_DEPENDS_SRC}"
+ rccDepends
+ CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
+ "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+ "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}"
+ OUTPUT_VARIABLE output
+)
+if (NOT RCC_DEPENDS)
+ message(SEND_ERROR "Initial build of rccDepends failed. Output: ${output}")
+endif()
+# Get name and timestamp of the output binary
+file(STRINGS "${RCC_DEPENDS_BIN}/target.txt" targetList ENCODING UTF-8)
+list(GET targetList 0 rccDependsBin)
+file(TIMESTAMP "${rccDependsBin}" timeBegin "${timeformat}")
+# Sleep, touch regular qrc input file, rebuild and compare timestamp
+execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
+execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${RCC_DEPENDS_BIN}/res1/input.txt")
+execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
+if (result)
+ message(SEND_ERROR "Second build of rccDepends failed.")
+endif()
+file(TIMESTAMP "${rccDependsBin}" timeStep1 "${timeformat}")
+if (NOT timeStep1 GREATER timeBegin)
+ message(SEND_ERROR "File (${rccDependsBin}) should have changed in the first step!")
+endif()
+# Sleep, update regular qrc file, rebuild and compare timestamp
+execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
+configure_file(${RCC_DEPENDS_SRC}/res1b.qrc.in ${RCC_DEPENDS_BIN}/res1.qrc COPYONLY)
+execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
+if (result)
+ message(SEND_ERROR "Third build of rccDepends failed.")
+endif()
+file(TIMESTAMP "${rccDependsBin}" timeStep2 "${timeformat}")
+if (NOT timeStep2 GREATER timeStep1)
+ message(SEND_ERROR "File (${rccDependsBin}) should have changed in the second step!")
+endif()
+# Sleep, touch regular qrc newly added input file, rebuild and compare timestamp
+execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
+execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${RCC_DEPENDS_BIN}/res1/inputAdded.txt")
+execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
+if (result)
+ message(SEND_ERROR "Fourth build of rccDepends failed.")
+endif()
+file(TIMESTAMP "${rccDependsBin}" timeStep3 "${timeformat}")
+if (NOT timeStep3 GREATER timeStep2)
+ message(SEND_ERROR "File (${rccDependsBin}) should have changed in the third step!")
+endif()
+# Sleep, touch generated qrc input file, rebuild and compare timestamp
+execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
+execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${RCC_DEPENDS_BIN}/res2/input.txt")
+execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
+if (result)
+ message(SEND_ERROR "Fifth build of rccDepends failed.")
+endif()
+file(TIMESTAMP "${rccDependsBin}" timeStep4 "${timeformat}")
+if (NOT timeStep4 GREATER timeStep3)
+ message(SEND_ERROR "File (${rccDependsBin}) should have changed in the fourth step!")
+endif()
+# Sleep, update generated qrc file, rebuild and compare timestamp
+execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
+configure_file(${RCC_DEPENDS_SRC}/res2b.qrc.in ${RCC_DEPENDS_BIN}/res2.qrc.in COPYONLY)
+execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
+if (result)
+ message(SEND_ERROR "Sixth build of rccDepends failed.")
+endif()
+file(TIMESTAMP "${rccDependsBin}" timeStep5 "${timeformat}")
+if (NOT timeStep5 GREATER timeStep4)
+ message(SEND_ERROR "File (${rccDependsBin}) should have changed in the fitfh step!")
+endif()
+# Sleep, touch generated qrc newly added input file, rebuild and compare timestamp
+execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
+execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${RCC_DEPENDS_BIN}/res2/inputAdded.txt")
+execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${RCC_DEPENDS_BIN}" RESULT_VARIABLE result)
+if (result)
+ message(SEND_ERROR "Seventh build of rccDepends failed.")
+endif()
+file(TIMESTAMP "${rccDependsBin}" timeStep6 "${timeformat}")
+if (NOT timeStep6 GREATER timeStep5)
+ message(SEND_ERROR "File (${rccDependsBin}) should have changed in the sixth step!")
+endif()
+
+
+# -- Test
+# Ensure a repeated build succeeds when a header containing a QObject changes
+set(timeformat "%Y%j%H%M%S")
+configure_file(mocRerun/test1a.h.in mocRerun/test1.h COPYONLY)
+try_compile(MOC_RERUN
+ "${CMAKE_CURRENT_BINARY_DIR}/mocRerun"
+ "${CMAKE_CURRENT_SOURCE_DIR}/mocRerun"
+ mocRerun
+ CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
+ "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+ "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}"
+ OUTPUT_VARIABLE output
+)
+if (NOT MOC_RERUN)
+ message(SEND_ERROR "Initial build of mocRerun failed. Output: ${output}")
+endif()
+# Get name and timestamp of the output binary
+file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/mocRerun/target1.txt" target1List ENCODING UTF-8)
+list(GET target1List 0 binFile)
+file(TIMESTAMP "${binFile}" timeBegin "${timeformat}")
+# Change file content and rebuild
+execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1)
+configure_file(mocRerun/test1b.h.in mocRerun/test1.h COPYONLY)
+execute_process(COMMAND "${CMAKE_COMMAND}" --build .
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mocRerun"
+ RESULT_VARIABLE mocRerun_result
+ )
+if (mocRerun_result)
+ message(SEND_ERROR "Second build of mocRerun failed.")
+endif()
+# Compare timestamps
+file(TIMESTAMP "${binFile}" timeStep1 "${timeformat}")
+if (NOT timeStep1 GREATER timeBegin)
+ message(SEND_ERROR "File (${binFile}) should have changed in the first step!")
+endif()
+
+
+# -- Test
+# Tests Q_PLUGIN_METADATA json file change detection
+if (NOT QT_TEST_VERSION STREQUAL 4)
+ try_compile(MOC_PLUGIN
+ "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin"
+ "${CMAKE_CURRENT_SOURCE_DIR}/mocPlugin"
+ mocPlugin
+ CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+ "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}"
+ OUTPUT_VARIABLE output
+ )
+ if (NOT MOC_PLUGIN)
+ message(SEND_ERROR "Initial build of mocPlugin failed. Output: ${output}")
+ endif()
+
+ set(timeformat "%Y%j%H%M%S")
+ set(mocPlugSrcDir "${CMAKE_CURRENT_SOURCE_DIR}/mocPlugin")
+ set(mocPlugBinDir "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin")
+ find_library(plAFile "PlugA" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH)
+ find_library(plBFile "PlugB" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH)
+ find_library(plCFile "PlugC" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH)
+ find_library(plDFile "PlugD" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH)
+
+ file(TIMESTAMP "${plAFile}" plABefore "${timeformat}")
+ file(TIMESTAMP "${plBFile}" plBBefore "${timeformat}")
+ file(TIMESTAMP "${plCFile}" plCBefore "${timeformat}")
+ file(TIMESTAMP "${plDFile}" plDBefore "${timeformat}")
+
+ # Ensure that the timestamp will change and change the json files
+ execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1)
+ configure_file("${mocPlugSrcDir}/jsonIn/StyleD.json" "${mocPlugBinDir}/jsonFiles/StyleC.json")
+ configure_file("${mocPlugSrcDir}/jsonIn/StyleC.json" "${mocPlugBinDir}/jsonFiles/sub/StyleD.json")
+ execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocPlugBinDir}")
+
+ file(TIMESTAMP "${plAFile}" plAAfter "${timeformat}")
+ file(TIMESTAMP "${plBFile}" plBAfter "${timeformat}")
+ file(TIMESTAMP "${plCFile}" plCAfter "${timeformat}")
+ file(TIMESTAMP "${plDFile}" plDAfter "${timeformat}")
+
+ if (plAAfter GREATER plABefore)
+ message(SEND_ERROR "file (${plAFile}) should not have changed!")
+ endif()
+ if (plBAfter GREATER plBBefore)
+ message(SEND_ERROR "file (${plBFile}) should not have changed!")
+ endif()
+ if (NOT plCAfter GREATER plCBefore)
+ message(SEND_ERROR "file (${plCFile}) should have changed!")
+ endif()
+ if (NOT plDAfter GREATER plDBefore)
+ message(SEND_ERROR "file (${plDFile}) should have changed!")
+ endif()
+
+ # Test custom macro
+ file(TIMESTAMP "${plCFile}" plCBefore "${timeformat}")
+ file(TIMESTAMP "${plDFile}" plDBefore "${timeformat}")
+ execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1)
+ configure_file("${mocPlugSrcDir}/jsonIn/StyleD.json" "${mocPlugBinDir}/jsonFiles/StyleC_Custom.json")
+ configure_file("${mocPlugSrcDir}/jsonIn/StyleC.json" "${mocPlugBinDir}/jsonFiles/sub/StyleD_Custom.json")
+ execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocPlugBinDir}")
+ file(TIMESTAMP "${plCFile}" plCAfter "${timeformat}")
+ file(TIMESTAMP "${plDFile}" plDAfter "${timeformat}")
+ if (NOT plCAfter GREATER plCBefore)
+ message(SEND_ERROR "file (${plCFile}) should have changed!")
+ endif()
+ if (NOT plDAfter GREATER plDBefore)
+ message(SEND_ERROR "file (${plDFile}) should have changed!")
+ endif()
+
+endif()
diff --git a/Tests/QtAutogenRerun/defines_test/CMakeLists.txt b/Tests/QtAutogenRerun/defines_test/CMakeLists.txt
new file mode 100644
index 0000000..9ee9a22
--- /dev/null
+++ b/Tests/QtAutogenRerun/defines_test/CMakeLists.txt
@@ -0,0 +1,4 @@
+
+add_executable(defines_test defines_test.cpp)
+set_target_properties(defines_test PROPERTIES AUTOMOC TRUE)
+target_link_libraries(defines_test Qt4::QtGui)
diff --git a/Tests/QtAutogenRerun/defines_test/defines_test.cpp b/Tests/QtAutogenRerun/defines_test/defines_test.cpp
new file mode 100644
index 0000000..cf4e9cb
--- /dev/null
+++ b/Tests/QtAutogenRerun/defines_test/defines_test.cpp
@@ -0,0 +1,38 @@
+
+#include <QObject>
+
+#ifdef QT_GUI_LIB
+#include <QTextDocument>
+
+class SomeDocument : public QTextDocument
+{
+ Q_OBJECT
+
+Q_SIGNALS:
+ void someSig();
+};
+#endif
+
+#ifdef QT_CORE_LIB
+class SomeObject : public QObject
+{
+ Q_OBJECT
+
+Q_SIGNALS:
+ void someSig();
+};
+#endif
+
+int main(int argc, char** argv)
+{
+#ifdef QT_CORE_LIB
+ QMetaObject sosmo = SomeObject::staticMetaObject;
+#endif
+#ifdef QT_GUI_LIB
+ QMetaObject sdsmo = SomeDocument::staticMetaObject;
+#endif
+
+ return 0;
+}
+
+#include "defines_test.moc"
diff --git a/Tests/QtAutogenRerun/dummy.cpp b/Tests/QtAutogenRerun/dummy.cpp
new file mode 100644
index 0000000..4837a76
--- /dev/null
+++ b/Tests/QtAutogenRerun/dummy.cpp
@@ -0,0 +1,5 @@
+
+int main(int argv, char** args)
+{
+ return 0;
+}
diff --git a/Tests/QtAutogen/mocPlugin/CMakeLists.txt b/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt
index f80aa29..9b224fb 100644
--- a/Tests/QtAutogen/mocPlugin/CMakeLists.txt
+++ b/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.9)
project(mocPlugin CXX)
set(CMAKE_AUTOMOC_DEPEND_FILTERS
diff --git a/Tests/QtAutogen/mocPlugin/StyleA.cpp b/Tests/QtAutogenRerun/mocPlugin/StyleA.cpp
index b5e8753..b5e8753 100644
--- a/Tests/QtAutogen/mocPlugin/StyleA.cpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleA.cpp
diff --git a/Tests/QtAutogen/mocPlugin/StyleA.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleA.hpp
index 1b6154d..1b6154d 100644
--- a/Tests/QtAutogen/mocPlugin/StyleA.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleA.hpp
diff --git a/Tests/QtAutogen/mocPlugin/StyleA.json b/Tests/QtAutogenRerun/mocPlugin/StyleA.json
index cc33953..cc33953 100644
--- a/Tests/QtAutogen/mocPlugin/StyleA.json
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleA.json
diff --git a/Tests/QtAutogen/mocPlugin/StyleA_Custom.json b/Tests/QtAutogenRerun/mocPlugin/StyleA_Custom.json
index cc33953..cc33953 100644
--- a/Tests/QtAutogen/mocPlugin/StyleA_Custom.json
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleA_Custom.json
diff --git a/Tests/QtAutogen/mocPlugin/StyleB.cpp b/Tests/QtAutogenRerun/mocPlugin/StyleB.cpp
index 17d4400..17d4400 100644
--- a/Tests/QtAutogen/mocPlugin/StyleB.cpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleB.cpp
diff --git a/Tests/QtAutogen/mocPlugin/StyleB.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleB.hpp
index 163c9b2..163c9b2 100644
--- a/Tests/QtAutogen/mocPlugin/StyleB.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleB.hpp
diff --git a/Tests/QtAutogen/mocPlugin/StyleC.cpp b/Tests/QtAutogenRerun/mocPlugin/StyleC.cpp
index 37e7564..37e7564 100644
--- a/Tests/QtAutogen/mocPlugin/StyleC.cpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleC.cpp
diff --git a/Tests/QtAutogen/mocPlugin/StyleC.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleC.hpp
index 52a887a..52a887a 100644
--- a/Tests/QtAutogen/mocPlugin/StyleC.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleC.hpp
diff --git a/Tests/QtAutogen/mocPlugin/StyleCommon.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleCommon.hpp
index f1a7ec6..f1a7ec6 100644
--- a/Tests/QtAutogen/mocPlugin/StyleCommon.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleCommon.hpp
diff --git a/Tests/QtAutogen/mocPlugin/StyleD.cpp b/Tests/QtAutogenRerun/mocPlugin/StyleD.cpp
index 7e4b121..7e4b121 100644
--- a/Tests/QtAutogen/mocPlugin/StyleD.cpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleD.cpp
diff --git a/Tests/QtAutogen/mocPlugin/StyleD.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleD.hpp
index df8a439..df8a439 100644
--- a/Tests/QtAutogen/mocPlugin/StyleD.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleD.hpp
diff --git a/Tests/QtAutogen/mocPlugin/StyleE.cpp b/Tests/QtAutogenRerun/mocPlugin/StyleE.cpp
index 8fc9a7f..8fc9a7f 100644
--- a/Tests/QtAutogen/mocPlugin/StyleE.cpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleE.cpp
diff --git a/Tests/QtAutogen/mocPlugin/StyleE.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleE.hpp
index e7915a8..e7915a8 100644
--- a/Tests/QtAutogen/mocPlugin/StyleE.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleE.hpp
diff --git a/Tests/QtAutogen/mocPlugin/jsonIn/StyleB.json b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json
index 129cac4..129cac4 100644
--- a/Tests/QtAutogen/mocPlugin/jsonIn/StyleB.json
+++ b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json
diff --git a/Tests/QtAutogen/mocPlugin/jsonIn/StyleB_Custom.json b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB_Custom.json
index 129cac4..129cac4 100644
--- a/Tests/QtAutogen/mocPlugin/jsonIn/StyleB_Custom.json
+++ b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB_Custom.json
diff --git a/Tests/QtAutogen/mocPlugin/jsonIn/StyleC.json b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleC.json
index 119aaa4..119aaa4 100644
--- a/Tests/QtAutogen/mocPlugin/jsonIn/StyleC.json
+++ b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleC.json
diff --git a/Tests/QtAutogen/mocPlugin/jsonIn/StyleD.json b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleD.json
index 732c547..732c547 100644
--- a/Tests/QtAutogen/mocPlugin/jsonIn/StyleD.json
+++ b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleD.json
diff --git a/Tests/QtAutogen/mocPlugin/main.cpp b/Tests/QtAutogenRerun/mocPlugin/main.cpp
index 3ba2ddc..3ba2ddc 100644
--- a/Tests/QtAutogen/mocPlugin/main.cpp
+++ b/Tests/QtAutogenRerun/mocPlugin/main.cpp
diff --git a/Tests/QtAutogen/mocRerun/CMakeLists.txt b/Tests/QtAutogenRerun/mocRerun/CMakeLists.txt
index 14b077b..7380bdd 100644
--- a/Tests/QtAutogen/mocRerun/CMakeLists.txt
+++ b/Tests/QtAutogenRerun/mocRerun/CMakeLists.txt
@@ -1,4 +1,5 @@
-cmake_minimum_required(VERSION 3.7)
+cmake_minimum_required(VERSION 3.9)
+cmake_policy(SET CMP0071 NEW)
project(mocRerun CXX)
if (QT_TEST_VERSION STREQUAL 4)
@@ -27,7 +28,6 @@ add_executable(mocRerun
${CMAKE_CURRENT_BINARY_DIR}/main.cpp
res1.qrc
)
-set_property(TARGET mocRerun PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
target_include_directories(mocRerun PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(mocRerun ${QT_CORE_TARGET})
# Write target name to text file
diff --git a/Tests/QtAutogen/mocRerun/input.txt b/Tests/QtAutogenRerun/mocRerun/input.txt
index da62762..da62762 100644
--- a/Tests/QtAutogen/mocRerun/input.txt
+++ b/Tests/QtAutogenRerun/mocRerun/input.txt
diff --git a/Tests/QtAutogen/mocRerun/main.cpp.in b/Tests/QtAutogenRerun/mocRerun/main.cpp.in
index b37ff61..b37ff61 100644
--- a/Tests/QtAutogen/mocRerun/main.cpp.in
+++ b/Tests/QtAutogenRerun/mocRerun/main.cpp.in
diff --git a/Tests/QtAutogen/mocRerun/res1.qrc b/Tests/QtAutogenRerun/mocRerun/res1.qrc
index fb804b5..fb804b5 100644
--- a/Tests/QtAutogen/mocRerun/res1.qrc
+++ b/Tests/QtAutogenRerun/mocRerun/res1.qrc
diff --git a/Tests/QtAutogen/mocRerun/test1a.h.in b/Tests/QtAutogenRerun/mocRerun/test1a.h.in
index a335046..a335046 100644
--- a/Tests/QtAutogen/mocRerun/test1a.h.in
+++ b/Tests/QtAutogenRerun/mocRerun/test1a.h.in
diff --git a/Tests/QtAutogen/mocRerun/test1b.h.in b/Tests/QtAutogenRerun/mocRerun/test1b.h.in
index 6128eeb..6128eeb 100644
--- a/Tests/QtAutogen/mocRerun/test1b.h.in
+++ b/Tests/QtAutogenRerun/mocRerun/test1b.h.in
diff --git a/Tests/QtAutogen/rccDepends/CMakeLists.txt b/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt
index 878ae5d..edc0ac3 100644
--- a/Tests/QtAutogen/rccDepends/CMakeLists.txt
+++ b/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 3.7)
-project(rccDepends)
+cmake_minimum_required(VERSION 3.9)
+project(rccDepends CXX)
set(CMAKE_AUTORCC ON)
diff --git a/Tests/QtAutogen/rccDepends/main.cpp b/Tests/QtAutogenRerun/rccDepends/main.cpp
index 766b775..766b775 100644
--- a/Tests/QtAutogen/rccDepends/main.cpp
+++ b/Tests/QtAutogenRerun/rccDepends/main.cpp
diff --git a/Tests/QtAutogen/rccDepends/res/input1.txt.in b/Tests/QtAutogenRerun/rccDepends/res/input1.txt.in
index da62762..da62762 100644
--- a/Tests/QtAutogen/rccDepends/res/input1.txt.in
+++ b/Tests/QtAutogenRerun/rccDepends/res/input1.txt.in
diff --git a/Tests/QtAutogen/rccDepends/res/input2.txt.in b/Tests/QtAutogenRerun/rccDepends/res/input2.txt.in
index 08e14b7..08e14b7 100644
--- a/Tests/QtAutogen/rccDepends/res/input2.txt.in
+++ b/Tests/QtAutogenRerun/rccDepends/res/input2.txt.in
diff --git a/Tests/QtAutogen/rccDepends/res1a.qrc.in b/Tests/QtAutogenRerun/rccDepends/res1a.qrc.in
index d111ffb..d111ffb 100644
--- a/Tests/QtAutogen/rccDepends/res1a.qrc.in
+++ b/Tests/QtAutogenRerun/rccDepends/res1a.qrc.in
diff --git a/Tests/QtAutogen/rccDepends/res1b.qrc.in b/Tests/QtAutogenRerun/rccDepends/res1b.qrc.in
index 4cb3f04..4cb3f04 100644
--- a/Tests/QtAutogen/rccDepends/res1b.qrc.in
+++ b/Tests/QtAutogenRerun/rccDepends/res1b.qrc.in
diff --git a/Tests/QtAutogen/rccDepends/res2a.qrc.in b/Tests/QtAutogenRerun/rccDepends/res2a.qrc.in
index 19f34ac..19f34ac 100644
--- a/Tests/QtAutogen/rccDepends/res2a.qrc.in
+++ b/Tests/QtAutogenRerun/rccDepends/res2a.qrc.in
diff --git a/Tests/QtAutogen/rccDepends/res2b.qrc.in b/Tests/QtAutogenRerun/rccDepends/res2b.qrc.in
index 19e8ba1..19e8ba1 100644
--- a/Tests/QtAutogen/rccDepends/res2b.qrc.in
+++ b/Tests/QtAutogenRerun/rccDepends/res2b.qrc.in
diff --git a/Tests/README b/Tests/README
deleted file mode 100644
index 8b2fda8..0000000
--- a/Tests/README
+++ /dev/null
@@ -1,39 +0,0 @@
-If you think about adding a new testcase then here is a small checklist you
-can run through to find a proper place for it. Go through the list from the
-beginning and stop once you find something that matches your tests needs,
-i.e. if you will test a module and only need the configure mode use the
-instructions from section 2, not 3.
-
-1. Your testcase can run in CMake script mode, i.e. "cmake -P something"
-
-Put your test in Tests/CMakeTests/ directory as a .cmake.in file. It will be
-put into the test binary directory by configure_file(... @ONLY) and run from
-there. Use the AddCMakeTest() macro in Tests/CMakeTests/CMakeLists.txt to add
-your test to the test runs.
-
-2. Your test needs CMake to run in configure mode, but will not build anything
-
-This includes tests that will build something using try_compile() and friends,
-but nothing that expects add_executable(), add_library(), or add_test() to run.
-
-If the test configures the project only once and it must succeed then put it
-into the Tests/CMakeOnly/ directory. Create a subdirectory named like your
-test and write the CMakeLists.txt you need into that subdirectory. Use the
-add_CMakeOnly_test() macro from Tests/CMakeOnly/CMakeLists.txt to add your
-test to the test runs.
-
-If the test configures the project with multiple variations and verifies
-success or failure each time then put it into the Tests/RunCMake/ directory.
-Read the instructions in Tests/RunCMake/CMakeLists.txt to add a test.
-
-3. If you are testing something from the Modules directory
-
-Put your test in the Tests/Modules/ directory. Create a subdirectory there
-named after your test. Use the ADD_TEST_MACRO macro from Tests/CMakeLists.txt
-to add your test to the test run. If you have put your stuff in
-Tests/Modules/Foo then you call it using ADD_TEST_MACRO(Module.Foo Foo).
-
-4. You are doing other stuff.
-
-Find a good place ;) In doubt mail to cmake-developers@cmake.org and ask for
-advise.
diff --git a/Tests/README.rst b/Tests/README.rst
new file mode 100644
index 0000000..3e98938
--- /dev/null
+++ b/Tests/README.rst
@@ -0,0 +1,31 @@
+CMake Tests Directory
+*********************
+
+This directory contains the CMake test suite.
+See also the `CMake Source Code Guide`_.
+
+.. _`CMake Source Code Guide`: ../Help/dev/source.rst
+
+Many tests exist as immediate subdirectories, but some tests
+are organized as follows.
+
+* ``CMakeLib/``:
+ Source code, used for tests, that links to the ``CMakeLib`` library
+ defined over in ``Source/``.
+
+* ``CMakeOnly/``:
+ Deprecated. Tests that run CMake to generate a project but not build it.
+ Superseded by ``Tests/RunCMake/``.
+
+* ``Find*/``:
+ Tests for specific find modules that can only be run on machines with
+ the corresponding packages installed. They are enabled in
+ ``CMakeLists.txt`` by undocumented options used on CI builds.
+
+* ``Module/``:
+ Tests for specific CMake modules.
+
+* ``RunCMake/``:
+ Tests that run CMake and/or other tools while precisely checking
+ their return code and stdout/stderr content. Useful for testing
+ error cases and diagnostic output.
diff --git a/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake
index ef33012..87b0de0 100644
--- a/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake
+++ b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake
@@ -11,7 +11,7 @@ endif()
]])
endif()
-file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
set(check_pairs
\"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/test.manifest\"
)
diff --git a/Tests/RunCMake/BuildDepends/C-Exe.cmake b/Tests/RunCMake/BuildDepends/C-Exe.cmake
index 5057ca9..ad5cd4d 100644
--- a/Tests/RunCMake/BuildDepends/C-Exe.cmake
+++ b/Tests/RunCMake/BuildDepends/C-Exe.cmake
@@ -2,7 +2,7 @@ enable_language(C)
add_executable(main ${CMAKE_CURRENT_BINARY_DIR}/main.c)
-file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
set(check_pairs
\"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/main.c\"
)
diff --git a/Tests/RunCMake/BuildDepends/Custom-Always.cmake b/Tests/RunCMake/BuildDepends/Custom-Always.cmake
index d412708..c7e7fb0 100644
--- a/Tests/RunCMake/BuildDepends/Custom-Always.cmake
+++ b/Tests/RunCMake/BuildDepends/Custom-Always.cmake
@@ -16,7 +16,7 @@ add_custom_command(
add_custom_target(drive ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/after-always)
-file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
set(check_pairs
\"${CMAKE_CURRENT_BINARY_DIR}/always-updated|${CMAKE_CURRENT_BINARY_DIR}/before-always\"
\"${CMAKE_CURRENT_BINARY_DIR}/after-always|${CMAKE_CURRENT_BINARY_DIR}/always-updated\"
diff --git a/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake
index 687c827..1e1f22a 100644
--- a/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake
+++ b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake
@@ -16,7 +16,7 @@ add_custom_command(
add_custom_target(drive ALL DEPENDS use-byproduct)
add_dependencies(drive produce)
-file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
if (check_step EQUAL 1)
set(check_pairs
\"${CMAKE_CURRENT_BINARY_DIR}/use-byproduct|${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp\"
diff --git a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake
index 0f92e0e..8b2ae78 100644
--- a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake
+++ b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake
@@ -6,7 +6,7 @@ add_custom_command(
add_custom_target(generate ALL DEPENDS output.cxx)
set_property(TARGET generate PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})
-file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
set(check_pairs
\"${CMAKE_CURRENT_BINARY_DIR}/output.cxx|${CMAKE_CURRENT_BINARY_DIR}/MakeCustomIncludes.h\"
)
diff --git a/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake b/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake
index add9aeb..af6ad86 100644
--- a/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake
+++ b/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake
@@ -3,7 +3,7 @@ get_filename_component(include_dir "${CMAKE_BINARY_DIR}" PATH)
include_directories("${include_dir}")
add_executable(MakeInProjectOnly MakeInProjectOnly.c)
set(CMAKE_DEPENDS_IN_PROJECT_ONLY 1)
-file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
if (check_step EQUAL 1)
set(check_pairs
\"$<TARGET_FILE:MakeInProjectOnly>|${include_dir}/MakeInProjectOnly.h\"
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index 9941c70..1bf8fbc 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -32,7 +32,8 @@ endfunction()
run_BuildDepends(C-Exe)
if(NOT RunCMake_GENERATOR STREQUAL "Xcode")
- if(RunCMake_GENERATOR MATCHES "Visual Studio 10")
+ if(RunCMake_GENERATOR MATCHES "Visual Studio 10" OR
+ RunCMake_GENERATOR_TOOLSET MATCHES "^(v80|v90|v100)$")
# VS 10 forgets to re-link when a manifest changes
set(run_BuildDepends_skip_step_2 1)
endif()
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 79f487d..13df4a8 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -148,6 +148,7 @@ add_RunCMake_test(GeneratorExpression)
add_RunCMake_test(GeneratorPlatform)
add_RunCMake_test(GeneratorToolset)
add_RunCMake_test(GNUInstallDirs -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME})
+add_RunCMake_test(GoogleTest) # Note: does not actually depend on Google Test
add_RunCMake_test(TargetPropertyGeneratorExpressions)
add_RunCMake_test(Languages)
add_RunCMake_test(LinkStatic)
@@ -181,8 +182,10 @@ add_RunCMake_test(add_custom_target)
add_RunCMake_test(add_dependencies)
add_RunCMake_test(add_subdirectory)
add_RunCMake_test(build_command)
+add_executable(exit_code exit_code.c)
+set(execute_process_ARGS -DEXIT_CODE_EXE=$<TARGET_FILE:exit_code>)
if(NOT CMake_TEST_EXTERNAL_CMAKE)
- set(execute_process_ARGS -DTEST_ENCODING_EXE=$<TARGET_FILE:testEncoding>)
+ list(APPEND execute_process_ARGS -DTEST_ENCODING_EXE=$<TARGET_FILE:testEncoding>)
endif()
add_RunCMake_test(execute_process)
add_RunCMake_test(export)
@@ -213,6 +216,7 @@ add_RunCMake_test(get_property)
add_RunCMake_test(if)
add_RunCMake_test(include)
add_RunCMake_test(include_directories)
+add_RunCMake_test(include_guard)
add_RunCMake_test(list)
add_RunCMake_test(message)
add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES})
@@ -220,6 +224,7 @@ add_RunCMake_test(return)
add_RunCMake_test(separate_arguments)
add_RunCMake_test(set_property)
add_RunCMake_test(string)
+add_RunCMake_test(test_include_dirs)
foreach(var
CMAKE_C_COMPILER_ID
CMAKE_C_COMPILER_VERSION
@@ -341,7 +346,11 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
add_RunCMake_test(ClangTidy -DPSEUDO_TIDY=$<TARGET_FILE:pseudo_tidy>)
add_RunCMake_test(IncludeWhatYouUse -DPSEUDO_IWYU=$<TARGET_FILE:pseudo_iwyu>)
add_RunCMake_test(Cpplint -DPSEUDO_CPPLINT=$<TARGET_FILE:pseudo_cpplint>)
+ if(DEFINED CMake_TEST_CUDA)
+ list(APPEND CompilerLauncher_ARGS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
+ endif()
add_RunCMake_test(CompilerLauncher)
+ add_RunCMake_test(ctest_labels_for_subprojects)
endif()
add_RunCMake_test_group(CPack "DEB;RPM;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ")
@@ -371,3 +380,7 @@ if(CMake_TEST_ANDROID_NDK OR CMake_TEST_ANDROID_STANDALONE_TOOLCHAIN)
endif()
set_property(TEST RunCMake.Android PROPERTY TIMEOUT ${CMake_TEST_ANDROID_TIMEOUT})
endif()
+
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^89]|[89][0-9])")
+ add_RunCMake_test(CSharpCustomCommand)
+endif()
diff --git a/Tests/RunCMake/CPack/CMakeLists.txt b/Tests/RunCMake/CPack/CMakeLists.txt
index c361af0..1b3dbb2 100644
--- a/Tests/RunCMake/CPack/CMakeLists.txt
+++ b/Tests/RunCMake/CPack/CMakeLists.txt
@@ -15,3 +15,7 @@ include(tests/${RunCMake_TEST_FILE_PREFIX}/test.cmake)
set(CPACK_GENERATOR "${GENERATOR_TYPE}")
include(CPack)
+
+if(COMMAND run_after_include_cpack)
+ run_after_include_cpack()
+endif()
diff --git a/Tests/RunCMake/CPack/README.txt b/Tests/RunCMake/CPack/README.txt
index 7c98f69..cf7c02c 100644
--- a/Tests/RunCMake/CPack/README.txt
+++ b/Tests/RunCMake/CPack/README.txt
@@ -91,6 +91,11 @@ If test will be used for multiple generators but some of them require some
generator specific commands then those commands should be added to 'test.cmake'
script wrapped with 'if(GENERATOR_TYPE STREQUAL <name_of_the_generator>)'.
+NOTE: In some cases (for example when testing CPackComponent.cmake functions)
+the test has to run some functions after CPack.cmake is included. In such cases
+a function run_after_include_cpack can be declared in test.cmake file and that
+function will run after the inclusion of CPack.cmake.
+
build phase (optional and not available for source package tests)
-----------------------------------------------------------------
diff --git a/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake b/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake
index 1a373b9..8fc1218 100644
--- a/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake
+++ b/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake
@@ -1,6 +1,6 @@
add_executable(mytest test.cpp)
-file(GENERATE OUTPUT runtest_info.cmake CONTENT [[
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtest_info.cmake CONTENT [[
set(EXPECTED_MYTEST_NAME "$<TARGET_FILE_NAME:mytest>")
]])
diff --git a/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake b/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake
index 77fe8ed..b23d3c7 100644
--- a/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake
+++ b/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake
@@ -6,7 +6,7 @@ foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES)
OUTPUT_NAME_${UPPER_CONFIG} bar_${CONFIG})
endforeach()
-file(GENERATE OUTPUT runtest_info_$<CONFIG>.cmake CONTENT [[
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtest_info_$<CONFIG>.cmake CONTENT [[
set(CPACK_BUILD_CONFIG "$<CONFIG>")
set(EXPECTED_MYTEST_NAME "$<TARGET_FILE_NAME:mytest>")
]])
diff --git a/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake b/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake
index 2e1d465..2001d9f 100644
--- a/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake
+++ b/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake
@@ -1,6 +1,6 @@
add_executable(mytest test.cpp)
-file(GENERATE OUTPUT runtest_info.cmake CONTENT [[
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtest_info.cmake CONTENT [[
set(EXPECTED_MYTEST_NAME "$<TARGET_FILE_NAME:mytest>")
]])
diff --git a/Tests/RunCMake/CSharpCustomCommand/CMakeLists.txt b/Tests/RunCMake/CSharpCustomCommand/CMakeLists.txt
new file mode 100644
index 0000000..74b3ff8
--- /dev/null
+++ b/Tests/RunCMake/CSharpCustomCommand/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.3)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CSharpCustomCommand/CommandWithOutput-check.cmake b/Tests/RunCMake/CSharpCustomCommand/CommandWithOutput-check.cmake
new file mode 100644
index 0000000..60d77eb
--- /dev/null
+++ b/Tests/RunCMake/CSharpCustomCommand/CommandWithOutput-check.cmake
@@ -0,0 +1,21 @@
+if(checkLevel EQUAL 0)
+ message("checking generation (${srcName} does not exist)")
+ if(EXISTS "${generatedFileName}")
+ set(RunCMake_TEST_FAILED "file \"${generatedFileName}\" should not exist")
+ endif()
+elseif(checkLevel EQUAL 1)
+ message("checking build 1 (generate ${srcName})")
+ if(NOT "${actual_stdout}" MATCHES "${commandComment}")
+ set(RunCMake_TEST_FAILED "command not executed")
+ endif()
+elseif(checkLevel EQUAL 2)
+ message("checking build 2 (no change in ${srcName}.in)")
+ if("${actual_stdout}" MATCHES "${commandComment}")
+ set(RunCMake_TEST_FAILED "command executed")
+ endif()
+elseif(checkLevel EQUAL 3)
+ message("checking build 3 (update ${srcName})")
+ if(NOT "${actual_stdout}" MATCHES "${commandComment}")
+ set(RunCMake_TEST_FAILED "command not executed")
+ endif()
+endif()
diff --git a/Tests/RunCMake/CSharpCustomCommand/CommandWithOutput.cmake b/Tests/RunCMake/CSharpCustomCommand/CommandWithOutput.cmake
new file mode 100644
index 0000000..68341fa
--- /dev/null
+++ b/Tests/RunCMake/CSharpCustomCommand/CommandWithOutput.cmake
@@ -0,0 +1,13 @@
+enable_language(CSharp)
+
+add_executable(CSharpCustomCommand dummy.cs)
+
+add_custom_command(OUTPUT ${generatedFileName}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${inputFileName} ${generatedFileName}
+ MAIN_DEPENDENCY ${inputFileName}
+ COMMENT "${commandComment}")
+
+target_sources(CSharpCustomCommand PRIVATE
+ ${inputFileName}
+ ${generatedFileName})
diff --git a/Tests/RunCMake/CSharpCustomCommand/RunCMakeTest.cmake b/Tests/RunCMake/CSharpCustomCommand/RunCMakeTest.cmake
new file mode 100644
index 0000000..fa5618a
--- /dev/null
+++ b/Tests/RunCMake/CSharpCustomCommand/RunCMakeTest.cmake
@@ -0,0 +1,34 @@
+include(RunCMake)
+
+# Use a single build tree for a few tests without cleaning.
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CommandWithOutput-build)
+set(RunCMake_TEST_NO_CLEAN 1)
+file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+set(RunCMake-check-file CommandWithOutput-check.cmake)
+
+set(srcName "test.cs")
+set(srcFileName "${CMAKE_CURRENT_LIST_DIR}/${srcName}.in")
+set(inputFileName "${RunCMake_TEST_BINARY_DIR}/${srcName}.in")
+set(generatedFileName "${RunCMake_TEST_BINARY_DIR}/${srcName}")
+set(commandComment "Generating ${srcName}")
+
+# copy the input file to build dir to avoid changing files in cmake
+# source tree.
+file(COPY "${srcFileName}" DESTINATION "${RunCMake_TEST_BINARY_DIR}")
+
+set(RunCMake_TEST_OPTIONS ${RunCMake_TEST_OPTIONS}
+ "-DinputFileName=${inputFileName}"
+ "-DgeneratedFileName=${generatedFileName}"
+ "-DcommandComment=${commandComment}")
+
+set(checkLevel 0)
+run_cmake(CommandWithOutput)
+set(checkLevel 1)
+run_cmake_command(CommandWithOutput-build1 ${CMAKE_COMMAND} --build . --config Debug)
+set(checkLevel 2)
+run_cmake_command(CommandWithOutput-build2 ${CMAKE_COMMAND} --build . --config Debug)
+# change file content to trigger custom command with next build
+file(APPEND ${inputFileName} "\n")
+set(checkLevel 3)
+run_cmake_command(CommandWithOutput-build3 ${CMAKE_COMMAND} --build . --config Debug)
diff --git a/Tests/RunCMake/CSharpCustomCommand/dummy.cs b/Tests/RunCMake/CSharpCustomCommand/dummy.cs
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CSharpCustomCommand/dummy.cs
diff --git a/Tests/RunCMake/CSharpCustomCommand/test.cs.in b/Tests/RunCMake/CSharpCustomCommand/test.cs.in
new file mode 100644
index 0000000..05a7531
--- /dev/null
+++ b/Tests/RunCMake/CSharpCustomCommand/test.cs.in
@@ -0,0 +1,8 @@
+class TestCs
+{
+ public static int Main(string[] args)
+ {
+ System.Console.WriteLine("Test C#");
+ return 0;
+ }
+}
diff --git a/Tests/RunCMake/CommandLine/E_md5sum-dir-result.txt b/Tests/RunCMake/CommandLine/E_md5sum-dir-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_md5sum-dir-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_md5sum-dir-stderr.txt b/Tests/RunCMake/CommandLine/E_md5sum-dir-stderr.txt
new file mode 100644
index 0000000..061fd64
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_md5sum-dir-stderr.txt
@@ -0,0 +1 @@
+Error: . is a directory
diff --git a/Tests/RunCMake/CommandLine/E_md5sum-mixed-result.txt b/Tests/RunCMake/CommandLine/E_md5sum-mixed-result.txt
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_md5sum-mixed-result.txt
@@ -0,0 +1 @@
+2
diff --git a/Tests/RunCMake/CommandLine/E_md5sum-mixed-stderr.txt b/Tests/RunCMake/CommandLine/E_md5sum-mixed-stderr.txt
new file mode 100644
index 0000000..b6b84c3
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_md5sum-mixed-stderr.txt
@@ -0,0 +1,2 @@
+Error: . is a directory
+nonexisting: No such file or directory
diff --git a/Tests/RunCMake/CommandLine/E_md5sum-mixed-stdout.txt b/Tests/RunCMake/CommandLine/E_md5sum-mixed-stdout.txt
new file mode 100644
index 0000000..18e49be
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_md5sum-mixed-stdout.txt
@@ -0,0 +1 @@
+275876e34cf609db118f3d84b799a790 ../dummy
diff --git a/Tests/RunCMake/CommandLine/E_md5sum-no-file-result.txt b/Tests/RunCMake/CommandLine/E_md5sum-no-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_md5sum-no-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_md5sum-no-file-stderr.txt b/Tests/RunCMake/CommandLine/E_md5sum-no-file-stderr.txt
new file mode 100644
index 0000000..732e8c4
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_md5sum-no-file-stderr.txt
@@ -0,0 +1 @@
+nonexisting: No such file or directory
diff --git a/Tests/RunCMake/CommandLine/E_md5sum-result.txt b/Tests/RunCMake/CommandLine/E_md5sum-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_md5sum-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_md5sum-stdout.txt b/Tests/RunCMake/CommandLine/E_md5sum-stdout.txt
new file mode 100644
index 0000000..18e49be
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_md5sum-stdout.txt
@@ -0,0 +1 @@
+275876e34cf609db118f3d84b799a790 ../dummy
diff --git a/Tests/RunCMake/CommandLine/E_sha1sum-dir-result.txt b/Tests/RunCMake/CommandLine/E_sha1sum-dir-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha1sum-dir-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_sha1sum-dir-stderr.txt b/Tests/RunCMake/CommandLine/E_sha1sum-dir-stderr.txt
new file mode 100644
index 0000000..061fd64
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha1sum-dir-stderr.txt
@@ -0,0 +1 @@
+Error: . is a directory
diff --git a/Tests/RunCMake/CommandLine/E_sha1sum-no-file-result.txt b/Tests/RunCMake/CommandLine/E_sha1sum-no-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha1sum-no-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_sha1sum-no-file-stderr.txt b/Tests/RunCMake/CommandLine/E_sha1sum-no-file-stderr.txt
new file mode 100644
index 0000000..732e8c4
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha1sum-no-file-stderr.txt
@@ -0,0 +1 @@
+nonexisting: No such file or directory
diff --git a/Tests/RunCMake/CommandLine/E_sha1sum-result.txt b/Tests/RunCMake/CommandLine/E_sha1sum-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha1sum-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_sha1sum-stdout.txt b/Tests/RunCMake/CommandLine/E_sha1sum-stdout.txt
new file mode 100644
index 0000000..689b85b
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha1sum-stdout.txt
@@ -0,0 +1 @@
+829c3804401b0727f70f73d4415e162400cbe57b ../dummy
diff --git a/Tests/RunCMake/CommandLine/E_sha224sum-dir-result.txt b/Tests/RunCMake/CommandLine/E_sha224sum-dir-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha224sum-dir-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_sha224sum-dir-stderr.txt b/Tests/RunCMake/CommandLine/E_sha224sum-dir-stderr.txt
new file mode 100644
index 0000000..061fd64
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha224sum-dir-stderr.txt
@@ -0,0 +1 @@
+Error: . is a directory
diff --git a/Tests/RunCMake/CommandLine/E_sha224sum-no-file-result.txt b/Tests/RunCMake/CommandLine/E_sha224sum-no-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha224sum-no-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_sha224sum-no-file-stderr.txt b/Tests/RunCMake/CommandLine/E_sha224sum-no-file-stderr.txt
new file mode 100644
index 0000000..732e8c4
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha224sum-no-file-stderr.txt
@@ -0,0 +1 @@
+nonexisting: No such file or directory
diff --git a/Tests/RunCMake/CommandLine/E_sha224sum-result.txt b/Tests/RunCMake/CommandLine/E_sha224sum-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha224sum-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_sha224sum-stdout.txt b/Tests/RunCMake/CommandLine/E_sha224sum-stdout.txt
new file mode 100644
index 0000000..5b3e217
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha224sum-stdout.txt
@@ -0,0 +1 @@
+37d32c6dbabed711cb1d4620b64090fef0ef63ab16a4a51d668259e6 ../dummy
diff --git a/Tests/RunCMake/CommandLine/E_sha256sum-dir-result.txt b/Tests/RunCMake/CommandLine/E_sha256sum-dir-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha256sum-dir-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_sha256sum-dir-stderr.txt b/Tests/RunCMake/CommandLine/E_sha256sum-dir-stderr.txt
new file mode 100644
index 0000000..061fd64
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha256sum-dir-stderr.txt
@@ -0,0 +1 @@
+Error: . is a directory
diff --git a/Tests/RunCMake/CommandLine/E_sha256sum-no-file-result.txt b/Tests/RunCMake/CommandLine/E_sha256sum-no-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha256sum-no-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_sha256sum-no-file-stderr.txt b/Tests/RunCMake/CommandLine/E_sha256sum-no-file-stderr.txt
new file mode 100644
index 0000000..732e8c4
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha256sum-no-file-stderr.txt
@@ -0,0 +1 @@
+nonexisting: No such file or directory
diff --git a/Tests/RunCMake/CommandLine/E_sha256sum-result.txt b/Tests/RunCMake/CommandLine/E_sha256sum-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha256sum-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_sha256sum-stdout.txt b/Tests/RunCMake/CommandLine/E_sha256sum-stdout.txt
new file mode 100644
index 0000000..9a18770
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha256sum-stdout.txt
@@ -0,0 +1 @@
+b5a2c96250612366ea272ffac6d9744aaf4b45aacd96aa7cfcb931ee3b558259 ../dummy
diff --git a/Tests/RunCMake/CommandLine/E_sha384sum-dir-result.txt b/Tests/RunCMake/CommandLine/E_sha384sum-dir-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha384sum-dir-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_sha384sum-dir-stderr.txt b/Tests/RunCMake/CommandLine/E_sha384sum-dir-stderr.txt
new file mode 100644
index 0000000..061fd64
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha384sum-dir-stderr.txt
@@ -0,0 +1 @@
+Error: . is a directory
diff --git a/Tests/RunCMake/CommandLine/E_sha384sum-no-file-result.txt b/Tests/RunCMake/CommandLine/E_sha384sum-no-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha384sum-no-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_sha384sum-no-file-stderr.txt b/Tests/RunCMake/CommandLine/E_sha384sum-no-file-stderr.txt
new file mode 100644
index 0000000..732e8c4
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha384sum-no-file-stderr.txt
@@ -0,0 +1 @@
+nonexisting: No such file or directory
diff --git a/Tests/RunCMake/CommandLine/E_sha384sum-result.txt b/Tests/RunCMake/CommandLine/E_sha384sum-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha384sum-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_sha384sum-stdout.txt b/Tests/RunCMake/CommandLine/E_sha384sum-stdout.txt
new file mode 100644
index 0000000..b706ac5
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha384sum-stdout.txt
@@ -0,0 +1 @@
+43c1835ceba2e29596f05e3859d4fe2b6d124a181ed670f68e914bd3ed251b02b4be609608a13f23ec3d98da6c4eb8cd ../dummy
diff --git a/Tests/RunCMake/CommandLine/E_sha512sum-dir-result.txt b/Tests/RunCMake/CommandLine/E_sha512sum-dir-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha512sum-dir-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_sha512sum-dir-stderr.txt b/Tests/RunCMake/CommandLine/E_sha512sum-dir-stderr.txt
new file mode 100644
index 0000000..061fd64
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha512sum-dir-stderr.txt
@@ -0,0 +1 @@
+Error: . is a directory
diff --git a/Tests/RunCMake/CommandLine/E_sha512sum-no-file-result.txt b/Tests/RunCMake/CommandLine/E_sha512sum-no-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha512sum-no-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_sha512sum-no-file-stderr.txt b/Tests/RunCMake/CommandLine/E_sha512sum-no-file-stderr.txt
new file mode 100644
index 0000000..732e8c4
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha512sum-no-file-stderr.txt
@@ -0,0 +1 @@
+nonexisting: No such file or directory
diff --git a/Tests/RunCMake/CommandLine/E_sha512sum-result.txt b/Tests/RunCMake/CommandLine/E_sha512sum-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha512sum-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_sha512sum-stdout.txt b/Tests/RunCMake/CommandLine/E_sha512sum-stdout.txt
new file mode 100644
index 0000000..4305383
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_sha512sum-stdout.txt
@@ -0,0 +1 @@
+1692526aab84461a8aebcefddcba2b33fb5897ab180c53e8b345ae125484d0aaa35baf60487050be21ed8909a48eace93851bf139087ce1f7a87d97b6120a651 ../dummy
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index f94b10a..6efcc12 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -172,6 +172,30 @@ run_cmake_command(E_env-bad-arg1 ${CMAKE_COMMAND} -E env -bad-arg1)
run_cmake_command(E_env-set ${CMAKE_COMMAND} -E env TEST_ENV=1 ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/E_env-set.cmake)
run_cmake_command(E_env-unset ${CMAKE_COMMAND} -E env TEST_ENV=1 ${CMAKE_COMMAND} -E env --unset=TEST_ENV ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/E_env-unset.cmake)
+run_cmake_command(E_md5sum-dir ${CMAKE_COMMAND} -E md5sum .)
+run_cmake_command(E_sha1sum-dir ${CMAKE_COMMAND} -E sha1sum .)
+run_cmake_command(E_sha224sum-dir ${CMAKE_COMMAND} -E sha224sum .)
+run_cmake_command(E_sha256sum-dir ${CMAKE_COMMAND} -E sha256sum .)
+run_cmake_command(E_sha384sum-dir ${CMAKE_COMMAND} -E sha384sum .)
+run_cmake_command(E_sha512sum-dir ${CMAKE_COMMAND} -E sha512sum .)
+
+run_cmake_command(E_md5sum-no-file ${CMAKE_COMMAND} -E md5sum nonexisting)
+run_cmake_command(E_sha1sum-no-file ${CMAKE_COMMAND} -E sha1sum nonexisting)
+run_cmake_command(E_sha224sum-no-file ${CMAKE_COMMAND} -E sha224sum nonexisting)
+run_cmake_command(E_sha256sum-no-file ${CMAKE_COMMAND} -E sha256sum nonexisting)
+run_cmake_command(E_sha384sum-no-file ${CMAKE_COMMAND} -E sha384sum nonexisting)
+run_cmake_command(E_sha512sum-no-file ${CMAKE_COMMAND} -E sha512sum nonexisting)
+
+file(WRITE "${RunCMake_BINARY_DIR}/dummy" "dummy")
+run_cmake_command(E_md5sum ${CMAKE_COMMAND} -E md5sum ../dummy)
+run_cmake_command(E_md5sum-mixed ${CMAKE_COMMAND} -E md5sum . ../dummy nonexisting)
+run_cmake_command(E_sha1sum ${CMAKE_COMMAND} -E sha1sum ../dummy)
+run_cmake_command(E_sha224sum ${CMAKE_COMMAND} -E sha224sum ../dummy)
+run_cmake_command(E_sha256sum ${CMAKE_COMMAND} -E sha256sum ../dummy)
+run_cmake_command(E_sha384sum ${CMAKE_COMMAND} -E sha384sum ../dummy)
+run_cmake_command(E_sha512sum ${CMAKE_COMMAND} -E sha512sum ../dummy)
+file(REMOVE "${RunCMake_BINARY_DIR}/dummy")
+
set(RunCMake_DEFAULT_stderr ".")
run_cmake_command(E_sleep-no-args ${CMAKE_COMMAND} -E sleep)
unset(RunCMake_DEFAULT_stderr)
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-launch.cmake b/Tests/RunCMake/CompilerLauncher/CUDA-launch.cmake
new file mode 100644
index 0000000..6b4b816
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-launch.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(CUDA.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA.cmake b/Tests/RunCMake/CompilerLauncher/CUDA.cmake
new file mode 100644
index 0000000..fe5560b
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA.cmake
@@ -0,0 +1,4 @@
+enable_language(CUDA)
+set(CMAKE_CUDA_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.cu)
diff --git a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
index 5884d5c..ab26512 100644
--- a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
@@ -15,9 +15,14 @@ function(run_compiler_launcher lang)
run_cmake_command(${lang}-Build ${CMAKE_COMMAND} --build . ${verbose_args})
endfunction()
-run_compiler_launcher(C)
-run_compiler_launcher(CXX)
-if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake")
- run_compiler_launcher(C-launch)
- run_compiler_launcher(CXX-launch)
+set(langs C CXX)
+if(CMake_TEST_CUDA)
+ list(APPEND langs CUDA)
endif()
+
+foreach(lang ${langs})
+ run_compiler_launcher(${lang})
+ if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake")
+ run_compiler_launcher(${lang}-launch)
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/CompilerLauncher/main.cu b/Tests/RunCMake/CompilerLauncher/main.cu
new file mode 100644
index 0000000..f8b643a
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/main.cu
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/ExternalProject/NoOptions-stderr.txt b/Tests/RunCMake/ExternalProject/NoOptions-stderr.txt
index 12a76c5..2fc7d29 100644
--- a/Tests/RunCMake/ExternalProject/NoOptions-stderr.txt
+++ b/Tests/RunCMake/ExternalProject/NoOptions-stderr.txt
@@ -6,12 +6,12 @@
is not an existing non-empty directory. Please specify one of:
\* SOURCE_DIR with an existing non-empty directory
+ \* DOWNLOAD_COMMAND
\* URL
\* GIT_REPOSITORY
+ \* SVN_REPOSITORY
\* HG_REPOSITORY
\* CVS_REPOSITORY and CVS_MODULE
- \* SVN_REVISION
- \* DOWNLOAD_COMMAND
Call Stack \(most recent call first\):
.*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_add_download_command\)
NoOptions.cmake:[0-9]+ \(ExternalProject_Add\)
diff --git a/Tests/RunCMake/ExternalProject/SourceEmpty-stderr.txt b/Tests/RunCMake/ExternalProject/SourceEmpty-stderr.txt
index 58a343c..07c6e87 100644
--- a/Tests/RunCMake/ExternalProject/SourceEmpty-stderr.txt
+++ b/Tests/RunCMake/ExternalProject/SourceEmpty-stderr.txt
@@ -6,12 +6,12 @@
is not an existing non-empty directory. Please specify one of:
\* SOURCE_DIR with an existing non-empty directory
+ \* DOWNLOAD_COMMAND
\* URL
\* GIT_REPOSITORY
+ \* SVN_REPOSITORY
\* HG_REPOSITORY
\* CVS_REPOSITORY and CVS_MODULE
- \* SVN_REVISION
- \* DOWNLOAD_COMMAND
Call Stack \(most recent call first\):
.*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_add_download_command\)
SourceEmpty.cmake:[0-9]+ \(ExternalProject_Add\)
diff --git a/Tests/RunCMake/ExternalProject/SourceMissing-stderr.txt b/Tests/RunCMake/ExternalProject/SourceMissing-stderr.txt
index e62f7cf..373f6e3 100644
--- a/Tests/RunCMake/ExternalProject/SourceMissing-stderr.txt
+++ b/Tests/RunCMake/ExternalProject/SourceMissing-stderr.txt
@@ -6,12 +6,12 @@
is not an existing non-empty directory. Please specify one of:
\* SOURCE_DIR with an existing non-empty directory
+ \* DOWNLOAD_COMMAND
\* URL
\* GIT_REPOSITORY
+ \* SVN_REPOSITORY
\* HG_REPOSITORY
\* CVS_REPOSITORY and CVS_MODULE
- \* SVN_REVISION
- \* DOWNLOAD_COMMAND
Call Stack \(most recent call first\):
.*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_add_download_command\)
SourceMissing.cmake:[0-9]+ \(ExternalProject_Add\)
diff --git a/Tests/RunCMake/File_Generate/CMP0070-NEW-check.cmake b/Tests/RunCMake/File_Generate/CMP0070-NEW-check.cmake
new file mode 100644
index 0000000..05ec26e
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CMP0070-NEW-check.cmake
@@ -0,0 +1,13 @@
+foreach(f
+ "${RunCMake_TEST_SOURCE_DIR}/relative-input-NEW.txt"
+ "${RunCMake_TEST_BINARY_DIR}/relative-output-NEW.txt"
+ )
+ if(EXISTS "${f}")
+ file(READ "${f}" content)
+ if(NOT content MATCHES "^relative-input-NEW[\r\n]*$")
+ string(APPEND RunCMake_TEST_FAILED "File\n ${f}\ndoes not have expected content.\n")
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "Missing\n ${f}\n")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/File_Generate/CMP0070-NEW.cmake b/Tests/RunCMake/File_Generate/CMP0070-NEW.cmake
new file mode 100644
index 0000000..1a03822
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CMP0070-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT relative-output-NEW.txt INPUT relative-input-NEW.txt)
diff --git a/Tests/RunCMake/File_Generate/CMP0070-OLD-check.cmake b/Tests/RunCMake/File_Generate/CMP0070-OLD-check.cmake
new file mode 100644
index 0000000..a71d822
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CMP0070-OLD-check.cmake
@@ -0,0 +1,13 @@
+foreach(f
+ "${RunCMake_TEST_BINARY_DIR}/relative-input-OLD.txt"
+ "${RunCMake_TEST_BINARY_DIR}/relative-output-OLD.txt"
+ )
+ if(EXISTS "${f}")
+ file(READ "${f}" content)
+ if(NOT content MATCHES "^relative-input-OLD[\r\n]*$")
+ string(APPEND RunCMake_TEST_FAILED "File\n ${f}\ndoes not have expected content.\n")
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "Missing\n ${f}\n")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/File_Generate/CMP0070-OLD.cmake b/Tests/RunCMake/File_Generate/CMP0070-OLD.cmake
new file mode 100644
index 0000000..0fb47cd
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CMP0070-OLD.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0070 OLD)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/relative-input-OLD.txt "relative-input-OLD\n")
+file(GENERATE OUTPUT relative-output-OLD.txt INPUT relative-input-OLD.txt)
diff --git a/Tests/RunCMake/File_Generate/CMP0070-WARN-check.cmake b/Tests/RunCMake/File_Generate/CMP0070-WARN-check.cmake
new file mode 100644
index 0000000..1488df0
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CMP0070-WARN-check.cmake
@@ -0,0 +1,13 @@
+foreach(f
+ "${RunCMake_TEST_BINARY_DIR}/relative-input-WARN.txt"
+ "${RunCMake_TEST_BINARY_DIR}/relative-output-WARN.txt"
+ )
+ if(EXISTS "${f}")
+ file(READ "${f}" content)
+ if(NOT content MATCHES "^relative-input-WARN[\r\n]*$")
+ string(APPEND RunCMake_TEST_FAILED "File\n ${f}\ndoes not have expected content.\n")
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "Missing\n ${f}\n")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/File_Generate/CMP0070-WARN-stderr.txt b/Tests/RunCMake/File_Generate/CMP0070-WARN-stderr.txt
new file mode 100644
index 0000000..dbabaa9
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CMP0070-WARN-stderr.txt
@@ -0,0 +1,27 @@
+^CMake Warning \(dev\) in CMakeLists.txt:
+ Policy CMP0070 is not set: Define file\(GENERATE\) behavior for relative
+ paths. Run "cmake --help-policy CMP0070" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+
+ file\(GENERATE\) given relative INPUT path:
+
+ relative-input-WARN.txt
+
+ This is not defined behavior unless CMP0070 is set to NEW. For
+ compatibility with older versions of CMake, the previous undefined behavior
+ will be used.
+This warning is for project developers. Use -Wno-dev to suppress it.(
++
+CMake Warning \(dev\) in CMakeLists.txt:
+ Policy CMP0070 is not set: Define file\(GENERATE\) behavior for relative
+ paths. Run "cmake --help-policy CMP0070" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+
+ file\(GENERATE\) given relative OUTPUT path:
+
+ relative-output-WARN.txt
+
+ This is not defined behavior unless CMP0070 is set to NEW. For
+ compatibility with older versions of CMake, the previous undefined behavior
+ will be used.
+This warning is for project developers. Use -Wno-dev to suppress it.)+$
diff --git a/Tests/RunCMake/File_Generate/CMP0070-WARN.cmake b/Tests/RunCMake/File_Generate/CMP0070-WARN.cmake
new file mode 100644
index 0000000..ccb0452
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CMP0070-WARN.cmake
@@ -0,0 +1,2 @@
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/relative-input-WARN.txt "relative-input-WARN\n")
+file(GENERATE OUTPUT relative-output-WARN.txt INPUT relative-input-WARN.txt)
diff --git a/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake b/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake
index e2b081d..59ccf19 100644
--- a/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake
+++ b/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake
@@ -7,6 +7,6 @@ target_compile_options(empty
)
file(GENERATE
- OUTPUT opts-$<COMPILE_LANGUAGE>.txt
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opts-$<COMPILE_LANGUAGE>.txt
CONTENT "$<TARGET_PROPERTY:empty,COMPILE_OPTIONS>\n"
)
diff --git a/Tests/RunCMake/File_Generate/ReRunCMake.cmake b/Tests/RunCMake/File_Generate/ReRunCMake.cmake
index 109d60e..541d86d 100644
--- a/Tests/RunCMake/File_Generate/ReRunCMake.cmake
+++ b/Tests/RunCMake/File_Generate/ReRunCMake.cmake
@@ -1,5 +1,5 @@
file(GENERATE
- OUTPUT output_file.txt
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output_file.txt"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/input_file.txt"
)
diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
index 82e903d..b660463 100644
--- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
+++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
@@ -1,5 +1,9 @@
include(RunCMake)
+run_cmake(CMP0070-NEW)
+run_cmake(CMP0070-OLD)
+run_cmake(CMP0070-WARN)
+
run_cmake(CommandConflict)
if("${RunCMake_GENERATOR}" MATCHES "Visual Studio|Xcode")
run_cmake(OutputConflict)
diff --git a/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake b/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake
index d1d832a..bb36a4c 100644
--- a/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake
+++ b/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake
@@ -1,5 +1,5 @@
file(GENERATE
- OUTPUT output_file.txt
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/output_file.txt
CONTENT "123"
)
diff --git a/Tests/RunCMake/File_Generate/relative-input-NEW.txt b/Tests/RunCMake/File_Generate/relative-input-NEW.txt
new file mode 100644
index 0000000..7293e90
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/relative-input-NEW.txt
@@ -0,0 +1 @@
+relative-input-NEW
diff --git a/Tests/RunCMake/Framework/FrameworkLayout.cmake b/Tests/RunCMake/Framework/FrameworkLayout.cmake
index 3d62a8a..4f42459 100644
--- a/Tests/RunCMake/Framework/FrameworkLayout.cmake
+++ b/Tests/RunCMake/Framework/FrameworkLayout.cmake
@@ -22,4 +22,4 @@ set_source_files_properties(some.txt PROPERTIES MACOSX_PACKAGE_LOCATION somedir)
add_custom_command(TARGET Framework POST_BUILD
COMMAND /usr/bin/file $<TARGET_FILE:Framework>)
-file(GENERATE OUTPUT FrameworkName.cmake CONTENT "set(framework-dir \"$<TARGET_BUNDLE_DIR:Framework>\")\n")
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkName.cmake CONTENT "set(framework-dir \"$<TARGET_BUNDLE_DIR:Framework>\")\n")
diff --git a/Tests/RunCMake/GenerateExportHeader/GEH.cmake b/Tests/RunCMake/GenerateExportHeader/GEH.cmake
index e0677a7..cfca8fe 100644
--- a/Tests/RunCMake/GenerateExportHeader/GEH.cmake
+++ b/Tests/RunCMake/GenerateExportHeader/GEH.cmake
@@ -45,13 +45,6 @@ include(GenerateExportHeader)
set(CMAKE_CXX_STANDARD 98)
-# Those versions of the HP compiler that need a flag to get proper C++98
-# template support also need a flag to use the newer C++ library.
-if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
- CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
- string(APPEND CMAKE_CXX_FLAGS " -AA")
-endif ()
-
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command-stderr.txt b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command-stderr.txt
index 789b4d0..c8b124a 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command-stderr.txt
@@ -3,8 +3,8 @@ CMake Error at COMPILE_LANGUAGE-add_custom_command.cmake:6 \(add_custom_command\
\$<COMPILE_LANGUAGE>
- \$<COMPILE_LANGUAGE:...> may only be used to specify include directories
- compile definitions, compile options and to evaluate components of the
+ \$<COMPILE_LANGUAGE:...> may only be used to specify include directories,
+ compile definitions, compile options, and to evaluate components of the
file\(GENERATE\) command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target-stderr.txt b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target-stderr.txt
index 400fbc0..e8cefc7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target-stderr.txt
@@ -3,8 +3,8 @@ CMake Error at COMPILE_LANGUAGE-add_custom_target.cmake:4 \(add_custom_target\):
\$<COMPILE_LANGUAGE>
- \$<COMPILE_LANGUAGE:...> may only be used to specify include directories
- compile definitions, compile options and to evaluate components of the
+ \$<COMPILE_LANGUAGE:...> may only be used to specify include directories,
+ compile definitions, compile options, and to evaluate components of the
file\(GENERATE\) command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable-stderr.txt b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable-stderr.txt
index e45bb02..7fa1f25 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable-stderr.txt
@@ -3,8 +3,8 @@ CMake Error at COMPILE_LANGUAGE-add_executable.cmake:4 \(add_executable\):
\$<COMPILE_LANGUAGE>
- \$<COMPILE_LANGUAGE:...> may only be used to specify include directories
- compile definitions, compile options and to evaluate components of the
+ \$<COMPILE_LANGUAGE:...> may only be used to specify include directories,
+ compile definitions, compile options, and to evaluate components of the
file\(GENERATE\) command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library-stderr.txt b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library-stderr.txt
index c9ee6fe..ee60b58 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library-stderr.txt
@@ -3,8 +3,8 @@ CMake Error at COMPILE_LANGUAGE-add_library.cmake:4 \(add_library\):
\$<COMPILE_LANGUAGE>
- \$<COMPILE_LANGUAGE:...> may only be used to specify include directories
- compile definitions, compile options and to evaluate components of the
+ \$<COMPILE_LANGUAGE:...> may only be used to specify include directories,
+ compile definitions, compile options, and to evaluate components of the
file\(GENERATE\) command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test-stderr.txt b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test-stderr.txt
index 9955f5d..fd8a731 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test-stderr.txt
@@ -3,8 +3,8 @@ CMake Error at COMPILE_LANGUAGE-add_test.cmake:5 \(add_test\):
\$<COMPILE_LANGUAGE>
- \$<COMPILE_LANGUAGE:...> may only be used to specify include directories
- compile definitions, compile options and to evaluate components of the
+ \$<COMPILE_LANGUAGE:...> may only be used to specify include directories,
+ compile definitions, compile options, and to evaluate components of the
file\(GENERATE\) command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install-stderr.txt b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install-stderr.txt
index eca700f..bef7f63 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install-stderr.txt
@@ -3,6 +3,6 @@ CMake Error:
\$<COMPILE_LANGUAGE>
- \$<COMPILE_LANGUAGE:...> may only be used to specify include directories
- compile definitions, compile options and to evaluate components of the
+ \$<COMPILE_LANGUAGE:...> may only be used to specify include directories,
+ compile definitions, compile options, and to evaluate components of the
file\(GENERATE\) command.
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources-stderr.txt b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources-stderr.txt
index 2d324e2..687d9b7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources-stderr.txt
@@ -3,8 +3,8 @@ CMake Error at COMPILE_LANGUAGE-target_sources.cmake:5 \(target_sources\):
\$<COMPILE_LANGUAGE>
- \$<COMPILE_LANGUAGE:...> may only be used to specify include directories
- compile definitions, compile options and to evaluate components of the
+ \$<COMPILE_LANGUAGE:...> may only be used to specify include directories,
+ compile definitions, compile options, and to evaluate components of the
file\(GENERATE\) command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GoogleTest/CMakeLists.txt b/Tests/RunCMake/GoogleTest/CMakeLists.txt
new file mode 100644
index 0000000..dc92486
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.6)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test-stdout.txt
new file mode 100644
index 0000000..5f7753d
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-test-stdout.txt
@@ -0,0 +1,25 @@
+Test project .*
+ Start 1: TEST:basic\.case_foo!1
+1/8 Test #1: TEST:basic\.case_foo!1 \.+ +Passed +[0-9.]+ sec
+ Start 2: TEST:basic\.case_bar!1
+2/8 Test #2: TEST:basic\.case_bar!1 \.+ +Passed +[0-9.]+ sec
+ Start 3: TEST:basic\.disabled_case!1
+3/8 Test #3: TEST:basic\.disabled_case!1 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
+ Start 4: TEST:disabled\.case!1
+4/8 Test #4: TEST:disabled\.case!1 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
+ Start 5: TEST:typed/short\.case!1
+5/8 Test #5: TEST:typed/short\.case!1 \.+ +Passed +[0-9.]+ sec
+ Start 6: TEST:typed/float\.case!1
+6/8 Test #6: TEST:typed/float\.case!1 \.+ +Passed +[0-9.]+ sec
+ Start 7: TEST:value/test\.case/1!1
+7/8 Test #7: TEST:value/test\.case/1!1 \.+ +Passed +[0-9.]+ sec
+ Start 8: TEST:value/test\.case/"foo"!1
+8/8 Test #8: TEST:value/test\.case/"foo"!1 \.+ +Passed +[0-9.]+ sec
+
+100% tests passed, 0 tests failed out of 6
+
+Total Test time \(real\) = +[0-9.]+ sec
+
+The following tests did not run:
+.*3 - TEST:basic\.disabled_case!1 \(Disabled\)
+.*4 - TEST:disabled\.case!1 \(Disabled\)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest.cmake b/Tests/RunCMake/GoogleTest/GoogleTest.cmake
new file mode 100644
index 0000000..9a3677f
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTest.cmake
@@ -0,0 +1,15 @@
+project(test_include_dirs)
+include(CTest)
+include(GoogleTest)
+
+enable_testing()
+
+add_executable(fake_gtest fake_gtest.cpp)
+
+gtest_discover_tests(
+ fake_gtest
+ TEST_PREFIX TEST:
+ TEST_SUFFIX !1
+ EXTRA_ARGS how now "\"brown\" cow"
+ PROPERTIES LABELS TEST
+)
diff --git a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
new file mode 100644
index 0000000..aec8568
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
@@ -0,0 +1,26 @@
+include(RunCMake)
+
+function(run_GoogleTest)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GoogleTest-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ endif()
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(GoogleTest)
+ run_cmake_command(GoogleTest-build
+ ${CMAKE_COMMAND}
+ --build .
+ --config Debug
+ )
+ run_cmake_command(GoogleTest-test
+ ${CMAKE_CTEST_COMMAND}
+ -C Debug
+ -L TEST
+ --no-label-summary
+ )
+endfunction()
+
+run_GoogleTest()
diff --git a/Tests/RunCMake/GoogleTest/fake_gtest.cpp b/Tests/RunCMake/GoogleTest/fake_gtest.cpp
new file mode 100644
index 0000000..f1bd7ef
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/fake_gtest.cpp
@@ -0,0 +1,41 @@
+#include <iostream>
+#include <string>
+
+int main(int argc, char** argv)
+{
+ // Note: GoogleTest.cmake doesn't actually depend on Google Test as such;
+ // it only requires that we produces output in the expected format when
+ // invoked with --gtest_list_tests. Thus, we fake that here. This allows us
+ // to test the module without actually needing Google Test.
+ if (argc > 1 && std::string(argv[1]) == "--gtest_list_tests") {
+ std::cout << "basic." << std::endl;
+ std::cout << " case_foo" << std::endl;
+ std::cout << " case_bar" << std::endl;
+ std::cout << " DISABLED_disabled_case" << std::endl;
+ std::cout << "DISABLED_disabled." << std::endl;
+ std::cout << " case" << std::endl;
+ std::cout << "typed/0. # TypeParam = short" << std::endl;
+ std::cout << " case" << std::endl;
+ std::cout << "typed/1. # TypeParam = float" << std::endl;
+ std::cout << " case" << std::endl;
+ std::cout << "value/test." << std::endl;
+ std::cout << " case/0 # GetParam() = 1" << std::endl;
+ std::cout << " case/1 # GetParam() = \"foo\"" << std::endl;
+ return 0;
+ }
+
+ if (argc > 5) {
+ // Simple test of EXTRA_ARGS
+ if (std::string(argv[3]) == "how" && std::string(argv[4]) == "now" &&
+ std::string(argv[5]) == "\"brown\" cow") {
+ return 0;
+ }
+ }
+
+ // Print arguments for debugging, if we didn't get the expected arguments
+ for (int i = 1; i < argc; ++i) {
+ std::cerr << "arg[" << i << "]: '" << argv[i] << "'\n";
+ }
+
+ return 1;
+}
diff --git a/Tests/RunCMake/Syntax/.gitattributes b/Tests/RunCMake/Syntax/.gitattributes
index 35a9eaf..79af285 100644
--- a/Tests/RunCMake/Syntax/.gitattributes
+++ b/Tests/RunCMake/Syntax/.gitattributes
@@ -1,3 +1,3 @@
CommandTabs.cmake whitespace=-tab-in-indent
-StringCRLF.cmake whitespace=cr-at-eol -crlf
-BracketCRLF.cmake whitespace=cr-at-eol -crlf
+StringCRLF.cmake eol=crlf
+BracketCRLF.cmake eol=crlf
diff --git a/Tests/RunCMake/Syntax/BracketCRLF.cmake b/Tests/RunCMake/Syntax/BracketCRLF.cmake
index bda0e17..2ea6df2 100644
--- a/Tests/RunCMake/Syntax/BracketCRLF.cmake
+++ b/Tests/RunCMake/Syntax/BracketCRLF.cmake
@@ -1,8 +1,8 @@
-if([[
-]] STREQUAL "" AND
-[[a
-b]] STREQUAL "a\nb")
- message("CRLF->LF worked")
-else()
- message(FATAL_ERROR "CRLF->LF failed")
-endif()
+if([[
+]] STREQUAL "" AND
+[[a
+b]] STREQUAL "a\nb")
+ message("CRLF->LF worked")
+else()
+ message(FATAL_ERROR "CRLF->LF failed")
+endif()
diff --git a/Tests/RunCMake/Syntax/StringCRLF.cmake b/Tests/RunCMake/Syntax/StringCRLF.cmake
index d20cfea..14aad31 100644
--- a/Tests/RunCMake/Syntax/StringCRLF.cmake
+++ b/Tests/RunCMake/Syntax/StringCRLF.cmake
@@ -1,6 +1,6 @@
-if("a
-b" STREQUAL "a\nb")
- message("CRLF->LF worked")
-else()
- message(FATAL_ERROR "CRLF->LF failed")
-endif()
+if("a
+b" STREQUAL "a\nb")
+ message("CRLF->LF worked")
+else()
+ message(FATAL_ERROR "CRLF->LF failed")
+endif()
diff --git a/Tests/RunCMake/TargetObjects/NoTarget.cmake b/Tests/RunCMake/TargetObjects/NoTarget.cmake
index 5d7e33e..268577d 100644
--- a/Tests/RunCMake/TargetObjects/NoTarget.cmake
+++ b/Tests/RunCMake/TargetObjects/NoTarget.cmake
@@ -1,7 +1,7 @@
add_library(iface INTERFACE)
target_sources(iface INTERFACE $<TARGET_OBJECTS:NoTarget>)
-file(GENERATE OUTPUT test_output CONTENT $<TARGET_OBJECTS:NoTarget>)
-file(GENERATE OUTPUT test_output2 CONTENT $<TARGET_PROPERTY:iface,INTERFACE_SOURCES>)
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_output CONTENT $<TARGET_OBJECTS:NoTarget>)
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_output2 CONTENT $<TARGET_PROPERTY:iface,INTERFACE_SOURCES>)
install(FILES $<TARGET_OBJECTS:NoTarget> DESTINATION objects)
diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake
index 8e5fdd0..3bb3e37 100644
--- a/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake
+++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake
@@ -1,3 +1,3 @@
add_library(StaticLib empty.cpp)
-file(GENERATE OUTPUT test_output CONTENT $<TARGET_OBJECTS:StaticLib>)
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_output CONTENT $<TARGET_OBJECTS:StaticLib>)
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 3af877f..6e7c2f3 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -4,3 +4,4 @@ run_cmake(VsTargetsFileReferences)
run_cmake(VsCustomProps)
run_cmake(VsDebuggerWorkingDir)
run_cmake(VsCSharpCustomTags)
+run_cmake(VsCSharpReferenceProps)
diff --git a/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake
index 70ea193..9eb4619 100644
--- a/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake
@@ -4,20 +4,31 @@ if(NOT EXISTS "${csProjectFile}")
return()
endif()
-set(tagFound FALSE)
+# test VS_CSHARP_* for the following extensions
+set(fileExtensions
+ "cs"
+ "png"
+ "jpg"
+ "xml"
+ "settings")
+#
set(tagName "MyCustomTag")
set(tagValue "MyCustomValue")
file(STRINGS "${csProjectFile}" lines)
-foreach(line IN LISTS lines)
- if(line MATCHES "^ *<${tagName}>${tagValue}</${tagName}>")
- message(STATUS "foo.csproj has tag ${tagName} with value ${tagValue} defined")
- set(tagFound TRUE)
+
+foreach(e ${fileExtensions})
+ string(TOUPPER ${e} eUC)
+ set(tagFound FALSE)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<${tagName}${eUC}>${tagValue}${eUC}</${tagName}${eUC}>")
+ message(STATUS "foo.csproj has tag ${tagName}${eUC} with value ${tagValue}${eUC} defined")
+ set(tagFound TRUE)
+ endif()
+ endforeach()
+ if(NOT tagFound)
+ set(RunCMake_TEST_FAILED "Source file tag ${tagName}${eUC} with value ${tagValue}${eUC} not found.")
+ return()
endif()
endforeach()
-
-if(NOT tagFound)
- set(RunCMake_TEST_FAILED "Source file tag ${tagName} with value ${tagValue} not found.")
- return()
-endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake b/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake
index c51e9c3..45766a0 100644
--- a/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake
+++ b/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake
@@ -1,11 +1,27 @@
enable_language(CSharp)
-add_library(foo foo.cs)
-set(props_file "${CMAKE_CURRENT_SOURCE_DIR}/my.props")
+# test VS_CSHARP_* for the following extensions
+set(fileExtensions
+ "cs"
+ "png"
+ "jpg"
+ "xml"
+ "settings")
+#
set(tagName "MyCustomTag")
set(tagValue "MyCustomValue")
-set_source_files_properties(foo.cs
- PROPERTIES
- VS_CSHARP_${tagName} "${tagValue}")
+set(fileNames)
+foreach(e ${fileExtensions})
+ set(currentFile "${CMAKE_CURRENT_BINARY_DIR}/foo.${e}")
+ list(APPEND fileNames ${currentFile})
+ execute_process(COMMAND ${CMAKE_COMMAND} -E touch
+ "${currentFile}")
+ string(TOUPPER ${e} eUC)
+ set_source_files_properties("${currentFile}"
+ PROPERTIES
+ VS_CSHARP_${tagName}${eUC} "${tagValue}${eUC}")
+endforeach()
+
+add_library(foo ${fileNames})
diff --git a/Tests/RunCMake/VS10Project/VsCSharpReferenceProps-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpReferenceProps-check.cmake
new file mode 100644
index 0000000..8b9bb67
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpReferenceProps-check.cmake
@@ -0,0 +1,49 @@
+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(test1Reference "System")
+set(test1Tag "Hello")
+set(test1Value "World")
+
+set(test2Reference "foo2")
+set(test2Tag "Hallo")
+set(test2Value "Welt")
+
+set(tag1Found FALSE)
+set(ref1Found FALSE)
+
+file(STRINGS "${csProjectFile}" lines)
+
+foreach(i 1 2)
+ set(testReference "${test${i}Reference}")
+ set(testTag "${test${i}Tag}")
+ set(testValue "${test${i}Value}")
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<(Project|)Reference .*>$")
+ set(validTag FALSE)
+ if(line MATCHES "^ *<(Project|)Reference .*\".*${testReference}.*\".*>$")
+ set(validTag TRUE)
+ message(STATUS "foo.csproj is using reference ${testReference}")
+ set(ref${i}Found TRUE)
+ endif()
+ endif()
+ if(line MATCHES "^ *<${testTag}>${testValue}</${testTag}>$")
+ if(validTag)
+ message(STATUS "foo.csproj reference ${testReference} has tag ${testTag}")
+ set(tag${i}Found TRUE)
+ else()
+ message(STATUS "tag ${testTag} found in wrong place!")
+ set(tag${i}Found FALSE)
+ endif()
+ endif()
+ endforeach()
+endforeach()
+
+if(NOT tag1Found OR NOT ref1Found OR
+ NOT tag2Found OR NOT ref2Found)
+ set(RunCMake_TEST_FAILED "Custom reference XML tag not found.")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpReferenceProps.cmake b/Tests/RunCMake/VS10Project/VsCSharpReferenceProps.cmake
new file mode 100644
index 0000000..2af1756
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpReferenceProps.cmake
@@ -0,0 +1,19 @@
+enable_language(CSharp)
+add_library(foo foo.cs)
+add_library(foo2 foo.cs)
+
+set(test1Reference "System")
+set(test1Tag "Hello")
+set(test1Value "World")
+
+set(test2Reference "foo2")
+set(test2Tag "Hallo")
+set(test2Value "Welt")
+
+target_link_libraries(foo foo2)
+
+set_target_properties(foo PROPERTIES
+ VS_DOTNET_REFERENCES "${test1Reference};Blubb"
+ VS_DOTNET_REFERENCEPROP_${test1Reference}_TAG_${test1Tag} ${test1Value}
+ VS_DOTNET_REFERENCEPROP_${test2Reference}_TAG_${test2Tag} ${test2Value}
+ )
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CMakeLists.txt.in b/Tests/RunCMake/ctest_labels_for_subprojects/CMakeLists.txt.in
new file mode 100644
index 0000000..30dd37e
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CMakeLists.txt.in
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.9)
+@CASE_CMAKELISTS_PREFIX_CODE@
+project(CTestLabelsForSubprojects@CASE_NAME@ NONE)
+include(CTest)
+@CASE_CMAKELISTS_SUFFIX_CODE@
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in b/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in
new file mode 100644
index 0000000..1e1905b
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in
@@ -0,0 +1,2 @@
+set(CTEST_PROJECT_NAME "CTestLabelsForSubprojects@CASE_NAME@")
+@CTEST_EXTRA_CONFIG@
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfigCTestScript-check.cmake b/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfigCTestScript-check.cmake
new file mode 100644
index 0000000..ea05851
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfigCTestScript-check.cmake
@@ -0,0 +1,36 @@
+set(EXPERIMENTAL_FEATURE_REGEX "<Subproject name=\"MyExperimentalFeature\">.*<Label>MyExperimentalFeature</Label>.*</Subproject>")
+set(PRODUCTION_CODE_REGEX "<Subproject name=\"MyProductionCode\">.*<Label>MyProductionCode</Label>.*</Subproject>")
+set(SUBPROJECTS_REGEX "${EXPERIMENTAL_FEATURE_REGEX}.*${PRODUCTION_CODE_REGEX}")
+
+file(GLOB configure_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Configure.xml")
+if(configure_xml_file)
+ file(READ "${configure_xml_file}" configure_xml)
+ if(NOT configure_xml MATCHES "${SUBPROJECTS_REGEX}.*<Configure>")
+ set(RunCMake_TEST_FAILED "Configure.xml does not contain the expected list of subprojects")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Configure.xml not found")
+endif()
+
+file(GLOB build_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Build.xml")
+if(build_xml_file)
+ file(READ "${build_xml_file}" build_xml)
+ set(BUILD_WARNING_REGEX "<Failure type=\"Warning\">.*<Labels>.*<Label>MyExperimentalFeature</Label>.*</Labels>")
+ if(NOT build_xml MATCHES "${SUBPROJECTS_REGEX}.*<Build>.*${BUILD_ERROR_REGEX}.*</Build>")
+ set(RunCMake_TEST_FAILED "Build.xml does not contain the expected list of subprojects and labels")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Build.xml not found")
+endif()
+
+file(GLOB test_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Test.xml")
+if(test_xml_file)
+ file(READ "${test_xml_file}" test_xml)
+ set(TEST_FAILED_REGEX "<Test Status=\"failed\">.*<Labels>.*<Label>MyExperimentalFeature</Label>.*<Label>NotASubproject</Label>.*</Labels>")
+ set(TEST_PASSED_REGEX "<Test Status=\"passed\">.*<Labels>.*<Label>MyProductionCode</Label>.*</Labels>")
+ if(NOT test_xml MATCHES "${SUBPROJECTS_REGEX}.*<Testing>.*${TEST_FAILED_REGEX}.*${TEST_PASSED_REGEX}.*${TEST_NOTRUN_REGEX}.*</Testing>")
+ set(RunCMake_TEST_FAILED "Test.xml does not contain the expected list of subprojects and labels")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "${CTEST_BINARY_DIRECTORY}/Testing/*/Test.xml not found")
+endif()
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfigCTestScript-stdout.txt b/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfigCTestScript-stdout.txt
new file mode 100644
index 0000000..ae00e51
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfigCTestScript-stdout.txt
@@ -0,0 +1,7 @@
+17% tests passed, 5 tests failed out of 6
++
+Subproject Time Summary:
+MyExperimentalFeature += +[0-9.]+ sec \(5 tests\)
+MyProductionCode += +[0-9.]+ sec \(1 test\)
++
+Total Test time \(real\) = +[0-9.]+ sec
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariable-check.cmake b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariable-check.cmake
new file mode 100644
index 0000000..ea05851
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariable-check.cmake
@@ -0,0 +1,36 @@
+set(EXPERIMENTAL_FEATURE_REGEX "<Subproject name=\"MyExperimentalFeature\">.*<Label>MyExperimentalFeature</Label>.*</Subproject>")
+set(PRODUCTION_CODE_REGEX "<Subproject name=\"MyProductionCode\">.*<Label>MyProductionCode</Label>.*</Subproject>")
+set(SUBPROJECTS_REGEX "${EXPERIMENTAL_FEATURE_REGEX}.*${PRODUCTION_CODE_REGEX}")
+
+file(GLOB configure_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Configure.xml")
+if(configure_xml_file)
+ file(READ "${configure_xml_file}" configure_xml)
+ if(NOT configure_xml MATCHES "${SUBPROJECTS_REGEX}.*<Configure>")
+ set(RunCMake_TEST_FAILED "Configure.xml does not contain the expected list of subprojects")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Configure.xml not found")
+endif()
+
+file(GLOB build_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Build.xml")
+if(build_xml_file)
+ file(READ "${build_xml_file}" build_xml)
+ set(BUILD_WARNING_REGEX "<Failure type=\"Warning\">.*<Labels>.*<Label>MyExperimentalFeature</Label>.*</Labels>")
+ if(NOT build_xml MATCHES "${SUBPROJECTS_REGEX}.*<Build>.*${BUILD_ERROR_REGEX}.*</Build>")
+ set(RunCMake_TEST_FAILED "Build.xml does not contain the expected list of subprojects and labels")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Build.xml not found")
+endif()
+
+file(GLOB test_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Test.xml")
+if(test_xml_file)
+ file(READ "${test_xml_file}" test_xml)
+ set(TEST_FAILED_REGEX "<Test Status=\"failed\">.*<Labels>.*<Label>MyExperimentalFeature</Label>.*<Label>NotASubproject</Label>.*</Labels>")
+ set(TEST_PASSED_REGEX "<Test Status=\"passed\">.*<Labels>.*<Label>MyProductionCode</Label>.*</Labels>")
+ if(NOT test_xml MATCHES "${SUBPROJECTS_REGEX}.*<Testing>.*${TEST_FAILED_REGEX}.*${TEST_PASSED_REGEX}.*${TEST_NOTRUN_REGEX}.*</Testing>")
+ set(RunCMake_TEST_FAILED "Test.xml does not contain the expected list of subprojects and labels")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "${CTEST_BINARY_DIRECTORY}/Testing/*/Test.xml not found")
+endif()
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariable-stdout.txt b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariable-stdout.txt
new file mode 100644
index 0000000..ae00e51
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariable-stdout.txt
@@ -0,0 +1,7 @@
+17% tests passed, 5 tests failed out of 6
++
+Subproject Time Summary:
+MyExperimentalFeature += +[0-9.]+ sec \(5 tests\)
+MyProductionCode += +[0-9.]+ sec \(1 test\)
++
+Total Test time \(real\) = +[0-9.]+ sec
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-check.cmake b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-check.cmake
new file mode 100644
index 0000000..7beefba
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-check.cmake
@@ -0,0 +1,34 @@
+set(THIRD_PARTY_REGEX "<Subproject name=\"MyThirdPartyDependency\">.*<Label>MyThirdPartyDependency</Label>.*</Subproject>")
+set(SUBPROJECTS_REGEX "${THIRD_PARTY_REGEX}")
+
+file(GLOB configure_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Configure.xml")
+if(configure_xml_file)
+ file(READ "${configure_xml_file}" configure_xml)
+ if(NOT configure_xml MATCHES "${SUBPROJECTS_REGEX}.*<Configure>")
+ set(RunCMake_TEST_FAILED "Configure.xml does not contain the expected list of subprojects")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Configure.xml not found")
+endif()
+
+file(GLOB build_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Build.xml")
+if(build_xml_file)
+ file(READ "${build_xml_file}" build_xml)
+ set(BUILD_ERROR_REGEX "<Failure type=\"Error\">.*<Labels>.*<Label>MyThirdPartyDependency</Label>.*<Label>NotASubproject</Label>.*</Labels>")
+ if(NOT build_xml MATCHES "${SUBPROJECTS_REGEX}.*<Build>.*${BUILD_ERROR_REGEX}.*</Build>")
+ set(RunCMake_TEST_FAILED "Build.xml does not contain the expected list of subprojects and labels")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Build.xml not found")
+endif()
+
+file(GLOB test_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Test.xml")
+if(test_xml_file)
+ file(READ "${test_xml_file}" test_xml)
+ set(TEST_NOTRUN_REGEX "<Test Status=\"notrun\">.*<Labels>.*<Label>MyThirdPartyDependency</Label>.*<Label>NotASubproject</Label>.*</Labels>")
+ if(NOT test_xml MATCHES "${SUBPROJECTS_REGEX}.*<Testing>.*${TEST_FAILED_REGEX}.*${TEST_PASSED_REGEX}.*${TEST_NOTRUN_REGEX}.*</Testing>")
+ set(RunCMake_TEST_FAILED "Test.xml does not contain the expected list of subprojects and labels")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "${CTEST_BINARY_DIRECTORY}/Testing/*/Test.xml not found")
+endif()
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-result.txt b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stderr.txt b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stderr.txt
new file mode 100644
index 0000000..38566fb
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stderr.txt
@@ -0,0 +1 @@
+Unable to find executable:.*MyThirdPartyDependency/src/thirdparty
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stdout.txt b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stdout.txt
new file mode 100644
index 0000000..a78a99a
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stdout.txt
@@ -0,0 +1,6 @@
+0% tests passed, 1 tests failed out of 1
++
+Subproject Time Summary:
+MyThirdPartyDependency += +[0-9.]+ sec \(1 test\)
++
+Total Test time \(real\) = +[0-9.]+ sec
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-result.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-result.txt
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-result.txt
@@ -0,0 +1 @@
+8
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-stderr.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-stderr.txt
new file mode 100644
index 0000000..ba4235d
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-stderr.txt
@@ -0,0 +1 @@
+Errors while running CTest
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-stdout.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-stdout.txt
new file mode 100644
index 0000000..b5d76a9
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCMakeLists-stdout.txt
@@ -0,0 +1,6 @@
+50% tests passed, 1 tests failed out of 2
++
+Subproject Time Summary:
+MySubproject += +[0-9.]+ sec \(2 tests\)
++
+Total Test time \(real\) = +[0-9.]+ sec
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-result.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-result.txt
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-result.txt
@@ -0,0 +1 @@
+8
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-stderr.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-stderr.txt
new file mode 100644
index 0000000..ba4235d
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-stderr.txt
@@ -0,0 +1 @@
+Errors while running CTest
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-stdout.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-stdout.txt
new file mode 100644
index 0000000..01851fd
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfig-stdout.txt
@@ -0,0 +1,6 @@
+67% tests passed, 1 tests failed out of 3
++
+Subproject Time Summary:
+MySubproject += +[0-9.]+ sec \(2 tests\)
++
+Total Test time \(real\) = +[0-9.]+ sec
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-result.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-result.txt
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-result.txt
@@ -0,0 +1 @@
+8
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-stderr.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-stderr.txt
new file mode 100644
index 0000000..ba4235d
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-stderr.txt
@@ -0,0 +1 @@
+Errors while running CTest
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-stdout.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-stdout.txt
new file mode 100644
index 0000000..0209bfe
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCTestConfigNoSummary-stdout.txt
@@ -0,0 +1,7 @@
+67% tests passed, 1 tests failed out of 3
++
+Label Time Summary:
+MySubproject += +[0-9.]+ sec \(2 tests\)
+NotASubproject += +[0-9.]+ sec \(1 test\)
++
+Total Test time \(real\) = +[0-9.]+ sec
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-result.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-result.txt
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-result.txt
@@ -0,0 +1 @@
+8
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-stderr.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-stderr.txt
new file mode 100644
index 0000000..ba4235d
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-stderr.txt
@@ -0,0 +1 @@
+Errors while running CTest
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-stdout.txt b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-stdout.txt
new file mode 100644
index 0000000..b5d76a9
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/ModuleVariableCommandLine-stdout.txt
@@ -0,0 +1,6 @@
+50% tests passed, 1 tests failed out of 2
++
+Subproject Time Summary:
+MySubproject += +[0-9.]+ sec \(2 tests\)
++
+Total Test time \(real\) = +[0-9.]+ sec
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/MyExperimentalFeature/CMakeLists.txt b/Tests/RunCMake/ctest_labels_for_subprojects/MyExperimentalFeature/CMakeLists.txt
new file mode 100644
index 0000000..cc07a07
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/MyExperimentalFeature/CMakeLists.txt
@@ -0,0 +1,33 @@
+project(MyExperimentalFeature)
+cmake_minimum_required(VERSION 3.8)
+
+include(CTest)
+
+set(CMAKE_DIRECTORY_LABELS "MyExperimentalFeature;NotASubproject")
+
+add_executable(testapp experimental.c)
+
+add_test(experimentalFail1 testapp 5)
+set_tests_properties (experimentalFail1
+ PROPERTIES PASS_REGULAR_EXPRESSION "Test!"
+ )
+
+add_test(experimentalFail2 testapp -5)
+set_tests_properties (experimentalFail2
+ PROPERTIES PASS_REGULAR_EXPRESSION "Test!"
+ )
+
+add_test(experimentalFail3 testapp -5)
+set_tests_properties (experimentalFail3
+ PROPERTIES PASS_REGULAR_EXPRESSION "Test!"
+ )
+
+add_test(experimentalFail4 testapp -5)
+set_tests_properties (experimentalFail4
+ PROPERTIES PASS_REGULAR_EXPRESSION "Test!"
+ )
+
+add_test(experimentalFail5 testapp -5)
+set_tests_properties (experimentalFail5
+ PROPERTIES PASS_REGULAR_EXPRESSION "Test!"
+ )
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/MyExperimentalFeature/experimental.c b/Tests/RunCMake/ctest_labels_for_subprojects/MyExperimentalFeature/experimental.c
new file mode 100644
index 0000000..7cb11ae
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/MyExperimentalFeature/experimental.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+int main(void)
+{
+ int i = 0;
+ if (i > 0) {
+ printf("This doesn't happen.\n");
+ printf("Neither does this.\n");
+ }
+ i = i + 1;
+ if (i > 0) {
+ printf("This does happen.\n");
+ }
+
+ return 0;
+}
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/MyProductionCode/CMakeLists.txt b/Tests/RunCMake/ctest_labels_for_subprojects/MyProductionCode/CMakeLists.txt
new file mode 100644
index 0000000..c2ee673
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/MyProductionCode/CMakeLists.txt
@@ -0,0 +1,12 @@
+project(MyProductionCode)
+cmake_minimum_required(VERSION 3.8)
+
+include(CTest)
+
+add_executable(production production.c)
+add_test(NAME production COMMAND production)
+
+set_property(TARGET production PROPERTY LABELS MyProductionCode)
+set_property(TEST production PROPERTY LABELS MyProductionCode)
+
+set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY LABELS "NotASubproject")
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/MyProductionCode/production.c b/Tests/RunCMake/ctest_labels_for_subprojects/MyProductionCode/production.c
new file mode 100644
index 0000000..54dc2be
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/MyProductionCode/production.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+int main(void)
+{
+ int j = 0;
+ if (j > 0) {
+ printf("This doesn't happen.\n");
+ printf("Neither does this.\n");
+ }
+ j = j + 1;
+ if (j > 0) {
+ printf("This does happen.\n");
+ }
+
+ return 0;
+}
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/CMakeLists.txt b/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/CMakeLists.txt
new file mode 100644
index 0000000..d5b9c2f
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/CMakeLists.txt
@@ -0,0 +1,7 @@
+project(MyThirdPartyDependency)
+cmake_minimum_required(VERSION 3.8)
+
+include(CTest)
+
+set_directory_properties(PROPERTIES LABELS "NotASubproject;MyThirdPartyDependency")
+add_subdirectory(src)
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/CMakeLists.txt b/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/CMakeLists.txt
new file mode 100644
index 0000000..dc6cb2a
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/CMakeLists.txt
@@ -0,0 +1,10 @@
+project(MyThirdPartyDependency)
+cmake_minimum_required(VERSION 3.8)
+
+include(CTest)
+
+add_executable(thirdparty thirdparty.c)
+add_test(NAME thirdparty COMMAND thirdparty)
+
+set_property(TARGET thirdparty PROPERTY LABELS NotASubproject)
+set_property(TEST thirdparty PROPERTY LABELS NotASubproject)
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/thirdparty.c b/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/thirdparty.c
new file mode 100644
index 0000000..babe82d
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/thirdparty.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+
+int main(void)
+{
+ printf(This function has an error!\n");
+ n = 5;
+ return 0;
+}
+
+int notcalled()
+{
+ printf(This function doesn't get called.\n");
+ return 0;
+}
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/RunCMakeTest.cmake b/Tests/RunCMake/ctest_labels_for_subprojects/RunCMakeTest.cmake
new file mode 100644
index 0000000..dbe7bf8
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/RunCMakeTest.cmake
@@ -0,0 +1,185 @@
+include(RunCTest)
+
+
+# 1. Specify subprojects in the CTest script
+function(run_CTestScriptVariable)
+ set(CTEST_EXTRA_CONFIG "set(CTEST_USE_LAUNCHERS 1)")
+ set(CASE_TEST_PREFIX_CODE [[
+file(COPY "${CTEST_RUNCMAKE_SOURCE_DIRECTORY}/MyProductionCode"
+ DESTINATION ${CTEST_SOURCE_DIRECTORY})
+file(COPY "${CTEST_RUNCMAKE_SOURCE_DIRECTORY}/MyExperimentalFeature"
+ DESTINATION ${CTEST_SOURCE_DIRECTORY})
+
+set(CTEST_LABELS_FOR_SUBPROJECTS "MyProductionCode;MyExperimentalFeature")
+ ]])
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_subdirectory(MyExperimentalFeature)
+add_subdirectory(MyProductionCode)
+ ]])
+
+ run_ctest(CTestScriptVariable)
+
+ unset(CTEST_EXTRA_CONFIG)
+ unset(CASE_TEST_PREFIX_CODE)
+ unset(CASE_CMAKELISTS_SUFFIX_CODE)
+endfunction()
+run_CTestScriptVariable()
+
+# 2. Specify subprojects via a CTest script variable on the command line e.g.
+# ctest -S test.cmake -DCTEST_LABELS_FOR_SUBPROJECTS:STRING="MySubproject"
+# Note: This test includes a failing build
+function(run_CTestScriptVariableCommandLine)
+ set(CTEST_EXTRA_CONFIG "set(CTEST_USE_LAUNCHERS 1)")
+ set(CASE_TEST_PREFIX_CODE [[
+file(COPY "${CTEST_RUNCMAKE_SOURCE_DIRECTORY}/MyThirdPartyDependency"
+ DESTINATION ${CTEST_SOURCE_DIRECTORY})
+ ]])
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_subdirectory(MyThirdPartyDependency)
+ ]])
+
+ run_ctest(CTestScriptVariableCommandLine "-DCTEST_LABELS_FOR_SUBPROJECTS:STRING=MyThirdPartyDependency")
+
+ unset(CTEST_EXTRA_CONFIG)
+ unset(CASE_TEST_PREFIX_CODE)
+ unset(CASE_CMAKELISTS_SUFFIX_CODE)
+endfunction()
+run_CTestScriptVariableCommandLine()
+
+# 3. Set subprojects via a CTest module variable on the command line
+# (will populate DartConfiguration.tcl)
+function(run_ModuleVariableCommandLine)
+ set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/ModuleVariableCommandLine")
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/ModuleVariableCommandLine-build")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}")
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+set(someFile "${CMAKE_CURRENT_SOURCE_DIR}/test.cmake")
+add_test(NAME SuccessfulTest COMMAND "${CMAKE_COMMAND}" --version)
+set_property(TEST SuccessfulTest PROPERTY LABELS MySubproject)
+add_test(NAME FailingTest
+ COMMAND ${CMAKE_COMMAND} -E compare_files "${someFile}" "${someFile}xxx")
+set_property(TEST FailingTest PROPERTY LABELS MySubproject)
+ ]])
+ configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in
+ ${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt @ONLY)
+
+ set(RunCMake_TEST_OPTIONS "-DCTEST_LABELS_FOR_SUBPROJECTS:STRING=MySubproject")
+ run_cmake(ModuleVariableCommandLine-cmake)
+ unset(RunCMake_TEST_OPTIONS)
+ run_cmake_command(ModuleVariableCommandLine ${CMAKE_CTEST_COMMAND} -C Debug -V)
+
+ unset(RunCMake_TEST_SOURCE_DIR)
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+ unset(CASE_CMAKELISTS_SUFFIX_CODE)
+endfunction()
+run_ModuleVariableCommandLine()
+
+# 4. Set subprojects via a CTest module variable in CMakeLists.txt
+# (will populate DartConfiguration.tcl)
+function(run_ModuleVariableCMakeLists)
+ set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/ModuleVariableCMakeLists")
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/ModuleVariableCMakeLists-build")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}")
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ set(CASE_CMAKELISTS_PREFIX_CODE [[
+set(CTEST_LABELS_FOR_SUBPROJECTS MySubproject)
+]])
+
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+set(someFile "${CMAKE_CURRENT_SOURCE_DIR}/test.cmake")
+add_test(NAME SuccessfulTest COMMAND "${CMAKE_COMMAND}" --version)
+set_property(TEST SuccessfulTest PROPERTY LABELS MySubproject)
+add_test(NAME FailingTest
+ COMMAND ${CMAKE_COMMAND} -E compare_files "${someFile}" "${someFile}xxx")
+set_property(TEST FailingTest PROPERTY LABELS MySubproject)
+ ]])
+ configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in
+ ${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt @ONLY)
+
+ run_cmake(ModuleVariableCMakeLists-cmake)
+ run_cmake_command(ModuleVariableCMakeLists ${CMAKE_CTEST_COMMAND} -C Debug -V)
+
+ unset(RunCMake_TEST_SOURCE_DIR)
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+ unset(CASE_CMAKELISTS_SUFFIX_CODE)
+ unset(CASE_CMAKELISTS_SUFFIX_CODE)
+endfunction()
+run_ModuleVariableCMakeLists()
+
+# The remaining tests set subprojects in CTestConfig.cmake. Settings in this
+# config file are shared by both the CTest module and the ctest command line
+# `Dashboard Client` mode (e.g. ctest -S).
+
+function(run_ModuleVariableCTestConfig CASE_NAME)
+ set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${CASE_NAME}")
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${CASE_NAME}-build")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}")
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ set(CTEST_EXTRA_CONFIG "set(CTEST_LABELS_FOR_SUBPROJECTS \"MySubproject\")")
+ configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in
+ ${RunCMake_TEST_SOURCE_DIR}/CTestConfig.cmake @ONLY)
+
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+set(someFile "${CMAKE_CURRENT_SOURCE_DIR}/test.cmake")
+add_test(NAME SuccessfulTest COMMAND "${CMAKE_COMMAND}" --version)
+set_property(TEST SuccessfulTest PROPERTY LABELS MySubproject)
+add_test(NAME FailingTest
+ COMMAND ${CMAKE_COMMAND} -E compare_files "${someFile}" "${someFile}xxx")
+set_property(TEST FailingTest PROPERTY LABELS MySubproject)
+add_test(NAME AnotherSuccessfulTest COMMAND "${CMAKE_COMMAND}" --version)
+set_property(TEST AnotherSuccessfulTest PROPERTY LABELS NotASubproject)
+ ]])
+ configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in
+ ${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt @ONLY)
+
+ run_cmake(${CASE_NAME}-cmake)
+ run_cmake_command(${CASE_NAME} ${CMAKE_CTEST_COMMAND} -C Debug -V ${ARGN})
+
+ unset(RunCMake_TEST_SOURCE_DIR)
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+ unset(CTEST_EXTRA_CONFIG)
+ unset(CASE_CMAKELISTS_SUFFIX_CODE)
+endfunction()
+
+# 5. Check that the Subproject timing Summary is printed
+run_ModuleVariableCTestConfig(ModuleVariableCTestConfig)
+
+# 6. Use --no-subproject-summary to disable the Subproject timing summary.
+run_ModuleVariableCTestConfig(ModuleVariableCTestConfigNoSummary --no-subproject-summary)
+
+# 7. Verify that subprojects are sent to CDash when running a CTest script
+function(run_CTestConfigCTestScript)
+ set(CTEST_EXTRA_CONFIG [[
+set(CTEST_USE_LAUNCHERS 1)
+set(CTEST_LABELS_FOR_SUBPROJECTS "MyProductionCode;MyExperimentalFeature")
+ ]])
+ set(CASE_TEST_PREFIX_CODE [[
+file(COPY "${CTEST_RUNCMAKE_SOURCE_DIRECTORY}/MyProductionCode"
+ DESTINATION ${CTEST_SOURCE_DIRECTORY})
+file(COPY "${CTEST_RUNCMAKE_SOURCE_DIRECTORY}/MyExperimentalFeature"
+ DESTINATION ${CTEST_SOURCE_DIRECTORY})
+ ]])
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_subdirectory(MyExperimentalFeature)
+add_subdirectory(MyProductionCode)
+ ]])
+ run_ctest(CTestConfigCTestScript)
+
+ unset(CTEST_EXTRA_CONFIG)
+ unset(CASE_TEST_PREFIX_CODE)
+ unset(CASE_CMAKELISTS_SUFFIX_CODE)
+endfunction()
+run_CTestConfigCTestScript()
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/test.cmake.in b/Tests/RunCMake/ctest_labels_for_subprojects/test.cmake.in
new file mode 100644
index 0000000..8cec08d
--- /dev/null
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/test.cmake.in
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 3.7)
+
+# Settings:
+
+set(CTEST_SITE "test-site")
+set(CTEST_BUILD_NAME "test-build-name")
+set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
+set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
+set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
+set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_RUNCMAKE_SOURCE_DIRECTORY "@RunCMake_SOURCE_DIR@")
+
+@CASE_TEST_PREFIX_CODE@
+
+set(ctest_test_args "@CASE_CTEST_TEST_ARGS@")
+ctest_start(Experimental)
+ctest_configure()
+ctest_build()
+ctest_test(${ctest_test_args})
diff --git a/Tests/RunCMake/execute_process/ExitValues-stdout.txt b/Tests/RunCMake/execute_process/ExitValues-stdout.txt
new file mode 100644
index 0000000..3bcaf46
--- /dev/null
+++ b/Tests/RunCMake/execute_process/ExitValues-stdout.txt
@@ -0,0 +1,14 @@
+^-- 1 - 1 RESULT_VARIABLE: 0
+-- 1 - 2 RESULT_VARIABLE: [^0].*
+-- 2 - 1 RESULT_VARIABLE: 0
+-- 2 - 1 RESULTS_VARIABLE: 0
+-- 2 - 2 RESULT_VARIABLE: [^0].*
+-- 2 - 2 RESULTS_VARIABLE: [^0].*
+-- 3 - 1 RESULTS_VARIABLE: 0
+-- 3 - 2 RESULTS_VARIABLE: [^0].*
+-- 4 - 1 RESULT_VARIABLE: 0
+-- 4 - 1 RESULTS_VARIABLE: [^0].*;0;[^0].*;0;[^0].*;0
+-- 4 - 1 RESULTS_VARIABLE_LENGTH: 6
+-- 5 - 1 RESULT_VARIABLE: [^0].*
+-- 5 - 1 RESULTS_VARIABLE: 0;0;[^0].*
+-- 5 - 1 RESULTS_VARIABLE_LENGTH: 3$
diff --git a/Tests/RunCMake/execute_process/ExitValues.cmake b/Tests/RunCMake/execute_process/ExitValues.cmake
new file mode 100644
index 0000000..d80a57b
--- /dev/null
+++ b/Tests/RunCMake/execute_process/ExitValues.cmake
@@ -0,0 +1,120 @@
+#1st TEST RESULT_VARIABLE ONLY
+execute_process(COMMAND ${EXIT_CODE_EXE} "zero_exit"
+ RESULT_VARIABLE r0
+ )
+message(STATUS " 1 - 1 RESULT_VARIABLE: ${r0}")
+if(NOT r0 EQUAL 0)
+ message(FATAL_ERROR "zero exit code expected")
+endif()
+execute_process(COMMAND ${EXIT_CODE_EXE} "non_zero_exit"
+ RESULT_VARIABLE r01
+ ERROR_QUIET
+ )
+message(STATUS " 1 - 2 RESULT_VARIABLE: ${r01}")
+if(r01 EQUAL 0)
+ message(FATAL_ERROR "non-zero exit code expected")
+endif()
+#2nd TEST RESULT_VARIABLE and RESULTS_VARIABLE
+execute_process(COMMAND ${EXIT_CODE_EXE} "zero_exit"
+ RESULT_VARIABLE r1
+ RESULTS_VARIABLE r1s
+ )
+message(STATUS " 2 - 1 RESULT_VARIABLE: ${r1}")
+message(STATUS " 2 - 1 RESULTS_VARIABLE: ${r1s}")
+if(NOT r1 EQUAL 0 OR NOT r1s EQUAL 0)
+ message(FATAL_ERROR "zero exit code expected")
+endif()
+execute_process(COMMAND ${EXIT_CODE_EXE} "non_zero_exit"
+ RESULT_VARIABLE r11
+ RESULTS_VARIABLE r11s
+ ERROR_QUIET
+ )
+message(STATUS " 2 - 2 RESULT_VARIABLE: ${r11}")
+message(STATUS " 2 - 2 RESULTS_VARIABLE: ${r11s}")
+if(r11 EQUAL 0 OR r11s EQUAL 0)
+ message(FATAL_ERROR "non-zero exit code expected")
+endif()
+#3rd TEST RESULTS_VARIABLE
+execute_process(COMMAND ${EXIT_CODE_EXE} "zero_exit"
+ RESULTS_VARIABLE r2s
+ )
+message(STATUS " 3 - 1 RESULTS_VARIABLE: ${r2s}")
+if(NOT r2s EQUAL 0)
+ message(FATAL_ERROR "zero exit code expected")
+endif()
+execute_process(COMMAND ${EXIT_CODE_EXE} "non_zero_exit"
+ RESULTS_VARIABLE r21s
+ ERROR_QUIET
+ )
+message(STATUS " 3 - 2 RESULTS_VARIABLE: ${r21s}")
+if(r21s EQUAL 0)
+ message(FATAL_ERROR "non-zero exit code expected")
+endif()
+#4th TEST RESULT_VARIABLE and RESULTS_VARIABLE WITH MULTICOMMAND
+execute_process(COMMAND ${EXIT_CODE_EXE} "non_zero_exit"
+ COMMAND ${EXIT_CODE_EXE} "zero_exit"
+ COMMAND ${EXIT_CODE_EXE} "non_zero_exit"
+ COMMAND ${EXIT_CODE_EXE} "zero_exit"
+ COMMAND ${EXIT_CODE_EXE} "non_zero_exit"
+ COMMAND ${EXIT_CODE_EXE} "zero_exit"
+ RESULT_VARIABLE r31
+ RESULTS_VARIABLE r31s
+ OUTPUT_QUIET
+ ERROR_QUIET
+ )
+message(STATUS " 4 - 1 RESULT_VARIABLE: ${r31}")
+message(STATUS " 4 - 1 RESULTS_VARIABLE: ${r31s}")
+if(NOT r31 EQUAL 0)
+ message(FATAL_ERROR "zero exit code expected for last command")
+endif()
+list(LENGTH r31s r31sLen)
+message(STATUS " 4 - 1 RESULTS_VARIABLE_LENGTH: ${r31sLen}")
+if(NOT r31sLen EQUAL 6)
+ message(FATAL_ERROR "length of RESULTS_VARIABLE is not as expected")
+else()
+ foreach(loop_var RANGE 5)
+ list(GET r31s ${loop_var} rsLocal)
+ math(EXPR isOdd "${loop_var} % 2")
+ if(isOdd)
+ if(NOT rsLocal EQUAL 0)
+ message(FATAL_ERROR "zero exit code expected")
+ endif()
+ else()
+ if(rsLocal EQUAL 0)
+ message(FATAL_ERROR "non-zero exit code expected")
+ endif()
+ endif()
+ endforeach()
+endif()
+#5th TEST RESULT_VARIABLE and RESULTS_VARIABLE WITH MULTICOMMAND
+execute_process(COMMAND ${EXIT_CODE_EXE} "zero_exit"
+ COMMAND ${EXIT_CODE_EXE} "zero_exit"
+ COMMAND ${EXIT_CODE_EXE} "non_zero_exit"
+ RESULT_VARIABLE r41
+ RESULTS_VARIABLE r41s
+ OUTPUT_QUIET
+ ERROR_QUIET
+ )
+message(STATUS " 5 - 1 RESULT_VARIABLE: ${r41}")
+message(STATUS " 5 - 1 RESULTS_VARIABLE: ${r41s}")
+if(r41 EQUAL 0)
+ message(FATAL_ERROR "non-zero exit code expected for last command")
+endif()
+list(LENGTH r41s r41sLen)
+message(STATUS " 5 - 1 RESULTS_VARIABLE_LENGTH: ${r41sLen}")
+if(NOT r31sLen EQUAL 6)
+ message(FATAL_ERROR "length of RESULTS_VARIABLE is not as expected")
+else()
+ list(GET r41s 0 rsLocal)
+ if(NOT rsLocal EQUAL 0)
+ message(FATAL_ERROR "zero exit code expected")
+ endif()
+ list(GET r41s 1 rsLocal)
+ if(NOT rsLocal EQUAL 0)
+ message(FATAL_ERROR "zero exit code expected")
+ endif()
+ list(GET r41s 2 rsLocal)
+ if(rsLocal EQUAL 0)
+ message(FATAL_ERROR "non-zero exit code expected")
+ endif()
+endif()
diff --git a/Tests/RunCMake/execute_process/RunCMakeTest.cmake b/Tests/RunCMake/execute_process/RunCMakeTest.cmake
index 62e18c6..83589bb 100644
--- a/Tests/RunCMake/execute_process/RunCMakeTest.cmake
+++ b/Tests/RunCMake/execute_process/RunCMakeTest.cmake
@@ -11,3 +11,7 @@ run_cmake(EncodingMissing)
if(TEST_ENCODING_EXE)
run_cmake_command(EncodingUTF8 ${CMAKE_COMMAND} -DTEST_ENCODING=UTF8 -DTEST_ENCODING_EXE=${TEST_ENCODING_EXE} -P ${RunCMake_SOURCE_DIR}/Encoding.cmake)
endif()
+
+if(EXIT_CODE_EXE)
+ run_cmake_command(ExitValues ${CMAKE_COMMAND} -DEXIT_CODE_EXE=${EXIT_CODE_EXE} -P ${RunCMake_SOURCE_DIR}/ExitValues.cmake)
+endif()
diff --git a/Tests/RunCMake/exit_code.c b/Tests/RunCMake/exit_code.c
new file mode 100644
index 0000000..3eba019
--- /dev/null
+++ b/Tests/RunCMake/exit_code.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+// Usage:
+//
+// /path/to/program arg1 [arg2 [...]]
+//
+// Return EXIT_SUCCESS if 'zero_exit'
+// string was found in <arg1>.
+// Return EXIT_FAILURE if 'non_zero_exit'
+// string was found in <arg1>.
+
+int main(int argc, const char* argv[])
+{
+ const char* substring_failure = "non_zero_exit";
+ const char* substring_success = "zero_exit";
+ const char* str = argv[1];
+ if (argc < 2) {
+ return EXIT_FAILURE;
+ }
+ if (strcmp(str, substring_success) == 0) {
+ return EXIT_SUCCESS;
+ } else if (strcmp(str, substring_failure) == 0) {
+ return EXIT_FAILURE;
+ }
+ fprintf(stderr, "Failed to find string '%s' in '%s'\n", substring_success,
+ str);
+ return EXIT_FAILURE;
+}
diff --git a/Tests/RunCMake/include_guard/CMakeLists.txt b/Tests/RunCMake/include_guard/CMakeLists.txt
new file mode 100644
index 0000000..d3137f6
--- /dev/null
+++ b/Tests/RunCMake/include_guard/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.9)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/include_guard/DirectoryScope.cmake b/Tests/RunCMake/include_guard/DirectoryScope.cmake
new file mode 100644
index 0000000..d6c5a3c
--- /dev/null
+++ b/Tests/RunCMake/include_guard/DirectoryScope.cmake
@@ -0,0 +1,19 @@
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Scripts")
+
+# Test include_guard with DIRECTORY scope
+
+# Add subdirectory which includes DirScript three times:
+# 1. Include at inner function scope
+# 2. At directory scope
+# 3. At another subdirectory to check that the guard is checked
+# against parent directories
+add_subdirectory(sub_dir_script1)
+# Add another directory which includes DirScript
+add_subdirectory(sub_dir_script2)
+
+# check inclusions count
+get_property(dir_count GLOBAL PROPERTY DIR_SCRIPT_COUNT)
+if(NOT dir_count EQUAL 2)
+ message(FATAL_ERROR
+ "Wrong DIR_SCRIPT_COUNT value: ${dir_count}, expected: 2")
+endif()
diff --git a/Tests/RunCMake/include_guard/GlobalScope.cmake b/Tests/RunCMake/include_guard/GlobalScope.cmake
new file mode 100644
index 0000000..02137fa
--- /dev/null
+++ b/Tests/RunCMake/include_guard/GlobalScope.cmake
@@ -0,0 +1,11 @@
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Scripts")
+
+# Test GLOBAL include guard
+add_subdirectory(global_script_dir)
+include(GlobScript)
+
+get_property(glob_count GLOBAL PROPERTY GLOB_SCRIPT_COUNT)
+if(NOT glob_count EQUAL 1)
+ message(FATAL_ERROR
+ "Wrong GLOB_SCRIPT_COUNT value: ${glob_count}, expected: 1")
+endif()
diff --git a/Tests/RunCMake/include_guard/InvalidArgumentsNumber-result.txt b/Tests/RunCMake/include_guard/InvalidArgumentsNumber-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/include_guard/InvalidArgumentsNumber-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt b/Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt
new file mode 100644
index 0000000..cdd33ac
--- /dev/null
+++ b/Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at InvalidArgumentsNumber.cmake:1 \(include_guard\):
+ include_guard given an invalid number of arguments. The command takes at
+ most 1 argument.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/include_guard/InvalidArgumentsNumber.cmake b/Tests/RunCMake/include_guard/InvalidArgumentsNumber.cmake
new file mode 100644
index 0000000..a63a395
--- /dev/null
+++ b/Tests/RunCMake/include_guard/InvalidArgumentsNumber.cmake
@@ -0,0 +1 @@
+include_guard(ARG1 ARG2)
diff --git a/Tests/RunCMake/include_guard/InvalidScope-result.txt b/Tests/RunCMake/include_guard/InvalidScope-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/include_guard/InvalidScope-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/include_guard/InvalidScope-stderr.txt b/Tests/RunCMake/include_guard/InvalidScope-stderr.txt
new file mode 100644
index 0000000..456709d
--- /dev/null
+++ b/Tests/RunCMake/include_guard/InvalidScope-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at InvalidScope.cmake:1 \(include_guard\):
+ include_guard given an invalid scope: INVALID
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/include_guard/InvalidScope.cmake b/Tests/RunCMake/include_guard/InvalidScope.cmake
new file mode 100644
index 0000000..f69f9fd
--- /dev/null
+++ b/Tests/RunCMake/include_guard/InvalidScope.cmake
@@ -0,0 +1 @@
+include_guard(INVALID)
diff --git a/Tests/RunCMake/include_guard/RunCMakeTest.cmake b/Tests/RunCMake/include_guard/RunCMakeTest.cmake
new file mode 100644
index 0000000..e87bddd
--- /dev/null
+++ b/Tests/RunCMake/include_guard/RunCMakeTest.cmake
@@ -0,0 +1,7 @@
+include(RunCMake)
+
+run_cmake(VariableScope)
+run_cmake(DirectoryScope)
+run_cmake(GlobalScope)
+run_cmake(InvalidScope)
+run_cmake(InvalidArgumentsNumber)
diff --git a/Tests/RunCMake/include_guard/Scripts/DirScript.cmake b/Tests/RunCMake/include_guard/Scripts/DirScript.cmake
new file mode 100644
index 0000000..e61d180
--- /dev/null
+++ b/Tests/RunCMake/include_guard/Scripts/DirScript.cmake
@@ -0,0 +1,12 @@
+include_guard(DIRECTORY)
+
+set(prop_name DIR_SCRIPT_COUNT)
+get_property(count_is_set GLOBAL PROPERTY ${prop_name} SET)
+
+if(NOT count_is_set)
+ set_property(GLOBAL PROPERTY ${prop_name} 1)
+else()
+ get_property(count GLOBAL PROPERTY ${prop_name})
+ math(EXPR count "${count} + 1")
+ set_property(GLOBAL PROPERTY ${prop_name} ${count})
+endif()
diff --git a/Tests/RunCMake/include_guard/Scripts/GlobScript.cmake b/Tests/RunCMake/include_guard/Scripts/GlobScript.cmake
new file mode 100644
index 0000000..c26bf40
--- /dev/null
+++ b/Tests/RunCMake/include_guard/Scripts/GlobScript.cmake
@@ -0,0 +1,12 @@
+include_guard(GLOBAL)
+
+set(prop_name GLOB_SCRIPT_COUNT)
+get_property(count_is_set GLOBAL PROPERTY ${prop_name} SET)
+
+if(NOT count_is_set)
+ set_property(GLOBAL PROPERTY ${prop_name} 1)
+else()
+ get_property(count GLOBAL PROPERTY ${prop_name})
+ math(EXPR count "${count} + 1")
+ set_property(GLOBAL PROPERTY ${prop_name} ${count})
+endif()
diff --git a/Tests/RunCMake/include_guard/Scripts/VarScript.cmake b/Tests/RunCMake/include_guard/Scripts/VarScript.cmake
new file mode 100644
index 0000000..3080377
--- /dev/null
+++ b/Tests/RunCMake/include_guard/Scripts/VarScript.cmake
@@ -0,0 +1,12 @@
+include_guard()
+
+set(prop_name VAR_SCRIPT_COUNT)
+get_property(count_is_set GLOBAL PROPERTY ${prop_name} SET)
+
+if(NOT count_is_set)
+ set_property(GLOBAL PROPERTY ${prop_name} 1)
+else()
+ get_property(count GLOBAL PROPERTY ${prop_name})
+ math(EXPR count "${count} + 1")
+ set_property(GLOBAL PROPERTY ${prop_name} ${count})
+endif()
diff --git a/Tests/RunCMake/include_guard/VariableScope.cmake b/Tests/RunCMake/include_guard/VariableScope.cmake
new file mode 100644
index 0000000..7f8477d
--- /dev/null
+++ b/Tests/RunCMake/include_guard/VariableScope.cmake
@@ -0,0 +1,24 @@
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Scripts")
+
+# Test include_guard with VARIABLE scope
+function(var_include_func)
+ # Include twice in the same scope
+ include(VarScript)
+ include(VarScript)
+ get_property(var_count GLOBAL PROPERTY VAR_SCRIPT_COUNT)
+ if(NOT var_count EQUAL 1)
+ message(FATAL_ERROR
+ "Wrong VAR_SCRIPT_COUNT value: ${var_count}, expected: 1")
+ endif()
+endfunction()
+
+var_include_func()
+
+# Check again that include_guard has been reset
+include(VarScript)
+
+get_property(var_count GLOBAL PROPERTY VAR_SCRIPT_COUNT)
+if(NOT var_count EQUAL 2)
+ message(FATAL_ERROR
+ "Wrong VAR_SCRIPT_COUNT value: ${var_count}, expected: 2")
+endif()
diff --git a/Tests/RunCMake/include_guard/global_script_dir/CMakeLists.txt b/Tests/RunCMake/include_guard/global_script_dir/CMakeLists.txt
new file mode 100644
index 0000000..ee7ea2e
--- /dev/null
+++ b/Tests/RunCMake/include_guard/global_script_dir/CMakeLists.txt
@@ -0,0 +1 @@
+include(GlobScript)
diff --git a/Tests/RunCMake/include_guard/sub_dir_script1/CMakeLists.txt b/Tests/RunCMake/include_guard/sub_dir_script1/CMakeLists.txt
new file mode 100644
index 0000000..d3626e5
--- /dev/null
+++ b/Tests/RunCMake/include_guard/sub_dir_script1/CMakeLists.txt
@@ -0,0 +1,9 @@
+function(dir_check)
+ include(DirScript)
+endfunction()
+
+dir_check()
+
+include(DirScript)
+
+add_subdirectory(sub_dir_script3)
diff --git a/Tests/RunCMake/include_guard/sub_dir_script1/sub_dir_script3/CMakeLists.txt b/Tests/RunCMake/include_guard/sub_dir_script1/sub_dir_script3/CMakeLists.txt
new file mode 100644
index 0000000..1c3b1b2
--- /dev/null
+++ b/Tests/RunCMake/include_guard/sub_dir_script1/sub_dir_script3/CMakeLists.txt
@@ -0,0 +1 @@
+include(DirScript)
diff --git a/Tests/RunCMake/include_guard/sub_dir_script2/CMakeLists.txt b/Tests/RunCMake/include_guard/sub_dir_script2/CMakeLists.txt
new file mode 100644
index 0000000..1c3b1b2
--- /dev/null
+++ b/Tests/RunCMake/include_guard/sub_dir_script2/CMakeLists.txt
@@ -0,0 +1 @@
+include(DirScript)
diff --git a/Tests/RunCMake/string/Prepend.cmake b/Tests/RunCMake/string/Prepend.cmake
new file mode 100644
index 0000000..8eaeebb
--- /dev/null
+++ b/Tests/RunCMake/string/Prepend.cmake
@@ -0,0 +1,58 @@
+set(out)
+string(PREPEND out)
+if(DEFINED out)
+ message(FATAL_ERROR "\"string(PREPEND out)\" set out to \"${out}\"")
+endif()
+
+set(out "")
+string(PREPEND out)
+if(NOT out STREQUAL "")
+ message(FATAL_ERROR "\"string(PREPEND out)\" set out to \"${out}\"")
+endif()
+
+set(out x)
+string(PREPEND out)
+if(NOT out STREQUAL "x")
+ message(FATAL_ERROR "\"string(PREPEND out)\" set out to \"${out}\"")
+endif()
+
+
+set(out)
+string(PREPEND out a)
+if(NOT out STREQUAL "a")
+ message(FATAL_ERROR "\"string(PREPEND out a)\" set out to \"${out}\"")
+endif()
+
+set(out "")
+string(PREPEND out a)
+if(NOT out STREQUAL "a")
+ message(FATAL_ERROR "\"string(PREPEND out a)\" set out to \"${out}\"")
+endif()
+
+set(out x)
+string(PREPEND out a)
+if(NOT out STREQUAL "ax")
+ message(FATAL_ERROR "\"string(PREPEND out a)\" set out to \"${out}\"")
+endif()
+
+
+set(out x)
+string(PREPEND out a "b")
+if(NOT out STREQUAL "abx")
+ message(FATAL_ERROR "\"string(PREPEND out a \"b\")\" set out to \"${out}\"")
+endif()
+
+set(b)
+set(out x)
+string(PREPEND out ${b})
+if(NOT out STREQUAL "x")
+ message(FATAL_ERROR "\"string(PREPEND out \${b})\" set out to \"${out}\"")
+endif()
+
+set(b b)
+set(out x)
+string(PREPEND out a "${b}" [[
+${c}]])
+if(NOT out STREQUAL "ab\${c}x")
+ message(FATAL_ERROR "\"string(PREPEND out a \"\${b}\" [[\${c}]])\" set out to \"${out}\"")
+endif()
diff --git a/Tests/RunCMake/string/PrependNoArgs-result.txt b/Tests/RunCMake/string/PrependNoArgs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/string/PrependNoArgs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/string/PrependNoArgs-stderr.txt b/Tests/RunCMake/string/PrependNoArgs-stderr.txt
new file mode 100644
index 0000000..8d433f9
--- /dev/null
+++ b/Tests/RunCMake/string/PrependNoArgs-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at PrependNoArgs.cmake:1 \(string\):
+ string sub-command PREPEND requires at least one argument.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/string/PrependNoArgs.cmake b/Tests/RunCMake/string/PrependNoArgs.cmake
new file mode 100644
index 0000000..f324f28
--- /dev/null
+++ b/Tests/RunCMake/string/PrependNoArgs.cmake
@@ -0,0 +1 @@
+string(PREPEND)
diff --git a/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt b/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
new file mode 100644
index 0000000..4360d79
--- /dev/null
+++ b/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
@@ -0,0 +1,12 @@
+^matches: Some::;Scope
+results from: string\(REGEX MATCHALL\)
+CMAKE_MATCH_0: -->Scope<--
+CMAKE_MATCH_1: -->Scope<--
+CMAKE_MATCH_2: --><--
+CMAKE_MATCH_COUNT: -->1<--
+replace: \[Some\]\[Scope\]
+results from: string\(REGEX REPLACE\)
+CMAKE_MATCH_0: -->Scope<--
+CMAKE_MATCH_1: -->Scope<--
+CMAKE_MATCH_2: --><--
+CMAKE_MATCH_COUNT: -->1<--$
diff --git a/Tests/RunCMake/string/RegexMultiMatchClear.cmake b/Tests/RunCMake/string/RegexMultiMatchClear.cmake
new file mode 100644
index 0000000..80b6b3c
--- /dev/null
+++ b/Tests/RunCMake/string/RegexMultiMatchClear.cmake
@@ -0,0 +1,20 @@
+cmake_minimum_required (VERSION 3.0)
+project (RegexClear NONE)
+
+function (output_results msg)
+ message("results from: ${msg}")
+ message("CMAKE_MATCH_0: -->${CMAKE_MATCH_0}<--")
+ message("CMAKE_MATCH_1: -->${CMAKE_MATCH_1}<--")
+ message("CMAKE_MATCH_2: -->${CMAKE_MATCH_2}<--")
+ message("CMAKE_MATCH_COUNT: -->${CMAKE_MATCH_COUNT}<--")
+endfunction ()
+
+set(haystack "Some::Scope")
+
+string(REGEX MATCHALL "^([^:]+)(::)?" matches "${haystack}")
+message("matches: ${matches}")
+output_results("string(REGEX MATCHALL)")
+
+string(REGEX REPLACE "^([^:]+)(::)?" "[\\1]" replace "${haystack}")
+message("replace: ${replace}")
+output_results("string(REGEX REPLACE)")
diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake
index 38a77b0..513d1e3 100644
--- a/Tests/RunCMake/string/RunCMakeTest.cmake
+++ b/Tests/RunCMake/string/RunCMakeTest.cmake
@@ -3,6 +3,9 @@ include(RunCMake)
run_cmake(Append)
run_cmake(AppendNoArgs)
+run_cmake(Prepend)
+run_cmake(PrependNoArgs)
+
run_cmake(Concat)
run_cmake(ConcatNoArgs)
@@ -20,6 +23,7 @@ run_cmake(UuidMissingTypeValue)
run_cmake(UuidBadType)
run_cmake(RegexClear)
+run_cmake(RegexMultiMatchClear)
run_cmake(UTF-16BE)
run_cmake(UTF-16LE)
diff --git a/Tests/RunCMake/test_include_dirs/CMakeLists.txt b/Tests/RunCMake/test_include_dirs/CMakeLists.txt
new file mode 100644
index 0000000..dc92486
--- /dev/null
+++ b/Tests/RunCMake/test_include_dirs/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.6)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/test_include_dirs/RunCMakeTest.cmake b/Tests/RunCMake/test_include_dirs/RunCMakeTest.cmake
new file mode 100644
index 0000000..d1633e4
--- /dev/null
+++ b/Tests/RunCMake/test_include_dirs/RunCMakeTest.cmake
@@ -0,0 +1,17 @@
+include(RunCMake)
+
+function(run_TID)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TID-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ endif()
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(TID)
+ run_cmake_command(TID-build ${CMAKE_COMMAND} --build . --config Debug)
+ run_cmake_command(TID-test ${CMAKE_CTEST_COMMAND} -C Debug)
+endfunction()
+
+run_TID()
diff --git a/Tests/RunCMake/test_include_dirs/TID-test-stdout.txt b/Tests/RunCMake/test_include_dirs/TID-test-stdout.txt
new file mode 100644
index 0000000..19bf051
--- /dev/null
+++ b/Tests/RunCMake/test_include_dirs/TID-test-stdout.txt
@@ -0,0 +1,17 @@
+Test project .*
+ Start 1: house\.dog
+1/6 Test #1: house\.dog \.+ +Passed +[0-9.]+ sec
+ Start 2: house\.cat
+2/6 Test #2: house\.cat \.+ +Passed +[0-9.]+ sec
+ Start 3: farm\.cow
+3/6 Test #3: farm\.cow \.+ +Passed +[0-9.]+ sec
+ Start 4: farm\.pig
+4/6 Test #4: farm\.pig \.+ +Passed +[0-9.]+ sec
+ Start 5: zoo\.fox
+5/6 Test #5: zoo\.fox \.+ +Passed +[0-9.]+ sec
+ Start 6: zoo\.emu
+6/6 Test #6: zoo\.emu \.+ +Passed +[0-9.]+ sec
+
+100% tests passed, 0 tests failed out of 6
+
+Total Test time \(real\) = +[0-9.]+ sec
diff --git a/Tests/RunCMake/test_include_dirs/TID.cmake b/Tests/RunCMake/test_include_dirs/TID.cmake
new file mode 100644
index 0000000..1e74f90
--- /dev/null
+++ b/Tests/RunCMake/test_include_dirs/TID.cmake
@@ -0,0 +1,29 @@
+project(test_include_dirs)
+include(CTest)
+
+enable_testing()
+
+add_executable(dummy dummy.cpp)
+
+function(generate_tests NAME)
+ set(ctest_file "${CMAKE_CURRENT_BINARY_DIR}/${NAME}_tests.cmake")
+ add_custom_command(
+ OUTPUT "${ctest_file}"
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EXECUTABLE=$<TARGET_FILE:dummy>"
+ -D "TEST_SUITE=${NAME}"
+ -D "TEST_NAMES=${ARGN}"
+ -D "CTEST_FILE=${ctest_file}"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/add-tests.cmake"
+ VERBATIM
+ )
+ add_custom_target(${NAME}_tests ALL DEPENDS "${ctest_file}")
+endfunction()
+
+generate_tests(house dog cat)
+generate_tests(farm cow pig)
+generate_tests(zoo fox emu)
+
+set_property(DIRECTORY PROPERTY TEST_INCLUDE_FILE "house_tests.cmake")
+set_property(DIRECTORY APPEND PROPERTY TEST_INCLUDE_FILES "farm_tests.cmake")
+set_property(DIRECTORY APPEND PROPERTY TEST_INCLUDE_FILES "zoo_tests.cmake")
diff --git a/Tests/RunCMake/test_include_dirs/add-tests.cmake b/Tests/RunCMake/test_include_dirs/add-tests.cmake
new file mode 100644
index 0000000..e74665a
--- /dev/null
+++ b/Tests/RunCMake/test_include_dirs/add-tests.cmake
@@ -0,0 +1,8 @@
+set(script)
+
+foreach(TEST_NAME ${TEST_NAMES})
+ set(script "${script}add_test(\"${TEST_SUITE}.${TEST_NAME}\"")
+ set(script "${script} \"${TEST_EXECUTABLE}\")\n")
+endforeach()
+
+file(WRITE "${CTEST_FILE}" "${script}")
diff --git a/Tests/RunCMake/test_include_dirs/dummy.cpp b/Tests/RunCMake/test_include_dirs/dummy.cpp
new file mode 100644
index 0000000..f8b643a
--- /dev/null
+++ b/Tests/RunCMake/test_include_dirs/dummy.cpp
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/Server/CMakeLists.txt b/Tests/Server/CMakeLists.txt
index e7eaa8d..2ad05c3 100644
--- a/Tests/Server/CMakeLists.txt
+++ b/Tests/Server/CMakeLists.txt
@@ -20,6 +20,7 @@ macro(do_test bsname file)
endif()
endmacro()
+do_test("test_cache" "tc_cache.json")
do_test("test_handshake" "tc_handshake.json")
do_test("test_globalSettings" "tc_globalSettings.json")
do_test("test_buildsystem1" "tc_buildsystem1.json")
diff --git a/Tests/Server/cmakelib.py b/Tests/Server/cmakelib.py
index 78450d5..2218e02 100644
--- a/Tests/Server/cmakelib.py
+++ b/Tests/Server/cmakelib.py
@@ -95,6 +95,21 @@ def initProc(cmakeCommand):
return cmakeCommand
+def exitProc(cmakeCommand):
+ # Tell the server to exit.
+ cmakeCommand.stdin.close()
+ cmakeCommand.stdout.close()
+
+ # Wait for the server to exit.
+ # If this version of python supports it, terminate the server after a timeout.
+ try:
+ cmakeCommand.wait(timeout=5)
+ except TypeError:
+ cmakeCommand.wait()
+ except:
+ cmakeCommand.terminate()
+ raise
+
def waitForMessage(cmakeCommand, expected):
data = ordered(expected)
packet = ordered(waitForRawMessage(cmakeCommand))
@@ -197,3 +212,27 @@ def validateGlobalSettings(cmakeCommand, cmakeCommandPath, data):
print("Validating", i)
if (packet[i] != data[i]):
sys.exit(1)
+
+def validateCache(cmakeCommand, data):
+ packet = waitForReply(cmakeCommand, 'cache', '', False)
+
+ cache = packet['cache']
+
+ if (data['isEmpty']):
+ if (cache != []):
+ print('Expected empty cache, but got data.\n')
+ sys.exit(1)
+ return;
+
+ if (cache == []):
+ print('Expected cache contents, but got none.\n')
+ sys.exit(1)
+
+ hadHomeDir = False
+ for value in cache:
+ if (value['key'] == 'CMAKE_HOME_DIRECTORY'):
+ hadHomeDir = True
+
+ if (not hadHomeDir):
+ print('No CMAKE_HOME_DIRECTORY found in cache.')
+ sys.exit(1)
diff --git a/Tests/Server/server-test.py b/Tests/Server/server-test.py
index 62d9008..f5a3f28 100644
--- a/Tests/Server/server-test.py
+++ b/Tests/Server/server-test.py
@@ -84,7 +84,7 @@ for obj in testData:
if 'extraGenerator' in data: extraGenerator = data['extraGenerator']
if not os.path.isabs(buildDirectory):
buildDirectory = buildDir + "/" + buildDirectory
- if not os.path.isabs(sourceDirectory):
+ if sourceDirectory != '' and not os.path.isabs(sourceDirectory):
sourceDirectory = sourceDir + "/" + sourceDirectory
cmakelib.handshake(proc, major, minor, sourceDirectory, buildDirectory,
generator, extraGenerator)
@@ -95,26 +95,20 @@ for obj in testData:
if not 'generator' in data: data['generator'] = cmakeGenerator
if not 'extraGenerator' in data: data['extraGenerator'] = ''
cmakelib.validateGlobalSettings(proc, cmakeCommand, data)
+ elif 'validateCache' in obj:
+ data = obj['validateCache']
+ if not 'isEmpty' in data: data['isEmpty'] = false
+ cmakelib.validateCache(proc, data)
elif 'message' in obj:
print("MESSAGE:", obj["message"])
+ elif 'reconnect' in obj:
+ cmakelib.exitProc(proc)
+ proc = cmakelib.initProc(cmakeCommand)
else:
print("Unknown command:", json.dumps(obj))
sys.exit(2)
print("Completed")
-# Tell the server to exit.
-proc.stdin.close()
-proc.stdout.close()
-
-# Wait for the server to exit.
-# If this version of python supports it, terminate the server after a timeout.
-try:
- proc.wait(timeout=5)
-except TypeError:
- proc.wait()
-except:
- proc.terminate()
- raise
-
-sys.exit(0)
+cmakelib.exitProc(proc)
+sys.exit(proc.returncode)
diff --git a/Tests/Server/tc_cache.json b/Tests/Server/tc_cache.json
new file mode 100644
index 0000000..74af6d9
--- /dev/null
+++ b/Tests/Server/tc_cache.json
@@ -0,0 +1,24 @@
+[
+{ "message": "Testing cache" },
+
+{ "message": "Cache after first handshake is empty:" },
+{ "handshake": {"major": 1, "sourceDirectory": "buildsystem1", "buildDirectory": "buildsystem1"} },
+{ "send": { "type": "cache" } },
+{ "validateCache": { "isEmpty": true } },
+
+{ "message": "Cache after configure is populated:" },
+{ "send": { "type": "configure" } },
+{ "reply": { "type": "configure", "skipProgress":true } },
+{ "send": { "type": "cache" } },
+{ "validateCache": { "isEmpty": false } },
+
+{ "message": "Handshake for existing cache requires buildDirectory only:" },
+{ "reconnect": {} },
+{ "handshake": {"major": 1, "sourceDirectory": "", "buildDirectory": "buildsystem1"} },
+
+{ "message": "Cache after reconnect is again populated:" },
+{ "send": { "type": "cache" } },
+{ "validateCache": { "isEmpty": false } },
+
+{ "message": "Everything ok." }
+]
diff --git a/Tests/Server/tc_handshake.json b/Tests/Server/tc_handshake.json
index 975bb3d..4bb7fa7 100644
--- a/Tests/Server/tc_handshake.json
+++ b/Tests/Server/tc_handshake.json
@@ -11,6 +11,10 @@
{ "send": {"test": "sometext","cookie":"monster"} },
{ "recv": {"cookie":"monster","errorMessage":"No type given in request.","inReplyTo":"","type":"error"} },
+{ "message": "Testing commands before handshake" },
+{ "send": {"type": "cache","cookie":"monster"} },
+{ "recv": {"cookie":"monster","errorMessage":"Waiting for type \"handshake\".","inReplyTo":"cache","type":"error"} },
+
{ "message": "Testing handshake" },
{ "send": {"type": "sometype","cookie":"monster2"} },
{ "recv": {"cookie":"monster2","errorMessage":"Waiting for type \"handshake\".","inReplyTo":"sometype","type":"error"} },
diff --git a/Tests/SimpleInstall/scripts/sample_script.bat b/Tests/SimpleInstall/scripts/sample_script.bat
index 64a77b5..a9af38c 100755
--- a/Tests/SimpleInstall/scripts/sample_script.bat
+++ b/Tests/SimpleInstall/scripts/sample_script.bat
@@ -1 +1 @@
-@echo Sample Script Output
+@echo Sample Script Output
diff --git a/Tests/SimpleInstallS2/scripts/sample_script.bat b/Tests/SimpleInstallS2/scripts/sample_script.bat
index 64a77b5..a9af38c 100755
--- a/Tests/SimpleInstallS2/scripts/sample_script.bat
+++ b/Tests/SimpleInstallS2/scripts/sample_script.bat
@@ -1 +1 @@
-@echo Sample Script Output
+@echo Sample Script Output
diff --git a/Tests/XCTest/CMakeLists.txt b/Tests/XCTest/CMakeLists.txt
index d40c40e..d0b07ea 100644
--- a/Tests/XCTest/CMakeLists.txt
+++ b/Tests/XCTest/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.1)
-project(XCTest)
+project(XCTest C)
enable_testing()
find_package(XCTest REQUIRED)
diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt
index f1e8f95..6a90c84 100644
--- a/Utilities/Doxygen/CMakeLists.txt
+++ b/Utilities/Doxygen/CMakeLists.txt
@@ -3,7 +3,7 @@
if(NOT CMake_SOURCE_DIR)
set(CMakeDeveloperReference_STANDALONE 1)
- cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR)
+ cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)
diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp
index fe0f7df..349945a 100644
--- a/Utilities/IWYU/mapping.imp
+++ b/Utilities/IWYU/mapping.imp
@@ -21,6 +21,7 @@
{ include: [ "<wctype.h>", public, "<cwctype>", public ] },
# HACK: check whether this can be removed with next iwyu release.
+ { include: [ "<bits/shared_ptr.h>", private, "<memory>", public ] },
{ include: [ "<bits/std_function.h>", private, "<functional>", public ] },
{ include: [ "<bits/time.h>", private, "<time.h>", public ] },
{ include: [ "<bits/types/clock_t.h>", private, "<time.h>", public ] },
@@ -67,18 +68,6 @@
{ symbol: [ "std::__decay_and_strip<cmFindPackageCommand::PathLabel &>::__type", private, "\"cmConfigure.h\"", public ] },
{ symbol: [ "std::__decay_and_strip<__gnu_cxx::__normal_iterator<const cmCTestTestHandler::cmCTestTestProperties *, std::vector<cmCTestTestHandler::cmCTestTestProperties, std::allocator<cmCTestTestHandler::cmCTestTestProperties> > > &>::__type", private, "\"cmConfigure.h\"", public ] },
- # Wrappers for headers added in TR1 / C++11
- # { include: [ "<array>", public, "\"cm_array.hxx\"", public ] },
- # { include: [ "<functional>", public, "\"cm_functional.hxx\"", public ] },
- # { include: [ "<memory>", public, "\"cm_memory.hxx\"", public ] },
- { include: [ "<unordered_map>", public, "\"cm_unordered_map.hxx\"", public ] },
- { include: [ "<unordered_set>", public, "\"cm_unordered_set.hxx\"", public ] },
- # { include: [ "<tr1/array>", public, "\"cm_array.hxx\"", public ] },
- # { include: [ "<tr1/functional>", public, "\"cm_functional.hxx\"", public ] },
- # { include: [ "<tr1/memory>", public, "\"cm_memory.hxx\"", public ] },
- { include: [ "<tr1/unordered_map>", public, "\"cm_unordered_map.hxx\"", public ] },
- { include: [ "<tr1/unordered_set>", public, "\"cm_unordered_set.hxx\"", public ] },
-
# KWIML
{ include: [ "<stdint.h>", public, "\"cm_kwiml.h\"", public ] },
{ include: [ "<inttypes.h>", public, "\"cm_kwiml.h\"", public ] },
@@ -87,14 +76,6 @@
{ include: [ "<sys/stat.h>", public, "\"cm_sys_stat.h\"", public ] },
{ symbol: [ "mode_t", private, "\"cm_sys_stat.h\"", public ] },
- # TODO: remove once TR1 / C++11 is required.
- { include: [ "\"cmsys/hash_fun.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] },
- { include: [ "\"cmsys/hash_fun.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] },
- { include: [ "\"cmsys/hash_map.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] },
- { include: [ "\"cmsys/hash_set.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] },
- { include: [ "\"cmsys/hashtable.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] },
- { include: [ "\"cmsys/hashtable.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] },
-
# Wrappers for 3rd-party libraries used from the system.
{ include: [ "<archive.h>", private, "\"cm_libarchive.h\"", public ] },
{ include: [ "<archive_entry.h>", private, "\"cm_libarchive.h\"", public ] },
diff --git a/Utilities/Release/linux64_release.cmake b/Utilities/Release/linux64_release.cmake
index 3d8ddba..02742ad 100644
--- a/Utilities/Release/linux64_release.cmake
+++ b/Utilities/Release/linux64_release.cmake
@@ -36,7 +36,6 @@ PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3
CPACK_SYSTEM_NAME:STRING=Linux-x86_64
BUILD_QtDialog:BOOL:=TRUE
CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-CMake_ENABLE_SERVER_MODE:BOOL=TRUE
CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:STRING=3
CMake_INSTALL_DEPENDENCIES:BOOL=ON
CMAKE_PREFIX_PATH:STRING=${qt_prefix}
diff --git a/Utilities/Release/osx_release.cmake b/Utilities/Release/osx_release.cmake
index 36498a7..c69eb11 100644
--- a/Utilities/Release/osx_release.cmake
+++ b/Utilities/Release/osx_release.cmake
@@ -20,7 +20,6 @@ CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7
CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
CPACK_SYSTEM_NAME:STRING=Darwin-x86_64
BUILD_QtDialog:BOOL=TRUE
-CMake_ENABLE_SERVER_MODE:BOOL=TRUE
CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:STRING=3
CMake_INSTALL_DEPENDENCIES:BOOL=ON
CMAKE_SKIP_RPATH:BOOL=TRUE
diff --git a/Utilities/Release/win32_release.cmake b/Utilities/Release/win32_release.cmake
index df9fe27..f54a4ca 100644
--- a/Utilities/Release/win32_release.cmake
+++ b/Utilities/Release/win32_release.cmake
@@ -15,7 +15,6 @@ CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
CMAKE_Fortran_COMPILER:FILEPATH=FALSE
CMAKE_GENERATOR:INTERNAL=Ninja
BUILD_QtDialog:BOOL:=TRUE
-CMake_ENABLE_SERVER_MODE:BOOL=TRUE
CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:STRING=3
CMake_INSTALL_DEPENDENCIES:BOOL=ON
CMAKE_EXE_LINKER_FLAGS:STRING=-machine:x86 -subsystem:console,5.01
diff --git a/Utilities/Release/win64_release.cmake b/Utilities/Release/win64_release.cmake
index ab52d79..bd2690f 100644
--- a/Utilities/Release/win64_release.cmake
+++ b/Utilities/Release/win64_release.cmake
@@ -16,7 +16,6 @@ CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
CMAKE_Fortran_COMPILER:FILEPATH=FALSE
CMAKE_GENERATOR:INTERNAL=Ninja
BUILD_QtDialog:BOOL:=TRUE
-CMake_ENABLE_SERVER_MODE:BOOL=TRUE
CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:STRING=3
CMake_INSTALL_DEPENDENCIES:BOOL=ON
CMAKE_EXE_LINKER_FLAGS:STRING=-machine:x64 -subsystem:console,5.02
diff --git a/Utilities/Scripts/BoostScanDeps.cmake b/Utilities/Scripts/BoostScanDeps.cmake
index 2fd8f86..bd2e6a8 100644
--- a/Utilities/Scripts/BoostScanDeps.cmake
+++ b/Utilities/Scripts/BoostScanDeps.cmake
@@ -39,29 +39,40 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs)
# Start by finding all headers for the component; header
# dependencies via #include will be solved by future passes
+ file(GLOB_RECURSE _boost_mpi_python_headers
+ RELATIVE "${includedir}"
+ "${includedir}/boost/mpi/python/*")
+ list(INSERT _boost_mpi_python_headers 0 "boost/mpi/python.hpp")
+
+ file(GLOB_RECURSE _boost_python_numpy_headers
+ RELATIVE "${includedir}"
+ "${includedir}/boost/python/numpy/*")
+ list(INSERT _boost_python_numpy_headers 0 "boost/python/numpy.hpp")
# Special-case since it is part of mpi; look only in boost/mpi/python*
if(component STREQUAL "mpi_python")
set(_boost_DEPS "python")
set(library_component TRUE)
- file(GLOB_RECURSE _boost_unprocessed_headers
- RELATIVE "${includedir}"
- "${includedir}/boost/mpi/python/*")
- list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/mpi/python.hpp")
+ set(_boost_unprocessed_headers ${_boost_mpi_python_headers})
+ # Special-case since it is part of python; look only in boost/python/numpy*
+ elseif(component STREQUAL "numpy")
+ set(_boost_DEPS "python")
+ set(library_component TRUE)
+ set(_boost_unprocessed_headers ${_boost_python_numpy_headers})
# Special-case since it is a serialization variant; look in boost/serialization
elseif(component STREQUAL "wserialization")
set(library_component TRUE)
file(GLOB_RECURSE _boost_unprocessed_headers
RELATIVE "${includedir}"
"${includedir}/boost/serialization/*")
- list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/serialization.hpp")
+ list(INSERT _boost_unprocessed_headers 0 "boost/serialization.hpp")
# Not really a library in its own right, but treat it as one
elseif(component STREQUAL "math")
set(library_component TRUE)
file(GLOB_RECURSE _boost_unprocessed_headers
RELATIVE "${includedir}"
"${includedir}/boost/math/*")
- list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/math.hpp")
+ list(INSERT _boost_unprocessed_headers 0 "boost/math.hpp")
# Single test header
elseif(component STREQUAL "unit_test_framework")
set(library_component TRUE)
@@ -79,7 +90,8 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs)
file(GLOB_RECURSE _boost_unprocessed_headers
RELATIVE "${includedir}"
"${includedir}/boost/${component}/*")
- list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/${component}.hpp")
+ list(INSERT _boost_unprocessed_headers 0 "boost/${component}.hpp")
+ list(REMOVE_ITEM _boost_unprocessed_headers ${_boost_mpi_python_headers} ${_boost_python_numpy_headers})
endif()
while(_boost_unprocessed_headers)
@@ -102,6 +114,8 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs)
foreach(line ${_boost_header_deps})
string(REGEX REPLACE "^[ \t]*#[ \t]*define[ \t][ \t]*BOOST_LIB_NAME[ \t][ \t]*boost_([^ \t][^ \t]*).*" "\\1" _boost_component_match "${line}")
+ string(REPLACE "python3" "python" _boost_component_match "${_boost_component_match}")
+ string(REPLACE "numpy3" "numpy" _boost_component_match "${_boost_component_match}")
list(FIND _boost_DEPS "${_boost_component_match}" _boost_dep_found)
if(_boost_component_match STREQUAL "bzip2" OR
_boost_component_match STREQUAL "zlib")
@@ -119,6 +133,12 @@ function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs)
# hard dependency (handle as special-case for mpi_python).
continue()
endif()
+ if(component STREQUAL "python" AND
+ boost_component_match STREQUAL "numpy")
+ # Optional python dependency; skip to avoid making it a
+ # hard dependency (handle as special-case for numpy).
+ continue()
+ endif()
if (_boost_dep_found EQUAL -1 AND
NOT "${_boost_component_match}" STREQUAL "${component}")
list(APPEND _boost_DEPS "${_boost_component_match}")
@@ -168,6 +188,11 @@ if(IS_DIRECTORY "${BOOST_DIR}/boost/mpi" AND
IS_DIRECTORY "${BOOST_DIR}/boost/python")
list(APPEND boost_components "mpi_python")
endif()
+# Special-case numpy, since it's a part of python
+if(IS_DIRECTORY "${BOOST_DIR}/boost/python" AND
+ IS_DIRECTORY "${BOOST_DIR}/boost/python/numpy")
+ list(APPEND boost_components "numpy")
+endif()
# Special-case wserialization, which is a variant of serialization
if(IS_DIRECTORY "${BOOST_DIR}/boost/serialization")
list(APPEND boost_components "wserialization")
diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash
index edcda77..428a9e4 100755
--- a/Utilities/Scripts/clang-format.bash
+++ b/Utilities/Scripts/clang-format.bash
@@ -92,7 +92,7 @@ fi
# Verify that we have a tool.
if ! type -p "$clang_format" >/dev/null; then
- echo "Unable to locate '$clang_format'"
+ echo "Unable to locate a 'clang-format' tool."
exit 1
fi
diff --git a/Utilities/Scripts/regenerate-lexers.bash b/Utilities/Scripts/regenerate-lexers.bash
new file mode 100755
index 0000000..22b681f
--- /dev/null
+++ b/Utilities/Scripts/regenerate-lexers.bash
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+set -e
+
+pushd "${BASH_SOURCE%/*}/../../Source/LexerParser" > /dev/null
+
+for lexer in \
+ CommandArgument \
+ DependsJava \
+ Expr \
+ Fortran
+do
+ echo "Generating Lexer ${lexer}"
+ flex --nounistd -DFLEXINT_H --noline --header-file=cm${lexer}Lexer.h -ocm${lexer}Lexer.cxx cm${lexer}Lexer.in.l
+ sed -i 's/\s*$//' cm${lexer}Lexer.h cm${lexer}Lexer.cxx # remove trailing whitespaces
+ sed -i '${/^$/d;}' cm${lexer}Lexer.h cm${lexer}Lexer.cxx # remove blank line at the end
+ sed -i '1i#include "cmStandardLexer.h"' cm${lexer}Lexer.cxx # add cmStandardLexer.h include
+done
+
+
+# these lexers (at the moment only the ListFileLexer) are compiled as C and do not generate a header
+for lexer in ListFile
+do
+
+ echo "Generating Lexer ${lexer}"
+ flex --nounistd -DFLEXINT_H --noline -ocm${lexer}Lexer.c cm${lexer}Lexer.in.l
+ sed -i 's/\s*$//' cm${lexer}Lexer.c # remove trailing whitespaces
+ sed -i '${/^$/d;}' cm${lexer}Lexer.c # remove blank line at the end
+ sed -i '1i#include "cmStandardLexer.h"' cm${lexer}Lexer.c # add cmStandardLexer.h include
+
+done
+
+popd > /dev/null
diff --git a/Utilities/Scripts/update-jsoncpp.bash b/Utilities/Scripts/update-jsoncpp.bash
new file mode 100755
index 0000000..f8fe544
--- /dev/null
+++ b/Utilities/Scripts/update-jsoncpp.bash
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+set -e
+set -x
+shopt -s dotglob
+
+readonly name="jsoncpp"
+readonly ownership="JsonCpp Upstream <kwrobot@kitware.com>"
+readonly subtree="Utilities/cmjsoncpp"
+readonly repo="https://github.com/open-source-parsers/jsoncpp.git"
+readonly tag="1.8.2"
+readonly shortlog=false
+readonly paths="
+ LICENSE
+ include/json
+ src/lib_json
+"
+readonly remove="
+ include/json/autolink.h
+ src/lib_json/CMakeLists.txt
+ src/lib_json/sconscript
+ src/lib_json/version.h.in
+"
+
+extract_source () {
+ git_archive
+ pushd "${extractdir}/${name}-reduced"
+ rm $remove
+ echo "* -whitespace" > .gitattributes
+ popd
+}
+
+. "${BASH_SOURCE%/*}/update-third-party.bash"
diff --git a/Utilities/Scripts/update-libarchive.bash b/Utilities/Scripts/update-libarchive.bash
index 41c6a66..7534f94 100755
--- a/Utilities/Scripts/update-libarchive.bash
+++ b/Utilities/Scripts/update-libarchive.bash
@@ -8,7 +8,7 @@ readonly name="LibArchive"
readonly ownership="LibArchive Upstream <libarchive-discuss@googlegroups.com>"
readonly subtree="Utilities/cmlibarchive"
readonly repo="https://github.com/libarchive/libarchive.git"
-readonly tag="v3.3.1"
+readonly tag="v3.3.2"
readonly shortlog=false
readonly paths="
CMakeLists.txt
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index a29380c..2de821c 100644
--- a/Utilities/Sphinx/CMakeLists.txt
+++ b/Utilities/Sphinx/CMakeLists.txt
@@ -3,7 +3,7 @@
if(NOT CMake_SOURCE_DIR)
set(CMakeHelp_STANDALONE 1)
- cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR)
+ cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)
diff --git a/Utilities/cmbzip2/dlltest.dsp b/Utilities/cmbzip2/dlltest.dsp
deleted file mode 100644
index 4b1615e..0000000
--- a/Utilities/cmbzip2/dlltest.dsp
+++ /dev/null
@@ -1,93 +0,0 @@
-# Microsoft Developer Studio Project File - Name="dlltest" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** •ÒW‚µ‚È‚¢‚Å‚­‚¾‚³‚¢ **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=dlltest - Win32 Debug
-!MESSAGE ‚±‚ê‚Í—LŒø‚ÈÒ²¸Ì§²Ù‚Å‚Í‚ ‚è‚Ü‚¹‚ñB ‚±‚ÌÌßÛ¼Þª¸Ä‚ðËÞÙÄÞ‚·‚邽‚ß‚É‚Í NMAKE ‚ðŽg—p‚µ‚Ä‚­‚¾‚³‚¢B
-!MESSAGE [Ò²¸Ì§²Ù‚Ì´¸½Îß°Ä] ºÏÝÄÞ‚ðŽg—p‚µ‚ÄŽÀs‚µ‚Ä‚­‚¾‚³‚¢
-!MESSAGE
-!MESSAGE NMAKE /f "dlltest.mak".
-!MESSAGE
-!MESSAGE NMAKE ‚ÌŽÀsŽž‚É\¬‚ðŽw’è‚Å‚«‚Ü‚·
-!MESSAGE ºÏÝÄÞ ×²Ýã‚ÅϸۂÌÝ’è‚ð’è‹`‚µ‚Ü‚·B—á:
-!MESSAGE
-!MESSAGE NMAKE /f "dlltest.mak" CFG="dlltest - Win32 Debug"
-!MESSAGE
-!MESSAGE ‘I‘ð‰Â”\‚ÈËÞÙÄÞ Ó°ÄÞ:
-!MESSAGE
-!MESSAGE "dlltest - Win32 Release" ("Win32 (x86) Console Application" —p)
-!MESSAGE "dlltest - Win32 Debug" ("Win32 (x86) Console Application" —p)
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "dlltest - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x411 /d "NDEBUG"
-# ADD RSC /l 0x411 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"minibz2.exe"
-
-!ELSEIF "$(CFG)" == "dlltest - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "dlltest_"
-# PROP BASE Intermediate_Dir "dlltest_"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "dlltest_"
-# PROP Intermediate_Dir "dlltest_"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x411 /d "_DEBUG"
-# ADD RSC /l 0x411 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"minibz2.exe" /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "dlltest - Win32 Release"
-# Name "dlltest - Win32 Debug"
-# Begin Source File
-
-SOURCE=.\bzlib.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dlltest.c
-# End Source File
-# End Target
-# End Project
diff --git a/Utilities/cmbzip2/libbz2.dsp b/Utilities/cmbzip2/libbz2.dsp
deleted file mode 100644
index a21a20f..0000000
--- a/Utilities/cmbzip2/libbz2.dsp
+++ /dev/null
@@ -1,130 +0,0 @@
-# Microsoft Developer Studio Project File - Name="libbz2" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** •ÒW‚µ‚È‚¢‚Å‚­‚¾‚³‚¢ **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=libbz2 - Win32 Debug
-!MESSAGE ‚±‚ê‚Í—LŒø‚ÈÒ²¸Ì§²Ù‚Å‚Í‚ ‚è‚Ü‚¹‚ñB ‚±‚ÌÌßÛ¼Þª¸Ä‚ðËÞÙÄÞ‚·‚邽‚ß‚É‚Í NMAKE ‚ðŽg—p‚µ‚Ä‚­‚¾‚³‚¢B
-!MESSAGE [Ò²¸Ì§²Ù‚Ì´¸½Îß°Ä] ºÏÝÄÞ‚ðŽg—p‚µ‚ÄŽÀs‚µ‚Ä‚­‚¾‚³‚¢
-!MESSAGE
-!MESSAGE NMAKE /f "libbz2.mak".
-!MESSAGE
-!MESSAGE NMAKE ‚ÌŽÀsŽž‚É\¬‚ðŽw’è‚Å‚«‚Ü‚·
-!MESSAGE ºÏÝÄÞ ×²Ýã‚ÅϸۂÌÝ’è‚ð’è‹`‚µ‚Ü‚·B—á:
-!MESSAGE
-!MESSAGE NMAKE /f "libbz2.mak" CFG="libbz2 - Win32 Debug"
-!MESSAGE
-!MESSAGE ‘I‘ð‰Â”\‚ÈËÞÙÄÞ Ó°ÄÞ:
-!MESSAGE
-!MESSAGE "libbz2 - Win32 Release" ("Win32 (x86) Dynamic-Link Library" —p)
-!MESSAGE "libbz2 - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" —p)
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "libbz2 - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
-# ADD BASE RSC /l 0x411 /d "NDEBUG"
-# ADD RSC /l 0x411 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"libbz2.dll"
-
-!ELSEIF "$(CFG)" == "libbz2 - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
-# ADD BASE RSC /l 0x411 /d "_DEBUG"
-# ADD RSC /l 0x411 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"libbz2.dll" /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "libbz2 - Win32 Release"
-# Name "libbz2 - Win32 Debug"
-# Begin Source File
-
-SOURCE=.\blocksort.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\bzlib.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\bzlib.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\bzlib_private.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\compress.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\crctable.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\decompress.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\huffman.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libbz2.def
-# End Source File
-# Begin Source File
-
-SOURCE=.\randtable.c
-# End Source File
-# End Target
-# End Project
diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt
index bc9076e..ef370cc 100644
--- a/Utilities/cmjsoncpp/CMakeLists.txt
+++ b/Utilities/cmjsoncpp/CMakeLists.txt
@@ -9,11 +9,9 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PathScale")
endif()
set(JSONCPP_SOURCES
- src/lib_json/json_batchallocator.h
src/lib_json/json_reader.cpp
src/lib_json/json_tool.h
src/lib_json/json_value.cpp
- src/lib_json/json_valueiterator.inl
src/lib_json/json_writer.cpp
)
diff --git a/Utilities/cmjsoncpp/LICENSE b/Utilities/cmjsoncpp/LICENSE
index ca2bfe1..89280a6 100644
--- a/Utilities/cmjsoncpp/LICENSE
+++ b/Utilities/cmjsoncpp/LICENSE
@@ -2,13 +2,13 @@ The JsonCpp library's source code, including accompanying documentation,
tests and demonstration applications, are licensed under the following
conditions...
-The author (Baptiste Lepilleur) explicitly disclaims copyright in all
+Baptiste Lepilleur and The JsonCpp Authors explicitly disclaim copyright in all
jurisdictions which recognize such a disclaimer. In such jurisdictions,
this software is released into the Public Domain.
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
-2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
-released under the terms of the MIT License (see below).
+2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur and
+The JsonCpp Authors, and is released under the terms of the MIT License (see below).
In jurisdictions which recognize Public Domain property, the user of this
software may choose to accept it either as 1) Public Domain, 2) under the
@@ -23,7 +23,7 @@ described in clear, concise terms at:
The full text of the MIT License follows:
========================================================================
-Copyright (c) 2007-2010 Baptiste Lepilleur
+Copyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
diff --git a/Utilities/cmjsoncpp/include/json/allocator.h b/Utilities/cmjsoncpp/include/json/allocator.h
new file mode 100644
index 0000000..9562436
--- /dev/null
+++ b/Utilities/cmjsoncpp/include/json/allocator.h
@@ -0,0 +1,102 @@
+// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#ifndef CPPTL_JSON_ALLOCATOR_H_INCLUDED
+#define CPPTL_JSON_ALLOCATOR_H_INCLUDED
+
+#include <cstring>
+#include <memory>
+
+#if !defined(__SUNPRO_CC)
+#pragma pack(push, 8)
+#endif
+
+namespace Json {
+template<typename T>
+class SecureAllocator {
+ public:
+ // Type definitions
+ using value_type = T;
+ using pointer = T*;
+ using const_pointer = const T*;
+ using reference = T&;
+ using const_reference = const T&;
+ using size_type = std::size_t;
+ using difference_type = std::ptrdiff_t;
+
+ /**
+ * Allocate memory for N items using the standard allocator.
+ */
+ pointer allocate(size_type n) {
+ // allocate using "global operator new"
+ return static_cast<pointer>(::operator new(n * sizeof(T)));
+ }
+
+ /**
+ * Release memory which was allocated for N items at pointer P.
+ *
+ * The memory block is filled with zeroes before being released.
+ * The pointer argument is tagged as "volatile" to prevent the
+ * compiler optimizing out this critical step.
+ */
+ void deallocate(volatile pointer p, size_type n) {
+ std::memset(p, 0, n * sizeof(T));
+ // free using "global operator delete"
+ ::operator delete(p);
+ }
+
+ /**
+ * Construct an item in-place at pointer P.
+ */
+ template<typename... Args>
+ void construct(pointer p, Args&&... args) {
+ // construct using "placement new" and "perfect forwarding"
+ ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
+ }
+
+ size_type max_size() const {
+ return size_t(-1) / sizeof(T);
+ }
+
+ pointer address( reference x ) const {
+ return std::addressof(x);
+ }
+
+ const_pointer address( const_reference x ) const {
+ return std::addressof(x);
+ }
+
+ /**
+ * Destroy an item in-place at pointer P.
+ */
+ void destroy(pointer p) {
+ // destroy using "explicit destructor"
+ p->~T();
+ }
+
+ // Boilerplate
+ SecureAllocator() {}
+ template<typename U> SecureAllocator(const SecureAllocator<U>&) {}
+ template<typename U> struct rebind { using other = SecureAllocator<U>; };
+};
+
+
+template<typename T, typename U>
+bool operator==(const SecureAllocator<T>&, const SecureAllocator<U>&) {
+ return true;
+}
+
+template<typename T, typename U>
+bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
+ return false;
+}
+
+} //namespace Json
+
+#if !defined(__SUNPRO_CC)
+#pragma pack(pop)
+#endif
+
+#endif // CPPTL_JSON_ALLOCATOR_H_INCLUDED
diff --git a/Utilities/cmjsoncpp/include/json/assertions.h b/Utilities/cmjsoncpp/include/json/assertions.h
index 37a3ff5..f64913f 100644
--- a/Utilities/cmjsoncpp/include/json/assertions.h
+++ b/Utilities/cmjsoncpp/include/json/assertions.h
@@ -1,4 +1,4 @@
-// Copyright 2007-2010 Baptiste Lepilleur
+// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -11,31 +11,44 @@
#endif // if !defined(JSON_IS_AMALGAMATION)
#include <stdlib.h>
+#include <sstream>
+/** It should not be possible for a maliciously designed file to
+ * cause an abort() or seg-fault, so these macros are used only
+ * for pre-condition violations and internal logic errors.
+ */
#if JSON_USE_EXCEPTION
-#include <stdexcept>
-#define JSON_ASSERT(condition) \
- assert(condition); // @todo <= change this into an exception throw
-#define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message);
+
+// @todo <= add detail about condition in exception
+# define JSON_ASSERT(condition) \
+ {if (!(condition)) {Json::throwLogicError( "assert json failed" );}}
+
+# define JSON_FAIL_MESSAGE(message) \
+ { \
+ JSONCPP_OSTRINGSTREAM oss; oss << message; \
+ Json::throwLogicError(oss.str()); \
+ abort(); \
+ }
+
#else // JSON_USE_EXCEPTION
-#define JSON_ASSERT(condition) assert(condition);
+
+# define JSON_ASSERT(condition) assert(condition)
// The call to assert() will show the failure message in debug builds. In
-// release bugs we write to invalid memory in order to crash hard, so that a
-// debugger or crash reporter gets the chance to take over. We still call exit()
-// afterward in order to tell the compiler that this macro doesn't return.
-#define JSON_FAIL_MESSAGE(message) \
+// release builds we abort, for a core-dump or debugger.
+# define JSON_FAIL_MESSAGE(message) \
{ \
- assert(false&& message); \
- strcpy(reinterpret_cast<char*>(666), message); \
- exit(123); \
+ JSONCPP_OSTRINGSTREAM oss; oss << message; \
+ assert(false && oss.str().c_str()); \
+ abort(); \
}
+
#endif
#define JSON_ASSERT_MESSAGE(condition, message) \
if (!(condition)) { \
- JSON_FAIL_MESSAGE(message) \
+ JSON_FAIL_MESSAGE(message); \
}
#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
diff --git a/Utilities/cmjsoncpp/include/json/config.h b/Utilities/cmjsoncpp/include/json/config.h
index 6847ceb..eb52e71 100644
--- a/Utilities/cmjsoncpp/include/json/config.h
+++ b/Utilities/cmjsoncpp/include/json/config.h
@@ -1,10 +1,13 @@
-// Copyright 2007-2010 Baptiste Lepilleur
+// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
#ifndef JSON_CONFIG_H_INCLUDED
#define JSON_CONFIG_H_INCLUDED
+#include <stddef.h>
+#include <string> //typedef String
+#include <stdint.h> //typedef int64_t, uint64_t
// Include KWSys Large File Support configuration.
#include <cmsys/Configure.h>
@@ -22,17 +25,6 @@
/// std::map
/// as Value container.
//# define JSON_USE_CPPTL_SMALLMAP 1
-/// If defined, indicates that Json specific container should be used
-/// (hash table & simple deque container with customizable allocator).
-/// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332
-//# define JSON_VALUE_USE_INTERNAL_MAP 1
-/// Force usage of standard new/malloc based allocator instead of memory pool
-/// based allocator.
-/// The memory pools allocator used optimization (initializing Value and
-/// ValueInternalLink
-/// as if it was a POD) that may cause some validation tool to report errors.
-/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined.
-//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1
// If non-zero, the library uses exceptions to report bad input instead of C
// assertion macros. The default is to use exceptions.
@@ -55,12 +47,12 @@
#ifdef JSON_IN_CPPTL
#define JSON_API CPPTL_API
#elif defined(JSON_DLL_BUILD)
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) || defined(__MINGW32__)
#define JSON_API __declspec(dllexport)
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
#endif // if defined(_MSC_VER)
#elif defined(JSON_DLL)
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) || defined(__MINGW32__)
#define JSON_API __declspec(dllimport)
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
#endif // if defined(_MSC_VER)
@@ -74,26 +66,97 @@
// Storages, and 64 bits integer support is disabled.
// #define JSON_NO_INT64 1
-#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6
-// Microsoft Visual Studio 6 only support conversion from __int64 to double
-// (no conversion from unsigned __int64).
-#define JSON_USE_INT64_DOUBLE_CONVERSION 1
-// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
-// characters in the debug information)
-// All projects I've ever seen with VS6 were using this globally (not bothering
-// with pragma push/pop).
-#pragma warning(disable : 4786)
-#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6
-
-#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008
-/// Indicates that the following function is deprecated.
-#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
+#if defined(_MSC_VER) // MSVC
+# if _MSC_VER <= 1200 // MSVC 6
+ // Microsoft Visual Studio 6 only support conversion from __int64 to double
+ // (no conversion from unsigned __int64).
+# define JSON_USE_INT64_DOUBLE_CONVERSION 1
+ // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
+ // characters in the debug information)
+ // All projects I've ever seen with VS6 were using this globally (not bothering
+ // with pragma push/pop).
+# pragma warning(disable : 4786)
+# endif // MSVC 6
+
+# if _MSC_VER >= 1500 // MSVC 2008
+ /// Indicates that the following function is deprecated.
+# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
+# endif
+
+#endif // defined(_MSC_VER)
+
+// In c++11 the override keyword allows you to explicity define that a function
+// is intended to override the base-class version. This makes the code more
+// managable and fixes a set of common hard-to-find bugs.
+#if __cplusplus >= 201103L
+# define JSONCPP_OVERRIDE override
+# define JSONCPP_NOEXCEPT noexcept
+#elif defined(_MSC_VER) && _MSC_VER > 1600 && _MSC_VER < 1900
+# define JSONCPP_OVERRIDE override
+# define JSONCPP_NOEXCEPT throw()
+#elif defined(_MSC_VER) && _MSC_VER >= 1900
+# define JSONCPP_OVERRIDE override
+# define JSONCPP_NOEXCEPT noexcept
+#else
+# define JSONCPP_OVERRIDE
+# define JSONCPP_NOEXCEPT throw()
+#endif
+
+#ifndef JSON_HAS_RVALUE_REFERENCES
+
+#if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
+#define JSON_HAS_RVALUE_REFERENCES 1
+#endif // MSVC >= 2010
+
+#ifdef __clang__
+#if __has_feature(cxx_rvalue_references)
+#define JSON_HAS_RVALUE_REFERENCES 1
+#endif // has_feature
+
+#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
+#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
+#define JSON_HAS_RVALUE_REFERENCES 1
+#endif // GXX_EXPERIMENTAL
+
+#endif // __clang__ || __GNUC__
+
+#endif // not defined JSON_HAS_RVALUE_REFERENCES
+
+#ifndef JSON_HAS_RVALUE_REFERENCES
+#define JSON_HAS_RVALUE_REFERENCES 0
#endif
+#ifdef __clang__
+# if __has_extension(attribute_deprecated_with_message)
+# define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
+# endif
+#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
+# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
+# define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
+# elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
+# define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
+# endif // GNUC version
+#endif // __clang__ || __GNUC__
+
+#undef JSONCPP_DEPRECATED // no deprecations in CMake copy
#if !defined(JSONCPP_DEPRECATED)
#define JSONCPP_DEPRECATED(message)
#endif // if !defined(JSONCPP_DEPRECATED)
+#if __GNUC__ >= 6
+# define JSON_USE_INT64_DOUBLE_CONVERSION 1
+#endif
+
+#if !defined(JSON_IS_AMALGAMATION)
+
+# include "version.h"
+
+# if JSONCPP_USING_SECURE_MEMORY
+# include "allocator.h" //typedef Allocator
+# endif
+
+#endif // if !defined(JSON_IS_AMALGAMATION)
+
namespace Json {
typedef int Int;
typedef unsigned int UInt;
@@ -107,13 +170,26 @@ typedef unsigned int LargestUInt;
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
#else // if defined(_MSC_VER) // Other platforms, use long long
-typedef long long int Int64;
-typedef unsigned long long int UInt64;
+typedef int64_t Int64;
+typedef uint64_t UInt64;
#endif // if defined(_MSC_VER)
typedef Int64 LargestInt;
typedef UInt64 LargestUInt;
#define JSON_HAS_INT64
#endif // if defined(JSON_NO_INT64)
+#if JSONCPP_USING_SECURE_MEMORY
+#define JSONCPP_STRING std::basic_string<char, std::char_traits<char>, Json::SecureAllocator<char> >
+#define JSONCPP_OSTRINGSTREAM std::basic_ostringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >
+#define JSONCPP_OSTREAM std::basic_ostream<char, std::char_traits<char>>
+#define JSONCPP_ISTRINGSTREAM std::basic_istringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >
+#define JSONCPP_ISTREAM std::istream
+#else
+#define JSONCPP_STRING std::string
+#define JSONCPP_OSTRINGSTREAM std::ostringstream
+#define JSONCPP_OSTREAM std::ostream
+#define JSONCPP_ISTRINGSTREAM std::istringstream
+#define JSONCPP_ISTREAM std::istream
+#endif // if JSONCPP_USING_SECURE_MEMORY
} // end namespace Json
#endif // JSON_CONFIG_H_INCLUDED
diff --git a/Utilities/cmjsoncpp/include/json/features.h b/Utilities/cmjsoncpp/include/json/features.h
index 1bb7bb6..365abb3 100644
--- a/Utilities/cmjsoncpp/include/json/features.h
+++ b/Utilities/cmjsoncpp/include/json/features.h
@@ -1,4 +1,4 @@
-// Copyright 2007-2010 Baptiste Lepilleur
+// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -10,6 +10,10 @@
#include "forwards.h"
#endif // if !defined(JSON_IS_AMALGAMATION)
+#if !defined(__SUNPRO_CC)
+#pragma pack(push, 8)
+#endif
+
namespace Json {
/** \brief Configuration passed to reader and writer.
@@ -54,4 +58,8 @@ public:
} // namespace Json
+#if !defined(__SUNPRO_CC)
+#pragma pack(pop)
+#endif
+
#endif // CPPTL_JSON_FEATURES_H_INCLUDED
diff --git a/Utilities/cmjsoncpp/include/json/forwards.h b/Utilities/cmjsoncpp/include/json/forwards.h
index 84a26cd..70bbe19 100644
--- a/Utilities/cmjsoncpp/include/json/forwards.h
+++ b/Utilities/cmjsoncpp/include/json/forwards.h
@@ -1,4 +1,4 @@
-// Copyright 2007-2010 Baptiste Lepilleur
+// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -31,12 +31,6 @@ class Value;
class ValueIteratorBase;
class ValueIterator;
class ValueConstIterator;
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
-class ValueMapAllocator;
-class ValueInternalLink;
-class ValueInternalArray;
-class ValueInternalMap;
-#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP
} // namespace Json
diff --git a/Utilities/cmjsoncpp/include/json/json.h b/Utilities/cmjsoncpp/include/json/json.h
index f89bc62..5964672 100644
--- a/Utilities/cmjsoncpp/include/json/json.h
+++ b/Utilities/cmjsoncpp/include/json/json.h
@@ -1,4 +1,4 @@
-// Copyright 2007-2010 Baptiste Lepilleur
+// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
diff --git a/Utilities/cmjsoncpp/include/json/reader.h b/Utilities/cmjsoncpp/include/json/reader.h
index 95237d1..667246a 100644
--- a/Utilities/cmjsoncpp/include/json/reader.h
+++ b/Utilities/cmjsoncpp/include/json/reader.h
@@ -1,4 +1,4 @@
-// Copyright 2007-2010 Baptiste Lepilleur
+// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -14,6 +14,7 @@
#include <iosfwd>
#include <stack>
#include <string>
+#include <istream>
// Disable warning C4251: <data member>: <type> needs to have dll-interface to
// be used by...
@@ -22,13 +23,18 @@
#pragma warning(disable : 4251)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#if !defined(__SUNPRO_CC)
+#pragma pack(push, 8)
+#endif
+
namespace Json {
/** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a
*Value.
*
+ * deprecated Use CharReader and CharReaderBuilder.
*/
-class JSON_API Reader {
+class JSONCPP_DEPRECATED("Use CharReader and CharReaderBuilder instead") JSON_API Reader {
public:
typedef char Char;
typedef const Char* Location;
@@ -40,9 +46,9 @@ public:
*
*/
struct StructuredError {
- size_t offset_start;
- size_t offset_limit;
- std::string message;
+ ptrdiff_t offset_start;
+ ptrdiff_t offset_limit;
+ JSONCPP_STRING message;
};
/** \brief Constructs a Reader allowing all features
@@ -78,7 +84,7 @@ public:
document to read.
* \param endDoc Pointer on the end of the UTF-8 encoded string of the
document to read.
- \ Must be >= beginDoc.
+ * Must be >= beginDoc.
* \param root [out] Contains the root value of the document if it was
* successfully parsed.
* \param collectComments \c true to collect comment and allow writing them
@@ -97,7 +103,7 @@ public:
/// \brief Parse from input stream.
/// \see Json::operator>>(std::istream&, Json::Value&).
- bool parse(std::istream& is, Value& root, bool collectComments = true);
+ bool parse(JSONCPP_ISTREAM& is, Value& root, bool collectComments = true);
/** \brief Returns a user friendly string that list errors in the parsed
* document.
@@ -106,8 +112,10 @@ public:
* the parsed document. An empty string is returned if no error
* occurred
* during parsing.
+ * deprecated Use getFormattedErrorMessages() instead (typo fix).
*/
- std::string getFormatedErrorMessages() const;
+ JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.")
+ JSONCPP_STRING getFormatedErrorMessages() const;
/** \brief Returns a user friendly string that list errors in the parsed
* document.
@@ -117,7 +125,7 @@ public:
* occurred
* during parsing.
*/
- std::string getFormattedErrorMessages() const;
+ JSONCPP_STRING getFormattedErrorMessages() const;
/** \brief Returns a vector of structured erros encounted while parsing.
* \return A (possibly empty) vector of StructuredError objects. Currently
@@ -134,7 +142,7 @@ public:
* \return \c true if the error was successfully added, \c false if the
* Value offset exceeds the document size.
*/
- bool pushError(const Value& value, const std::string& message);
+ bool pushError(const Value& value, const JSONCPP_STRING& message);
/** \brief Add a semantic error message with extra context.
* \param value JSON Value location associated with the error
@@ -143,7 +151,7 @@ public:
* \return \c true if the error was successfully added, \c false if either
* Value offset exceeds the document size.
*/
- bool pushError(const Value& value, const std::string& message, const Value& extra);
+ bool pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra);
/** \brief Return whether there are any errors.
* \return \c true if there are no errors to report \c false if
@@ -179,13 +187,12 @@ private:
class ErrorInfo {
public:
Token token_;
- std::string message_;
+ JSONCPP_STRING message_;
Location extra_;
};
typedef std::deque<ErrorInfo> Errors;
- bool expectToken(TokenType type, Token& token, const char* message);
bool readToken(Token& token);
void skipSpaces();
bool match(Location pattern, int patternLength);
@@ -200,7 +207,7 @@ private:
bool decodeNumber(Token& token);
bool decodeNumber(Token& token, Value& decoded);
bool decodeString(Token& token);
- bool decodeString(Token& token, std::string& decoded);
+ bool decodeString(Token& token, JSONCPP_STRING& decoded);
bool decodeDouble(Token& token);
bool decodeDouble(Token& token, Value& decoded);
bool decodeUnicodeCodePoint(Token& token,
@@ -211,9 +218,9 @@ private:
Location& current,
Location end,
unsigned int& unicode);
- bool addError(const std::string& message, Token& token, Location extra = 0);
+ bool addError(const JSONCPP_STRING& message, Token& token, Location extra = 0);
bool recoverFromError(TokenType skipUntilToken);
- bool addErrorAndRecover(const std::string& message,
+ bool addErrorAndRecover(const JSONCPP_STRING& message,
Token& token,
TokenType skipUntilToken);
void skipUntilSpace();
@@ -221,24 +228,154 @@ private:
Char getNextChar();
void
getLocationLineAndColumn(Location location, int& line, int& column) const;
- std::string getLocationLineAndColumn(Location location) const;
+ JSONCPP_STRING getLocationLineAndColumn(Location location) const;
void addComment(Location begin, Location end, CommentPlacement placement);
void skipCommentTokens(Token& token);
+ static bool containsNewLine(Location begin, Location end);
+ static JSONCPP_STRING normalizeEOL(Location begin, Location end);
+
typedef std::stack<Value*> Nodes;
Nodes nodes_;
Errors errors_;
- std::string document_;
+ JSONCPP_STRING document_;
Location begin_;
Location end_;
Location current_;
Location lastValueEnd_;
Value* lastValue_;
- std::string commentsBefore_;
+ JSONCPP_STRING commentsBefore_;
Features features_;
bool collectComments_;
+}; // Reader
+
+/** Interface for reading JSON from a char array.
+ */
+class JSON_API CharReader {
+public:
+ virtual ~CharReader() {}
+ /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
+ document.
+ * The document must be a UTF-8 encoded string containing the document to read.
+ *
+ * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the
+ document to read.
+ * \param endDoc Pointer on the end of the UTF-8 encoded string of the
+ document to read.
+ * Must be >= beginDoc.
+ * \param root [out] Contains the root value of the document if it was
+ * successfully parsed.
+ * \param errs [out] Formatted error messages (if not NULL)
+ * a user friendly string that lists errors in the parsed
+ * document.
+ * \return \c true if the document was successfully parsed, \c false if an
+ error occurred.
+ */
+ virtual bool parse(
+ char const* beginDoc, char const* endDoc,
+ Value* root, JSONCPP_STRING* errs) = 0;
+
+ class JSON_API Factory {
+ public:
+ virtual ~Factory() {}
+ /** \brief Allocate a CharReader via operator new().
+ * \throw std::exception if something goes wrong (e.g. invalid settings)
+ */
+ virtual CharReader* newCharReader() const = 0;
+ }; // Factory
+}; // CharReader
+
+/** \brief Build a CharReader implementation.
+
+Usage:
+\code
+ using namespace Json;
+ CharReaderBuilder builder;
+ builder["collectComments"] = false;
+ Value value;
+ JSONCPP_STRING errs;
+ bool ok = parseFromStream(builder, std::cin, &value, &errs);
+\endcode
+*/
+class JSON_API CharReaderBuilder : public CharReader::Factory {
+public:
+ // Note: We use a Json::Value so that we can add data-members to this class
+ // without a major version bump.
+ /** Configuration of this builder.
+ These are case-sensitive.
+ Available settings (case-sensitive):
+ - `"collectComments": false or true`
+ - true to collect comment and allow writing them
+ back during serialization, false to discard comments.
+ This parameter is ignored if allowComments is false.
+ - `"allowComments": false or true`
+ - true if comments are allowed.
+ - `"strictRoot": false or true`
+ - true if root must be either an array or an object value
+ - `"allowDroppedNullPlaceholders": false or true`
+ - true if dropped null placeholders are allowed. (See StreamWriterBuilder.)
+ - `"allowNumericKeys": false or true`
+ - true if numeric object keys are allowed.
+ - `"allowSingleQuotes": false or true`
+ - true if '' are allowed for strings (both keys and values)
+ - `"stackLimit": integer`
+ - Exceeding stackLimit (recursive depth of `readValue()`) will
+ cause an exception.
+ - This is a security issue (seg-faults caused by deeply nested JSON),
+ so the default is low.
+ - `"failIfExtra": false or true`
+ - If true, `parse()` returns false when extra non-whitespace trails
+ the JSON value in the input string.
+ - `"rejectDupKeys": false or true`
+ - If true, `parse()` returns false when a key is duplicated within an object.
+ - `"allowSpecialFloats": false or true`
+ - If true, special float values (NaNs and infinities) are allowed
+ and their values are lossfree restorable.
+
+ You can examine 'settings_` yourself
+ to see the defaults. You can also write and read them just like any
+ JSON Value.
+ \sa setDefaults()
+ */
+ Json::Value settings_;
+
+ CharReaderBuilder();
+ ~CharReaderBuilder() JSONCPP_OVERRIDE;
+
+ CharReader* newCharReader() const JSONCPP_OVERRIDE;
+
+ /** \return true if 'settings' are legal and consistent;
+ * otherwise, indicate bad settings via 'invalid'.
+ */
+ bool validate(Json::Value* invalid) const;
+
+ /** A simple way to update a specific setting.
+ */
+ Value& operator[](JSONCPP_STRING key);
+
+ /** Called by ctor, but you can use this to reset settings_.
+ * \pre 'settings' != NULL (but Json::null is fine)
+ * \remark Defaults:
+ * snippet src/lib_json/json_reader.cpp CharReaderBuilderDefaults
+ */
+ static void setDefaults(Json::Value* settings);
+ /** Same as old Features::strictMode().
+ * \pre 'settings' != NULL (but Json::null is fine)
+ * \remark Defaults:
+ * snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode
+ */
+ static void strictMode(Json::Value* settings);
};
+/** Consume entire stream and use its begin/end.
+ * Someday we might have a real StreamReader, but for now this
+ * is convenient.
+ */
+bool JSON_API parseFromStream(
+ CharReader::Factory const&,
+ JSONCPP_ISTREAM&,
+ Value* root, std::string* errs);
+
/** \brief Read from 'sin' into 'root'.
Always keep comments from the input JSON.
@@ -263,10 +400,14 @@ private:
\throw std::exception on parse error.
\see Json::operator<<()
*/
-JSON_API std::istream& operator>>(std::istream&, Value&);
+JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);
} // namespace Json
+#if !defined(__SUNPRO_CC)
+#pragma pack(pop)
+#endif
+
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
#pragma warning(pop)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
diff --git a/Utilities/cmjsoncpp/include/json/value.h b/Utilities/cmjsoncpp/include/json/value.h
index 197a856..7b90c5a 100644
--- a/Utilities/cmjsoncpp/include/json/value.h
+++ b/Utilities/cmjsoncpp/include/json/value.h
@@ -1,4 +1,4 @@
-// Copyright 2007-2010 Baptiste Lepilleur
+// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -11,6 +11,7 @@
#endif // if !defined(JSON_IS_AMALGAMATION)
#include <string>
#include <vector>
+#include <exception>
#ifndef JSON_USE_CPPTL_SMALLMAP
#include <map>
@@ -21,6 +22,19 @@
#include <cpptl/forwards.h>
#endif
+//Conditional NORETURN attribute on the throw functions would:
+// a) suppress false positives from static code analysis
+// b) possibly improve optimization opportunities.
+#if !defined(JSONCPP_NORETURN)
+# if defined(_MSC_VER)
+# define JSONCPP_NORETURN __declspec(noreturn)
+# elif defined(__GNUC__)
+# define JSONCPP_NORETURN __attribute__ ((__noreturn__))
+# else
+# define JSONCPP_NORETURN
+# endif
+#endif
+
// Disable warning C4251: <data member>: <type> needs to have dll-interface to
// be used by...
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
@@ -28,10 +42,54 @@
#pragma warning(disable : 4251)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#if !defined(__SUNPRO_CC)
+#pragma pack(push, 8)
+#endif
+
/** \brief JSON (JavaScript Object Notation).
*/
namespace Json {
+/** Base class for all exceptions we throw.
+ *
+ * We use nothing but these internally. Of course, STL can throw others.
+ */
+class JSON_API Exception : public std::exception {
+public:
+ Exception(JSONCPP_STRING const& msg);
+ ~Exception() JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
+ char const* what() const JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
+protected:
+ JSONCPP_STRING msg_;
+};
+
+/** Exceptions which the user cannot easily avoid.
+ *
+ * E.g. out-of-memory (when we use malloc), stack-overflow, malicious input
+ *
+ * \remark derived from Json::Exception
+ */
+class JSON_API RuntimeError : public Exception {
+public:
+ RuntimeError(JSONCPP_STRING const& msg);
+};
+
+/** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
+ *
+ * These are precondition-violations (user bugs) and internal errors (our bugs).
+ *
+ * \remark derived from Json::Exception
+ */
+class JSON_API LogicError : public Exception {
+public:
+ LogicError(JSONCPP_STRING const& msg);
+};
+
+/// used internally
+JSONCPP_NORETURN void throwRuntimeError(JSONCPP_STRING const& msg);
+/// used internally
+JSONCPP_NORETURN void throwLogicError(JSONCPP_STRING const& msg);
+
/** \brief Type of the value held by a Value object.
*/
enum ValueType {
@@ -74,14 +132,14 @@ enum CommentPlacement {
*/
class JSON_API StaticString {
public:
- explicit StaticString(const char* czstring) : str_(czstring) {}
+ explicit StaticString(const char* czstring) : c_str_(czstring) {}
- operator const char*() const { return str_; }
+ operator const char*() const { return c_str_; }
- const char* c_str() const { return str_; }
+ const char* c_str() const { return c_str_; }
private:
- const char* str_;
+ const char* c_str_;
};
/** \brief Represents a <a HREF="http://www.json.org">JSON</a> value.
@@ -99,28 +157,29 @@ private:
* The type of the held value is represented by a #ValueType and
* can be obtained using type().
*
- * values of an #objectValue or #arrayValue can be accessed using operator[]()
- *methods.
- * Non const methods will automatically create the a #nullValue element
+ * Values of an #objectValue or #arrayValue can be accessed using operator[]()
+ * methods.
+ * Non-const methods will automatically create the a #nullValue element
* if it does not exist.
- * The sequence of an #arrayValue will be automatically resize and initialized
+ * The sequence of an #arrayValue will be automatically resized and initialized
* with #nullValue. resize() can be used to enlarge or truncate an #arrayValue.
*
- * The get() methods can be used to obtanis default value in the case the
- *required element
- * does not exist.
+ * The get() methods can be used to obtain default value in the case the
+ * required element does not exist.
*
* It is possible to iterate over the list of a #objectValue values using
* the getMemberNames() method.
+ *
+ * \note #Value string-length fit in size_t, but keys must be < 2^30.
+ * (The reason is an implementation detail.) A #CharReader will raise an
+ * exception if a bound is exceeded to avoid security holes in your app,
+ * but the Value API does *not* check bounds. That is the responsibility
+ * of the caller.
*/
class JSON_API Value {
friend class ValueIteratorBase;
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- friend class ValueInternalLink;
- friend class ValueInternalMap;
-#endif
public:
- typedef std::vector<std::string> Members;
+ typedef std::vector<JSONCPP_STRING> Members;
typedef ValueIterator iterator;
typedef ValueConstIterator const_iterator;
typedef Json::UInt UInt;
@@ -133,7 +192,10 @@ public:
typedef Json::LargestUInt LargestUInt;
typedef Json::ArrayIndex ArrayIndex;
- static const Value& null;
+ static const Value& null; ///< We regret this reference to a global instance; prefer the simpler Value().
+ static const Value& nullRef; ///< just a kludge for binary-compatibility; same as null
+ static Value const& nullSingleton(); ///< Prefer this to null or nullRef.
+
/// Minimum signed integer value that can be stored in a Json::Value.
static const LargestInt minLargestInt;
/// Maximum signed integer value that can be stored in a Json::Value.
@@ -159,7 +221,6 @@ public:
private:
#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
class CZString {
public:
enum DuplicationPolicy {
@@ -168,20 +229,39 @@ private:
duplicateOnCopy
};
CZString(ArrayIndex index);
- CZString(const char* cstr, DuplicationPolicy allocate);
- CZString(const CZString& other);
+ CZString(char const* str, unsigned length, DuplicationPolicy allocate);
+ CZString(CZString const& other);
+#if JSON_HAS_RVALUE_REFERENCES
+ CZString(CZString&& other);
+#endif
~CZString();
- CZString& operator=(CZString other);
- bool operator<(const CZString& other) const;
- bool operator==(const CZString& other) const;
+ CZString& operator=(const CZString& other);
+
+#if JSON_HAS_RVALUE_REFERENCES
+ CZString& operator=(CZString&& other);
+#endif
+
+ bool operator<(CZString const& other) const;
+ bool operator==(CZString const& other) const;
ArrayIndex index() const;
- const char* c_str() const;
+ //const char* c_str() const; ///< deprecated
+ char const* data() const;
+ unsigned length() const;
bool isStaticString() const;
private:
void swap(CZString& other);
- const char* cstr_;
- ArrayIndex index_;
+
+ struct StringStorage {
+ unsigned policy_: 2;
+ unsigned length_: 30; // 1GB max
+ };
+
+ char const* cstr_; // actually, a prefixed string, unless policy is noDup
+ union {
+ ArrayIndex index_;
+ StringStorage storage_;
+ };
};
public:
@@ -190,7 +270,6 @@ public:
#else
typedef CppTL::SmallMap<CZString, Value> ObjectValues;
#endif // ifndef JSON_USE_CPPTL_SMALLMAP
-#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP
#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
public:
@@ -217,47 +296,72 @@ Json::Value obj_value(Json::objectValue); // {}
Value(UInt64 value);
#endif // if defined(JSON_HAS_INT64)
Value(double value);
- Value(const char* value);
- Value(const char* beginValue, const char* endValue);
+ Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.)
+ Value(const char* begin, const char* end); ///< Copy all, incl zeroes.
/** \brief Constructs a value from a static string.
* Like other value string constructor but do not duplicate the string for
* internal storage. The given string must remain alive after the call to this
* constructor.
+ * \note This works only for null-terminated strings. (We cannot change the
+ * size of this class, so we have nowhere to store the length,
+ * which might be computed later for various operations.)
+ *
* Example of usage:
* \code
- * Json::Value aValue( StaticString("some text") );
+ * static StaticString foo("some text");
+ * Json::Value aValue(foo);
* \endcode
*/
Value(const StaticString& value);
- Value(const std::string& value);
+ Value(const JSONCPP_STRING& value); ///< Copy data() til size(). Embedded zeroes too.
#ifdef JSON_USE_CPPTL
Value(const CppTL::ConstString& value);
#endif
Value(bool value);
+ /// Deep copy.
Value(const Value& other);
+#if JSON_HAS_RVALUE_REFERENCES
+ /// Move constructor
+ Value(Value&& other);
+#endif
~Value();
+ /// Deep copy, then swap(other).
+ /// \note Over-write existing comments. To preserve comments, use #swapPayload().
Value& operator=(Value other);
- /// Swap values.
- /// \note Currently, comments are intentionally not swapped, for
- /// both logic and efficiency.
+
+ /// Swap everything.
void swap(Value& other);
+ /// Swap values but leave comments and source offsets in place.
+ void swapPayload(Value& other);
+
+ /// copy everything.
+ void copy(const Value& other);
+ /// copy values but leave comments and source offsets in place.
+ void copyPayload(const Value& other);
ValueType type() const;
+ /// Compare payload only, not comments etc.
bool operator<(const Value& other) const;
bool operator<=(const Value& other) const;
bool operator>=(const Value& other) const;
bool operator>(const Value& other) const;
-
bool operator==(const Value& other) const;
bool operator!=(const Value& other) const;
-
int compare(const Value& other) const;
- const char* asCString() const;
- std::string asString() const;
+ const char* asCString() const; ///< Embedded zeroes could cause you trouble!
+#if JSONCPP_USING_SECURE_MEMORY
+ unsigned getCStringLength() const; //Allows you to understand the length of the CString
+#endif
+ JSONCPP_STRING asString() const; ///< Embedded zeroes are possible.
+ /** Get raw char* of string-value.
+ * \return false if !string. (Seg-fault if str or end are NULL.)
+ */
+ bool getString(
+ char const** begin, char const** end) const;
#ifdef JSON_USE_CPPTL
CppTL::ConstString asConstString() const;
#endif
@@ -347,20 +451,28 @@ Json::Value obj_value(Json::objectValue); // {}
/// Equivalent to jsonvalue[jsonvalue.size()] = value;
Value& append(const Value& value);
+#if JSON_HAS_RVALUE_REFERENCES
+ Value& append(Value&& value);
+#endif
+
/// Access an object value by name, create a null member if it does not exist.
+ /// \note Because of our implementation, keys are limited to 2^30 -1 chars.
+ /// Exceeding that will cause an exception.
Value& operator[](const char* key);
/// Access an object value by name, returns null if there is no member with
/// that name.
const Value& operator[](const char* key) const;
/// Access an object value by name, create a null member if it does not exist.
- Value& operator[](const std::string& key);
+ /// \param key may contain embedded nulls.
+ Value& operator[](const JSONCPP_STRING& key);
/// Access an object value by name, returns null if there is no member with
/// that name.
- const Value& operator[](const std::string& key) const;
+ /// \param key may contain embedded nulls.
+ const Value& operator[](const JSONCPP_STRING& key) const;
/** \brief Access an object value by name, create a null member if it does not
exist.
- * If the object as no entry for that name, then the member name used to store
+ * If the object has no entry for that name, then the member name used to store
* the new entry is not duplicated.
* Example of use:
* \code
@@ -378,27 +490,71 @@ Json::Value obj_value(Json::objectValue); // {}
const Value& operator[](const CppTL::ConstString& key) const;
#endif
/// Return the member named key if it exist, defaultValue otherwise.
+ /// \note deep copy
Value get(const char* key, const Value& defaultValue) const;
/// Return the member named key if it exist, defaultValue otherwise.
- Value get(const std::string& key, const Value& defaultValue) const;
+ /// \note deep copy
+ /// \note key may contain embedded nulls.
+ Value get(const char* begin, const char* end, const Value& defaultValue) const;
+ /// Return the member named key if it exist, defaultValue otherwise.
+ /// \note deep copy
+ /// \param key may contain embedded nulls.
+ Value get(const JSONCPP_STRING& key, const Value& defaultValue) const;
#ifdef JSON_USE_CPPTL
/// Return the member named key if it exist, defaultValue otherwise.
+ /// \note deep copy
Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
#endif
+ /// Most general and efficient version of isMember()const, get()const,
+ /// and operator[]const
+ /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
+ Value const* find(char const* begin, char const* end) const;
+ /// Most general and efficient version of object-mutators.
+ /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
+ /// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue.
+ Value const* demand(char const* begin, char const* end);
/// \brief Remove and return the named member.
///
/// Do nothing if it did not exist.
/// \return the removed Value, or null.
/// \pre type() is objectValue or nullValue
/// \post type() is unchanged
+ /// deprecated
+ JSONCPP_DEPRECATED("")
Value removeMember(const char* key);
/// Same as removeMember(const char*)
- Value removeMember(const std::string& key);
+ /// \param key may contain embedded nulls.
+ /// deprecated
+ JSONCPP_DEPRECATED("")
+ Value removeMember(const JSONCPP_STRING& key);
+ /// Same as removeMember(const char* begin, const char* end, Value* removed),
+ /// but 'key' is null-terminated.
+ bool removeMember(const char* key, Value* removed);
+ /** \brief Remove the named map member.
+
+ Update 'removed' iff removed.
+ \param key may contain embedded nulls.
+ \return true iff removed (no exceptions)
+ */
+ bool removeMember(JSONCPP_STRING const& key, Value* removed);
+ /// Same as removeMember(JSONCPP_STRING const& key, Value* removed)
+ bool removeMember(const char* begin, const char* end, Value* removed);
+ /** \brief Remove the indexed array element.
+
+ O(n) expensive operations.
+ Update 'removed' iff removed.
+ \return true iff removed (no exceptions)
+ */
+ bool removeIndex(ArrayIndex i, Value* removed);
/// Return true if the object has a member named key.
+ /// \note 'key' must be null-terminated.
bool isMember(const char* key) const;
/// Return true if the object has a member named key.
- bool isMember(const std::string& key) const;
+ /// \param key may contain embedded nulls.
+ bool isMember(const JSONCPP_STRING& key) const;
+ /// Same as isMember(JSONCPP_STRING const& key)const
+ bool isMember(const char* begin, const char* end) const;
#ifdef JSON_USE_CPPTL
/// Return true if the object has a member named key.
bool isMember(const CppTL::ConstString& key) const;
@@ -416,15 +572,18 @@ Json::Value obj_value(Json::objectValue); // {}
// EnumValues enumValues() const;
//# endif
- /// Comments must be //... or /* ... */
+ /// deprecated Always pass len.
+ JSONCPP_DEPRECATED("Use setComment(JSONCPP_STRING const&) instead.")
void setComment(const char* comment, CommentPlacement placement);
/// Comments must be //... or /* ... */
- void setComment(const std::string& comment, CommentPlacement placement);
+ void setComment(const char* comment, size_t len, CommentPlacement placement);
+ /// Comments must be //... or /* ... */
+ void setComment(const JSONCPP_STRING& comment, CommentPlacement placement);
bool hasComment(CommentPlacement placement) const;
/// Include delimiters and embedded newlines.
- std::string getComment(CommentPlacement placement) const;
+ JSONCPP_STRING getComment(CommentPlacement placement) const;
- std::string toStyledString() const;
+ JSONCPP_STRING toStyledString() const;
const_iterator begin() const;
const_iterator end() const;
@@ -434,34 +593,22 @@ Json::Value obj_value(Json::objectValue); // {}
// Accessors for the [start, limit) range of bytes within the JSON text from
// which this value was parsed, if any.
- void setOffsetStart(size_t start);
- void setOffsetLimit(size_t limit);
- size_t getOffsetStart() const;
- size_t getOffsetLimit() const;
+ void setOffsetStart(ptrdiff_t start);
+ void setOffsetLimit(ptrdiff_t limit);
+ ptrdiff_t getOffsetStart() const;
+ ptrdiff_t getOffsetLimit() const;
private:
void initBasic(ValueType type, bool allocated = false);
- Value& resolveReference(const char* key, bool isStatic);
-
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- inline bool isItemAvailable() const { return itemIsUsed_ == 0; }
+ Value& resolveReference(const char* key);
+ Value& resolveReference(const char* key, const char* end);
- inline void setItemUsed(bool isUsed = true) { itemIsUsed_ = isUsed ? 1 : 0; }
-
- inline bool isMemberNameStatic() const { return memberNameIsStatic_ == 0; }
-
- inline void setMemberNameIsStatic(bool isStatic) {
- memberNameIsStatic_ = isStatic ? 1 : 0;
- }
-#endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP
-
-private:
struct CommentInfo {
CommentInfo();
~CommentInfo();
- void setComment(const char* text);
+ void setComment(const char* text, size_t len);
char* comment_;
};
@@ -480,26 +627,18 @@ private:
LargestUInt uint_;
double real_;
bool bool_;
- char* string_;
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- ValueInternalArray* array_;
- ValueInternalMap* map_;
-#else
+ char* string_; // actually ptr to unsigned, followed by str, unless !allocated_
ObjectValues* map_;
-#endif
} value_;
ValueType type_ : 8;
- int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container.
- int memberNameIsStatic_ : 1; // used by the ValueInternalMap container.
-#endif
+ unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
+ // If not allocated_, string_ must be null-terminated.
CommentInfo* comments_;
// [start, limit) byte offsets in the source JSON text from which this Value
// was extracted.
- size_t start_;
- size_t limit_;
+ ptrdiff_t start_;
+ ptrdiff_t limit_;
};
/** \brief Experimental and untested: represents an element of the "path" to
@@ -512,7 +651,7 @@ public:
PathArgument();
PathArgument(ArrayIndex index);
PathArgument(const char* key);
- PathArgument(const std::string& key);
+ PathArgument(const JSONCPP_STRING& key);
private:
enum Kind {
@@ -520,7 +659,7 @@ private:
kindIndex,
kindKey
};
- std::string key_;
+ JSONCPP_STRING key_;
ArrayIndex index_;
Kind kind_;
};
@@ -538,7 +677,7 @@ private:
*/
class JSON_API Path {
public:
- Path(const std::string& path,
+ Path(const JSONCPP_STRING& path,
const PathArgument& a1 = PathArgument(),
const PathArgument& a2 = PathArgument(),
const PathArgument& a3 = PathArgument(),
@@ -555,355 +694,16 @@ private:
typedef std::vector<const PathArgument*> InArgs;
typedef std::vector<PathArgument> Args;
- void makePath(const std::string& path, const InArgs& in);
- void addPathInArg(const std::string& path,
+ void makePath(const JSONCPP_STRING& path, const InArgs& in);
+ void addPathInArg(const JSONCPP_STRING& path,
const InArgs& in,
InArgs::const_iterator& itInArg,
PathArgument::Kind kind);
- void invalidPath(const std::string& path, int location);
+ void invalidPath(const JSONCPP_STRING& path, int location);
Args args_;
};
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
-/** \brief Allocator to customize Value internal map.
- * Below is an example of a simple implementation (default implementation
- actually
- * use memory pool for speed).
- * \code
- class DefaultValueMapAllocator : public ValueMapAllocator
- {
- public: // overridden from ValueMapAllocator
- virtual ValueInternalMap *newMap()
- {
- return new ValueInternalMap();
- }
-
- virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )
- {
- return new ValueInternalMap( other );
- }
-
- virtual void destructMap( ValueInternalMap *map )
- {
- delete map;
- }
-
- virtual ValueInternalLink *allocateMapBuckets( unsigned int size )
- {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets( ValueInternalLink *links )
- {
- delete [] links;
- }
-
- virtual ValueInternalLink *allocateMapLink()
- {
- return new ValueInternalLink();
- }
-
- virtual void releaseMapLink( ValueInternalLink *link )
- {
- delete link;
- }
- };
- * \endcode
- */
-class JSON_API ValueMapAllocator {
-public:
- virtual ~ValueMapAllocator();
- virtual ValueInternalMap* newMap() = 0;
- virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) = 0;
- virtual void destructMap(ValueInternalMap* map) = 0;
- virtual ValueInternalLink* allocateMapBuckets(unsigned int size) = 0;
- virtual void releaseMapBuckets(ValueInternalLink* links) = 0;
- virtual ValueInternalLink* allocateMapLink() = 0;
- virtual void releaseMapLink(ValueInternalLink* link) = 0;
-};
-
-/** \brief ValueInternalMap hash-map bucket chain link (for internal use only).
- * \internal previous_ & next_ allows for bidirectional traversal.
- */
-class JSON_API ValueInternalLink {
-public:
- enum {
- itemPerLink = 6
- }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture.
- enum InternalFlags {
- flagAvailable = 0,
- flagUsed = 1
- };
-
- ValueInternalLink();
-
- ~ValueInternalLink();
-
- Value items_[itemPerLink];
- char* keys_[itemPerLink];
- ValueInternalLink* previous_;
- ValueInternalLink* next_;
-};
-
-/** \brief A linked page based hash-table implementation used internally by
- *Value.
- * \internal ValueInternalMap is a tradional bucket based hash-table, with a
- *linked
- * list in each bucket to handle collision. There is an addional twist in that
- * each node of the collision linked list is a page containing a fixed amount of
- * value. This provides a better compromise between memory usage and speed.
- *
- * Each bucket is made up of a chained list of ValueInternalLink. The last
- * link of a given bucket can be found in the 'previous_' field of the following
- *bucket.
- * The last link of the last bucket is stored in tailLink_ as it has no
- *following bucket.
- * Only the last link of a bucket may contains 'available' item. The last link
- *always
- * contains at least one element unless is it the bucket one very first link.
- */
-class JSON_API ValueInternalMap {
- friend class ValueIteratorBase;
- friend class Value;
-
-public:
- typedef unsigned int HashKey;
- typedef unsigned int BucketIndex;
-
-#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
- struct IteratorState {
- IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {}
- ValueInternalMap* map_;
- ValueInternalLink* link_;
- BucketIndex itemIndex_;
- BucketIndex bucketIndex_;
- };
-#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
- ValueInternalMap();
- ValueInternalMap(const ValueInternalMap& other);
- ValueInternalMap& operator=(ValueInternalMap other);
- ~ValueInternalMap();
-
- void swap(ValueInternalMap& other);
-
- BucketIndex size() const;
-
- void clear();
-
- bool reserveDelta(BucketIndex growth);
-
- bool reserve(BucketIndex newItemCount);
-
- const Value* find(const char* key) const;
-
- Value* find(const char* key);
-
- Value& resolveReference(const char* key, bool isStatic);
-
- void remove(const char* key);
-
- void doActualRemove(ValueInternalLink* link,
- BucketIndex index,
- BucketIndex bucketIndex);
-
- ValueInternalLink*& getLastLinkInBucket(BucketIndex bucketIndex);
-
- Value& setNewItem(const char* key,
- bool isStatic,
- ValueInternalLink* link,
- BucketIndex index);
-
- Value& unsafeAdd(const char* key, bool isStatic, HashKey hashedKey);
-
- HashKey hash(const char* key) const;
-
- int compare(const ValueInternalMap& other) const;
-
-private:
- void makeBeginIterator(IteratorState& it) const;
- void makeEndIterator(IteratorState& it) const;
- static bool equals(const IteratorState& x, const IteratorState& other);
- static void increment(IteratorState& iterator);
- static void incrementBucket(IteratorState& iterator);
- static void decrement(IteratorState& iterator);
- static const char* key(const IteratorState& iterator);
- static const char* key(const IteratorState& iterator, bool& isStatic);
- static Value& value(const IteratorState& iterator);
- static int distance(const IteratorState& x, const IteratorState& y);
-
-private:
- ValueInternalLink* buckets_;
- ValueInternalLink* tailLink_;
- BucketIndex bucketsSize_;
- BucketIndex itemCount_;
-};
-
-/** \brief A simplified deque implementation used internally by Value.
-* \internal
-* It is based on a list of fixed "page", each page contains a fixed number of
-*items.
-* Instead of using a linked-list, a array of pointer is used for fast item
-*look-up.
-* Look-up for an element is as follow:
-* - compute page index: pageIndex = itemIndex / itemsPerPage
-* - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage]
-*
-* Insertion is amortized constant time (only the array containing the index of
-*pointers
-* need to be reallocated when items are appended).
-*/
-class JSON_API ValueInternalArray {
- friend class Value;
- friend class ValueIteratorBase;
-
-public:
- enum {
- itemsPerPage = 8
- }; // should be a power of 2 for fast divide and modulo.
- typedef Value::ArrayIndex ArrayIndex;
- typedef unsigned int PageIndex;
-
-#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
- struct IteratorState // Must be a POD
- {
- IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {}
- ValueInternalArray* array_;
- Value** currentPageIndex_;
- unsigned int currentItemIndex_;
- };
-#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
- ValueInternalArray();
- ValueInternalArray(const ValueInternalArray& other);
- ValueInternalArray& operator=(ValueInternalArray other);
- ~ValueInternalArray();
- void swap(ValueInternalArray& other);
-
- void clear();
- void resize(ArrayIndex newSize);
-
- Value& resolveReference(ArrayIndex index);
-
- Value* find(ArrayIndex index) const;
-
- ArrayIndex size() const;
-
- int compare(const ValueInternalArray& other) const;
-
-private:
- static bool equals(const IteratorState& x, const IteratorState& other);
- static void increment(IteratorState& iterator);
- static void decrement(IteratorState& iterator);
- static Value& dereference(const IteratorState& iterator);
- static Value& unsafeDereference(const IteratorState& iterator);
- static int distance(const IteratorState& x, const IteratorState& y);
- static ArrayIndex indexOf(const IteratorState& iterator);
- void makeBeginIterator(IteratorState& it) const;
- void makeEndIterator(IteratorState& it) const;
- void makeIterator(IteratorState& it, ArrayIndex index) const;
-
- void makeIndexValid(ArrayIndex index);
-
- Value** pages_;
- ArrayIndex size_;
- PageIndex pageCount_;
-};
-
-/** \brief Experimental: do not use. Allocator to customize Value internal
-array.
- * Below is an example of a simple implementation (actual implementation use
- * memory pool).
- \code
-class DefaultValueArrayAllocator : public ValueArrayAllocator
-{
-public: // overridden from ValueArrayAllocator
-virtual ~DefaultValueArrayAllocator()
-{
-}
-
-virtual ValueInternalArray *newArray()
-{
- return new ValueInternalArray();
-}
-
-virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other )
-{
- return new ValueInternalArray( other );
-}
-
-virtual void destruct( ValueInternalArray *array )
-{
- delete array;
-}
-
-virtual void reallocateArrayPageIndex( Value **&indexes,
- ValueInternalArray::PageIndex
-&indexCount,
- ValueInternalArray::PageIndex
-minNewIndexCount )
-{
- ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1;
- if ( minNewIndexCount > newIndexCount )
- newIndexCount = minNewIndexCount;
- void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );
- if ( !newIndexes )
- throw std::bad_alloc();
- indexCount = newIndexCount;
- indexes = static_cast<Value **>( newIndexes );
-}
-virtual void releaseArrayPageIndex( Value **indexes,
- ValueInternalArray::PageIndex indexCount )
-{
- if ( indexes )
- free( indexes );
-}
-
-virtual Value *allocateArrayPage()
-{
- return static_cast<Value *>( malloc( sizeof(Value) *
-ValueInternalArray::itemsPerPage ) );
-}
-
-virtual void releaseArrayPage( Value *value )
-{
- if ( value )
- free( value );
-}
-};
- \endcode
- */
-class JSON_API ValueArrayAllocator {
-public:
- virtual ~ValueArrayAllocator();
- virtual ValueInternalArray* newArray() = 0;
- virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) = 0;
- virtual void destructArray(ValueInternalArray* array) = 0;
- /** \brief Reallocate array page index.
- * Reallocates an array of pointer on each page.
- * \param indexes [input] pointer on the current index. May be \c NULL.
- * [output] pointer on the new index of at least
- * \a minNewIndexCount pages.
- * \param indexCount [input] current number of pages in the index.
- * [output] number of page the reallocated index can handle.
- * \b MUST be >= \a minNewIndexCount.
- * \param minNewIndexCount Minimum number of page the new index must be able
- * to
- * handle.
- */
- virtual void
- reallocateArrayPageIndex(Value**& indexes,
- ValueInternalArray::PageIndex& indexCount,
- ValueInternalArray::PageIndex minNewIndexCount) = 0;
- virtual void
- releaseArrayPageIndex(Value** indexes,
- ValueInternalArray::PageIndex indexCount) = 0;
- virtual Value* allocateArrayPage() = 0;
- virtual void releaseArrayPage(Value* value) = 0;
-};
-#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP
-
/** \brief base class for Value iterators.
*
*/
@@ -914,32 +714,35 @@ public:
typedef int difference_type;
typedef ValueIteratorBase SelfType;
- ValueIteratorBase();
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
-#else
- ValueIteratorBase(const ValueInternalArray::IteratorState& state);
- ValueIteratorBase(const ValueInternalMap::IteratorState& state);
-#endif
-
bool operator==(const SelfType& other) const { return isEqual(other); }
bool operator!=(const SelfType& other) const { return !isEqual(other); }
difference_type operator-(const SelfType& other) const {
- return computeDistance(other);
+ return other.computeDistance(*this);
}
/// Return either the index or the member name of the referenced value as a
/// Value.
Value key() const;
- /// Return the index of the referenced Value. -1 if it is not an arrayValue.
+ /// Return the index of the referenced Value, or -1 if it is not an arrayValue.
UInt index() const;
+ /// Return the member name of the referenced Value, or "" if it is not an
+ /// objectValue.
+ /// \note Avoid `c_str()` on result, as embedded zeroes are possible.
+ JSONCPP_STRING name() const;
+
/// Return the member name of the referenced Value. "" if it is not an
/// objectValue.
- const char* memberName() const;
+ /// deprecated This cannot be used for UTF-8 strings, since there can be embedded nulls.
+ JSONCPP_DEPRECATED("Use `key = name();` instead.")
+ char const* memberName() const;
+ /// Return the member name of the referenced Value, or NULL if it is not an
+ /// objectValue.
+ /// \note Better version than memberName(). Allows embedded nulls.
+ char const* memberName(char const** end) const;
protected:
Value& deref() const;
@@ -955,17 +758,15 @@ protected:
void copy(const SelfType& other);
private:
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
Value::ObjectValues::iterator current_;
// Indicates that iterator is for a null value.
bool isNull_;
-#else
- union {
- ValueInternalArray::IteratorState array_;
- ValueInternalMap::IteratorState map_;
- } iterator_;
- bool isArray_;
-#endif
+
+public:
+ // For some reason, BORLAND needs these at the end, rather
+ // than earlier. No idea why.
+ ValueIteratorBase();
+ explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
};
/** \brief const iterator for object and array value.
@@ -976,23 +777,19 @@ class JSON_API ValueConstIterator : public ValueIteratorBase {
public:
typedef const Value value_type;
- typedef unsigned int size_t;
- typedef int difference_type;
+ //typedef unsigned int size_t;
+ //typedef int difference_type;
typedef const Value& reference;
typedef const Value* pointer;
typedef ValueConstIterator SelfType;
ValueConstIterator();
+ ValueConstIterator(ValueIterator const& other);
private:
-/*! \internal Use by Value to create an iterator.
+/*! internal Use by Value to create an iterator.
*/
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
-#else
- ValueConstIterator(const ValueInternalArray::IteratorState& state);
- ValueConstIterator(const ValueInternalMap::IteratorState& state);
-#endif
public:
SelfType& operator=(const ValueIteratorBase& other);
@@ -1037,18 +834,13 @@ public:
typedef ValueIterator SelfType;
ValueIterator();
- ValueIterator(const ValueConstIterator& other);
+ explicit ValueIterator(const ValueConstIterator& other);
ValueIterator(const ValueIterator& other);
private:
-/*! \internal Use by Value to create an iterator.
+/*! internal Use by Value to create an iterator.
*/
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
explicit ValueIterator(const Value::ObjectValues::iterator& current);
-#else
- ValueIterator(const ValueInternalArray::IteratorState& state);
- ValueIterator(const ValueInternalMap::IteratorState& state);
-#endif
public:
SelfType& operator=(const SelfType& other);
@@ -1081,6 +873,17 @@ public:
} // namespace Json
+
+namespace std {
+/// Specialize std::swap() for Json::Value.
+template<>
+inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
+}
+
+#if !defined(__SUNPRO_CC)
+#pragma pack(pop)
+#endif
+
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
#pragma warning(pop)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
diff --git a/Utilities/cmjsoncpp/include/json/version.h b/Utilities/cmjsoncpp/include/json/version.h
index 6fe0682..d953961 100644
--- a/Utilities/cmjsoncpp/include/json/version.h
+++ b/Utilities/cmjsoncpp/include/json/version.h
@@ -1,14 +1,20 @@
-// DO NOT EDIT. This file is generated by CMake from "version"
-// and "version.h.in" files.
+// DO NOT EDIT. This file (and "version") is generated by CMake.
// Run CMake configure step to update it.
#ifndef JSON_VERSION_H_INCLUDED
# define JSON_VERSION_H_INCLUDED
-# define JSONCPP_VERSION_STRING "1.0.0"
+# define JSONCPP_VERSION_STRING "1.8.2"
# define JSONCPP_VERSION_MAJOR 1
-# define JSONCPP_VERSION_MINOR 0
-# define JSONCPP_VERSION_PATCH 0
+# define JSONCPP_VERSION_MINOR 8
+# define JSONCPP_VERSION_PATCH 2
# define JSONCPP_VERSION_QUALIFIER
# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
+#ifdef JSONCPP_USING_SECURE_MEMORY
+#undef JSONCPP_USING_SECURE_MEMORY
+#endif
+#define JSONCPP_USING_SECURE_MEMORY 0
+// If non-zero, the library zeroes any memory that it has allocated before
+// it frees its memory.
+
#endif // JSON_VERSION_H_INCLUDED
diff --git a/Utilities/cmjsoncpp/include/json/writer.h b/Utilities/cmjsoncpp/include/json/writer.h
index 10863b0..d3ae62b 100644
--- a/Utilities/cmjsoncpp/include/json/writer.h
+++ b/Utilities/cmjsoncpp/include/json/writer.h
@@ -1,4 +1,4 @@
-// Copyright 2007-2010 Baptiste Lepilleur
+// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -12,6 +12,7 @@
#include <iosfwd>
#include <vector>
#include <string>
+#include <ostream>
// Disable warning C4251: <data member>: <type> needs to have dll-interface to
// be used by...
@@ -20,17 +21,133 @@
#pragma warning(disable : 4251)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#if !defined(__SUNPRO_CC)
+#pragma pack(push, 8)
+#endif
+
namespace Json {
class Value;
+/**
+
+Usage:
+\code
+ using namespace Json;
+ void writeToStdout(StreamWriter::Factory const& factory, Value const& value) {
+ std::unique_ptr<StreamWriter> const writer(
+ factory.newStreamWriter());
+ writer->write(value, &std::cout);
+ std::cout << std::endl; // add lf and flush
+ }
+\endcode
+*/
+class JSON_API StreamWriter {
+protected:
+ JSONCPP_OSTREAM* sout_; // not owned; will not delete
+public:
+ StreamWriter();
+ virtual ~StreamWriter();
+ /** Write Value into document as configured in sub-class.
+ Do not take ownership of sout, but maintain a reference during function.
+ \pre sout != NULL
+ \return zero on success (For now, we always return zero, so check the stream instead.)
+ \throw std::exception possibly, depending on configuration
+ */
+ virtual int write(Value const& root, JSONCPP_OSTREAM* sout) = 0;
+
+ /** \brief A simple abstract factory.
+ */
+ class JSON_API Factory {
+ public:
+ virtual ~Factory();
+ /** \brief Allocate a CharReader via operator new().
+ * \throw std::exception if something goes wrong (e.g. invalid settings)
+ */
+ virtual StreamWriter* newStreamWriter() const = 0;
+ }; // Factory
+}; // StreamWriter
+
+/** \brief Write into stringstream, then return string, for convenience.
+ * A StreamWriter will be created from the factory, used, and then deleted.
+ */
+JSONCPP_STRING JSON_API writeString(StreamWriter::Factory const& factory, Value const& root);
+
+
+/** \brief Build a StreamWriter implementation.
+
+Usage:
+\code
+ using namespace Json;
+ Value value = ...;
+ StreamWriterBuilder builder;
+ builder["commentStyle"] = "None";
+ builder["indentation"] = " "; // or whatever you like
+ std::unique_ptr<Json::StreamWriter> writer(
+ builder.newStreamWriter());
+ writer->write(value, &std::cout);
+ std::cout << std::endl; // add lf and flush
+\endcode
+*/
+class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
+public:
+ // Note: We use a Json::Value so that we can add data-members to this class
+ // without a major version bump.
+ /** Configuration of this builder.
+ Available settings (case-sensitive):
+ - "commentStyle": "None" or "All"
+ - "indentation": "<anything>"
+ - "enableYAMLCompatibility": false or true
+ - slightly change the whitespace around colons
+ - "dropNullPlaceholders": false or true
+ - Drop the "null" string from the writer's output for nullValues.
+ Strictly speaking, this is not valid JSON. But when the output is being
+ fed to a browser's Javascript, it makes for smaller output and the
+ browser can handle the output just fine.
+ - "useSpecialFloats": false or true
+ - If true, outputs non-finite floating point values in the following way:
+ NaN values as "NaN", positive infinity as "Infinity", and negative infinity
+ as "-Infinity".
+
+ You can examine 'settings_` yourself
+ to see the defaults. You can also write and read them just like any
+ JSON Value.
+ \sa setDefaults()
+ */
+ Json::Value settings_;
+
+ StreamWriterBuilder();
+ ~StreamWriterBuilder() JSONCPP_OVERRIDE;
+
+ /**
+ * \throw std::exception if something goes wrong (e.g. invalid settings)
+ */
+ StreamWriter* newStreamWriter() const JSONCPP_OVERRIDE;
+
+ /** \return true if 'settings' are legal and consistent;
+ * otherwise, indicate bad settings via 'invalid'.
+ */
+ bool validate(Json::Value* invalid) const;
+ /** A simple way to update a specific setting.
+ */
+ Value& operator[](JSONCPP_STRING key);
+
+ /** Called by ctor, but you can use this to reset settings_.
+ * \pre 'settings' != NULL (but Json::null is fine)
+ * \remark Defaults:
+ * snippet src/lib_json/json_writer.cpp StreamWriterBuilderDefaults
+ */
+ static void setDefaults(Json::Value* settings);
+};
+
/** \brief Abstract class for writers.
+ * deprecated Use StreamWriter. (And really, this is an implementation detail.)
*/
-class JSON_API Writer {
+class JSONCPP_DEPRECATED("Use StreamWriter instead") JSON_API Writer {
public:
virtual ~Writer();
- virtual std::string write(const Value& root) = 0;
+ virtual JSONCPP_STRING write(const Value& root) = 0;
};
/** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format
@@ -40,11 +157,13 @@ public:
*consumption,
* but may be usefull to support feature such as RPC where bandwith is limited.
* \sa Reader, Value
+ * deprecated Use StreamWriterBuilder.
*/
-class JSON_API FastWriter : public Writer {
+class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API FastWriter : public Writer {
+
public:
FastWriter();
- virtual ~FastWriter() {}
+ ~FastWriter() JSONCPP_OVERRIDE {}
void enableYAMLCompatibility();
@@ -58,12 +177,12 @@ public:
void omitEndingLineFeed();
public: // overridden from Writer
- virtual std::string write(const Value& root);
+ JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;
private:
void writeValue(const Value& value);
- std::string document_;
+ JSONCPP_STRING document_;
bool yamlCompatiblityEnabled_;
bool dropNullPlaceholders_;
bool omitEndingLineFeed_;
@@ -91,40 +210,41 @@ private:
*#CommentPlacement.
*
* \sa Reader, Value, Value::setComment()
+ * deprecated Use StreamWriterBuilder.
*/
-class JSON_API StyledWriter : public Writer {
+class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API StyledWriter : public Writer {
public:
StyledWriter();
- virtual ~StyledWriter() {}
+ ~StyledWriter() JSONCPP_OVERRIDE {}
public: // overridden from Writer
/** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
* \param root Value to serialize.
* \return String containing the JSON document that represents the root value.
*/
- virtual std::string write(const Value& root);
+ JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;
private:
void writeValue(const Value& value);
void writeArrayValue(const Value& value);
bool isMultineArray(const Value& value);
- void pushValue(const std::string& value);
+ void pushValue(const JSONCPP_STRING& value);
void writeIndent();
- void writeWithIndent(const std::string& value);
+ void writeWithIndent(const JSONCPP_STRING& value);
void indent();
void unindent();
void writeCommentBeforeValue(const Value& root);
void writeCommentAfterValueOnSameLine(const Value& root);
bool hasCommentForValue(const Value& value);
- static std::string normalizeEOL(const std::string& text);
+ static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text);
- typedef std::vector<std::string> ChildValues;
+ typedef std::vector<JSONCPP_STRING> ChildValues;
ChildValues childValues_;
- std::string document_;
- std::string indentString_;
- int rightMargin_;
- int indentSize_;
+ JSONCPP_STRING document_;
+ JSONCPP_STRING indentString_;
+ unsigned int rightMargin_;
+ unsigned int indentSize_;
bool addChildValues_;
};
@@ -151,10 +271,14 @@ private:
#CommentPlacement.
*
* \sa Reader, Value, Value::setComment()
+ * deprecated Use StreamWriterBuilder.
*/
-class JSON_API StyledStreamWriter {
+class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API StyledStreamWriter {
public:
- StyledStreamWriter(std::string indentation = "\t");
+/**
+ * \param indentation Each level will be indented by this amount extra.
+ */
+ StyledStreamWriter(JSONCPP_STRING indentation = "\t");
~StyledStreamWriter() {}
public:
@@ -164,48 +288,53 @@ public:
* \note There is no point in deriving from Writer, since write() should not
* return a value.
*/
- void write(std::ostream& out, const Value& root);
+ void write(JSONCPP_OSTREAM& out, const Value& root);
private:
void writeValue(const Value& value);
void writeArrayValue(const Value& value);
bool isMultineArray(const Value& value);
- void pushValue(const std::string& value);
+ void pushValue(const JSONCPP_STRING& value);
void writeIndent();
- void writeWithIndent(const std::string& value);
+ void writeWithIndent(const JSONCPP_STRING& value);
void indent();
void unindent();
void writeCommentBeforeValue(const Value& root);
void writeCommentAfterValueOnSameLine(const Value& root);
bool hasCommentForValue(const Value& value);
- static std::string normalizeEOL(const std::string& text);
+ static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text);
- typedef std::vector<std::string> ChildValues;
+ typedef std::vector<JSONCPP_STRING> ChildValues;
ChildValues childValues_;
- std::ostream* document_;
- std::string indentString_;
- int rightMargin_;
- std::string indentation_;
- bool addChildValues_;
+ JSONCPP_OSTREAM* document_;
+ JSONCPP_STRING indentString_;
+ unsigned int rightMargin_;
+ JSONCPP_STRING indentation_;
+ bool addChildValues_ : 1;
+ bool indented_ : 1;
};
#if defined(JSON_HAS_INT64)
-std::string JSON_API valueToString(Int value);
-std::string JSON_API valueToString(UInt value);
+JSONCPP_STRING JSON_API valueToString(Int value);
+JSONCPP_STRING JSON_API valueToString(UInt value);
#endif // if defined(JSON_HAS_INT64)
-std::string JSON_API valueToString(LargestInt value);
-std::string JSON_API valueToString(LargestUInt value);
-std::string JSON_API valueToString(double value);
-std::string JSON_API valueToString(bool value);
-std::string JSON_API valueToQuotedString(const char* value);
+JSONCPP_STRING JSON_API valueToString(LargestInt value);
+JSONCPP_STRING JSON_API valueToString(LargestUInt value);
+JSONCPP_STRING JSON_API valueToString(double value);
+JSONCPP_STRING JSON_API valueToString(bool value);
+JSONCPP_STRING JSON_API valueToQuotedString(const char* value);
/// \brief Output using the StyledStreamWriter.
/// \see Json::operator>>()
-JSON_API std::ostream& operator<<(std::ostream&, const Value& root);
+JSON_API JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM&, const Value& root);
} // namespace Json
+#if !defined(__SUNPRO_CC)
+#pragma pack(pop)
+#endif
+
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
#pragma warning(pop)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_batchallocator.h b/Utilities/cmjsoncpp/src/lib_json/json_batchallocator.h
deleted file mode 100644
index 2fbef7a8..0000000
--- a/Utilities/cmjsoncpp/src/lib_json/json_batchallocator.h
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED
-#define JSONCPP_BATCHALLOCATOR_H_INCLUDED
-
-#include <stdlib.h>
-#include <assert.h>
-
-#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
-namespace Json {
-
-/* Fast memory allocator.
- *
- * This memory allocator allocates memory for a batch of object (specified by
- * the page size, the number of object in each page).
- *
- * It does not allow the destruction of a single object. All the allocated
- * objects can be destroyed at once. The memory can be either released or reused
- * for future allocation.
- *
- * The in-place new operator must be used to construct the object using the
- * pointer returned by allocate.
- */
-template <typename AllocatedType, const unsigned int objectPerAllocation>
-class BatchAllocator {
-public:
- BatchAllocator(unsigned int objectsPerPage = 255)
- : freeHead_(0), objectsPerPage_(objectsPerPage) {
- // printf( "Size: %d => %s\n", sizeof(AllocatedType),
- // typeid(AllocatedType).name() );
- assert(sizeof(AllocatedType) * objectPerAllocation >=
- sizeof(AllocatedType*)); // We must be able to store a slist in the
- // object free space.
- assert(objectsPerPage >= 16);
- batches_ = allocateBatch(0); // allocated a dummy page
- currentBatch_ = batches_;
- }
-
- ~BatchAllocator() {
- for (BatchInfo* batch = batches_; batch;) {
- BatchInfo* nextBatch = batch->next_;
- free(batch);
- batch = nextBatch;
- }
- }
-
- /// allocate space for an array of objectPerAllocation object.
- /// @warning it is the responsability of the caller to call objects
- /// constructors.
- AllocatedType* allocate() {
- if (freeHead_) // returns node from free list.
- {
- AllocatedType* object = freeHead_;
- freeHead_ = *(AllocatedType**)object;
- return object;
- }
- if (currentBatch_->used_ == currentBatch_->end_) {
- currentBatch_ = currentBatch_->next_;
- while (currentBatch_ && currentBatch_->used_ == currentBatch_->end_)
- currentBatch_ = currentBatch_->next_;
-
- if (!currentBatch_) // no free batch found, allocate a new one
- {
- currentBatch_ = allocateBatch(objectsPerPage_);
- currentBatch_->next_ = batches_; // insert at the head of the list
- batches_ = currentBatch_;
- }
- }
- AllocatedType* allocated = currentBatch_->used_;
- currentBatch_->used_ += objectPerAllocation;
- return allocated;
- }
-
- /// Release the object.
- /// @warning it is the responsability of the caller to actually destruct the
- /// object.
- void release(AllocatedType* object) {
- assert(object != 0);
- *(AllocatedType**)object = freeHead_;
- freeHead_ = object;
- }
-
-private:
- struct BatchInfo {
- BatchInfo* next_;
- AllocatedType* used_;
- AllocatedType* end_;
- AllocatedType buffer_[objectPerAllocation];
- };
-
- // disabled copy constructor and assignement operator.
- BatchAllocator(const BatchAllocator&);
- void operator=(const BatchAllocator&);
-
- static BatchInfo* allocateBatch(unsigned int objectsPerPage) {
- const unsigned int mallocSize =
- sizeof(BatchInfo) - sizeof(AllocatedType) * objectPerAllocation +
- sizeof(AllocatedType) * objectPerAllocation * objectsPerPage;
- BatchInfo* batch = static_cast<BatchInfo*>(malloc(mallocSize));
- batch->next_ = 0;
- batch->used_ = batch->buffer_;
- batch->end_ = batch->buffer_ + objectsPerPage;
- return batch;
- }
-
- BatchInfo* batches_;
- BatchInfo* currentBatch_;
- /// Head of a single linked list within the allocated space of freeed object
- AllocatedType* freeHead_;
- unsigned int objectsPerPage_;
-};
-
-} // namespace Json
-
-#endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION
-
-#endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl b/Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl
deleted file mode 100644
index 9ee15e9..0000000
--- a/Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl
+++ /dev/null
@@ -1,360 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-// included by json_value.cpp
-
-namespace Json {
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalArray
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueArrayAllocator::~ValueArrayAllocator() {}
-
-// //////////////////////////////////////////////////////////////////
-// class DefaultValueArrayAllocator
-// //////////////////////////////////////////////////////////////////
-#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-class DefaultValueArrayAllocator : public ValueArrayAllocator {
-public: // overridden from ValueArrayAllocator
- virtual ~DefaultValueArrayAllocator() {}
-
- virtual ValueInternalArray* newArray() { return new ValueInternalArray(); }
-
- virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) {
- return new ValueInternalArray(other);
- }
-
- virtual void destructArray(ValueInternalArray* array) { delete array; }
-
- virtual void
- reallocateArrayPageIndex(Value**& indexes,
- ValueInternalArray::PageIndex& indexCount,
- ValueInternalArray::PageIndex minNewIndexCount) {
- ValueInternalArray::PageIndex newIndexCount = (indexCount * 3) / 2 + 1;
- if (minNewIndexCount > newIndexCount)
- newIndexCount = minNewIndexCount;
- void* newIndexes = realloc(indexes, sizeof(Value*) * newIndexCount);
- JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc.");
- indexCount = newIndexCount;
- indexes = static_cast<Value**>(newIndexes);
- }
- virtual void releaseArrayPageIndex(Value** indexes,
- ValueInternalArray::PageIndex indexCount) {
- if (indexes)
- free(indexes);
- }
-
- virtual Value* allocateArrayPage() {
- return static_cast<Value*>(
- malloc(sizeof(Value) * ValueInternalArray::itemsPerPage));
- }
-
- virtual void releaseArrayPage(Value* value) {
- if (value)
- free(value);
- }
-};
-
-#else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-/// @todo make this thread-safe (lock when accessign batch allocator)
-class DefaultValueArrayAllocator : public ValueArrayAllocator {
-public: // overridden from ValueArrayAllocator
- virtual ~DefaultValueArrayAllocator() {}
-
- virtual ValueInternalArray* newArray() {
- ValueInternalArray* array = arraysAllocator_.allocate();
- new (array) ValueInternalArray(); // placement new
- return array;
- }
-
- virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) {
- ValueInternalArray* array = arraysAllocator_.allocate();
- new (array) ValueInternalArray(other); // placement new
- return array;
- }
-
- virtual void destructArray(ValueInternalArray* array) {
- if (array) {
- array->~ValueInternalArray();
- arraysAllocator_.release(array);
- }
- }
-
- virtual void
- reallocateArrayPageIndex(Value**& indexes,
- ValueInternalArray::PageIndex& indexCount,
- ValueInternalArray::PageIndex minNewIndexCount) {
- ValueInternalArray::PageIndex newIndexCount = (indexCount * 3) / 2 + 1;
- if (minNewIndexCount > newIndexCount)
- newIndexCount = minNewIndexCount;
- void* newIndexes = realloc(indexes, sizeof(Value*) * newIndexCount);
- JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc.");
- indexCount = newIndexCount;
- indexes = static_cast<Value**>(newIndexes);
- }
- virtual void releaseArrayPageIndex(Value** indexes,
- ValueInternalArray::PageIndex indexCount) {
- if (indexes)
- free(indexes);
- }
-
- virtual Value* allocateArrayPage() {
- return static_cast<Value*>(pagesAllocator_.allocate());
- }
-
- virtual void releaseArrayPage(Value* value) {
- if (value)
- pagesAllocator_.release(value);
- }
-
-private:
- BatchAllocator<ValueInternalArray, 1> arraysAllocator_;
- BatchAllocator<Value, ValueInternalArray::itemsPerPage> pagesAllocator_;
-};
-#endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-
-static ValueArrayAllocator*& arrayAllocator() {
- static DefaultValueArrayAllocator defaultAllocator;
- static ValueArrayAllocator* arrayAllocator = &defaultAllocator;
- return arrayAllocator;
-}
-
-static struct DummyArrayAllocatorInitializer {
- DummyArrayAllocatorInitializer() {
- arrayAllocator(); // ensure arrayAllocator() statics are initialized before
- // main().
- }
-} dummyArrayAllocatorInitializer;
-
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalArray
-// //////////////////////////////////////////////////////////////////
-bool ValueInternalArray::equals(const IteratorState& x,
- const IteratorState& other) {
- return x.array_ == other.array_ &&
- x.currentItemIndex_ == other.currentItemIndex_ &&
- x.currentPageIndex_ == other.currentPageIndex_;
-}
-
-void ValueInternalArray::increment(IteratorState& it) {
- JSON_ASSERT_MESSAGE(
- it.array_ && (it.currentPageIndex_ - it.array_->pages_) * itemsPerPage +
- it.currentItemIndex_ !=
- it.array_->size_,
- "ValueInternalArray::increment(): moving iterator beyond end");
- ++(it.currentItemIndex_);
- if (it.currentItemIndex_ == itemsPerPage) {
- it.currentItemIndex_ = 0;
- ++(it.currentPageIndex_);
- }
-}
-
-void ValueInternalArray::decrement(IteratorState& it) {
- JSON_ASSERT_MESSAGE(
- it.array_ && it.currentPageIndex_ == it.array_->pages_ &&
- it.currentItemIndex_ == 0,
- "ValueInternalArray::decrement(): moving iterator beyond end");
- if (it.currentItemIndex_ == 0) {
- it.currentItemIndex_ = itemsPerPage - 1;
- --(it.currentPageIndex_);
- } else {
- --(it.currentItemIndex_);
- }
-}
-
-Value& ValueInternalArray::unsafeDereference(const IteratorState& it) {
- return (*(it.currentPageIndex_))[it.currentItemIndex_];
-}
-
-Value& ValueInternalArray::dereference(const IteratorState& it) {
- JSON_ASSERT_MESSAGE(
- it.array_ && (it.currentPageIndex_ - it.array_->pages_) * itemsPerPage +
- it.currentItemIndex_ <
- it.array_->size_,
- "ValueInternalArray::dereference(): dereferencing invalid iterator");
- return unsafeDereference(it);
-}
-
-void ValueInternalArray::makeBeginIterator(IteratorState& it) const {
- it.array_ = const_cast<ValueInternalArray*>(this);
- it.currentItemIndex_ = 0;
- it.currentPageIndex_ = pages_;
-}
-
-void ValueInternalArray::makeIterator(IteratorState& it,
- ArrayIndex index) const {
- it.array_ = const_cast<ValueInternalArray*>(this);
- it.currentItemIndex_ = index % itemsPerPage;
- it.currentPageIndex_ = pages_ + index / itemsPerPage;
-}
-
-void ValueInternalArray::makeEndIterator(IteratorState& it) const {
- makeIterator(it, size_);
-}
-
-ValueInternalArray::ValueInternalArray() : pages_(0), size_(0), pageCount_(0) {}
-
-ValueInternalArray::ValueInternalArray(const ValueInternalArray& other)
- : pages_(0), size_(other.size_), pageCount_(0) {
- PageIndex minNewPages = other.size_ / itemsPerPage;
- arrayAllocator()->reallocateArrayPageIndex(pages_, pageCount_, minNewPages);
- JSON_ASSERT_MESSAGE(pageCount_ >= minNewPages,
- "ValueInternalArray::reserve(): bad reallocation");
- IteratorState itOther;
- other.makeBeginIterator(itOther);
- Value* value;
- for (ArrayIndex index = 0; index < size_; ++index, increment(itOther)) {
- if (index % itemsPerPage == 0) {
- PageIndex pageIndex = index / itemsPerPage;
- value = arrayAllocator()->allocateArrayPage();
- pages_[pageIndex] = value;
- }
- new (value) Value(dereference(itOther));
- }
-}
-
-ValueInternalArray& ValueInternalArray::operator=(ValueInternalArray other) {
- swap(other);
- return *this;
-}
-
-ValueInternalArray::~ValueInternalArray() {
- // destroy all constructed items
- IteratorState it;
- IteratorState itEnd;
- makeBeginIterator(it);
- makeEndIterator(itEnd);
- for (; !equals(it, itEnd); increment(it)) {
- Value* value = &dereference(it);
- value->~Value();
- }
- // release all pages
- PageIndex lastPageIndex = size_ / itemsPerPage;
- for (PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex)
- arrayAllocator()->releaseArrayPage(pages_[pageIndex]);
- // release pages index
- arrayAllocator()->releaseArrayPageIndex(pages_, pageCount_);
-}
-
-void ValueInternalArray::swap(ValueInternalArray& other) {
- Value** tempPages = pages_;
- pages_ = other.pages_;
- other.pages_ = tempPages;
- ArrayIndex tempSize = size_;
- size_ = other.size_;
- other.size_ = tempSize;
- PageIndex tempPageCount = pageCount_;
- pageCount_ = other.pageCount_;
- other.pageCount_ = tempPageCount;
-}
-
-void ValueInternalArray::clear() {
- ValueInternalArray dummy;
- swap(dummy);
-}
-
-void ValueInternalArray::resize(ArrayIndex newSize) {
- if (newSize == 0)
- clear();
- else if (newSize < size_) {
- IteratorState it;
- IteratorState itEnd;
- makeIterator(it, newSize);
- makeIterator(itEnd, size_);
- for (; !equals(it, itEnd); increment(it)) {
- Value* value = &dereference(it);
- value->~Value();
- }
- PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage;
- PageIndex lastPageIndex = size_ / itemsPerPage;
- for (; pageIndex < lastPageIndex; ++pageIndex)
- arrayAllocator()->releaseArrayPage(pages_[pageIndex]);
- size_ = newSize;
- } else if (newSize > size_)
- resolveReference(newSize);
-}
-
-void ValueInternalArray::makeIndexValid(ArrayIndex index) {
- // Need to enlarge page index ?
- if (index >= pageCount_ * itemsPerPage) {
- PageIndex minNewPages = (index + 1) / itemsPerPage;
- arrayAllocator()->reallocateArrayPageIndex(pages_, pageCount_, minNewPages);
- JSON_ASSERT_MESSAGE(pageCount_ >= minNewPages,
- "ValueInternalArray::reserve(): bad reallocation");
- }
-
- // Need to allocate new pages ?
- ArrayIndex nextPageIndex = (size_ % itemsPerPage) != 0
- ? size_ - (size_ % itemsPerPage) + itemsPerPage
- : size_;
- if (nextPageIndex <= index) {
- PageIndex pageIndex = nextPageIndex / itemsPerPage;
- PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1;
- for (; pageToAllocate-- > 0; ++pageIndex)
- pages_[pageIndex] = arrayAllocator()->allocateArrayPage();
- }
-
- // Initialize all new entries
- IteratorState it;
- IteratorState itEnd;
- makeIterator(it, size_);
- size_ = index + 1;
- makeIterator(itEnd, size_);
- for (; !equals(it, itEnd); increment(it)) {
- Value* value = &dereference(it);
- new (value) Value(); // Construct a default value using placement new
- }
-}
-
-Value& ValueInternalArray::resolveReference(ArrayIndex index) {
- if (index >= size_)
- makeIndexValid(index);
- return pages_[index / itemsPerPage][index % itemsPerPage];
-}
-
-Value* ValueInternalArray::find(ArrayIndex index) const {
- if (index >= size_)
- return 0;
- return &(pages_[index / itemsPerPage][index % itemsPerPage]);
-}
-
-ValueInternalArray::ArrayIndex ValueInternalArray::size() const {
- return size_;
-}
-
-int ValueInternalArray::distance(const IteratorState& x,
- const IteratorState& y) {
- return indexOf(y) - indexOf(x);
-}
-
-ValueInternalArray::ArrayIndex
-ValueInternalArray::indexOf(const IteratorState& iterator) {
- if (!iterator.array_)
- return ArrayIndex(-1);
- return ArrayIndex((iterator.currentPageIndex_ - iterator.array_->pages_) *
- itemsPerPage +
- iterator.currentItemIndex_);
-}
-
-int ValueInternalArray::compare(const ValueInternalArray& other) const {
- int sizeDiff(size_ - other.size_);
- if (sizeDiff != 0)
- return sizeDiff;
-
- for (ArrayIndex index = 0; index < size_; ++index) {
- int diff = pages_[index / itemsPerPage][index % itemsPerPage].compare(
- other.pages_[index / itemsPerPage][index % itemsPerPage]);
- if (diff != 0)
- return diff;
- }
- return 0;
-}
-
-} // namespace Json
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl b/Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl
deleted file mode 100644
index ef3f330..0000000
--- a/Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl
+++ /dev/null
@@ -1,473 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-// included by json_value.cpp
-
-namespace Json {
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalMap
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-/** \internal MUST be safely initialized using memset( this, 0,
- * sizeof(ValueInternalLink) );
- * This optimization is used by the fast allocator.
- */
-ValueInternalLink::ValueInternalLink() : previous_(0), next_(0) {}
-
-ValueInternalLink::~ValueInternalLink() {
- for (int index = 0; index < itemPerLink; ++index) {
- if (!items_[index].isItemAvailable()) {
- if (!items_[index].isMemberNameStatic())
- free(keys_[index]);
- } else
- break;
- }
-}
-
-ValueMapAllocator::~ValueMapAllocator() {}
-
-#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-class DefaultValueMapAllocator : public ValueMapAllocator {
-public: // overridden from ValueMapAllocator
- virtual ValueInternalMap* newMap() { return new ValueInternalMap(); }
-
- virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) {
- return new ValueInternalMap(other);
- }
-
- virtual void destructMap(ValueInternalMap* map) { delete map; }
-
- virtual ValueInternalLink* allocateMapBuckets(unsigned int size) {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets(ValueInternalLink* links) { delete[] links; }
-
- virtual ValueInternalLink* allocateMapLink() {
- return new ValueInternalLink();
- }
-
- virtual void releaseMapLink(ValueInternalLink* link) { delete link; }
-};
-#else
-/// @todo make this thread-safe (lock when accessign batch allocator)
-class DefaultValueMapAllocator : public ValueMapAllocator {
-public: // overridden from ValueMapAllocator
- virtual ValueInternalMap* newMap() {
- ValueInternalMap* map = mapsAllocator_.allocate();
- new (map) ValueInternalMap(); // placement new
- return map;
- }
-
- virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) {
- ValueInternalMap* map = mapsAllocator_.allocate();
- new (map) ValueInternalMap(other); // placement new
- return map;
- }
-
- virtual void destructMap(ValueInternalMap* map) {
- if (map) {
- map->~ValueInternalMap();
- mapsAllocator_.release(map);
- }
- }
-
- virtual ValueInternalLink* allocateMapBuckets(unsigned int size) {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets(ValueInternalLink* links) { delete[] links; }
-
- virtual ValueInternalLink* allocateMapLink() {
- ValueInternalLink* link = linksAllocator_.allocate();
- memset(link, 0, sizeof(ValueInternalLink));
- return link;
- }
-
- virtual void releaseMapLink(ValueInternalLink* link) {
- link->~ValueInternalLink();
- linksAllocator_.release(link);
- }
-
-private:
- BatchAllocator<ValueInternalMap, 1> mapsAllocator_;
- BatchAllocator<ValueInternalLink, 1> linksAllocator_;
-};
-#endif
-
-static ValueMapAllocator*& mapAllocator() {
- static DefaultValueMapAllocator defaultAllocator;
- static ValueMapAllocator* mapAllocator = &defaultAllocator;
- return mapAllocator;
-}
-
-static struct DummyMapAllocatorInitializer {
- DummyMapAllocatorInitializer() {
- mapAllocator(); // ensure mapAllocator() statics are initialized before
- // main().
- }
-} dummyMapAllocatorInitializer;
-
-// h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32.
-
-/*
-use linked list hash map.
-buckets array is a container.
-linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124)
-value have extra state: valid, available, deleted
-*/
-
-ValueInternalMap::ValueInternalMap()
- : buckets_(0), tailLink_(0), bucketsSize_(0), itemCount_(0) {}
-
-ValueInternalMap::ValueInternalMap(const ValueInternalMap& other)
- : buckets_(0), tailLink_(0), bucketsSize_(0), itemCount_(0) {
- reserve(other.itemCount_);
- IteratorState it;
- IteratorState itEnd;
- other.makeBeginIterator(it);
- other.makeEndIterator(itEnd);
- for (; !equals(it, itEnd); increment(it)) {
- bool isStatic;
- const char* memberName = key(it, isStatic);
- const Value& aValue = value(it);
- resolveReference(memberName, isStatic) = aValue;
- }
-}
-
-ValueInternalMap& ValueInternalMap::operator=(ValueInternalMap other) {
- swap(other);
- return *this;
-}
-
-ValueInternalMap::~ValueInternalMap() {
- if (buckets_) {
- for (BucketIndex bucketIndex = 0; bucketIndex < bucketsSize_;
- ++bucketIndex) {
- ValueInternalLink* link = buckets_[bucketIndex].next_;
- while (link) {
- ValueInternalLink* linkToRelease = link;
- link = link->next_;
- mapAllocator()->releaseMapLink(linkToRelease);
- }
- }
- mapAllocator()->releaseMapBuckets(buckets_);
- }
-}
-
-void ValueInternalMap::swap(ValueInternalMap& other) {
- ValueInternalLink* tempBuckets = buckets_;
- buckets_ = other.buckets_;
- other.buckets_ = tempBuckets;
- ValueInternalLink* tempTailLink = tailLink_;
- tailLink_ = other.tailLink_;
- other.tailLink_ = tempTailLink;
- BucketIndex tempBucketsSize = bucketsSize_;
- bucketsSize_ = other.bucketsSize_;
- other.bucketsSize_ = tempBucketsSize;
- BucketIndex tempItemCount = itemCount_;
- itemCount_ = other.itemCount_;
- other.itemCount_ = tempItemCount;
-}
-
-void ValueInternalMap::clear() {
- ValueInternalMap dummy;
- swap(dummy);
-}
-
-ValueInternalMap::BucketIndex ValueInternalMap::size() const {
- return itemCount_;
-}
-
-bool ValueInternalMap::reserveDelta(BucketIndex growth) {
- return reserve(itemCount_ + growth);
-}
-
-bool ValueInternalMap::reserve(BucketIndex newItemCount) {
- if (!buckets_ && newItemCount > 0) {
- buckets_ = mapAllocator()->allocateMapBuckets(1);
- bucketsSize_ = 1;
- tailLink_ = &buckets_[0];
- }
- // BucketIndex idealBucketCount = (newItemCount +
- // ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink;
- return true;
-}
-
-const Value* ValueInternalMap::find(const char* key) const {
- if (!bucketsSize_)
- return 0;
- HashKey hashedKey = hash(key);
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- for (const ValueInternalLink* current = &buckets_[bucketIndex]; current != 0;
- current = current->next_) {
- for (BucketIndex index = 0; index < ValueInternalLink::itemPerLink;
- ++index) {
- if (current->items_[index].isItemAvailable())
- return 0;
- if (strcmp(key, current->keys_[index]) == 0)
- return &current->items_[index];
- }
- }
- return 0;
-}
-
-Value* ValueInternalMap::find(const char* key) {
- const ValueInternalMap* constThis = this;
- return const_cast<Value*>(constThis->find(key));
-}
-
-Value& ValueInternalMap::resolveReference(const char* key, bool isStatic) {
- HashKey hashedKey = hash(key);
- if (bucketsSize_) {
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- ValueInternalLink** previous = 0;
- BucketIndex index;
- for (ValueInternalLink* current = &buckets_[bucketIndex]; current != 0;
- previous = &current->next_, current = current->next_) {
- for (index = 0; index < ValueInternalLink::itemPerLink; ++index) {
- if (current->items_[index].isItemAvailable())
- return setNewItem(key, isStatic, current, index);
- if (strcmp(key, current->keys_[index]) == 0)
- return current->items_[index];
- }
- }
- }
-
- reserveDelta(1);
- return unsafeAdd(key, isStatic, hashedKey);
-}
-
-void ValueInternalMap::remove(const char* key) {
- HashKey hashedKey = hash(key);
- if (!bucketsSize_)
- return;
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- for (ValueInternalLink* link = &buckets_[bucketIndex]; link != 0;
- link = link->next_) {
- BucketIndex index;
- for (index = 0; index < ValueInternalLink::itemPerLink; ++index) {
- if (link->items_[index].isItemAvailable())
- return;
- if (strcmp(key, link->keys_[index]) == 0) {
- doActualRemove(link, index, bucketIndex);
- return;
- }
- }
- }
-}
-
-void ValueInternalMap::doActualRemove(ValueInternalLink* link,
- BucketIndex index,
- BucketIndex bucketIndex) {
- // find last item of the bucket and swap it with the 'removed' one.
- // set removed items flags to 'available'.
- // if last page only contains 'available' items, then desallocate it (it's
- // empty)
- ValueInternalLink*& lastLink = getLastLinkInBucket(index);
- BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1
- for (; lastItemIndex < ValueInternalLink::itemPerLink;
- ++lastItemIndex) // may be optimized with dicotomic search
- {
- if (lastLink->items_[lastItemIndex].isItemAvailable())
- break;
- }
-
- BucketIndex lastUsedIndex = lastItemIndex - 1;
- Value* valueToDelete = &link->items_[index];
- Value* valueToPreserve = &lastLink->items_[lastUsedIndex];
- if (valueToDelete != valueToPreserve)
- valueToDelete->swap(*valueToPreserve);
- if (lastUsedIndex == 0) // page is now empty
- { // remove it from bucket linked list and delete it.
- ValueInternalLink* linkPreviousToLast = lastLink->previous_;
- if (linkPreviousToLast != 0) // can not deleted bucket link.
- {
- mapAllocator()->releaseMapLink(lastLink);
- linkPreviousToLast->next_ = 0;
- lastLink = linkPreviousToLast;
- }
- } else {
- Value dummy;
- valueToPreserve->swap(dummy); // restore deleted to default Value.
- valueToPreserve->setItemUsed(false);
- }
- --itemCount_;
-}
-
-ValueInternalLink*&
-ValueInternalMap::getLastLinkInBucket(BucketIndex bucketIndex) {
- if (bucketIndex == bucketsSize_ - 1)
- return tailLink_;
- ValueInternalLink*& previous = buckets_[bucketIndex + 1].previous_;
- if (!previous)
- previous = &buckets_[bucketIndex];
- return previous;
-}
-
-Value& ValueInternalMap::setNewItem(const char* key,
- bool isStatic,
- ValueInternalLink* link,
- BucketIndex index) {
- char* duplicatedKey = makeMemberName(key);
- ++itemCount_;
- link->keys_[index] = duplicatedKey;
- link->items_[index].setItemUsed();
- link->items_[index].setMemberNameIsStatic(isStatic);
- return link->items_[index]; // items already default constructed.
-}
-
-Value&
-ValueInternalMap::unsafeAdd(const char* key, bool isStatic, HashKey hashedKey) {
- JSON_ASSERT_MESSAGE(bucketsSize_ > 0,
- "ValueInternalMap::unsafeAdd(): internal logic error.");
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- ValueInternalLink*& previousLink = getLastLinkInBucket(bucketIndex);
- ValueInternalLink* link = previousLink;
- BucketIndex index;
- for (index = 0; index < ValueInternalLink::itemPerLink; ++index) {
- if (link->items_[index].isItemAvailable())
- break;
- }
- if (index == ValueInternalLink::itemPerLink) // need to add a new page
- {
- ValueInternalLink* newLink = mapAllocator()->allocateMapLink();
- index = 0;
- link->next_ = newLink;
- previousLink = newLink;
- link = newLink;
- }
- return setNewItem(key, isStatic, link, index);
-}
-
-ValueInternalMap::HashKey ValueInternalMap::hash(const char* key) const {
- HashKey hash = 0;
- while (*key)
- hash += *key++ * 37;
- return hash;
-}
-
-int ValueInternalMap::compare(const ValueInternalMap& other) const {
- int sizeDiff(itemCount_ - other.itemCount_);
- if (sizeDiff != 0)
- return sizeDiff;
- // Strict order guaranty is required. Compare all keys FIRST, then compare
- // values.
- IteratorState it;
- IteratorState itEnd;
- makeBeginIterator(it);
- makeEndIterator(itEnd);
- for (; !equals(it, itEnd); increment(it)) {
- if (!other.find(key(it)))
- return 1;
- }
-
- // All keys are equals, let's compare values
- makeBeginIterator(it);
- for (; !equals(it, itEnd); increment(it)) {
- const Value* otherValue = other.find(key(it));
- int valueDiff = value(it).compare(*otherValue);
- if (valueDiff != 0)
- return valueDiff;
- }
- return 0;
-}
-
-void ValueInternalMap::makeBeginIterator(IteratorState& it) const {
- it.map_ = const_cast<ValueInternalMap*>(this);
- it.bucketIndex_ = 0;
- it.itemIndex_ = 0;
- it.link_ = buckets_;
-}
-
-void ValueInternalMap::makeEndIterator(IteratorState& it) const {
- it.map_ = const_cast<ValueInternalMap*>(this);
- it.bucketIndex_ = bucketsSize_;
- it.itemIndex_ = 0;
- it.link_ = 0;
-}
-
-bool ValueInternalMap::equals(const IteratorState& x,
- const IteratorState& other) {
- return x.map_ == other.map_ && x.bucketIndex_ == other.bucketIndex_ &&
- x.link_ == other.link_ && x.itemIndex_ == other.itemIndex_;
-}
-
-void ValueInternalMap::incrementBucket(IteratorState& iterator) {
- ++iterator.bucketIndex_;
- JSON_ASSERT_MESSAGE(
- iterator.bucketIndex_ <= iterator.map_->bucketsSize_,
- "ValueInternalMap::increment(): attempting to iterate beyond end.");
- if (iterator.bucketIndex_ == iterator.map_->bucketsSize_)
- iterator.link_ = 0;
- else
- iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]);
- iterator.itemIndex_ = 0;
-}
-
-void ValueInternalMap::increment(IteratorState& iterator) {
- JSON_ASSERT_MESSAGE(iterator.map_,
- "Attempting to iterator using invalid iterator.");
- ++iterator.itemIndex_;
- if (iterator.itemIndex_ == ValueInternalLink::itemPerLink) {
- JSON_ASSERT_MESSAGE(
- iterator.link_ != 0,
- "ValueInternalMap::increment(): attempting to iterate beyond end.");
- iterator.link_ = iterator.link_->next_;
- if (iterator.link_ == 0)
- incrementBucket(iterator);
- } else if (iterator.link_->items_[iterator.itemIndex_].isItemAvailable()) {
- incrementBucket(iterator);
- }
-}
-
-void ValueInternalMap::decrement(IteratorState& iterator) {
- if (iterator.itemIndex_ == 0) {
- JSON_ASSERT_MESSAGE(iterator.map_,
- "Attempting to iterate using invalid iterator.");
- if (iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_]) {
- JSON_ASSERT_MESSAGE(iterator.bucketIndex_ > 0,
- "Attempting to iterate beyond beginning.");
- --(iterator.bucketIndex_);
- }
- iterator.link_ = iterator.link_->previous_;
- iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1;
- }
-}
-
-const char* ValueInternalMap::key(const IteratorState& iterator) {
- JSON_ASSERT_MESSAGE(iterator.link_,
- "Attempting to iterate using invalid iterator.");
- return iterator.link_->keys_[iterator.itemIndex_];
-}
-
-const char* ValueInternalMap::key(const IteratorState& iterator,
- bool& isStatic) {
- JSON_ASSERT_MESSAGE(iterator.link_,
- "Attempting to iterate using invalid iterator.");
- isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic();
- return iterator.link_->keys_[iterator.itemIndex_];
-}
-
-Value& ValueInternalMap::value(const IteratorState& iterator) {
- JSON_ASSERT_MESSAGE(iterator.link_,
- "Attempting to iterate using invalid iterator.");
- return iterator.link_->items_[iterator.itemIndex_];
-}
-
-int ValueInternalMap::distance(const IteratorState& x, const IteratorState& y) {
- int offset = 0;
- IteratorState it = x;
- while (!equals(it, y))
- increment(it);
- return offset;
-}
-
-} // namespace Json
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
index 7b33828..0249cc9 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
@@ -1,4 +1,5 @@
-// Copyright 2007-2011 Baptiste Lepilleur
+// Copyright 2007-2011 Baptiste Lepilleur and The JsonCpp Authors
+// Copyright (C) 2016 InfoTeCS JSC. All rights reserved.
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -14,18 +15,51 @@
#include <assert.h>
#include <string.h>
#include <istream>
-
-#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below
+#include <sstream>
+#include <memory>
+#include <set>
+#include <limits>
+
+#if defined(_MSC_VER)
+#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
+#define snprintf sprintf_s
+#elif _MSC_VER >= 1900 // VC++ 14.0 and above
+#define snprintf std::snprintf
+#else
#define snprintf _snprintf
#endif
+#elif defined(__ANDROID__) || defined(__QNXNTO__)
+#define snprintf snprintf
+#elif __cplusplus >= 201103L
+#if !defined(__MINGW32__) && !defined(__CYGWIN__)
+#define snprintf std::snprintf
+#endif
+#endif
+
+#if defined(__QNXNTO__)
+#define sscanf std::sscanf
+#endif
#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0
// Disable warning about strdup being deprecated.
#pragma warning(disable : 4996)
#endif
+// Define JSONCPP_DEPRECATED_STACK_LIMIT as an appropriate integer at compile time to change the stack limit
+#if !defined(JSONCPP_DEPRECATED_STACK_LIMIT)
+#define JSONCPP_DEPRECATED_STACK_LIMIT 1000
+#endif
+
+static size_t const stackLimit_g = JSONCPP_DEPRECATED_STACK_LIMIT; // see readValue()
+
namespace Json {
+#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
+typedef std::unique_ptr<CharReader> CharReaderPtr;
+#else
+typedef std::auto_ptr<CharReader> CharReaderPtr;
+#endif
+
// Implementation of class Features
// ////////////////////////////////
@@ -47,24 +81,7 @@ Features Features::strictMode() {
// Implementation of class Reader
// ////////////////////////////////
-static inline bool in(Reader::Char c,
- Reader::Char c1,
- Reader::Char c2,
- Reader::Char c3,
- Reader::Char c4) {
- return c == c1 || c == c2 || c == c3 || c == c4;
-}
-
-static inline bool in(Reader::Char c,
- Reader::Char c1,
- Reader::Char c2,
- Reader::Char c3,
- Reader::Char c4,
- Reader::Char c5) {
- return c == c1 || c == c2 || c == c3 || c == c4 || c == c5;
-}
-
-static bool containsNewLine(Reader::Location begin, Reader::Location end) {
+bool Reader::containsNewLine(Reader::Location begin, Reader::Location end) {
for (; begin < end; ++begin)
if (*begin == '\n' || *begin == '\r')
return true;
@@ -86,7 +103,7 @@ Reader::Reader(const Features& features)
bool
Reader::parse(const std::string& document, Value& root, bool collectComments) {
- document_ = document;
+ document_.assign(document.begin(), document.end());
const char* begin = document_.c_str();
const char* end = begin + document_.length();
return parse(begin, end, root, collectComments);
@@ -98,11 +115,11 @@ bool Reader::parse(std::istream& sin, Value& root, bool collectComments) {
// Those would allow streamed input from a file, if parse() were a
// template function.
- // Since std::string is reference-counted, this at least does not
+ // Since JSONCPP_STRING is reference-counted, this at least does not
// create an extra copy.
- std::string doc;
+ JSONCPP_STRING doc;
std::getline(sin, doc, (char)EOF);
- return parse(doc, root, collectComments);
+ return parse(doc.data(), doc.data() + doc.size(), root, collectComments);
}
bool Reader::parse(const char* beginDoc,
@@ -119,7 +136,7 @@ bool Reader::parse(const char* beginDoc,
current_ = begin_;
lastValueEnd_ = 0;
lastValue_ = 0;
- commentsBefore_ = "";
+ commentsBefore_.clear();
errors_.clear();
while (!nodes_.empty())
nodes_.pop();
@@ -147,21 +164,18 @@ bool Reader::parse(const char* beginDoc,
}
bool Reader::readValue() {
+ // readValue() may call itself only if it calls readObject() or ReadArray().
+ // These methods execute nodes_.push() just before and nodes_.pop)() just after calling readValue().
+ // parse() executes one nodes_.push(), so > instead of >=.
+ if (nodes_.size() > stackLimit_g) throwRuntimeError("Exceeded stackLimit in readValue().");
+
Token token;
skipCommentTokens(token);
bool successful = true;
if (collectComments_ && !commentsBefore_.empty()) {
- // Remove newline characters at the end of the comments
- size_t lastNonNewline = commentsBefore_.find_last_not_of("\r\n");
- if (lastNonNewline != std::string::npos) {
- commentsBefore_.erase(lastNonNewline + 1);
- } else {
- commentsBefore_.clear();
- }
-
currentValue().setComment(commentsBefore_, commentBefore);
- commentsBefore_ = "";
+ commentsBefore_.clear();
}
switch (token.type_) {
@@ -180,31 +194,42 @@ bool Reader::readValue() {
successful = decodeString(token);
break;
case tokenTrue:
- currentValue() = true;
+ {
+ Value v(true);
+ currentValue().swapPayload(v);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
+ }
break;
case tokenFalse:
- currentValue() = false;
+ {
+ Value v(false);
+ currentValue().swapPayload(v);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
+ }
break;
case tokenNull:
- currentValue() = Value();
+ {
+ Value v;
+ currentValue().swapPayload(v);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
+ }
break;
case tokenArraySeparator:
+ case tokenObjectEnd:
+ case tokenArrayEnd:
if (features_.allowDroppedNullPlaceholders_) {
// "Un-read" the current token and mark the current value as a null
// token.
current_--;
- currentValue() = Value();
+ Value v;
+ currentValue().swapPayload(v);
currentValue().setOffsetStart(current_ - begin_ - 1);
currentValue().setOffsetLimit(current_ - begin_);
break;
- }
- // Else, fall through...
+ } // Else, fall through...
default:
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
@@ -229,13 +254,6 @@ void Reader::skipCommentTokens(Token& token) {
}
}
-bool Reader::expectToken(TokenType type, Token& token, const char* message) {
- readToken(token);
- if (token.type_ != type)
- return addError(message, token);
- return true;
-}
-
bool Reader::readToken(Token& token) {
skipSpaces();
token.start_ = current_;
@@ -351,19 +369,39 @@ bool Reader::readComment() {
return true;
}
+JSONCPP_STRING Reader::normalizeEOL(Reader::Location begin, Reader::Location end) {
+ JSONCPP_STRING normalized;
+ normalized.reserve(static_cast<size_t>(end - begin));
+ Reader::Location current = begin;
+ while (current != end) {
+ char c = *current++;
+ if (c == '\r') {
+ if (current != end && *current == '\n')
+ // convert dos EOL
+ ++current;
+ // convert Mac EOL
+ normalized += '\n';
+ } else {
+ normalized += c;
+ }
+ }
+ return normalized;
+}
+
void
Reader::addComment(Location begin, Location end, CommentPlacement placement) {
assert(collectComments_);
+ const JSONCPP_STRING& normalized = normalizeEOL(begin, end);
if (placement == commentAfterOnSameLine) {
assert(lastValue_ != 0);
- lastValue_->setComment(std::string(begin, end), placement);
+ lastValue_->setComment(normalized, placement);
} else {
- commentsBefore_ += std::string(begin, end);
+ commentsBefore_ += normalized;
}
}
bool Reader::readCStyleComment() {
- while (current_ != end_) {
+ while ((current_ + 1) < end_) {
Char c = getNextChar();
if (c == '*' && *current_ == '/')
break;
@@ -374,23 +412,43 @@ bool Reader::readCStyleComment() {
bool Reader::readCppStyleComment() {
while (current_ != end_) {
Char c = getNextChar();
- if (c == '\r' || c == '\n')
+ if (c == '\n')
break;
+ if (c == '\r') {
+ // Consume DOS EOL. It will be normalized in addComment.
+ if (current_ != end_ && *current_ == '\n')
+ getNextChar();
+ // Break on Moc OS 9 EOL.
+ break;
+ }
}
return true;
}
void Reader::readNumber() {
- while (current_ != end_) {
- if (!(*current_ >= '0' && *current_ <= '9') &&
- !in(*current_, '.', 'e', 'E', '+', '-'))
- break;
- ++current_;
+ const char *p = current_;
+ char c = '0'; // stopgap for already consumed character
+ // integral part
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : '\0';
+ // fractional part
+ if (c == '.') {
+ c = (current_ = p) < end_ ? *p++ : '\0';
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : '\0';
+ }
+ // exponential part
+ if (c == 'e' || c == 'E') {
+ c = (current_ = p) < end_ ? *p++ : '\0';
+ if (c == '+' || c == '-')
+ c = (current_ = p) < end_ ? *p++ : '\0';
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : '\0';
}
}
bool Reader::readString() {
- Char c = 0;
+ Char c = '\0';
while (current_ != end_) {
c = getNextChar();
if (c == '\\')
@@ -403,8 +461,9 @@ bool Reader::readString() {
bool Reader::readObject(Token& tokenStart) {
Token tokenName;
- std::string name;
- currentValue() = Value(objectValue);
+ JSONCPP_STRING name;
+ Value init(objectValue);
+ currentValue().swapPayload(init);
currentValue().setOffsetStart(tokenStart.start_ - begin_);
while (readToken(tokenName)) {
bool initialTokenOk = true;
@@ -414,7 +473,7 @@ bool Reader::readObject(Token& tokenStart) {
break;
if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
return true;
- name = "";
+ name.clear();
if (tokenName.type_ == tokenString) {
if (!decodeString(tokenName, name))
return recoverFromError(tokenObjectEnd);
@@ -422,7 +481,7 @@ bool Reader::readObject(Token& tokenStart) {
Value numberName;
if (!decodeNumber(tokenName, numberName))
return recoverFromError(tokenObjectEnd);
- name = numberName.asString();
+ name = JSONCPP_STRING(numberName.asCString());
} else {
break;
}
@@ -457,10 +516,11 @@ bool Reader::readObject(Token& tokenStart) {
}
bool Reader::readArray(Token& tokenStart) {
- currentValue() = Value(arrayValue);
+ Value init(arrayValue);
+ currentValue().swapPayload(init);
currentValue().setOffsetStart(tokenStart.start_ - begin_);
skipSpaces();
- if (*current_ == ']') // empty array
+ if (current_ != end_ && *current_ == ']') // empty array
{
Token endArray;
readToken(endArray);
@@ -497,20 +557,1021 @@ bool Reader::decodeNumber(Token& token) {
Value decoded;
if (!decodeNumber(token, decoded))
return false;
- currentValue() = decoded;
+ currentValue().swapPayload(decoded);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
return true;
}
bool Reader::decodeNumber(Token& token, Value& decoded) {
- bool isDouble = false;
- for (Location inspect = token.start_; inspect != token.end_; ++inspect) {
- isDouble = isDouble || in(*inspect, '.', 'e', 'E', '+') ||
- (*inspect == '-' && inspect != token.start_);
+ // Attempts to parse the number as an integer. If the number is
+ // larger than the maximum supported value of an integer then
+ // we decode the number as a double.
+ Location current = token.start_;
+ bool isNegative = *current == '-';
+ if (isNegative)
+ ++current;
+ // TODO: Help the compiler do the div and mod at compile time or get rid of them.
+ Value::LargestUInt maxIntegerValue =
+ isNegative ? Value::LargestUInt(Value::maxLargestInt) + 1
+ : Value::maxLargestUInt;
+ Value::LargestUInt threshold = maxIntegerValue / 10;
+ Value::LargestUInt value = 0;
+ while (current < token.end_) {
+ Char c = *current++;
+ if (c < '0' || c > '9')
+ return decodeDouble(token, decoded);
+ Value::UInt digit(static_cast<Value::UInt>(c - '0'));
+ if (value >= threshold) {
+ // We've hit or exceeded the max value divided by 10 (rounded down). If
+ // a) we've only just touched the limit, b) this is the last digit, and
+ // c) it's small enough to fit in that rounding delta, we're okay.
+ // Otherwise treat this number as a double to avoid overflow.
+ if (value > threshold || current != token.end_ ||
+ digit > maxIntegerValue % 10) {
+ return decodeDouble(token, decoded);
+ }
+ }
+ value = value * 10 + digit;
+ }
+ if (isNegative && value == maxIntegerValue)
+ decoded = Value::minLargestInt;
+ else if (isNegative)
+ decoded = -Value::LargestInt(value);
+ else if (value <= Value::LargestUInt(Value::maxInt))
+ decoded = Value::LargestInt(value);
+ else
+ decoded = value;
+ return true;
+}
+
+bool Reader::decodeDouble(Token& token) {
+ Value decoded;
+ if (!decodeDouble(token, decoded))
+ return false;
+ currentValue().swapPayload(decoded);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ return true;
+}
+
+bool Reader::decodeDouble(Token& token, Value& decoded) {
+ double value = 0;
+ JSONCPP_STRING buffer(token.start_, token.end_);
+ JSONCPP_ISTRINGSTREAM is(buffer);
+ if (!(is >> value))
+ return addError("'" + JSONCPP_STRING(token.start_, token.end_) +
+ "' is not a number.",
+ token);
+ decoded = value;
+ return true;
+}
+
+bool Reader::decodeString(Token& token) {
+ JSONCPP_STRING decoded_string;
+ if (!decodeString(token, decoded_string))
+ return false;
+ Value decoded(decoded_string);
+ currentValue().swapPayload(decoded);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ return true;
+}
+
+bool Reader::decodeString(Token& token, JSONCPP_STRING& decoded) {
+ decoded.reserve(static_cast<size_t>(token.end_ - token.start_ - 2));
+ Location current = token.start_ + 1; // skip '"'
+ Location end = token.end_ - 1; // do not include '"'
+ while (current != end) {
+ Char c = *current++;
+ if (c == '"')
+ break;
+ else if (c == '\\') {
+ if (current == end)
+ return addError("Empty escape sequence in string", token, current);
+ Char escape = *current++;
+ switch (escape) {
+ case '"':
+ decoded += '"';
+ break;
+ case '/':
+ decoded += '/';
+ break;
+ case '\\':
+ decoded += '\\';
+ break;
+ case 'b':
+ decoded += '\b';
+ break;
+ case 'f':
+ decoded += '\f';
+ break;
+ case 'n':
+ decoded += '\n';
+ break;
+ case 'r':
+ decoded += '\r';
+ break;
+ case 't':
+ decoded += '\t';
+ break;
+ case 'u': {
+ unsigned int unicode;
+ if (!decodeUnicodeCodePoint(token, current, end, unicode))
+ return false;
+ decoded += codePointToUTF8(unicode);
+ } break;
+ default:
+ return addError("Bad escape sequence in string", token, current);
+ }
+ } else {
+ decoded += c;
+ }
+ }
+ return true;
+}
+
+bool Reader::decodeUnicodeCodePoint(Token& token,
+ Location& current,
+ Location end,
+ unsigned int& unicode) {
+
+ if (!decodeUnicodeEscapeSequence(token, current, end, unicode))
+ return false;
+ if (unicode >= 0xD800 && unicode <= 0xDBFF) {
+ // surrogate pairs
+ if (end - current < 6)
+ return addError(
+ "additional six characters expected to parse unicode surrogate pair.",
+ token,
+ current);
+ unsigned int surrogatePair;
+ if (*(current++) == '\\' && *(current++) == 'u') {
+ if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) {
+ unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
+ } else
+ return false;
+ } else
+ return addError("expecting another \\u token to begin the second half of "
+ "a unicode surrogate pair",
+ token,
+ current);
+ }
+ return true;
+}
+
+bool Reader::decodeUnicodeEscapeSequence(Token& token,
+ Location& current,
+ Location end,
+ unsigned int& ret_unicode) {
+ if (end - current < 4)
+ return addError(
+ "Bad unicode escape sequence in string: four digits expected.",
+ token,
+ current);
+ int unicode = 0;
+ for (int index = 0; index < 4; ++index) {
+ Char c = *current++;
+ unicode *= 16;
+ if (c >= '0' && c <= '9')
+ unicode += c - '0';
+ else if (c >= 'a' && c <= 'f')
+ unicode += c - 'a' + 10;
+ else if (c >= 'A' && c <= 'F')
+ unicode += c - 'A' + 10;
+ else
+ return addError(
+ "Bad unicode escape sequence in string: hexadecimal digit expected.",
+ token,
+ current);
+ }
+ ret_unicode = static_cast<unsigned int>(unicode);
+ return true;
+}
+
+bool
+Reader::addError(const JSONCPP_STRING& message, Token& token, Location extra) {
+ ErrorInfo info;
+ info.token_ = token;
+ info.message_ = message;
+ info.extra_ = extra;
+ errors_.push_back(info);
+ return false;
+}
+
+bool Reader::recoverFromError(TokenType skipUntilToken) {
+ size_t const errorCount = errors_.size();
+ Token skip;
+ for (;;) {
+ if (!readToken(skip))
+ errors_.resize(errorCount); // discard errors caused by recovery
+ if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream)
+ break;
+ }
+ errors_.resize(errorCount);
+ return false;
+}
+
+bool Reader::addErrorAndRecover(const JSONCPP_STRING& message,
+ Token& token,
+ TokenType skipUntilToken) {
+ addError(message, token);
+ return recoverFromError(skipUntilToken);
+}
+
+Value& Reader::currentValue() { return *(nodes_.top()); }
+
+Reader::Char Reader::getNextChar() {
+ if (current_ == end_)
+ return 0;
+ return *current_++;
+}
+
+void Reader::getLocationLineAndColumn(Location location,
+ int& line,
+ int& column) const {
+ Location current = begin_;
+ Location lastLineStart = current;
+ line = 0;
+ while (current < location && current != end_) {
+ Char c = *current++;
+ if (c == '\r') {
+ if (*current == '\n')
+ ++current;
+ lastLineStart = current;
+ ++line;
+ } else if (c == '\n') {
+ lastLineStart = current;
+ ++line;
+ }
+ }
+ // column & line start at 1
+ column = int(location - lastLineStart) + 1;
+ ++line;
+}
+
+JSONCPP_STRING Reader::getLocationLineAndColumn(Location location) const {
+ int line, column;
+ getLocationLineAndColumn(location, line, column);
+ char buffer[18 + 16 + 16 + 1];
+ snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
+ return buffer;
+}
+
+// Deprecated. Preserved for backward compatibility
+JSONCPP_STRING Reader::getFormatedErrorMessages() const {
+ return getFormattedErrorMessages();
+}
+
+JSONCPP_STRING Reader::getFormattedErrorMessages() const {
+ JSONCPP_STRING formattedMessage;
+ for (Errors::const_iterator itError = errors_.begin();
+ itError != errors_.end();
+ ++itError) {
+ const ErrorInfo& error = *itError;
+ formattedMessage +=
+ "* " + getLocationLineAndColumn(error.token_.start_) + "\n";
+ formattedMessage += " " + error.message_ + "\n";
+ if (error.extra_)
+ formattedMessage +=
+ "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n";
+ }
+ return formattedMessage;
+}
+
+std::vector<Reader::StructuredError> Reader::getStructuredErrors() const {
+ std::vector<Reader::StructuredError> allErrors;
+ for (Errors::const_iterator itError = errors_.begin();
+ itError != errors_.end();
+ ++itError) {
+ const ErrorInfo& error = *itError;
+ Reader::StructuredError structured;
+ structured.offset_start = error.token_.start_ - begin_;
+ structured.offset_limit = error.token_.end_ - begin_;
+ structured.message = error.message_;
+ allErrors.push_back(structured);
+ }
+ return allErrors;
+}
+
+bool Reader::pushError(const Value& value, const JSONCPP_STRING& message) {
+ ptrdiff_t const length = end_ - begin_;
+ if(value.getOffsetStart() > length
+ || value.getOffsetLimit() > length)
+ return false;
+ Token token;
+ token.type_ = tokenError;
+ token.start_ = begin_ + value.getOffsetStart();
+ token.end_ = end_ + value.getOffsetLimit();
+ ErrorInfo info;
+ info.token_ = token;
+ info.message_ = message;
+ info.extra_ = 0;
+ errors_.push_back(info);
+ return true;
+}
+
+bool Reader::pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra) {
+ ptrdiff_t const length = end_ - begin_;
+ if(value.getOffsetStart() > length
+ || value.getOffsetLimit() > length
+ || extra.getOffsetLimit() > length)
+ return false;
+ Token token;
+ token.type_ = tokenError;
+ token.start_ = begin_ + value.getOffsetStart();
+ token.end_ = begin_ + value.getOffsetLimit();
+ ErrorInfo info;
+ info.token_ = token;
+ info.message_ = message;
+ info.extra_ = begin_ + extra.getOffsetStart();
+ errors_.push_back(info);
+ return true;
+}
+
+bool Reader::good() const {
+ return !errors_.size();
+}
+
+// exact copy of Features
+class OurFeatures {
+public:
+ static OurFeatures all();
+ bool allowComments_;
+ bool strictRoot_;
+ bool allowDroppedNullPlaceholders_;
+ bool allowNumericKeys_;
+ bool allowSingleQuotes_;
+ bool failIfExtra_;
+ bool rejectDupKeys_;
+ bool allowSpecialFloats_;
+ int stackLimit_;
+}; // OurFeatures
+
+// exact copy of Implementation of class Features
+// ////////////////////////////////
+
+OurFeatures OurFeatures::all() { return OurFeatures(); }
+
+// Implementation of class Reader
+// ////////////////////////////////
+
+// exact copy of Reader, renamed to OurReader
+class OurReader {
+public:
+ typedef char Char;
+ typedef const Char* Location;
+ struct StructuredError {
+ ptrdiff_t offset_start;
+ ptrdiff_t offset_limit;
+ JSONCPP_STRING message;
+ };
+
+ OurReader(OurFeatures const& features);
+ bool parse(const char* beginDoc,
+ const char* endDoc,
+ Value& root,
+ bool collectComments = true);
+ JSONCPP_STRING getFormattedErrorMessages() const;
+ std::vector<StructuredError> getStructuredErrors() const;
+ bool pushError(const Value& value, const JSONCPP_STRING& message);
+ bool pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra);
+ bool good() const;
+
+private:
+ OurReader(OurReader const&); // no impl
+ void operator=(OurReader const&); // no impl
+
+ enum TokenType {
+ tokenEndOfStream = 0,
+ tokenObjectBegin,
+ tokenObjectEnd,
+ tokenArrayBegin,
+ tokenArrayEnd,
+ tokenString,
+ tokenNumber,
+ tokenTrue,
+ tokenFalse,
+ tokenNull,
+ tokenNaN,
+ tokenPosInf,
+ tokenNegInf,
+ tokenArraySeparator,
+ tokenMemberSeparator,
+ tokenComment,
+ tokenError
+ };
+
+ class Token {
+ public:
+ TokenType type_;
+ Location start_;
+ Location end_;
+ };
+
+ class ErrorInfo {
+ public:
+ Token token_;
+ JSONCPP_STRING message_;
+ Location extra_;
+ };
+
+ typedef std::deque<ErrorInfo> Errors;
+
+ bool readToken(Token& token);
+ void skipSpaces();
+ bool match(Location pattern, int patternLength);
+ bool readComment();
+ bool readCStyleComment();
+ bool readCppStyleComment();
+ bool readString();
+ bool readStringSingleQuote();
+ bool readNumber(bool checkInf);
+ bool readValue();
+ bool readObject(Token& token);
+ bool readArray(Token& token);
+ bool decodeNumber(Token& token);
+ bool decodeNumber(Token& token, Value& decoded);
+ bool decodeString(Token& token);
+ bool decodeString(Token& token, JSONCPP_STRING& decoded);
+ bool decodeDouble(Token& token);
+ bool decodeDouble(Token& token, Value& decoded);
+ bool decodeUnicodeCodePoint(Token& token,
+ Location& current,
+ Location end,
+ unsigned int& unicode);
+ bool decodeUnicodeEscapeSequence(Token& token,
+ Location& current,
+ Location end,
+ unsigned int& unicode);
+ bool addError(const JSONCPP_STRING& message, Token& token, Location extra = 0);
+ bool recoverFromError(TokenType skipUntilToken);
+ bool addErrorAndRecover(const JSONCPP_STRING& message,
+ Token& token,
+ TokenType skipUntilToken);
+ void skipUntilSpace();
+ Value& currentValue();
+ Char getNextChar();
+ void
+ getLocationLineAndColumn(Location location, int& line, int& column) const;
+ JSONCPP_STRING getLocationLineAndColumn(Location location) const;
+ void addComment(Location begin, Location end, CommentPlacement placement);
+ void skipCommentTokens(Token& token);
+
+ static JSONCPP_STRING normalizeEOL(Location begin, Location end);
+ static bool containsNewLine(Location begin, Location end);
+
+ typedef std::stack<Value*> Nodes;
+ Nodes nodes_;
+ Errors errors_;
+ JSONCPP_STRING document_;
+ Location begin_;
+ Location end_;
+ Location current_;
+ Location lastValueEnd_;
+ Value* lastValue_;
+ JSONCPP_STRING commentsBefore_;
+
+ OurFeatures const features_;
+ bool collectComments_;
+}; // OurReader
+
+// complete copy of Read impl, for OurReader
+
+bool OurReader::containsNewLine(OurReader::Location begin, OurReader::Location end) {
+ for (; begin < end; ++begin)
+ if (*begin == '\n' || *begin == '\r')
+ return true;
+ return false;
+}
+
+OurReader::OurReader(OurFeatures const& features)
+ : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),
+ lastValue_(), commentsBefore_(),
+ features_(features), collectComments_() {
+}
+
+bool OurReader::parse(const char* beginDoc,
+ const char* endDoc,
+ Value& root,
+ bool collectComments) {
+ if (!features_.allowComments_) {
+ collectComments = false;
+ }
+
+ begin_ = beginDoc;
+ end_ = endDoc;
+ collectComments_ = collectComments;
+ current_ = begin_;
+ lastValueEnd_ = 0;
+ lastValue_ = 0;
+ commentsBefore_.clear();
+ errors_.clear();
+ while (!nodes_.empty())
+ nodes_.pop();
+ nodes_.push(&root);
+
+ bool successful = readValue();
+ Token token;
+ skipCommentTokens(token);
+ if (features_.failIfExtra_) {
+ if ((features_.strictRoot_ || token.type_ != tokenError) && token.type_ != tokenEndOfStream) {
+ addError("Extra non-whitespace after JSON value.", token);
+ return false;
+ }
+ }
+ if (collectComments_ && !commentsBefore_.empty())
+ root.setComment(commentsBefore_, commentAfter);
+ if (features_.strictRoot_) {
+ if (!root.isArray() && !root.isObject()) {
+ // Set error location to start of doc, ideally should be first token found
+ // in doc
+ token.type_ = tokenError;
+ token.start_ = beginDoc;
+ token.end_ = endDoc;
+ addError(
+ "A valid JSON document must be either an array or an object value.",
+ token);
+ return false;
+ }
+ }
+ return successful;
+}
+
+bool OurReader::readValue() {
+ // To preserve the old behaviour we cast size_t to int.
+ if (static_cast<int>(nodes_.size()) > features_.stackLimit_) throwRuntimeError("Exceeded stackLimit in readValue().");
+ Token token;
+ skipCommentTokens(token);
+ bool successful = true;
+
+ if (collectComments_ && !commentsBefore_.empty()) {
+ currentValue().setComment(commentsBefore_, commentBefore);
+ commentsBefore_.clear();
+ }
+
+ switch (token.type_) {
+ case tokenObjectBegin:
+ successful = readObject(token);
+ currentValue().setOffsetLimit(current_ - begin_);
+ break;
+ case tokenArrayBegin:
+ successful = readArray(token);
+ currentValue().setOffsetLimit(current_ - begin_);
+ break;
+ case tokenNumber:
+ successful = decodeNumber(token);
+ break;
+ case tokenString:
+ successful = decodeString(token);
+ break;
+ case tokenTrue:
+ {
+ Value v(true);
+ currentValue().swapPayload(v);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ }
+ break;
+ case tokenFalse:
+ {
+ Value v(false);
+ currentValue().swapPayload(v);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ }
+ break;
+ case tokenNull:
+ {
+ Value v;
+ currentValue().swapPayload(v);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ }
+ break;
+ case tokenNaN:
+ {
+ Value v(std::numeric_limits<double>::quiet_NaN());
+ currentValue().swapPayload(v);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ }
+ break;
+ case tokenPosInf:
+ {
+ Value v(std::numeric_limits<double>::infinity());
+ currentValue().swapPayload(v);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ }
+ break;
+ case tokenNegInf:
+ {
+ Value v(-std::numeric_limits<double>::infinity());
+ currentValue().swapPayload(v);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ }
+ break;
+ case tokenArraySeparator:
+ case tokenObjectEnd:
+ case tokenArrayEnd:
+ if (features_.allowDroppedNullPlaceholders_) {
+ // "Un-read" the current token and mark the current value as a null
+ // token.
+ current_--;
+ Value v;
+ currentValue().swapPayload(v);
+ currentValue().setOffsetStart(current_ - begin_ - 1);
+ currentValue().setOffsetLimit(current_ - begin_);
+ break;
+ } // else, fall through ...
+ default:
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ return addError("Syntax error: value, object or array expected.", token);
+ }
+
+ if (collectComments_) {
+ lastValueEnd_ = current_;
+ lastValue_ = &currentValue();
+ }
+
+ return successful;
+}
+
+void OurReader::skipCommentTokens(Token& token) {
+ if (features_.allowComments_) {
+ do {
+ readToken(token);
+ } while (token.type_ == tokenComment);
+ } else {
+ readToken(token);
+ }
+}
+
+bool OurReader::readToken(Token& token) {
+ skipSpaces();
+ token.start_ = current_;
+ Char c = getNextChar();
+ bool ok = true;
+ switch (c) {
+ case '{':
+ token.type_ = tokenObjectBegin;
+ break;
+ case '}':
+ token.type_ = tokenObjectEnd;
+ break;
+ case '[':
+ token.type_ = tokenArrayBegin;
+ break;
+ case ']':
+ token.type_ = tokenArrayEnd;
+ break;
+ case '"':
+ token.type_ = tokenString;
+ ok = readString();
+ break;
+ case '\'':
+ if (features_.allowSingleQuotes_) {
+ token.type_ = tokenString;
+ ok = readStringSingleQuote();
+ break;
+ } // else continue
+ case '/':
+ token.type_ = tokenComment;
+ ok = readComment();
+ break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ token.type_ = tokenNumber;
+ readNumber(false);
+ break;
+ case '-':
+ if (readNumber(true)) {
+ token.type_ = tokenNumber;
+ } else {
+ token.type_ = tokenNegInf;
+ ok = features_.allowSpecialFloats_ && match("nfinity", 7);
+ }
+ break;
+ case 't':
+ token.type_ = tokenTrue;
+ ok = match("rue", 3);
+ break;
+ case 'f':
+ token.type_ = tokenFalse;
+ ok = match("alse", 4);
+ break;
+ case 'n':
+ token.type_ = tokenNull;
+ ok = match("ull", 3);
+ break;
+ case 'N':
+ if (features_.allowSpecialFloats_) {
+ token.type_ = tokenNaN;
+ ok = match("aN", 2);
+ } else {
+ ok = false;
+ }
+ break;
+ case 'I':
+ if (features_.allowSpecialFloats_) {
+ token.type_ = tokenPosInf;
+ ok = match("nfinity", 7);
+ } else {
+ ok = false;
+ }
+ break;
+ case ',':
+ token.type_ = tokenArraySeparator;
+ break;
+ case ':':
+ token.type_ = tokenMemberSeparator;
+ break;
+ case 0:
+ token.type_ = tokenEndOfStream;
+ break;
+ default:
+ ok = false;
+ break;
}
- if (isDouble)
- return decodeDouble(token, decoded);
+ if (!ok)
+ token.type_ = tokenError;
+ token.end_ = current_;
+ return true;
+}
+
+void OurReader::skipSpaces() {
+ while (current_ != end_) {
+ Char c = *current_;
+ if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
+ ++current_;
+ else
+ break;
+ }
+}
+
+bool OurReader::match(Location pattern, int patternLength) {
+ if (end_ - current_ < patternLength)
+ return false;
+ int index = patternLength;
+ while (index--)
+ if (current_[index] != pattern[index])
+ return false;
+ current_ += patternLength;
+ return true;
+}
+
+bool OurReader::readComment() {
+ Location commentBegin = current_ - 1;
+ Char c = getNextChar();
+ bool successful = false;
+ if (c == '*')
+ successful = readCStyleComment();
+ else if (c == '/')
+ successful = readCppStyleComment();
+ if (!successful)
+ return false;
+
+ if (collectComments_) {
+ CommentPlacement placement = commentBefore;
+ if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) {
+ if (c != '*' || !containsNewLine(commentBegin, current_))
+ placement = commentAfterOnSameLine;
+ }
+
+ addComment(commentBegin, current_, placement);
+ }
+ return true;
+}
+
+JSONCPP_STRING OurReader::normalizeEOL(OurReader::Location begin, OurReader::Location end) {
+ JSONCPP_STRING normalized;
+ normalized.reserve(static_cast<size_t>(end - begin));
+ OurReader::Location current = begin;
+ while (current != end) {
+ char c = *current++;
+ if (c == '\r') {
+ if (current != end && *current == '\n')
+ // convert dos EOL
+ ++current;
+ // convert Mac EOL
+ normalized += '\n';
+ } else {
+ normalized += c;
+ }
+ }
+ return normalized;
+}
+
+void
+OurReader::addComment(Location begin, Location end, CommentPlacement placement) {
+ assert(collectComments_);
+ const JSONCPP_STRING& normalized = normalizeEOL(begin, end);
+ if (placement == commentAfterOnSameLine) {
+ assert(lastValue_ != 0);
+ lastValue_->setComment(normalized, placement);
+ } else {
+ commentsBefore_ += normalized;
+ }
+}
+
+bool OurReader::readCStyleComment() {
+ while ((current_ + 1) < end_) {
+ Char c = getNextChar();
+ if (c == '*' && *current_ == '/')
+ break;
+ }
+ return getNextChar() == '/';
+}
+
+bool OurReader::readCppStyleComment() {
+ while (current_ != end_) {
+ Char c = getNextChar();
+ if (c == '\n')
+ break;
+ if (c == '\r') {
+ // Consume DOS EOL. It will be normalized in addComment.
+ if (current_ != end_ && *current_ == '\n')
+ getNextChar();
+ // Break on Moc OS 9 EOL.
+ break;
+ }
+ }
+ return true;
+}
+
+bool OurReader::readNumber(bool checkInf) {
+ const char *p = current_;
+ if (checkInf && p != end_ && *p == 'I') {
+ current_ = ++p;
+ return false;
+ }
+ char c = '0'; // stopgap for already consumed character
+ // integral part
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : '\0';
+ // fractional part
+ if (c == '.') {
+ c = (current_ = p) < end_ ? *p++ : '\0';
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : '\0';
+ }
+ // exponential part
+ if (c == 'e' || c == 'E') {
+ c = (current_ = p) < end_ ? *p++ : '\0';
+ if (c == '+' || c == '-')
+ c = (current_ = p) < end_ ? *p++ : '\0';
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : '\0';
+ }
+ return true;
+}
+bool OurReader::readString() {
+ Char c = 0;
+ while (current_ != end_) {
+ c = getNextChar();
+ if (c == '\\')
+ getNextChar();
+ else if (c == '"')
+ break;
+ }
+ return c == '"';
+}
+
+
+bool OurReader::readStringSingleQuote() {
+ Char c = 0;
+ while (current_ != end_) {
+ c = getNextChar();
+ if (c == '\\')
+ getNextChar();
+ else if (c == '\'')
+ break;
+ }
+ return c == '\'';
+}
+
+bool OurReader::readObject(Token& tokenStart) {
+ Token tokenName;
+ JSONCPP_STRING name;
+ Value init(objectValue);
+ currentValue().swapPayload(init);
+ currentValue().setOffsetStart(tokenStart.start_ - begin_);
+ while (readToken(tokenName)) {
+ bool initialTokenOk = true;
+ while (tokenName.type_ == tokenComment && initialTokenOk)
+ initialTokenOk = readToken(tokenName);
+ if (!initialTokenOk)
+ break;
+ if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
+ return true;
+ name.clear();
+ if (tokenName.type_ == tokenString) {
+ if (!decodeString(tokenName, name))
+ return recoverFromError(tokenObjectEnd);
+ } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) {
+ Value numberName;
+ if (!decodeNumber(tokenName, numberName))
+ return recoverFromError(tokenObjectEnd);
+ name = numberName.asString();
+ } else {
+ break;
+ }
+
+ Token colon;
+ if (!readToken(colon) || colon.type_ != tokenMemberSeparator) {
+ return addErrorAndRecover(
+ "Missing ':' after object member name", colon, tokenObjectEnd);
+ }
+ if (name.length() >= (1U<<30)) throwRuntimeError("keylength >= 2^30");
+ if (features_.rejectDupKeys_ && currentValue().isMember(name)) {
+ JSONCPP_STRING msg = "Duplicate key: '" + name + "'";
+ return addErrorAndRecover(
+ msg, tokenName, tokenObjectEnd);
+ }
+ Value& value = currentValue()[name];
+ nodes_.push(&value);
+ bool ok = readValue();
+ nodes_.pop();
+ if (!ok) // error already set
+ return recoverFromError(tokenObjectEnd);
+
+ Token comma;
+ if (!readToken(comma) ||
+ (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&
+ comma.type_ != tokenComment)) {
+ return addErrorAndRecover(
+ "Missing ',' or '}' in object declaration", comma, tokenObjectEnd);
+ }
+ bool finalizeTokenOk = true;
+ while (comma.type_ == tokenComment && finalizeTokenOk)
+ finalizeTokenOk = readToken(comma);
+ if (comma.type_ == tokenObjectEnd)
+ return true;
+ }
+ return addErrorAndRecover(
+ "Missing '}' or object member name", tokenName, tokenObjectEnd);
+}
+
+bool OurReader::readArray(Token& tokenStart) {
+ Value init(arrayValue);
+ currentValue().swapPayload(init);
+ currentValue().setOffsetStart(tokenStart.start_ - begin_);
+ skipSpaces();
+ if (current_ != end_ && *current_ == ']') // empty array
+ {
+ Token endArray;
+ readToken(endArray);
+ return true;
+ }
+ int index = 0;
+ for (;;) {
+ Value& value = currentValue()[index++];
+ nodes_.push(&value);
+ bool ok = readValue();
+ nodes_.pop();
+ if (!ok) // error already set
+ return recoverFromError(tokenArrayEnd);
+
+ Token token;
+ // Accept Comment after last item in the array.
+ ok = readToken(token);
+ while (token.type_ == tokenComment && ok) {
+ ok = readToken(token);
+ }
+ bool badTokenType =
+ (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd);
+ if (!ok || badTokenType) {
+ return addErrorAndRecover(
+ "Missing ',' or ']' in array declaration", token, tokenArrayEnd);
+ }
+ if (token.type_ == tokenArrayEnd)
+ break;
+ }
+ return true;
+}
+
+bool OurReader::decodeNumber(Token& token) {
+ Value decoded;
+ if (!decodeNumber(token, decoded))
+ return false;
+ currentValue().swapPayload(decoded);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ return true;
+}
+
+bool OurReader::decodeNumber(Token& token, Value& decoded) {
// Attempts to parse the number as an integer. If the number is
// larger than the maximum supported value of an integer then
// we decode the number as a double.
@@ -518,6 +1579,7 @@ bool Reader::decodeNumber(Token& token, Value& decoded) {
bool isNegative = *current == '-';
if (isNegative)
++current;
+ // TODO: Help the compiler do the div and mod at compile time or get rid of them.
Value::LargestUInt maxIntegerValue =
isNegative ? Value::LargestUInt(-Value::minLargestInt)
: Value::maxLargestUInt;
@@ -526,9 +1588,7 @@ bool Reader::decodeNumber(Token& token, Value& decoded) {
while (current < token.end_) {
Char c = *current++;
if (c < '0' || c > '9')
- return addError("'" + std::string(token.start_, token.end_) +
- "' is not a number.",
- token);
+ return decodeDouble(token, decoded);
Value::UInt digit(static_cast<Value::UInt>(c - '0'));
if (value >= threshold) {
// We've hit or exceeded the max value divided by 10 (rounded down). If
@@ -551,26 +1611,27 @@ bool Reader::decodeNumber(Token& token, Value& decoded) {
return true;
}
-bool Reader::decodeDouble(Token& token) {
+bool OurReader::decodeDouble(Token& token) {
Value decoded;
if (!decodeDouble(token, decoded))
return false;
- currentValue() = decoded;
+ currentValue().swapPayload(decoded);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
return true;
}
-bool Reader::decodeDouble(Token& token, Value& decoded) {
+bool OurReader::decodeDouble(Token& token, Value& decoded) {
double value = 0;
const int bufferSize = 32;
int count;
- int length = int(token.end_ - token.start_);
+ ptrdiff_t const length = token.end_ - token.start_;
// Sanity check to avoid buffer overflow exploits.
if (length < 0) {
return addError("Unable to parse token length", token);
}
+ size_t const ulength = static_cast<size_t>(length);
// Avoid using a string constant for the format control string given to
// sscanf, as this can cause hard to debug crashes on OS X. See here for more
@@ -581,34 +1642,36 @@ bool Reader::decodeDouble(Token& token, Value& decoded) {
if (length <= bufferSize) {
Char buffer[bufferSize + 1];
- memcpy(buffer, token.start_, length);
+ memcpy(buffer, token.start_, ulength);
buffer[length] = 0;
+ fixNumericLocaleInput(buffer, buffer + length);
count = sscanf(buffer, format, &value);
} else {
- std::string buffer(token.start_, token.end_);
+ JSONCPP_STRING buffer(token.start_, token.end_);
count = sscanf(buffer.c_str(), format, &value);
}
if (count != 1)
- return addError("'" + std::string(token.start_, token.end_) +
+ return addError("'" + JSONCPP_STRING(token.start_, token.end_) +
"' is not a number.",
token);
decoded = value;
return true;
}
-bool Reader::decodeString(Token& token) {
- std::string decoded;
- if (!decodeString(token, decoded))
+bool OurReader::decodeString(Token& token) {
+ JSONCPP_STRING decoded_string;
+ if (!decodeString(token, decoded_string))
return false;
- currentValue() = decoded;
+ Value decoded(decoded_string);
+ currentValue().swapPayload(decoded);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
return true;
}
-bool Reader::decodeString(Token& token, std::string& decoded) {
- decoded.reserve(token.end_ - token.start_ - 2);
+bool OurReader::decodeString(Token& token, JSONCPP_STRING& decoded) {
+ decoded.reserve(static_cast<size_t>(token.end_ - token.start_ - 2));
Location current = token.start_ + 1; // skip '"'
Location end = token.end_ - 1; // do not include '"'
while (current != end) {
@@ -660,11 +1723,12 @@ bool Reader::decodeString(Token& token, std::string& decoded) {
return true;
}
-bool Reader::decodeUnicodeCodePoint(Token& token,
+bool OurReader::decodeUnicodeCodePoint(Token& token,
Location& current,
Location end,
unsigned int& unicode) {
+ unicode = 0; // Convince scanbuild this is always initialized before use.
if (!decodeUnicodeEscapeSequence(token, current, end, unicode))
return false;
if (unicode >= 0xD800 && unicode <= 0xDBFF) {
@@ -689,16 +1753,16 @@ bool Reader::decodeUnicodeCodePoint(Token& token,
return true;
}
-bool Reader::decodeUnicodeEscapeSequence(Token& token,
+bool OurReader::decodeUnicodeEscapeSequence(Token& token,
Location& current,
Location end,
- unsigned int& unicode) {
+ unsigned int& ret_unicode) {
if (end - current < 4)
return addError(
"Bad unicode escape sequence in string: four digits expected.",
token,
current);
- unicode = 0;
+ int unicode = 0;
for (int index = 0; index < 4; ++index) {
Char c = *current++;
unicode *= 16;
@@ -714,11 +1778,12 @@ bool Reader::decodeUnicodeEscapeSequence(Token& token,
token,
current);
}
+ ret_unicode = static_cast<unsigned int>(unicode);
return true;
}
bool
-Reader::addError(const std::string& message, Token& token, Location extra) {
+OurReader::addError(const JSONCPP_STRING& message, Token& token, Location extra) {
ErrorInfo info;
info.token_ = token;
info.message_ = message;
@@ -727,8 +1792,8 @@ Reader::addError(const std::string& message, Token& token, Location extra) {
return false;
}
-bool Reader::recoverFromError(TokenType skipUntilToken) {
- int errorCount = int(errors_.size());
+bool OurReader::recoverFromError(TokenType skipUntilToken) {
+ size_t errorCount = errors_.size();
Token skip;
for (;;) {
if (!readToken(skip))
@@ -740,22 +1805,22 @@ bool Reader::recoverFromError(TokenType skipUntilToken) {
return false;
}
-bool Reader::addErrorAndRecover(const std::string& message,
+bool OurReader::addErrorAndRecover(const JSONCPP_STRING& message,
Token& token,
TokenType skipUntilToken) {
addError(message, token);
return recoverFromError(skipUntilToken);
}
-Value& Reader::currentValue() { return *(nodes_.top()); }
+Value& OurReader::currentValue() { return *(nodes_.top()); }
-Reader::Char Reader::getNextChar() {
+OurReader::Char OurReader::getNextChar() {
if (current_ == end_)
return 0;
return *current_++;
}
-void Reader::getLocationLineAndColumn(Location location,
+void OurReader::getLocationLineAndColumn(Location location,
int& line,
int& column) const {
Location current = begin_;
@@ -778,29 +1843,16 @@ void Reader::getLocationLineAndColumn(Location location,
++line;
}
-std::string Reader::getLocationLineAndColumn(Location location) const {
+JSONCPP_STRING OurReader::getLocationLineAndColumn(Location location) const {
int line, column;
getLocationLineAndColumn(location, line, column);
char buffer[18 + 16 + 16 + 1];
-#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__)
-#if defined(WINCE)
- _snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
-#else
- sprintf_s(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
-#endif
-#else
snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
-#endif
return buffer;
}
-// Deprecated. Preserved for backward compatibility
-std::string Reader::getFormatedErrorMessages() const {
- return getFormattedErrorMessages();
-}
-
-std::string Reader::getFormattedErrorMessages() const {
- std::string formattedMessage;
+JSONCPP_STRING OurReader::getFormattedErrorMessages() const {
+ JSONCPP_STRING formattedMessage;
for (Errors::const_iterator itError = errors_.begin();
itError != errors_.end();
++itError) {
@@ -815,13 +1867,13 @@ std::string Reader::getFormattedErrorMessages() const {
return formattedMessage;
}
-std::vector<Reader::StructuredError> Reader::getStructuredErrors() const {
- std::vector<Reader::StructuredError> allErrors;
+std::vector<OurReader::StructuredError> OurReader::getStructuredErrors() const {
+ std::vector<OurReader::StructuredError> allErrors;
for (Errors::const_iterator itError = errors_.begin();
itError != errors_.end();
++itError) {
const ErrorInfo& error = *itError;
- Reader::StructuredError structured;
+ OurReader::StructuredError structured;
structured.offset_start = error.token_.start_ - begin_;
structured.offset_limit = error.token_.end_ - begin_;
structured.message = error.message_;
@@ -830,8 +1882,8 @@ std::vector<Reader::StructuredError> Reader::getStructuredErrors() const {
return allErrors;
}
-bool Reader::pushError(const Value& value, const std::string& message) {
- size_t length = end_ - begin_;
+bool OurReader::pushError(const Value& value, const JSONCPP_STRING& message) {
+ ptrdiff_t length = end_ - begin_;
if(value.getOffsetStart() > length
|| value.getOffsetLimit() > length)
return false;
@@ -847,8 +1899,8 @@ bool Reader::pushError(const Value& value, const std::string& message) {
return true;
}
-bool Reader::pushError(const Value& value, const std::string& message, const Value& extra) {
- size_t length = end_ - begin_;
+bool OurReader::pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra) {
+ ptrdiff_t length = end_ - begin_;
if(value.getOffsetStart() > length
|| value.getOffsetLimit() > length
|| extra.getOffsetLimit() > length)
@@ -865,19 +1917,147 @@ bool Reader::pushError(const Value& value, const std::string& message, const Val
return true;
}
-bool Reader::good() const {
+bool OurReader::good() const {
return !errors_.size();
}
-std::istream& operator>>(std::istream& sin, Value& root) {
- Json::Reader reader;
- bool ok = reader.parse(sin, root, true);
+
+class OurCharReader : public CharReader {
+ bool const collectComments_;
+ OurReader reader_;
+public:
+ OurCharReader(
+ bool collectComments,
+ OurFeatures const& features)
+ : collectComments_(collectComments)
+ , reader_(features)
+ {}
+ bool parse(
+ char const* beginDoc, char const* endDoc,
+ Value* root, JSONCPP_STRING* errs) JSONCPP_OVERRIDE {
+ bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
+ if (errs) {
+ *errs = reader_.getFormattedErrorMessages();
+ }
+ return ok;
+ }
+};
+
+CharReaderBuilder::CharReaderBuilder()
+{
+ setDefaults(&settings_);
+}
+CharReaderBuilder::~CharReaderBuilder()
+{}
+CharReader* CharReaderBuilder::newCharReader() const
+{
+ bool collectComments = settings_["collectComments"].asBool();
+ OurFeatures features = OurFeatures::all();
+ features.allowComments_ = settings_["allowComments"].asBool();
+ features.strictRoot_ = settings_["strictRoot"].asBool();
+ features.allowDroppedNullPlaceholders_ = settings_["allowDroppedNullPlaceholders"].asBool();
+ features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool();
+ features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool();
+ features.stackLimit_ = settings_["stackLimit"].asInt();
+ features.failIfExtra_ = settings_["failIfExtra"].asBool();
+ features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool();
+ features.allowSpecialFloats_ = settings_["allowSpecialFloats"].asBool();
+ return new OurCharReader(collectComments, features);
+}
+static void getValidReaderKeys(std::set<JSONCPP_STRING>* valid_keys)
+{
+ valid_keys->clear();
+ valid_keys->insert("collectComments");
+ valid_keys->insert("allowComments");
+ valid_keys->insert("strictRoot");
+ valid_keys->insert("allowDroppedNullPlaceholders");
+ valid_keys->insert("allowNumericKeys");
+ valid_keys->insert("allowSingleQuotes");
+ valid_keys->insert("stackLimit");
+ valid_keys->insert("failIfExtra");
+ valid_keys->insert("rejectDupKeys");
+ valid_keys->insert("allowSpecialFloats");
+}
+bool CharReaderBuilder::validate(Json::Value* invalid) const
+{
+ Json::Value my_invalid;
+ if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL
+ Json::Value& inv = *invalid;
+ std::set<JSONCPP_STRING> valid_keys;
+ getValidReaderKeys(&valid_keys);
+ Value::Members keys = settings_.getMemberNames();
+ size_t n = keys.size();
+ for (size_t i = 0; i < n; ++i) {
+ JSONCPP_STRING const& key = keys[i];
+ if (valid_keys.find(key) == valid_keys.end()) {
+ inv[key] = settings_[key];
+ }
+ }
+ return 0u == inv.size();
+}
+Value& CharReaderBuilder::operator[](JSONCPP_STRING key)
+{
+ return settings_[key];
+}
+// static
+void CharReaderBuilder::strictMode(Json::Value* settings)
+{
+//! [CharReaderBuilderStrictMode]
+ (*settings)["allowComments"] = false;
+ (*settings)["strictRoot"] = true;
+ (*settings)["allowDroppedNullPlaceholders"] = false;
+ (*settings)["allowNumericKeys"] = false;
+ (*settings)["allowSingleQuotes"] = false;
+ (*settings)["stackLimit"] = 1000;
+ (*settings)["failIfExtra"] = true;
+ (*settings)["rejectDupKeys"] = true;
+ (*settings)["allowSpecialFloats"] = false;
+//! [CharReaderBuilderStrictMode]
+}
+// static
+void CharReaderBuilder::setDefaults(Json::Value* settings)
+{
+//! [CharReaderBuilderDefaults]
+ (*settings)["collectComments"] = true;
+ (*settings)["allowComments"] = true;
+ (*settings)["strictRoot"] = false;
+ (*settings)["allowDroppedNullPlaceholders"] = false;
+ (*settings)["allowNumericKeys"] = false;
+ (*settings)["allowSingleQuotes"] = false;
+ (*settings)["stackLimit"] = 1000;
+ (*settings)["failIfExtra"] = false;
+ (*settings)["rejectDupKeys"] = false;
+ (*settings)["allowSpecialFloats"] = false;
+//! [CharReaderBuilderDefaults]
+}
+
+//////////////////////////////////
+// global functions
+
+bool parseFromStream(
+ CharReader::Factory const& fact, JSONCPP_ISTREAM& sin,
+ Value* root, JSONCPP_STRING* errs)
+{
+ JSONCPP_OSTRINGSTREAM ssin;
+ ssin << sin.rdbuf();
+ JSONCPP_STRING doc = ssin.str();
+ char const* begin = doc.data();
+ char const* end = begin + doc.size();
+ // Note that we do not actually need a null-terminator.
+ CharReaderPtr const reader(fact.newCharReader());
+ return reader->parse(begin, end, root, errs);
+}
+
+JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) {
+ CharReaderBuilder b;
+ JSONCPP_STRING errs;
+ bool ok = parseFromStream(b, sin, &root, &errs);
if (!ok) {
fprintf(stderr,
"Error from reader: %s",
- reader.getFormattedErrorMessages().c_str());
+ errs.c_str());
- JSON_FAIL_MESSAGE("reader error");
+ throwRuntimeError(errs);
}
return sin;
}
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_tool.h b/Utilities/cmjsoncpp/src/lib_json/json_tool.h
index f9b61c3..4316178 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_tool.h
+++ b/Utilities/cmjsoncpp/src/lib_json/json_tool.h
@@ -1,4 +1,4 @@
-// Copyright 2007-2010 Baptiste Lepilleur
+// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -6,6 +6,16 @@
#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED
#define LIB_JSONCPP_JSON_TOOL_H_INCLUDED
+
+// Also support old flag NO_LOCALE_SUPPORT
+#ifdef NO_LOCALE_SUPPORT
+#define JSONCPP_NO_LOCALE_SUPPORT
+#endif
+
+#ifndef JSONCPP_NO_LOCALE_SUPPORT
+#include <clocale>
+#endif
+
/* This header provides common string manipulation support, such as UTF-8,
* portable conversion from/to string...
*
@@ -13,10 +23,18 @@
*/
namespace Json {
+static char getDecimalPoint() {
+#ifdef JSONCPP_NO_LOCALE_SUPPORT
+ return '\0';
+#else
+ struct lconv* lc = localeconv();
+ return lc ? *(lc->decimal_point) : '\0';
+#endif
+}
/// Converts a unicode code-point to UTF-8.
-static inline std::string codePointToUTF8(unsigned int cp) {
- std::string result;
+static inline JSONCPP_STRING codePointToUTF8(unsigned int cp) {
+ JSONCPP_STRING result;
// based on description from http://en.wikipedia.org/wiki/UTF-8
@@ -30,8 +48,8 @@ static inline std::string codePointToUTF8(unsigned int cp) {
} else if (cp <= 0xFFFF) {
result.resize(3);
result[2] = static_cast<char>(0x80 | (0x3f & cp));
- result[1] = 0x80 | static_cast<char>((0x3f & (cp >> 6)));
- result[0] = 0xE0 | static_cast<char>((0xf & (cp >> 12)));
+ result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));
+ result[0] = static_cast<char>(0xE0 | (0xf & (cp >> 12)));
} else if (cp <= 0x10FFFF) {
result.resize(4);
result[3] = static_cast<char>(0x80 | (0x3f & cp));
@@ -43,7 +61,7 @@ static inline std::string codePointToUTF8(unsigned int cp) {
return result;
}
-/// Returns true if ch is a control character (in range [0,32[).
+/// Returns true if ch is a control character (in range [1,31]).
static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; }
enum {
@@ -63,7 +81,7 @@ typedef char UIntToStringBuffer[uintToStringBufferSize];
static inline void uintToString(LargestUInt value, char*& current) {
*--current = 0;
do {
- *--current = char(value % 10) + '0';
+ *--current = static_cast<char>(value % 10U + static_cast<unsigned>('0'));
value /= 10;
} while (value != 0);
}
@@ -82,6 +100,18 @@ static inline void fixNumericLocale(char* begin, char* end) {
}
}
+static inline void fixNumericLocaleInput(char* begin, char* end) {
+ char decimalPoint = getDecimalPoint();
+ if (decimalPoint != '\0' && decimalPoint != '.') {
+ while (begin < end) {
+ if (*begin == '.') {
+ *begin = decimalPoint;
+ }
+ ++begin;
+ }
+ }
+}
+
} // namespace Json {
#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp
index 478afe1..f271e57 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp
@@ -1,4 +1,4 @@
-// Copyright 2011 Baptiste Lepilleur
+// Copyright 2011 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -7,9 +7,6 @@
#include <json/assertions.h>
#include <json/value.h>
#include <json/writer.h>
-#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-#include "json_batchallocator.h"
-#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
#endif // if !defined(JSON_IS_AMALGAMATION)
#include <math.h>
#include <sstream>
@@ -20,6 +17,7 @@
#include <cpptl/conststring.h>
#endif
#include <cstddef> // size_t
+#include <algorithm> // min()
#define JSON_ASSERT_UNREACHABLE assert(false)
@@ -33,9 +31,22 @@ namespace Json {
#else
#define ALIGNAS(byte_alignment)
#endif
-static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 };
-const unsigned char& kNullRef = kNull[0];
-const Value& Value::null = reinterpret_cast<const Value&>(kNullRef);
+//static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 };
+//const unsigned char& kNullRef = kNull[0];
+//const Value& Value::null = reinterpret_cast<const Value&>(kNullRef);
+//const Value& Value::nullRef = null;
+
+// static
+Value const& Value::nullSingleton()
+{
+ static Value const nullStatic;
+ return nullStatic;
+}
+
+// for backwards compatibility, we'll leave these global references around, but DO NOT
+// use them in JSONCPP library code any more!
+Value const& Value::null = Value::nullSingleton();
+Value const& Value::nullRef = Value::nullSingleton();
const Int Value::minInt = Int(~(UInt(-1) / 2));
const Int Value::maxInt = Int(UInt(-1) / 2);
@@ -53,17 +64,17 @@ const LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2));
const LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2);
const LargestUInt Value::maxLargestUInt = LargestUInt(-1);
-/// Unknown size marker
-static const unsigned int unknown = (unsigned)-1;
-
#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
template <typename T, typename U>
static inline bool InRange(double d, T min, U max) {
+ // The casts can lose precision, but we are looking only for
+ // an approximate range. Might fail on edge cases though. ~cdunn
+ //return d >= static_cast<double>(min) && d <= static_cast<double>(max);
return d >= min && d <= max;
}
#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
static inline double integerToDouble(Json::UInt64 value) {
- return static_cast<double>(Int64(value / 2)) * 2.0 + Int64(value & 1);
+ return static_cast<double>(Int64(value / 2)) * 2.0 + static_cast<double>(Int64(value & 1));
}
template <typename T> static inline double integerToDouble(T value) {
@@ -84,27 +95,84 @@ static inline bool InRange(double d, T min, U max) {
* @return Pointer on the duplicate instance of string.
*/
static inline char* duplicateStringValue(const char* value,
- unsigned int length = unknown) {
- if (length == unknown)
- length = (unsigned int)strlen(value);
-
+ size_t length)
+{
// Avoid an integer overflow in the call to malloc below by limiting length
// to a sane value.
- if (length >= (unsigned)Value::maxInt)
+ if (length >= static_cast<size_t>(Value::maxInt))
length = Value::maxInt - 1;
char* newString = static_cast<char*>(malloc(length + 1));
- JSON_ASSERT_MESSAGE(newString != 0,
- "in Json::Value::duplicateStringValue(): "
- "Failed to allocate string value buffer");
+ if (newString == NULL) {
+ throwRuntimeError(
+ "in Json::Value::duplicateStringValue(): "
+ "Failed to allocate string value buffer");
+ }
memcpy(newString, value, length);
newString[length] = 0;
return newString;
}
-/** Free the string duplicated by duplicateStringValue().
+/* Record the length as a prefix.
+ */
+static inline char* duplicateAndPrefixStringValue(
+ const char* value,
+ unsigned int length)
+{
+ // Avoid an integer overflow in the call to malloc below by limiting length
+ // to a sane value.
+ JSON_ASSERT_MESSAGE(length <= static_cast<unsigned>(Value::maxInt) - sizeof(unsigned) - 1U,
+ "in Json::Value::duplicateAndPrefixStringValue(): "
+ "length too big for prefixing");
+ unsigned actualLength = length + static_cast<unsigned>(sizeof(unsigned)) + 1U;
+ char* newString = static_cast<char*>(malloc(actualLength));
+ if (newString == 0) {
+ throwRuntimeError(
+ "in Json::Value::duplicateAndPrefixStringValue(): "
+ "Failed to allocate string value buffer");
+ }
+ *reinterpret_cast<unsigned*>(newString) = length;
+ memcpy(newString + sizeof(unsigned), value, length);
+ newString[actualLength - 1U] = 0; // to avoid buffer over-run accidents by users later
+ return newString;
+}
+inline static void decodePrefixedString(
+ bool isPrefixed, char const* prefixed,
+ unsigned* length, char const** value)
+{
+ if (!isPrefixed) {
+ *length = static_cast<unsigned>(strlen(prefixed));
+ *value = prefixed;
+ } else {
+ *length = *reinterpret_cast<unsigned const*>(prefixed);
+ *value = prefixed + sizeof(unsigned);
+ }
+}
+/** Free the string duplicated by duplicateStringValue()/duplicateAndPrefixStringValue().
*/
-static inline void releaseStringValue(char* value) { free(value); }
+#if JSONCPP_USING_SECURE_MEMORY
+static inline void releasePrefixedStringValue(char* value) {
+ unsigned length = 0;
+ char const* valueDecoded;
+ decodePrefixedString(true, value, &length, &valueDecoded);
+ size_t const size = sizeof(unsigned) + length + 1U;
+ memset(value, 0, size);
+ free(value);
+}
+static inline void releaseStringValue(char* value, unsigned length) {
+ // length==0 => we allocated the strings memory
+ size_t size = (length==0) ? strlen(value) : length;
+ memset(value, 0, size);
+ free(value);
+}
+#else // !JSONCPP_USING_SECURE_MEMORY
+static inline void releasePrefixedStringValue(char* value) {
+ free(value);
+}
+static inline void releaseStringValue(char* value, unsigned) {
+ free(value);
+}
+#endif // JSONCPP_USING_SECURE_MEMORY
} // namespace Json
@@ -116,16 +184,36 @@ static inline void releaseStringValue(char* value) { free(value); }
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
#if !defined(JSON_IS_AMALGAMATION)
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
-#include "json_internalarray.inl"
-#include "json_internalmap.inl"
-#endif // JSON_VALUE_USE_INTERNAL_MAP
#include "json_valueiterator.inl"
#endif // if !defined(JSON_IS_AMALGAMATION)
namespace Json {
+Exception::Exception(JSONCPP_STRING const& msg)
+ : msg_(msg)
+{}
+Exception::~Exception() JSONCPP_NOEXCEPT
+{}
+char const* Exception::what() const JSONCPP_NOEXCEPT
+{
+ return msg_.c_str();
+}
+RuntimeError::RuntimeError(JSONCPP_STRING const& msg)
+ : Exception(msg)
+{}
+LogicError::LogicError(JSONCPP_STRING const& msg)
+ : Exception(msg)
+{}
+JSONCPP_NORETURN void throwRuntimeError(JSONCPP_STRING const& msg)
+{
+ throw RuntimeError(msg);
+}
+JSONCPP_NORETURN void throwLogicError(JSONCPP_STRING const& msg)
+{
+ throw LogicError(msg);
+}
+
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
@@ -134,22 +222,25 @@ namespace Json {
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
-Value::CommentInfo::CommentInfo() : comment_(0) {}
+Value::CommentInfo::CommentInfo() : comment_(0)
+{}
Value::CommentInfo::~CommentInfo() {
if (comment_)
- releaseStringValue(comment_);
+ releaseStringValue(comment_, 0u);
}
-void Value::CommentInfo::setComment(const char* text) {
- if (comment_)
- releaseStringValue(comment_);
+void Value::CommentInfo::setComment(const char* text, size_t len) {
+ if (comment_) {
+ releaseStringValue(comment_, 0u);
+ comment_ = 0;
+ }
JSON_ASSERT(text != 0);
JSON_ASSERT_MESSAGE(
text[0] == '\0' || text[0] == '/',
"in Json::Value::setComment(): Comments must start with /");
// It seems that /**/ style comments are acceptable as well.
- comment_ = duplicateStringValue(text);
+ comment_ = duplicateStringValue(text, len);
}
// //////////////////////////////////////////////////////////////////
@@ -159,29 +250,41 @@ void Value::CommentInfo::setComment(const char* text) {
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
-// Notes: index_ indicates if the string was allocated when
+// Notes: policy_ indicates if the string was allocated when
// a string is stored.
-Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {}
+Value::CZString::CZString(ArrayIndex aindex) : cstr_(0), index_(aindex) {}
-Value::CZString::CZString(const char* cstr, DuplicationPolicy allocate)
- : cstr_(allocate == duplicate ? duplicateStringValue(cstr) : cstr),
- index_(allocate) {}
+Value::CZString::CZString(char const* str, unsigned ulength, DuplicationPolicy allocate)
+ : cstr_(str) {
+ // allocate != duplicate
+ storage_.policy_ = allocate & 0x3;
+ storage_.length_ = ulength & 0x3FFFFFFF;
+}
-Value::CZString::CZString(const CZString& other)
- : cstr_(other.index_ != noDuplication && other.cstr_ != 0
- ? duplicateStringValue(other.cstr_)
- : other.cstr_),
- index_(other.cstr_
- ? static_cast<ArrayIndex>(other.index_ == noDuplication
+Value::CZString::CZString(const CZString& other) {
+ cstr_ = (other.storage_.policy_ != noDuplication && other.cstr_ != 0
+ ? duplicateStringValue(other.cstr_, other.storage_.length_)
+ : other.cstr_);
+ storage_.policy_ = static_cast<unsigned>(other.cstr_
+ ? (static_cast<DuplicationPolicy>(other.storage_.policy_) == noDuplication
? noDuplication : duplicate)
- : other.index_) {}
+ : static_cast<DuplicationPolicy>(other.storage_.policy_)) & 3U;
+ storage_.length_ = other.storage_.length_;
+}
+
+#if JSON_HAS_RVALUE_REFERENCES
+Value::CZString::CZString(CZString&& other)
+ : cstr_(other.cstr_), index_(other.index_) {
+ other.cstr_ = nullptr;
+}
+#endif
Value::CZString::~CZString() {
- if (cstr_ && index_ == duplicate)
- releaseStringValue(const_cast<char*>(cstr_));
+ if (cstr_ && storage_.policy_ == duplicate) {
+ releaseStringValue(const_cast<char*>(cstr_), storage_.length_ + 1u); //+1 for null terminating character for sake of completeness but not actually necessary
+ }
}
void Value::CZString::swap(CZString& other) {
@@ -189,34 +292,53 @@ void Value::CZString::swap(CZString& other) {
std::swap(index_, other.index_);
}
-Value::CZString& Value::CZString::operator=(CZString other) {
- swap(other);
+Value::CZString& Value::CZString::operator=(const CZString& other) {
+ cstr_ = other.cstr_;
+ index_ = other.index_;
return *this;
}
+#if JSON_HAS_RVALUE_REFERENCES
+Value::CZString& Value::CZString::operator=(CZString&& other) {
+ cstr_ = other.cstr_;
+ index_ = other.index_;
+ other.cstr_ = nullptr;
+ return *this;
+}
+#endif
+
bool Value::CZString::operator<(const CZString& other) const {
- if (cstr_) {
- assert(other.cstr_);
- return strcmp(cstr_, other.cstr_) < 0;
- }
- return index_ < other.index_;
+ if (!cstr_) return index_ < other.index_;
+ //return strcmp(cstr_, other.cstr_) < 0;
+ // Assume both are strings.
+ unsigned this_len = this->storage_.length_;
+ unsigned other_len = other.storage_.length_;
+ unsigned min_len = std::min<unsigned>(this_len, other_len);
+ JSON_ASSERT(this->cstr_ && other.cstr_);
+ int comp = memcmp(this->cstr_, other.cstr_, min_len);
+ if (comp < 0) return true;
+ if (comp > 0) return false;
+ return (this_len < other_len);
}
bool Value::CZString::operator==(const CZString& other) const {
- if (cstr_) {
- assert(other.cstr_);
- return strcmp(cstr_, other.cstr_) == 0;
- }
- return index_ == other.index_;
+ if (!cstr_) return index_ == other.index_;
+ //return strcmp(cstr_, other.cstr_) == 0;
+ // Assume both are strings.
+ unsigned this_len = this->storage_.length_;
+ unsigned other_len = other.storage_.length_;
+ if (this_len != other_len) return false;
+ JSON_ASSERT(this->cstr_ && other.cstr_);
+ int comp = memcmp(this->cstr_, other.cstr_, this_len);
+ return comp == 0;
}
ArrayIndex Value::CZString::index() const { return index_; }
-const char* Value::CZString::c_str() const { return cstr_; }
-
-bool Value::CZString::isStaticString() const { return index_ == noDuplication; }
-
-#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP
+//const char* Value::CZString::c_str() const { return cstr_; }
+const char* Value::CZString::data() const { return cstr_; }
+unsigned Value::CZString::length() const { return storage_.length_; }
+bool Value::CZString::isStaticString() const { return storage_.policy_ == noDuplication; }
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
@@ -226,13 +348,14 @@ bool Value::CZString::isStaticString() const { return index_ == noDuplication; }
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
-/*! \internal Default constructor initialization must be equivalent to:
+/*! internal Default constructor initialization must be equivalent to:
* memset( this, 0, sizeof(Value) )
* This optimization is used in ValueInternalMap fast allocator.
*/
-Value::Value(ValueType type) {
- initBasic(type);
- switch (type) {
+Value::Value(ValueType vtype) {
+ static char const emptyString[] = "";
+ initBasic(vtype);
+ switch (vtype) {
case nullValue:
break;
case intValue:
@@ -243,21 +366,13 @@ Value::Value(ValueType type) {
value_.real_ = 0.0;
break;
case stringValue:
- value_.string_ = 0;
+ // allocated_ == false, so this is safe.
+ value_.string_ = const_cast<char*>(static_cast<char const*>(emptyString));
break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
case arrayValue:
case objectValue:
value_.map_ = new ObjectValues();
break;
-#else
- case arrayValue:
- value_.array_ = arrayAllocator()->newArray();
- break;
- case objectValue:
- value_.map_ = mapAllocator()->newMap();
- break;
-#endif
case booleanValue:
value_.bool_ = false;
break;
@@ -293,19 +408,20 @@ Value::Value(double value) {
Value::Value(const char* value) {
initBasic(stringValue, true);
- value_.string_ = duplicateStringValue(value);
+ JSON_ASSERT_MESSAGE(value != NULL, "Null Value Passed to Value Constructor");
+ value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(strlen(value)));
}
Value::Value(const char* beginValue, const char* endValue) {
initBasic(stringValue, true);
value_.string_ =
- duplicateStringValue(beginValue, (unsigned int)(endValue - beginValue));
+ duplicateAndPrefixStringValue(beginValue, static_cast<unsigned>(endValue - beginValue));
}
-Value::Value(const std::string& value) {
+Value::Value(const JSONCPP_STRING& value) {
initBasic(stringValue, true);
value_.string_ =
- duplicateStringValue(value.c_str(), (unsigned int)value.length());
+ duplicateAndPrefixStringValue(value.data(), static_cast<unsigned>(value.length()));
}
Value::Value(const StaticString& value) {
@@ -316,7 +432,7 @@ Value::Value(const StaticString& value) {
#ifdef JSON_USE_CPPTL
Value::Value(const CppTL::ConstString& value) {
initBasic(stringValue, true);
- value_.string_ = duplicateStringValue(value, value.length());
+ value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(value.length()));
}
#endif
@@ -325,14 +441,11 @@ Value::Value(bool value) {
value_.bool_ = value;
}
-Value::Value(const Value& other)
+Value::Value(Value const& other)
: type_(other.type_), allocated_(false)
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
,
- itemIsUsed_(0)
-#endif
- ,
- comments_(0), start_(other.start_), limit_(other.limit_) {
+ comments_(0), start_(other.start_), limit_(other.limit_)
+{
switch (type_) {
case nullValue:
case intValue:
@@ -342,27 +455,22 @@ Value::Value(const Value& other)
value_ = other.value_;
break;
case stringValue:
- if (other.value_.string_) {
- value_.string_ = duplicateStringValue(other.value_.string_);
+ if (other.value_.string_ && other.allocated_) {
+ unsigned len;
+ char const* str;
+ decodePrefixedString(other.allocated_, other.value_.string_,
+ &len, &str);
+ value_.string_ = duplicateAndPrefixStringValue(str, len);
allocated_ = true;
} else {
- value_.string_ = 0;
+ value_.string_ = other.value_.string_;
allocated_ = false;
}
break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
case arrayValue:
case objectValue:
value_.map_ = new ObjectValues(*other.value_.map_);
break;
-#else
- case arrayValue:
- value_.array_ = arrayAllocator()->newArrayCopy(*other.value_.array_);
- break;
- case objectValue:
- value_.map_ = mapAllocator()->newMapCopy(*other.value_.map_);
- break;
-#endif
default:
JSON_ASSERT_UNREACHABLE;
}
@@ -371,11 +479,20 @@ Value::Value(const Value& other)
for (int comment = 0; comment < numberOfCommentPlacement; ++comment) {
const CommentInfo& otherComment = other.comments_[comment];
if (otherComment.comment_)
- comments_[comment].setComment(otherComment.comment_);
+ comments_[comment].setComment(
+ otherComment.comment_, strlen(otherComment.comment_));
}
}
}
+#if JSON_HAS_RVALUE_REFERENCES
+// Move constructor
+Value::Value(Value&& other) {
+ initBasic(nullValue);
+ swap(other);
+}
+#endif
+
Value::~Value() {
switch (type_) {
case nullValue:
@@ -386,27 +503,19 @@ Value::~Value() {
break;
case stringValue:
if (allocated_)
- releaseStringValue(value_.string_);
+ releasePrefixedStringValue(value_.string_);
break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
case arrayValue:
case objectValue:
delete value_.map_;
break;
-#else
- case arrayValue:
- arrayAllocator()->destructArray(value_.array_);
- break;
- case objectValue:
- mapAllocator()->destructMap(value_.map_);
- break;
-#endif
default:
JSON_ASSERT_UNREACHABLE;
}
- if (comments_)
- delete[] comments_;
+ delete[] comments_;
+
+ value_.uint_ = 0;
}
Value& Value::operator=(Value other) {
@@ -414,18 +523,36 @@ Value& Value::operator=(Value other) {
return *this;
}
-void Value::swap(Value& other) {
+void Value::swapPayload(Value& other) {
ValueType temp = type_;
type_ = other.type_;
other.type_ = temp;
std::swap(value_, other.value_);
int temp2 = allocated_;
allocated_ = other.allocated_;
- other.allocated_ = temp2;
+ other.allocated_ = temp2 & 0x1;
+}
+
+void Value::copyPayload(const Value& other) {
+ type_ = other.type_;
+ value_ = other.value_;
+ allocated_ = other.allocated_;
+}
+
+void Value::swap(Value& other) {
+ swapPayload(other);
+ std::swap(comments_, other.comments_);
std::swap(start_, other.start_);
std::swap(limit_, other.limit_);
}
+void Value::copy(const Value& other) {
+ copyPayload(other);
+ comments_ = other.comments_;
+ start_ = other.start_;
+ limit_ = other.limit_;
+}
+
ValueType Value::type() const { return type_; }
int Value::compare(const Value& other) const {
@@ -452,10 +579,24 @@ bool Value::operator<(const Value& other) const {
case booleanValue:
return value_.bool_ < other.value_.bool_;
case stringValue:
- return (value_.string_ == 0 && other.value_.string_) ||
- (other.value_.string_ && value_.string_ &&
- strcmp(value_.string_, other.value_.string_) < 0);
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
+ {
+ if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
+ if (other.value_.string_) return true;
+ else return false;
+ }
+ unsigned this_len;
+ unsigned other_len;
+ char const* this_str;
+ char const* other_str;
+ decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+ decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);
+ unsigned min_len = std::min<unsigned>(this_len, other_len);
+ JSON_ASSERT(this_str && other_str);
+ int comp = memcmp(this_str, other_str, min_len);
+ if (comp < 0) return true;
+ if (comp > 0) return false;
+ return (this_len < other_len);
+ }
case arrayValue:
case objectValue: {
int delta = int(value_.map_->size() - other.value_.map_->size());
@@ -463,12 +604,6 @@ bool Value::operator<(const Value& other) const {
return delta < 0;
return (*value_.map_) < (*other.value_.map_);
}
-#else
- case arrayValue:
- return value_.array_->compare(*(other.value_.array_)) < 0;
- case objectValue:
- return value_.map_->compare(*(other.value_.map_)) < 0;
-#endif
default:
JSON_ASSERT_UNREACHABLE;
}
@@ -501,20 +636,25 @@ bool Value::operator==(const Value& other) const {
case booleanValue:
return value_.bool_ == other.value_.bool_;
case stringValue:
- return (value_.string_ == other.value_.string_) ||
- (other.value_.string_ && value_.string_ &&
- strcmp(value_.string_, other.value_.string_) == 0);
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
+ {
+ if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
+ return (value_.string_ == other.value_.string_);
+ }
+ unsigned this_len;
+ unsigned other_len;
+ char const* this_str;
+ char const* other_str;
+ decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+ decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);
+ if (this_len != other_len) return false;
+ JSON_ASSERT(this_str && other_str);
+ int comp = memcmp(this_str, other_str, this_len);
+ return comp == 0;
+ }
case arrayValue:
case objectValue:
return value_.map_->size() == other.value_.map_->size() &&
(*value_.map_) == (*other.value_.map_);
-#else
- case arrayValue:
- return value_.array_->compare(*(other.value_.array_)) == 0;
- case objectValue:
- return value_.map_->compare(*(other.value_.map_)) == 0;
-#endif
default:
JSON_ASSERT_UNREACHABLE;
}
@@ -526,15 +666,46 @@ bool Value::operator!=(const Value& other) const { return !(*this == other); }
const char* Value::asCString() const {
JSON_ASSERT_MESSAGE(type_ == stringValue,
"in Json::Value::asCString(): requires stringValue");
- return value_.string_;
+ if (value_.string_ == 0) return 0;
+ unsigned this_len;
+ char const* this_str;
+ decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+ return this_str;
+}
+
+#if JSONCPP_USING_SECURE_MEMORY
+unsigned Value::getCStringLength() const {
+ JSON_ASSERT_MESSAGE(type_ == stringValue,
+ "in Json::Value::asCString(): requires stringValue");
+ if (value_.string_ == 0) return 0;
+ unsigned this_len;
+ char const* this_str;
+ decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+ return this_len;
+}
+#endif
+
+bool Value::getString(char const** str, char const** cend) const {
+ if (type_ != stringValue) return false;
+ if (value_.string_ == 0) return false;
+ unsigned length;
+ decodePrefixedString(this->allocated_, this->value_.string_, &length, str);
+ *cend = *str + length;
+ return true;
}
-std::string Value::asString() const {
+JSONCPP_STRING Value::asString() const {
switch (type_) {
case nullValue:
return "";
case stringValue:
- return value_.string_ ? value_.string_ : "";
+ {
+ if (value_.string_ == 0) return "";
+ unsigned this_len;
+ char const* this_str;
+ decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+ return JSONCPP_STRING(this_str, this_len);
+ }
case booleanValue:
return value_.bool_ ? "true" : "false";
case intValue:
@@ -550,7 +721,11 @@ std::string Value::asString() const {
#ifdef JSON_USE_CPPTL
CppTL::ConstString Value::asConstString() const {
- return CppTL::ConstString(asString().c_str());
+ unsigned len;
+ char const* str;
+ decodePrefixedString(allocated_, value_.string_,
+ &len, &str);
+ return CppTL::ConstString(str, len);
}
#endif
@@ -689,7 +864,8 @@ float Value::asFloat() const {
#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
return static_cast<float>(value_.uint_);
#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- return integerToDouble(value_.uint_);
+ // This can fail (silently?) if the value is bigger than MAX_FLOAT.
+ return static_cast<float>(integerToDouble(value_.uint_));
#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
case realValue:
return static_cast<float>(value_.real_);
@@ -714,7 +890,8 @@ bool Value::asBool() const {
case uintValue:
return value_.uint_ ? true : false;
case realValue:
- return value_.real_ ? true : false;
+ // This is kind of strange. Not recommended.
+ return (value_.real_ != 0.0) ? true : false;
default:
break;
}
@@ -726,7 +903,7 @@ bool Value::isConvertibleTo(ValueType other) const {
case nullValue:
return (isNumeric() && asDouble() == 0.0) ||
(type_ == booleanValue && value_.bool_ == false) ||
- (type_ == stringValue && asString() == "") ||
+ (type_ == stringValue && asString().empty()) ||
(type_ == arrayValue && value_.map_->size() == 0) ||
(type_ == objectValue && value_.map_->size() == 0) ||
type_ == nullValue;
@@ -764,7 +941,6 @@ ArrayIndex Value::size() const {
case booleanValue:
case stringValue:
return 0;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
case arrayValue: // size of the array is highest index + 1
if (!value_.map_->empty()) {
ObjectValues::const_iterator itLast = value_.map_->end();
@@ -774,12 +950,6 @@ ArrayIndex Value::size() const {
return 0;
case objectValue:
return ArrayIndex(value_.map_->size());
-#else
- case arrayValue:
- return Int(value_.array_->size());
- case objectValue:
- return Int(value_.map_->size());
-#endif
}
JSON_ASSERT_UNREACHABLE;
return 0; // unreachable;
@@ -801,19 +971,10 @@ void Value::clear() {
start_ = 0;
limit_ = 0;
switch (type_) {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
case arrayValue:
case objectValue:
value_.map_->clear();
break;
-#else
- case arrayValue:
- value_.array_->clear();
- break;
- case objectValue:
- value_.map_->clear();
- break;
-#endif
default:
break;
}
@@ -824,7 +985,6 @@ void Value::resize(ArrayIndex newSize) {
"in Json::Value::resize(): requires arrayValue");
if (type_ == nullValue)
*this = Value(arrayValue);
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
ArrayIndex oldSize = size();
if (newSize == 0)
clear();
@@ -834,11 +994,8 @@ void Value::resize(ArrayIndex newSize) {
for (ArrayIndex index = newSize; index < oldSize; ++index) {
value_.map_->erase(index);
}
- assert(size() == newSize);
+ JSON_ASSERT(size() == newSize);
}
-#else
- value_.array_->resize(newSize);
-#endif
}
Value& Value::operator[](ArrayIndex index) {
@@ -847,18 +1004,14 @@ Value& Value::operator[](ArrayIndex index) {
"in Json::Value::operator[](ArrayIndex): requires arrayValue");
if (type_ == nullValue)
*this = Value(arrayValue);
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
CZString key(index);
ObjectValues::iterator it = value_.map_->lower_bound(key);
if (it != value_.map_->end() && (*it).first == key)
return (*it).second;
- ObjectValues::value_type defaultValue(key, null);
+ ObjectValues::value_type defaultValue(key, nullSingleton());
it = value_.map_->insert(it, defaultValue);
return (*it).second;
-#else
- return value_.array_->resolveReference(index);
-#endif
}
Value& Value::operator[](int index) {
@@ -873,17 +1026,12 @@ const Value& Value::operator[](ArrayIndex index) const {
type_ == nullValue || type_ == arrayValue,
"in Json::Value::operator[](ArrayIndex)const: requires arrayValue");
if (type_ == nullValue)
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
+ return nullSingleton();
CZString key(index);
ObjectValues::const_iterator it = value_.map_->find(key);
if (it == value_.map_->end())
- return null;
+ return nullSingleton();
return (*it).second;
-#else
- Value* value = value_.array_->find(index);
- return value ? *value : null;
-#endif
}
const Value& Value::operator[](int index) const {
@@ -893,149 +1041,215 @@ const Value& Value::operator[](int index) const {
return (*this)[ArrayIndex(index)];
}
-Value& Value::operator[](const char* key) {
- return resolveReference(key, false);
-}
-
-void Value::initBasic(ValueType type, bool allocated) {
- type_ = type;
+void Value::initBasic(ValueType vtype, bool allocated) {
+ type_ = vtype;
allocated_ = allocated;
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- itemIsUsed_ = 0;
-#endif
comments_ = 0;
start_ = 0;
limit_ = 0;
}
-Value& Value::resolveReference(const char* key, bool isStatic) {
+// Access an object value by name, create a null member if it does not exist.
+// @pre Type of '*this' is object or null.
+// @param key is null-terminated.
+Value& Value::resolveReference(const char* key) {
JSON_ASSERT_MESSAGE(
type_ == nullValue || type_ == objectValue,
"in Json::Value::resolveReference(): requires objectValue");
if (type_ == nullValue)
*this = Value(objectValue);
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
CZString actualKey(
- key, isStatic ? CZString::noDuplication : CZString::duplicateOnCopy);
+ key, static_cast<unsigned>(strlen(key)), CZString::noDuplication); // NOTE!
ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
if (it != value_.map_->end() && (*it).first == actualKey)
return (*it).second;
- ObjectValues::value_type defaultValue(actualKey, null);
+ ObjectValues::value_type defaultValue(actualKey, nullSingleton());
+ it = value_.map_->insert(it, defaultValue);
+ Value& value = (*it).second;
+ return value;
+}
+
+// @param key is not null-terminated.
+Value& Value::resolveReference(char const* key, char const* cend)
+{
+ JSON_ASSERT_MESSAGE(
+ type_ == nullValue || type_ == objectValue,
+ "in Json::Value::resolveReference(key, end): requires objectValue");
+ if (type_ == nullValue)
+ *this = Value(objectValue);
+ CZString actualKey(
+ key, static_cast<unsigned>(cend-key), CZString::duplicateOnCopy);
+ ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
+ if (it != value_.map_->end() && (*it).first == actualKey)
+ return (*it).second;
+
+ ObjectValues::value_type defaultValue(actualKey, nullSingleton());
it = value_.map_->insert(it, defaultValue);
Value& value = (*it).second;
return value;
-#else
- return value_.map_->resolveReference(key, isStatic);
-#endif
}
Value Value::get(ArrayIndex index, const Value& defaultValue) const {
const Value* value = &((*this)[index]);
- return value == &null ? defaultValue : *value;
+ return value == &nullSingleton() ? defaultValue : *value;
}
bool Value::isValidIndex(ArrayIndex index) const { return index < size(); }
-const Value& Value::operator[](const char* key) const {
+Value const* Value::find(char const* key, char const* cend) const
+{
JSON_ASSERT_MESSAGE(
type_ == nullValue || type_ == objectValue,
- "in Json::Value::operator[](char const*)const: requires objectValue");
- if (type_ == nullValue)
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString actualKey(key, CZString::noDuplication);
+ "in Json::Value::find(key, end, found): requires objectValue or nullValue");
+ if (type_ == nullValue) return NULL;
+ CZString actualKey(key, static_cast<unsigned>(cend-key), CZString::noDuplication);
ObjectValues::const_iterator it = value_.map_->find(actualKey);
- if (it == value_.map_->end())
- return null;
- return (*it).second;
-#else
- const Value* value = value_.map_->find(key);
- return value ? *value : null;
-#endif
+ if (it == value_.map_->end()) return NULL;
+ return &(*it).second;
+}
+const Value& Value::operator[](const char* key) const
+{
+ Value const* found = find(key, key + strlen(key));
+ if (!found) return nullSingleton();
+ return *found;
+}
+Value const& Value::operator[](JSONCPP_STRING const& key) const
+{
+ Value const* found = find(key.data(), key.data() + key.length());
+ if (!found) return nullSingleton();
+ return *found;
}
-Value& Value::operator[](const std::string& key) {
- return (*this)[key.c_str()];
+Value& Value::operator[](const char* key) {
+ return resolveReference(key, key + strlen(key));
}
-const Value& Value::operator[](const std::string& key) const {
- return (*this)[key.c_str()];
+Value& Value::operator[](const JSONCPP_STRING& key) {
+ return resolveReference(key.data(), key.data() + key.length());
}
Value& Value::operator[](const StaticString& key) {
- return resolveReference(key, true);
+ return resolveReference(key.c_str());
}
#ifdef JSON_USE_CPPTL
Value& Value::operator[](const CppTL::ConstString& key) {
- return (*this)[key.c_str()];
+ return resolveReference(key.c_str(), key.end_c_str());
}
-
-const Value& Value::operator[](const CppTL::ConstString& key) const {
- return (*this)[key.c_str()];
+Value const& Value::operator[](CppTL::ConstString const& key) const
+{
+ Value const* found = find(key.c_str(), key.end_c_str());
+ if (!found) return nullSingleton();
+ return *found;
}
#endif
Value& Value::append(const Value& value) { return (*this)[size()] = value; }
-Value Value::get(const char* key, const Value& defaultValue) const {
- const Value* value = &((*this)[key]);
- return value == &null ? defaultValue : *value;
-}
+#if JSON_HAS_RVALUE_REFERENCES
+ Value& Value::append(Value&& value) { return (*this)[size()] = value; }
+#endif
-Value Value::get(const std::string& key, const Value& defaultValue) const {
- return get(key.c_str(), defaultValue);
+Value Value::get(char const* key, char const* cend, Value const& defaultValue) const
+{
+ Value const* found = find(key, cend);
+ return !found ? defaultValue : *found;
+}
+Value Value::get(char const* key, Value const& defaultValue) const
+{
+ return get(key, key + strlen(key), defaultValue);
+}
+Value Value::get(JSONCPP_STRING const& key, Value const& defaultValue) const
+{
+ return get(key.data(), key.data() + key.length(), defaultValue);
}
-Value Value::removeMember(const char* key) {
- JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue,
- "in Json::Value::removeMember(): requires objectValue");
- if (type_ == nullValue)
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString actualKey(key, CZString::noDuplication);
+
+bool Value::removeMember(const char* key, const char* cend, Value* removed)
+{
+ if (type_ != objectValue) {
+ return false;
+ }
+ CZString actualKey(key, static_cast<unsigned>(cend-key), CZString::noDuplication);
ObjectValues::iterator it = value_.map_->find(actualKey);
if (it == value_.map_->end())
- return null;
- Value old(it->second);
+ return false;
+ *removed = it->second;
value_.map_->erase(it);
- return old;
-#else
- Value* value = value_.map_->find(key);
- if (value) {
- Value old(*value);
- value_.map_.remove(key);
- return old;
- } else {
- return null;
- }
-#endif
+ return true;
+}
+bool Value::removeMember(const char* key, Value* removed)
+{
+ return removeMember(key, key + strlen(key), removed);
}
+bool Value::removeMember(JSONCPP_STRING const& key, Value* removed)
+{
+ return removeMember(key.data(), key.data() + key.length(), removed);
+}
+Value Value::removeMember(const char* key)
+{
+ JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue,
+ "in Json::Value::removeMember(): requires objectValue");
+ if (type_ == nullValue)
+ return nullSingleton();
-Value Value::removeMember(const std::string& key) {
+ Value removed; // null
+ removeMember(key, key + strlen(key), &removed);
+ return removed; // still null if removeMember() did nothing
+}
+Value Value::removeMember(const JSONCPP_STRING& key)
+{
return removeMember(key.c_str());
}
+bool Value::removeIndex(ArrayIndex index, Value* removed) {
+ if (type_ != arrayValue) {
+ return false;
+ }
+ CZString key(index);
+ ObjectValues::iterator it = value_.map_->find(key);
+ if (it == value_.map_->end()) {
+ return false;
+ }
+ *removed = it->second;
+ ArrayIndex oldSize = size();
+ // shift left all items left, into the place of the "removed"
+ for (ArrayIndex i = index; i < (oldSize - 1); ++i){
+ CZString keey(i);
+ (*value_.map_)[keey] = (*this)[i + 1];
+ }
+ // erase the last one ("leftover")
+ CZString keyLast(oldSize - 1);
+ ObjectValues::iterator itLast = value_.map_->find(keyLast);
+ value_.map_->erase(itLast);
+ return true;
+}
+
#ifdef JSON_USE_CPPTL
Value Value::get(const CppTL::ConstString& key,
const Value& defaultValue) const {
- return get(key.c_str(), defaultValue);
+ return get(key.c_str(), key.end_c_str(), defaultValue);
}
#endif
-bool Value::isMember(const char* key) const {
- const Value* value = &((*this)[key]);
- return value != &null;
+bool Value::isMember(char const* key, char const* cend) const
+{
+ Value const* value = find(key, cend);
+ return NULL != value;
}
-
-bool Value::isMember(const std::string& key) const {
- return isMember(key.c_str());
+bool Value::isMember(char const* key) const
+{
+ return isMember(key, key + strlen(key));
+}
+bool Value::isMember(JSONCPP_STRING const& key) const
+{
+ return isMember(key.data(), key.data() + key.length());
}
#ifdef JSON_USE_CPPTL
bool Value::isMember(const CppTL::ConstString& key) const {
- return isMember(key.c_str());
+ return isMember(key.c_str(), key.end_c_str());
}
#endif
@@ -1047,19 +1261,12 @@ Value::Members Value::getMemberNames() const {
return Value::Members();
Members members;
members.reserve(value_.map_->size());
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
ObjectValues::const_iterator it = value_.map_->begin();
ObjectValues::const_iterator itEnd = value_.map_->end();
- for (; it != itEnd; ++it)
- members.push_back(std::string((*it).first.c_str()));
-#else
- ValueInternalMap::IteratorState it;
- ValueInternalMap::IteratorState itEnd;
- value_.map_->makeBeginIterator(it);
- value_.map_->makeEndIterator(itEnd);
- for (; !ValueInternalMap::equals(it, itEnd); ValueInternalMap::increment(it))
- members.push_back(std::string(ValueInternalMap::key(it)));
-#endif
+ for (; it != itEnd; ++it) {
+ members.push_back(JSONCPP_STRING((*it).first.data(),
+ (*it).first.length()));
+ }
return members;
}
//
@@ -1100,7 +1307,11 @@ bool Value::isBool() const { return type_ == booleanValue; }
bool Value::isInt() const {
switch (type_) {
case intValue:
+#if defined(JSON_HAS_INT64)
return value_.int_ >= minInt && value_.int_ <= maxInt;
+#else
+ return true;
+#endif
case uintValue:
return value_.uint_ <= UInt(maxInt);
case realValue:
@@ -1115,9 +1326,17 @@ bool Value::isInt() const {
bool Value::isUInt() const {
switch (type_) {
case intValue:
+#if defined(JSON_HAS_INT64)
return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt);
+#else
+ return value_.int_ >= 0;
+#endif
case uintValue:
+#if defined(JSON_HAS_INT64)
return value_.uint_ <= maxUInt;
+#else
+ return true;
+#endif
case realValue:
return value_.real_ >= 0 && value_.real_ <= maxUInt &&
IsIntegral(value_.real_);
@@ -1168,16 +1387,28 @@ bool Value::isUInt64() const {
}
bool Value::isIntegral() const {
+ switch (type_) {
+ case intValue:
+ case uintValue:
+ return true;
+ case realValue:
#if defined(JSON_HAS_INT64)
- return isInt64() || isUInt64();
+ // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a
+ // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we
+ // require the value to be strictly less than the limit.
+ return value_.real_ >= double(minInt64) && value_.real_ < maxUInt64AsDouble && IsIntegral(value_.real_);
#else
- return isInt() || isUInt();
-#endif
+ return value_.real_ >= minInt && value_.real_ <= maxUInt && IsIntegral(value_.real_);
+#endif // JSON_HAS_INT64
+ default:
+ break;
+ }
+ return false;
}
-bool Value::isDouble() const { return type_ == realValue || isIntegral(); }
+bool Value::isDouble() const { return type_ == intValue || type_ == uintValue || type_ == realValue; }
-bool Value::isNumeric() const { return isIntegral() || isDouble(); }
+bool Value::isNumeric() const { return isDouble(); }
bool Value::isString() const { return type_ == stringValue; }
@@ -1185,63 +1416,59 @@ bool Value::isArray() const { return type_ == arrayValue; }
bool Value::isObject() const { return type_ == objectValue; }
-void Value::setComment(const char* comment, CommentPlacement placement) {
+void Value::setComment(const char* comment, size_t len, CommentPlacement placement) {
if (!comments_)
comments_ = new CommentInfo[numberOfCommentPlacement];
- comments_[placement].setComment(comment);
+ if ((len > 0) && (comment[len-1] == '\n')) {
+ // Always discard trailing newline, to aid indentation.
+ len -= 1;
+ }
+ comments_[placement].setComment(comment, len);
+}
+
+void Value::setComment(const char* comment, CommentPlacement placement) {
+ setComment(comment, strlen(comment), placement);
}
-void Value::setComment(const std::string& comment, CommentPlacement placement) {
- setComment(comment.c_str(), placement);
+void Value::setComment(const JSONCPP_STRING& comment, CommentPlacement placement) {
+ setComment(comment.c_str(), comment.length(), placement);
}
bool Value::hasComment(CommentPlacement placement) const {
return comments_ != 0 && comments_[placement].comment_ != 0;
}
-std::string Value::getComment(CommentPlacement placement) const {
+JSONCPP_STRING Value::getComment(CommentPlacement placement) const {
if (hasComment(placement))
return comments_[placement].comment_;
return "";
}
-void Value::setOffsetStart(size_t start) { start_ = start; }
+void Value::setOffsetStart(ptrdiff_t start) { start_ = start; }
+
+void Value::setOffsetLimit(ptrdiff_t limit) { limit_ = limit; }
-void Value::setOffsetLimit(size_t limit) { limit_ = limit; }
+ptrdiff_t Value::getOffsetStart() const { return start_; }
-size_t Value::getOffsetStart() const { return start_; }
+ptrdiff_t Value::getOffsetLimit() const { return limit_; }
-size_t Value::getOffsetLimit() const { return limit_; }
+JSONCPP_STRING Value::toStyledString() const {
+ StreamWriterBuilder builder;
-std::string Value::toStyledString() const {
- StyledWriter writer;
- return writer.write(*this);
+ JSONCPP_STRING out = this->hasComment(commentBefore) ? "\n" : "";
+ out += Json::writeString(builder, *this);
+ out += "\n";
+
+ return out;
}
Value::const_iterator Value::begin() const {
switch (type_) {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if (value_.array_) {
- ValueInternalArray::IteratorState it;
- value_.array_->makeBeginIterator(it);
- return const_iterator(it);
- }
- break;
- case objectValue:
- if (value_.map_) {
- ValueInternalMap::IteratorState it;
- value_.map_->makeBeginIterator(it);
- return const_iterator(it);
- }
- break;
-#else
case arrayValue:
case objectValue:
if (value_.map_)
return const_iterator(value_.map_->begin());
break;
-#endif
default:
break;
}
@@ -1250,28 +1477,11 @@ Value::const_iterator Value::begin() const {
Value::const_iterator Value::end() const {
switch (type_) {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if (value_.array_) {
- ValueInternalArray::IteratorState it;
- value_.array_->makeEndIterator(it);
- return const_iterator(it);
- }
- break;
- case objectValue:
- if (value_.map_) {
- ValueInternalMap::IteratorState it;
- value_.map_->makeEndIterator(it);
- return const_iterator(it);
- }
- break;
-#else
case arrayValue:
case objectValue:
if (value_.map_)
return const_iterator(value_.map_->end());
break;
-#endif
default:
break;
}
@@ -1280,28 +1490,11 @@ Value::const_iterator Value::end() const {
Value::iterator Value::begin() {
switch (type_) {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if (value_.array_) {
- ValueInternalArray::IteratorState it;
- value_.array_->makeBeginIterator(it);
- return iterator(it);
- }
- break;
- case objectValue:
- if (value_.map_) {
- ValueInternalMap::IteratorState it;
- value_.map_->makeBeginIterator(it);
- return iterator(it);
- }
- break;
-#else
case arrayValue:
case objectValue:
if (value_.map_)
return iterator(value_.map_->begin());
break;
-#endif
default:
break;
}
@@ -1310,28 +1503,11 @@ Value::iterator Value::begin() {
Value::iterator Value::end() {
switch (type_) {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if (value_.array_) {
- ValueInternalArray::IteratorState it;
- value_.array_->makeEndIterator(it);
- return iterator(it);
- }
- break;
- case objectValue:
- if (value_.map_) {
- ValueInternalMap::IteratorState it;
- value_.map_->makeEndIterator(it);
- return iterator(it);
- }
- break;
-#else
case arrayValue:
case objectValue:
if (value_.map_)
return iterator(value_.map_->end());
break;
-#endif
default:
break;
}
@@ -1349,19 +1525,20 @@ PathArgument::PathArgument(ArrayIndex index)
PathArgument::PathArgument(const char* key)
: key_(key), index_(), kind_(kindKey) {}
-PathArgument::PathArgument(const std::string& key)
+PathArgument::PathArgument(const JSONCPP_STRING& key)
: key_(key.c_str()), index_(), kind_(kindKey) {}
// class Path
// //////////////////////////////////////////////////////////////////
-Path::Path(const std::string& path,
+Path::Path(const JSONCPP_STRING& path,
const PathArgument& a1,
const PathArgument& a2,
const PathArgument& a3,
const PathArgument& a4,
const PathArgument& a5) {
InArgs in;
+ in.reserve(5);
in.push_back(&a1);
in.push_back(&a2);
in.push_back(&a3);
@@ -1370,7 +1547,7 @@ Path::Path(const std::string& path,
makePath(path, in);
}
-void Path::makePath(const std::string& path, const InArgs& in) {
+void Path::makePath(const JSONCPP_STRING& path, const InArgs& in) {
const char* current = path.c_str();
const char* end = current + path.length();
InArgs::const_iterator itInArg = in.begin();
@@ -1385,23 +1562,23 @@ void Path::makePath(const std::string& path, const InArgs& in) {
index = index * 10 + ArrayIndex(*current - '0');
args_.push_back(index);
}
- if (current == end || *current++ != ']')
+ if (current == end || *++current != ']')
invalidPath(path, int(current - path.c_str()));
} else if (*current == '%') {
addPathInArg(path, in, itInArg, PathArgument::kindKey);
++current;
- } else if (*current == '.') {
+ } else if (*current == '.' || *current == ']') {
++current;
} else {
const char* beginName = current;
while (current != end && !strchr("[.", *current))
++current;
- args_.push_back(std::string(beginName, current));
+ args_.push_back(JSONCPP_STRING(beginName, current));
}
}
}
-void Path::addPathInArg(const std::string& /*path*/,
+void Path::addPathInArg(const JSONCPP_STRING& /*path*/,
const InArgs& in,
InArgs::const_iterator& itInArg,
PathArgument::Kind kind) {
@@ -1410,11 +1587,11 @@ void Path::addPathInArg(const std::string& /*path*/,
} else if ((*itInArg)->kind_ != kind) {
// Error: bad argument type
} else {
- args_.push_back(**itInArg);
+ args_.push_back(**itInArg++);
}
}
-void Path::invalidPath(const std::string& /*path*/, int /*location*/) {
+void Path::invalidPath(const JSONCPP_STRING& /*path*/, int /*location*/) {
// Error: invalid path.
}
@@ -1425,16 +1602,19 @@ const Value& Path::resolve(const Value& root) const {
if (arg.kind_ == PathArgument::kindIndex) {
if (!node->isArray() || !node->isValidIndex(arg.index_)) {
// Error: unable to resolve path (array value expected at position...
+ return Value::null;
}
node = &((*node)[arg.index_]);
} else if (arg.kind_ == PathArgument::kindKey) {
if (!node->isObject()) {
// Error: unable to resolve path (object value expected at position...)
+ return Value::null;
}
node = &((*node)[arg.key_]);
- if (node == &Value::null) {
+ if (node == &Value::nullSingleton()) {
// Error: unable to resolve path (object has no member named '' at
// position...)
+ return Value::null;
}
}
}
@@ -1453,7 +1633,7 @@ Value Path::resolve(const Value& root, const Value& defaultValue) const {
if (!node->isObject())
return defaultValue;
node = &((*node)[arg.key_]);
- if (node == &Value::null)
+ if (node == &Value::nullSingleton())
return defaultValue;
}
}
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl b/Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl
index a9f7df6..5243bfe 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl
+++ b/Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl
@@ -1,4 +1,4 @@
-// Copyright 2007-2010 Baptiste Lepilleur
+// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -16,68 +16,29 @@ namespace Json {
// //////////////////////////////////////////////////////////////////
ValueIteratorBase::ValueIteratorBase()
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
: current_(), isNull_(true) {
}
-#else
- : isArray_(true), isNull_(true) {
- iterator_.array_ = ValueInternalArray::IteratorState();
-}
-#endif
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
ValueIteratorBase::ValueIteratorBase(
const Value::ObjectValues::iterator& current)
: current_(current), isNull_(false) {}
-#else
-ValueIteratorBase::ValueIteratorBase(
- const ValueInternalArray::IteratorState& state)
- : isArray_(true) {
- iterator_.array_ = state;
-}
-
-ValueIteratorBase::ValueIteratorBase(
- const ValueInternalMap::IteratorState& state)
- : isArray_(false) {
- iterator_.map_ = state;
-}
-#endif
Value& ValueIteratorBase::deref() const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
return current_->second;
-#else
- if (isArray_)
- return ValueInternalArray::dereference(iterator_.array_);
- return ValueInternalMap::value(iterator_.map_);
-#endif
}
void ValueIteratorBase::increment() {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
++current_;
-#else
- if (isArray_)
- ValueInternalArray::increment(iterator_.array_);
- ValueInternalMap::increment(iterator_.map_);
-#endif
}
void ValueIteratorBase::decrement() {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
--current_;
-#else
- if (isArray_)
- ValueInternalArray::decrement(iterator_.array_);
- ValueInternalMap::decrement(iterator_.map_);
-#endif
}
ValueIteratorBase::difference_type
ValueIteratorBase::computeDistance(const SelfType& other) const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
#ifdef JSON_USE_CPPTL_SMALLMAP
- return current_ - other.current_;
+ return other.current_ - current_;
#else
// Iterator for null value are initialized using the default
// constructor, which initialize current_ to the default
@@ -100,80 +61,58 @@ ValueIteratorBase::computeDistance(const SelfType& other) const {
}
return myDistance;
#endif
-#else
- if (isArray_)
- return ValueInternalArray::distance(iterator_.array_,
- other.iterator_.array_);
- return ValueInternalMap::distance(iterator_.map_, other.iterator_.map_);
-#endif
}
bool ValueIteratorBase::isEqual(const SelfType& other) const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
if (isNull_) {
return other.isNull_;
}
return current_ == other.current_;
-#else
- if (isArray_)
- return ValueInternalArray::equals(iterator_.array_, other.iterator_.array_);
- return ValueInternalMap::equals(iterator_.map_, other.iterator_.map_);
-#endif
}
void ValueIteratorBase::copy(const SelfType& other) {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
current_ = other.current_;
isNull_ = other.isNull_;
-#else
- if (isArray_)
- iterator_.array_ = other.iterator_.array_;
- iterator_.map_ = other.iterator_.map_;
-#endif
}
Value ValueIteratorBase::key() const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
const Value::CZString czstring = (*current_).first;
- if (czstring.c_str()) {
+ if (czstring.data()) {
if (czstring.isStaticString())
- return Value(StaticString(czstring.c_str()));
- return Value(czstring.c_str());
+ return Value(StaticString(czstring.data()));
+ return Value(czstring.data(), czstring.data() + czstring.length());
}
return Value(czstring.index());
-#else
- if (isArray_)
- return Value(ValueInternalArray::indexOf(iterator_.array_));
- bool isStatic;
- const char* memberName = ValueInternalMap::key(iterator_.map_, isStatic);
- if (isStatic)
- return Value(StaticString(memberName));
- return Value(memberName);
-#endif
}
UInt ValueIteratorBase::index() const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
const Value::CZString czstring = (*current_).first;
- if (!czstring.c_str())
+ if (!czstring.data())
return czstring.index();
return Value::UInt(-1);
-#else
- if (isArray_)
- return Value::UInt(ValueInternalArray::indexOf(iterator_.array_));
- return Value::UInt(-1);
-#endif
}
-const char* ValueIteratorBase::memberName() const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- const char* name = (*current_).first.c_str();
- return name ? name : "";
-#else
- if (!isArray_)
- return ValueInternalMap::key(iterator_.map_);
- return "";
-#endif
+JSONCPP_STRING ValueIteratorBase::name() const {
+ char const* keey;
+ char const* end;
+ keey = memberName(&end);
+ if (!keey) return JSONCPP_STRING();
+ return JSONCPP_STRING(keey, end);
+}
+
+char const* ValueIteratorBase::memberName() const {
+ const char* cname = (*current_).first.data();
+ return cname ? cname : "";
+}
+
+char const* ValueIteratorBase::memberName(char const** end) const {
+ const char* cname = (*current_).first.data();
+ if (!cname) {
+ *end = NULL;
+ return NULL;
+ }
+ *end = cname + (*current_).first.length();
+ return cname;
}
// //////////////////////////////////////////////////////////////////
@@ -186,19 +125,12 @@ const char* ValueIteratorBase::memberName() const {
ValueConstIterator::ValueConstIterator() {}
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
ValueConstIterator::ValueConstIterator(
const Value::ObjectValues::iterator& current)
: ValueIteratorBase(current) {}
-#else
-ValueConstIterator::ValueConstIterator(
- const ValueInternalArray::IteratorState& state)
- : ValueIteratorBase(state) {}
-ValueConstIterator::ValueConstIterator(
- const ValueInternalMap::IteratorState& state)
- : ValueIteratorBase(state) {}
-#endif
+ValueConstIterator::ValueConstIterator(ValueIterator const& other)
+ : ValueIteratorBase(other) {}
ValueConstIterator& ValueConstIterator::
operator=(const ValueIteratorBase& other) {
@@ -216,19 +148,13 @@ operator=(const ValueIteratorBase& other) {
ValueIterator::ValueIterator() {}
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
ValueIterator::ValueIterator(const Value::ObjectValues::iterator& current)
: ValueIteratorBase(current) {}
-#else
-ValueIterator::ValueIterator(const ValueInternalArray::IteratorState& state)
- : ValueIteratorBase(state) {}
-
-ValueIterator::ValueIterator(const ValueInternalMap::IteratorState& state)
- : ValueIteratorBase(state) {}
-#endif
ValueIterator::ValueIterator(const ValueConstIterator& other)
- : ValueIteratorBase(other) {}
+ : ValueIteratorBase(other) {
+ throwRuntimeError("ConstIterator to Iterator should never be allowed.");
+}
ValueIterator::ValueIterator(const ValueIterator& other)
: ValueIteratorBase(other) {}
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
index e3f4e53..6e6e57e 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
@@ -1,4 +1,4 @@
-// Copyright 2011 Baptiste Lepilleur
+// Copyright 2011 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -7,15 +7,62 @@
#include <json/writer.h>
#include "json_tool.h"
#endif // if !defined(JSON_IS_AMALGAMATION)
-#include <utility>
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <sstream>
#include <iomanip>
+#include <memory>
+#include <sstream>
+#include <utility>
+#include <set>
+#include <cassert>
+#include <cstring>
+#include <cstdio>
+
+#if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1800 // Between VC++ 6.0 and VC++ 11.0
+#include <float.h>
+#define isfinite _finite
+#elif defined(__sun) && defined(__SVR4) //Solaris
+#if !defined(isfinite)
+#include <ieeefp.h>
+#define isfinite finite
+#endif
+#elif defined(_AIX)
+#if !defined(isfinite)
#include <math.h>
+#define isfinite finite
+#endif
+#elif defined(__hpux)
+#if !defined(isfinite)
+#if defined(__ia64) && !defined(finite)
+#define isfinite(x) ((sizeof(x) == sizeof(float) ? \
+ _Isfinitef(x) : _IsFinite(x)))
+#else
+#include <math.h>
+#define isfinite finite
+#endif
+#endif
+#else
+#include <cmath>
+#if !(defined(__QNXNTO__)) // QNX already defines isfinite
+#define isfinite std::isfinite
+#endif
+#endif
+
+#if defined(_MSC_VER)
+#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
+#define snprintf sprintf_s
+#elif _MSC_VER >= 1900 // VC++ 14.0 and above
+#define snprintf std::snprintf
+#else
+#define snprintf _snprintf
+#endif
+#elif defined(__ANDROID__) || defined(__QNXNTO__)
+#define snprintf snprintf
+#elif __cplusplus >= 201103L
+#if !defined(__MINGW32__) && !defined(__CYGWIN__)
+#define snprintf std::snprintf
+#endif
+#endif
-#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below
+#if defined(__BORLANDC__)
#include <float.h>
#define isfinite _finite
#define snprintf _snprintf
@@ -62,6 +109,12 @@
namespace Json {
+#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
+typedef std::unique_ptr<StreamWriter> StreamWriterPtr;
+#else
+typedef std::auto_ptr<StreamWriter> StreamWriterPtr;
+#endif
+
static bool containsControlCharacter(const char* str) {
while (*str) {
if (isControlCharacter(*(str++)))
@@ -70,20 +123,33 @@ static bool containsControlCharacter(const char* str) {
return false;
}
-std::string valueToString(LargestInt value) {
+static bool containsControlCharacter0(const char* str, unsigned len) {
+ char const* end = str + len;
+ while (end != str) {
+ if (isControlCharacter(*str) || 0==*str)
+ return true;
+ ++str;
+ }
+ return false;
+}
+
+JSONCPP_STRING valueToString(LargestInt value) {
UIntToStringBuffer buffer;
char* current = buffer + sizeof(buffer);
- bool isNegative = value < 0;
- if (isNegative)
- value = -value;
- uintToString(LargestUInt(value), current);
- if (isNegative)
+ if (value == Value::minLargestInt) {
+ uintToString(LargestUInt(Value::maxLargestInt) + 1, current);
*--current = '-';
+ } else if (value < 0) {
+ uintToString(LargestUInt(-value), current);
+ *--current = '-';
+ } else {
+ uintToString(LargestUInt(value), current);
+ }
assert(current >= buffer);
return current;
}
-std::string valueToString(LargestUInt value) {
+JSONCPP_STRING valueToString(LargestUInt value) {
UIntToStringBuffer buffer;
char* current = buffer + sizeof(buffer);
uintToString(value, current);
@@ -93,68 +159,70 @@ std::string valueToString(LargestUInt value) {
#if defined(JSON_HAS_INT64)
-std::string valueToString(Int value) {
+JSONCPP_STRING valueToString(Int value) {
return valueToString(LargestInt(value));
}
-std::string valueToString(UInt value) {
+JSONCPP_STRING valueToString(UInt value) {
return valueToString(LargestUInt(value));
}
#endif // # if defined(JSON_HAS_INT64)
-std::string valueToString(double value) {
+namespace {
+JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int precision) {
// Allocate a buffer that is more than large enough to store the 16 digits of
// precision requested below.
- char buffer[32];
+ char buffer[36];
int len = -1;
-// Print into the buffer. We need not request the alternative representation
-// that always has a decimal point because JSON doesn't distingish the
-// concepts of reals and integers.
-#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with
- // visual studio 2005 to
- // avoid warning.
-#if defined(WINCE)
- len = _snprintf(buffer, sizeof(buffer), "%.16g", value);
-#else
- len = sprintf_s(buffer, sizeof(buffer), "%.16g", value);
-#endif
-#else
+ char formatString[15];
+ snprintf(formatString, sizeof(formatString), "%%.%dg", precision);
+
+ // Print into the buffer. We need not request the alternative representation
+ // that always has a decimal point because JSON doesn't distingish the
+ // concepts of reals and integers.
if (isfinite(value)) {
- len = snprintf(buffer, sizeof(buffer), "%.16g", value);
+ len = snprintf(buffer, sizeof(buffer), formatString, value);
+ fixNumericLocale(buffer, buffer + len);
+
+ // try to ensure we preserve the fact that this was given to us as a double on input
+ if (!strchr(buffer, '.') && !strchr(buffer, 'e')) {
+ strcat(buffer, ".0");
+ }
+
} else {
// IEEE standard states that NaN values will not compare to themselves
if (value != value) {
- len = snprintf(buffer, sizeof(buffer), "null");
+ len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "NaN" : "null");
} else if (value < 0) {
- len = snprintf(buffer, sizeof(buffer), "-1e+9999");
+ len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "-Infinity" : "-1e+9999");
} else {
- len = snprintf(buffer, sizeof(buffer), "1e+9999");
+ len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "Infinity" : "1e+9999");
}
- // For those, we do not need to call fixNumLoc, but it is fast.
}
-#endif
assert(len >= 0);
- fixNumericLocale(buffer, buffer + len);
return buffer;
}
+}
+
+JSONCPP_STRING valueToString(double value) { return valueToString(value, false, 17); }
-std::string valueToString(bool value) { return value ? "true" : "false"; }
+JSONCPP_STRING valueToString(bool value) { return value ? "true" : "false"; }
-std::string valueToQuotedString(const char* value) {
+JSONCPP_STRING valueToQuotedString(const char* value) {
if (value == NULL)
return "";
// Not sure how to handle unicode...
if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL &&
!containsControlCharacter(value))
- return std::string("\"") + value + "\"";
+ return JSONCPP_STRING("\"") + value + "\"";
// We have to walk value and escape any special characters.
- // Appending to std::string is not efficient, but this should be rare.
+ // Appending to JSONCPP_STRING is not efficient, but this should be rare.
// (Note: forward slashes are *not* rare, but I am not escaping them.)
- std::string::size_type maxsize =
+ JSONCPP_STRING::size_type maxsize =
strlen(value) * 2 + 3; // allescaped+quotes+NULL
- std::string result;
+ JSONCPP_STRING result;
result.reserve(maxsize); // to avoid lots of mallocs
result += "\"";
for (const char* c = value; *c != 0; ++c) {
@@ -190,7 +258,85 @@ std::string valueToQuotedString(const char* value) {
// sequence from occurring.
default:
if (isControlCharacter(*c)) {
- std::ostringstream oss;
+ JSONCPP_OSTRINGSTREAM oss;
+ oss << "\\u" << std::hex << std::uppercase << std::setfill('0')
+ << std::setw(4) << static_cast<int>(*c);
+ result += oss.str();
+ } else {
+ result += *c;
+ }
+ break;
+ }
+ }
+ result += "\"";
+ return result;
+}
+
+// https://github.com/upcaste/upcaste/blob/master/src/upcore/src/cstring/strnpbrk.cpp
+static char const* strnpbrk(char const* s, char const* accept, size_t n) {
+ assert((s || !n) && accept);
+
+ char const* const end = s + n;
+ for (char const* cur = s; cur < end; ++cur) {
+ int const c = *cur;
+ for (char const* a = accept; *a; ++a) {
+ if (*a == c) {
+ return cur;
+ }
+ }
+ }
+ return NULL;
+}
+static JSONCPP_STRING valueToQuotedStringN(const char* value, unsigned length) {
+ if (value == NULL)
+ return "";
+ // Not sure how to handle unicode...
+ if (strnpbrk(value, "\"\\\b\f\n\r\t", length) == NULL &&
+ !containsControlCharacter0(value, length))
+ return JSONCPP_STRING("\"") + value + "\"";
+ // We have to walk value and escape any special characters.
+ // Appending to JSONCPP_STRING is not efficient, but this should be rare.
+ // (Note: forward slashes are *not* rare, but I am not escaping them.)
+ JSONCPP_STRING::size_type maxsize =
+ length * 2 + 3; // allescaped+quotes+NULL
+ JSONCPP_STRING result;
+ result.reserve(maxsize); // to avoid lots of mallocs
+ result += "\"";
+ char const* end = value + length;
+ for (const char* c = value; c != end; ++c) {
+ switch (*c) {
+ case '\"':
+ result += "\\\"";
+ break;
+ case '\\':
+ result += "\\\\";
+ break;
+ case '\b':
+ result += "\\b";
+ break;
+ case '\f':
+ result += "\\f";
+ break;
+ case '\n':
+ result += "\\n";
+ break;
+ case '\r':
+ result += "\\r";
+ break;
+ case '\t':
+ result += "\\t";
+ break;
+ // case '/':
+ // Even though \/ is considered a legal escape in JSON, a bare
+ // slash is also legal, so I see no reason to escape it.
+ // (I hope I am not misunderstanding something.)
+ // blep notes: actually escaping \/ may be useful in javascript to avoid </
+ // sequence.
+ // Should add a flag to allow this compatibility mode and prevent this
+ // sequence from occurring.
+ default:
+ if ((isControlCharacter(*c)) || (*c == 0)) {
+ JSONCPP_OSTRINGSTREAM oss;
oss << "\\u" << std::hex << std::uppercase << std::setfill('0')
<< std::setw(4) << static_cast<int>(*c);
result += oss.str();
@@ -221,8 +367,8 @@ void FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; }
void FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; }
-std::string FastWriter::write(const Value& root) {
- document_ = "";
+JSONCPP_STRING FastWriter::write(const Value& root) {
+ document_.clear();
writeValue(root);
if (!omitEndingLineFeed_)
document_ += "\n";
@@ -245,15 +391,21 @@ void FastWriter::writeValue(const Value& value) {
document_ += valueToString(value.asDouble());
break;
case stringValue:
- document_ += valueToQuotedString(value.asCString());
+ {
+ // Is NULL possible for value.string_? No.
+ char const* str;
+ char const* end;
+ bool ok = value.getString(&str, &end);
+ if (ok) document_ += valueToQuotedStringN(str, static_cast<unsigned>(end-str));
break;
+ }
case booleanValue:
document_ += valueToString(value.asBool());
break;
case arrayValue: {
document_ += '[';
- int size = value.size();
- for (int index = 0; index < size; ++index) {
+ ArrayIndex size = value.size();
+ for (ArrayIndex index = 0; index < size; ++index) {
if (index > 0)
document_ += ',';
writeValue(value[index]);
@@ -265,10 +417,10 @@ void FastWriter::writeValue(const Value& value) {
document_ += '{';
for (Value::Members::iterator it = members.begin(); it != members.end();
++it) {
- const std::string& name = *it;
+ const JSONCPP_STRING& name = *it;
if (it != members.begin())
document_ += ',';
- document_ += valueToQuotedString(name.c_str());
+ document_ += valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length()));
document_ += yamlCompatiblityEnabled_ ? ": " : ":";
writeValue(value[name]);
}
@@ -283,10 +435,10 @@ void FastWriter::writeValue(const Value& value) {
StyledWriter::StyledWriter()
: rightMargin_(74), indentSize_(3), addChildValues_() {}
-std::string StyledWriter::write(const Value& root) {
- document_ = "";
+JSONCPP_STRING StyledWriter::write(const Value& root) {
+ document_.clear();
addChildValues_ = false;
- indentString_ = "";
+ indentString_.clear();
writeCommentBeforeValue(root);
writeValue(root);
writeCommentAfterValueOnSameLine(root);
@@ -309,8 +461,15 @@ void StyledWriter::writeValue(const Value& value) {
pushValue(valueToString(value.asDouble()));
break;
case stringValue:
- pushValue(valueToQuotedString(value.asCString()));
+ {
+ // Is NULL possible for value.string_? No.
+ char const* str;
+ char const* end;
+ bool ok = value.getString(&str, &end);
+ if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
+ else pushValue("");
break;
+ }
case booleanValue:
pushValue(valueToString(value.asBool()));
break;
@@ -326,7 +485,7 @@ void StyledWriter::writeValue(const Value& value) {
indent();
Value::Members::iterator it = members.begin();
for (;;) {
- const std::string& name = *it;
+ const JSONCPP_STRING& name = *it;
const Value& childValue = value[name];
writeCommentBeforeValue(childValue);
writeWithIndent(valueToQuotedString(name.c_str()));
@@ -390,23 +549,25 @@ void StyledWriter::writeArrayValue(const Value& value) {
}
bool StyledWriter::isMultineArray(const Value& value) {
- int size = value.size();
+ ArrayIndex const size = value.size();
bool isMultiLine = size * 3 >= rightMargin_;
childValues_.clear();
- for (int index = 0; index < size && !isMultiLine; ++index) {
+ for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {
const Value& childValue = value[index];
- isMultiLine =
- isMultiLine || ((childValue.isArray() || childValue.isObject()) &&
+ isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
childValue.size() > 0);
}
if (!isMultiLine) // check if line length > max line length
{
childValues_.reserve(size);
addChildValues_ = true;
- int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
- for (int index = 0; index < size; ++index) {
+ ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
+ for (ArrayIndex index = 0; index < size; ++index) {
+ if (hasCommentForValue(value[index])) {
+ isMultiLine = true;
+ }
writeValue(value[index]);
- lineLength += int(childValues_[index].length());
+ lineLength += static_cast<ArrayIndex>(childValues_[index].length());
}
addChildValues_ = false;
isMultiLine = isMultiLine || lineLength >= rightMargin_;
@@ -414,7 +575,7 @@ bool StyledWriter::isMultineArray(const Value& value) {
return isMultiLine;
}
-void StyledWriter::pushValue(const std::string& value) {
+void StyledWriter::pushValue(const JSONCPP_STRING& value) {
if (addChildValues_)
childValues_.push_back(value);
else
@@ -432,15 +593,15 @@ void StyledWriter::writeIndent() {
document_ += indentString_;
}
-void StyledWriter::writeWithIndent(const std::string& value) {
+void StyledWriter::writeWithIndent(const JSONCPP_STRING& value) {
writeIndent();
document_ += value;
}
-void StyledWriter::indent() { indentString_ += std::string(indentSize_, ' '); }
+void StyledWriter::indent() { indentString_ += JSONCPP_STRING(indentSize_, ' '); }
void StyledWriter::unindent() {
- assert(int(indentString_.size()) >= indentSize_);
+ assert(indentString_.size() >= indentSize_);
indentString_.resize(indentString_.size() - indentSize_);
}
@@ -450,26 +611,27 @@ void StyledWriter::writeCommentBeforeValue(const Value& root) {
document_ += "\n";
writeIndent();
- std::string normalizedComment = normalizeEOL(root.getComment(commentBefore));
- std::string::const_iterator iter = normalizedComment.begin();
- while (iter != normalizedComment.end()) {
+ const JSONCPP_STRING& comment = root.getComment(commentBefore);
+ JSONCPP_STRING::const_iterator iter = comment.begin();
+ while (iter != comment.end()) {
document_ += *iter;
- if (*iter == '\n' && *(iter + 1) == '/')
+ if (*iter == '\n' &&
+ (iter != comment.end() && *(iter + 1) == '/'))
writeIndent();
++iter;
}
- // Comments are stripped of newlines, so add one here
+ // Comments are stripped of trailing newlines, so add one here
document_ += "\n";
}
void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
if (root.hasComment(commentAfterOnSameLine))
- document_ += " " + normalizeEOL(root.getComment(commentAfterOnSameLine));
+ document_ += " " + root.getComment(commentAfterOnSameLine);
if (root.hasComment(commentAfter)) {
document_ += "\n";
- document_ += normalizeEOL(root.getComment(commentAfter));
+ document_ += root.getComment(commentAfter);
document_ += "\n";
}
}
@@ -480,37 +642,21 @@ bool StyledWriter::hasCommentForValue(const Value& value) {
value.hasComment(commentAfter);
}
-std::string StyledWriter::normalizeEOL(const std::string& text) {
- std::string normalized;
- normalized.reserve(text.length());
- const char* begin = text.c_str();
- const char* end = begin + text.length();
- const char* current = begin;
- while (current != end) {
- char c = *current++;
- if (c == '\r') // mac or dos EOL
- {
- if (*current == '\n') // convert dos EOL
- ++current;
- normalized += '\n';
- } else // handle unix EOL & other char
- normalized += c;
- }
- return normalized;
-}
-
// Class StyledStreamWriter
// //////////////////////////////////////////////////////////////////
-StyledStreamWriter::StyledStreamWriter(std::string indentation)
+StyledStreamWriter::StyledStreamWriter(JSONCPP_STRING indentation)
: document_(NULL), rightMargin_(74), indentation_(indentation),
addChildValues_() {}
-void StyledStreamWriter::write(std::ostream& out, const Value& root) {
+void StyledStreamWriter::write(JSONCPP_OSTREAM& out, const Value& root) {
document_ = &out;
addChildValues_ = false;
- indentString_ = "";
+ indentString_.clear();
+ indented_ = true;
writeCommentBeforeValue(root);
+ if (!indented_) writeIndent();
+ indented_ = true;
writeValue(root);
writeCommentAfterValueOnSameLine(root);
*document_ << "\n";
@@ -532,8 +678,15 @@ void StyledStreamWriter::writeValue(const Value& value) {
pushValue(valueToString(value.asDouble()));
break;
case stringValue:
- pushValue(valueToQuotedString(value.asCString()));
+ {
+ // Is NULL possible for value.string_? No.
+ char const* str;
+ char const* end;
+ bool ok = value.getString(&str, &end);
+ if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
+ else pushValue("");
break;
+ }
case booleanValue:
pushValue(valueToString(value.asBool()));
break;
@@ -549,7 +702,7 @@ void StyledStreamWriter::writeValue(const Value& value) {
indent();
Value::Members::iterator it = members.begin();
for (;;) {
- const std::string& name = *it;
+ const JSONCPP_STRING& name = *it;
const Value& childValue = value[name];
writeCommentBeforeValue(childValue);
writeWithIndent(valueToQuotedString(name.c_str()));
@@ -586,8 +739,10 @@ void StyledStreamWriter::writeArrayValue(const Value& value) {
if (hasChildValue)
writeWithIndent(childValues_[index]);
else {
- writeIndent();
+ if (!indented_) writeIndent();
+ indented_ = true;
writeValue(childValue);
+ indented_ = false;
}
if (++index == size) {
writeCommentAfterValueOnSameLine(childValue);
@@ -613,23 +768,25 @@ void StyledStreamWriter::writeArrayValue(const Value& value) {
}
bool StyledStreamWriter::isMultineArray(const Value& value) {
- int size = value.size();
+ ArrayIndex const size = value.size();
bool isMultiLine = size * 3 >= rightMargin_;
childValues_.clear();
- for (int index = 0; index < size && !isMultiLine; ++index) {
+ for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {
const Value& childValue = value[index];
- isMultiLine =
- isMultiLine || ((childValue.isArray() || childValue.isObject()) &&
+ isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
childValue.size() > 0);
}
if (!isMultiLine) // check if line length > max line length
{
childValues_.reserve(size);
addChildValues_ = true;
- int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
- for (int index = 0; index < size; ++index) {
+ ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
+ for (ArrayIndex index = 0; index < size; ++index) {
+ if (hasCommentForValue(value[index])) {
+ isMultiLine = true;
+ }
writeValue(value[index]);
- lineLength += int(childValues_[index].length());
+ lineLength += static_cast<ArrayIndex>(childValues_[index].length());
}
addChildValues_ = false;
isMultiLine = isMultiLine || lineLength >= rightMargin_;
@@ -637,7 +794,7 @@ bool StyledStreamWriter::isMultineArray(const Value& value) {
return isMultiLine;
}
-void StyledStreamWriter::pushValue(const std::string& value) {
+void StyledStreamWriter::pushValue(const JSONCPP_STRING& value) {
if (addChildValues_)
childValues_.push_back(value);
else
@@ -645,24 +802,17 @@ void StyledStreamWriter::pushValue(const std::string& value) {
}
void StyledStreamWriter::writeIndent() {
- /*
- Some comments in this method would have been nice. ;-)
-
- if ( !document_.empty() )
- {
- char last = document_[document_.length()-1];
- if ( last == ' ' ) // already indented
- return;
- if ( last != '\n' ) // Comments may add new-line
- *document_ << '\n';
- }
- */
+ // blep intended this to look at the so-far-written string
+ // to determine whether we are already indented, but
+ // with a stream we cannot do that. So we rely on some saved state.
+ // The caller checks indented_.
*document_ << '\n' << indentString_;
}
-void StyledStreamWriter::writeWithIndent(const std::string& value) {
- writeIndent();
+void StyledStreamWriter::writeWithIndent(const JSONCPP_STRING& value) {
+ if (!indented_) writeIndent();
*document_ << value;
+ indented_ = false;
}
void StyledStreamWriter::indent() { indentString_ += indentation_; }
@@ -675,19 +825,30 @@ void StyledStreamWriter::unindent() {
void StyledStreamWriter::writeCommentBeforeValue(const Value& root) {
if (!root.hasComment(commentBefore))
return;
- *document_ << normalizeEOL(root.getComment(commentBefore));
- *document_ << "\n";
+
+ if (!indented_) writeIndent();
+ const JSONCPP_STRING& comment = root.getComment(commentBefore);
+ JSONCPP_STRING::const_iterator iter = comment.begin();
+ while (iter != comment.end()) {
+ *document_ << *iter;
+ if (*iter == '\n' &&
+ (iter != comment.end() && *(iter + 1) == '/'))
+ // writeIndent(); // would include newline
+ *document_ << indentString_;
+ ++iter;
+ }
+ indented_ = false;
}
void StyledStreamWriter::writeCommentAfterValueOnSameLine(const Value& root) {
if (root.hasComment(commentAfterOnSameLine))
- *document_ << " " + normalizeEOL(root.getComment(commentAfterOnSameLine));
+ *document_ << ' ' << root.getComment(commentAfterOnSameLine);
if (root.hasComment(commentAfter)) {
- *document_ << "\n";
- *document_ << normalizeEOL(root.getComment(commentAfter));
- *document_ << "\n";
+ writeIndent();
+ *document_ << root.getComment(commentAfter);
}
+ indented_ = false;
}
bool StyledStreamWriter::hasCommentForValue(const Value& value) {
@@ -696,28 +857,400 @@ bool StyledStreamWriter::hasCommentForValue(const Value& value) {
value.hasComment(commentAfter);
}
-std::string StyledStreamWriter::normalizeEOL(const std::string& text) {
- std::string normalized;
- normalized.reserve(text.length());
- const char* begin = text.c_str();
- const char* end = begin + text.length();
- const char* current = begin;
- while (current != end) {
- char c = *current++;
- if (c == '\r') // mac or dos EOL
+//////////////////////////
+// BuiltStyledStreamWriter
+
+/// Scoped enums are not available until C++11.
+struct CommentStyle {
+ /// Decide whether to write comments.
+ enum Enum {
+ None, ///< Drop all comments.
+ Most, ///< Recover odd behavior of previous versions (not implemented yet).
+ All ///< Keep all comments.
+ };
+};
+
+struct BuiltStyledStreamWriter : public StreamWriter
+{
+ BuiltStyledStreamWriter(
+ JSONCPP_STRING const& indentation,
+ CommentStyle::Enum cs,
+ JSONCPP_STRING const& colonSymbol,
+ JSONCPP_STRING const& nullSymbol,
+ JSONCPP_STRING const& endingLineFeedSymbol,
+ bool useSpecialFloats,
+ unsigned int precision);
+ int write(Value const& root, JSONCPP_OSTREAM* sout) JSONCPP_OVERRIDE;
+private:
+ void writeValue(Value const& value);
+ void writeArrayValue(Value const& value);
+ bool isMultineArray(Value const& value);
+ void pushValue(JSONCPP_STRING const& value);
+ void writeIndent();
+ void writeWithIndent(JSONCPP_STRING const& value);
+ void indent();
+ void unindent();
+ void writeCommentBeforeValue(Value const& root);
+ void writeCommentAfterValueOnSameLine(Value const& root);
+ static bool hasCommentForValue(const Value& value);
+
+ typedef std::vector<JSONCPP_STRING> ChildValues;
+
+ ChildValues childValues_;
+ JSONCPP_STRING indentString_;
+ unsigned int rightMargin_;
+ JSONCPP_STRING indentation_;
+ CommentStyle::Enum cs_;
+ JSONCPP_STRING colonSymbol_;
+ JSONCPP_STRING nullSymbol_;
+ JSONCPP_STRING endingLineFeedSymbol_;
+ bool addChildValues_ : 1;
+ bool indented_ : 1;
+ bool useSpecialFloats_ : 1;
+ unsigned int precision_;
+};
+BuiltStyledStreamWriter::BuiltStyledStreamWriter(
+ JSONCPP_STRING const& indentation,
+ CommentStyle::Enum cs,
+ JSONCPP_STRING const& colonSymbol,
+ JSONCPP_STRING const& nullSymbol,
+ JSONCPP_STRING const& endingLineFeedSymbol,
+ bool useSpecialFloats,
+ unsigned int precision)
+ : rightMargin_(74)
+ , indentation_(indentation)
+ , cs_(cs)
+ , colonSymbol_(colonSymbol)
+ , nullSymbol_(nullSymbol)
+ , endingLineFeedSymbol_(endingLineFeedSymbol)
+ , addChildValues_(false)
+ , indented_(false)
+ , useSpecialFloats_(useSpecialFloats)
+ , precision_(precision)
+{
+}
+int BuiltStyledStreamWriter::write(Value const& root, JSONCPP_OSTREAM* sout)
+{
+ sout_ = sout;
+ addChildValues_ = false;
+ indented_ = true;
+ indentString_.clear();
+ writeCommentBeforeValue(root);
+ if (!indented_) writeIndent();
+ indented_ = true;
+ writeValue(root);
+ writeCommentAfterValueOnSameLine(root);
+ *sout_ << endingLineFeedSymbol_;
+ sout_ = NULL;
+ return 0;
+}
+void BuiltStyledStreamWriter::writeValue(Value const& value) {
+ switch (value.type()) {
+ case nullValue:
+ pushValue(nullSymbol_);
+ break;
+ case intValue:
+ pushValue(valueToString(value.asLargestInt()));
+ break;
+ case uintValue:
+ pushValue(valueToString(value.asLargestUInt()));
+ break;
+ case realValue:
+ pushValue(valueToString(value.asDouble(), useSpecialFloats_, precision_));
+ break;
+ case stringValue:
+ {
+ // Is NULL is possible for value.string_? No.
+ char const* str;
+ char const* end;
+ bool ok = value.getString(&str, &end);
+ if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
+ else pushValue("");
+ break;
+ }
+ case booleanValue:
+ pushValue(valueToString(value.asBool()));
+ break;
+ case arrayValue:
+ writeArrayValue(value);
+ break;
+ case objectValue: {
+ Value::Members members(value.getMemberNames());
+ if (members.empty())
+ pushValue("{}");
+ else {
+ writeWithIndent("{");
+ indent();
+ Value::Members::iterator it = members.begin();
+ for (;;) {
+ JSONCPP_STRING const& name = *it;
+ Value const& childValue = value[name];
+ writeCommentBeforeValue(childValue);
+ writeWithIndent(valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length())));
+ *sout_ << colonSymbol_;
+ writeValue(childValue);
+ if (++it == members.end()) {
+ writeCommentAfterValueOnSameLine(childValue);
+ break;
+ }
+ *sout_ << ",";
+ writeCommentAfterValueOnSameLine(childValue);
+ }
+ unindent();
+ writeWithIndent("}");
+ }
+ } break;
+ }
+}
+
+void BuiltStyledStreamWriter::writeArrayValue(Value const& value) {
+ unsigned size = value.size();
+ if (size == 0)
+ pushValue("[]");
+ else {
+ bool isMultiLine = (cs_ == CommentStyle::All) || isMultineArray(value);
+ if (isMultiLine) {
+ writeWithIndent("[");
+ indent();
+ bool hasChildValue = !childValues_.empty();
+ unsigned index = 0;
+ for (;;) {
+ Value const& childValue = value[index];
+ writeCommentBeforeValue(childValue);
+ if (hasChildValue)
+ writeWithIndent(childValues_[index]);
+ else {
+ if (!indented_) writeIndent();
+ indented_ = true;
+ writeValue(childValue);
+ indented_ = false;
+ }
+ if (++index == size) {
+ writeCommentAfterValueOnSameLine(childValue);
+ break;
+ }
+ *sout_ << ",";
+ writeCommentAfterValueOnSameLine(childValue);
+ }
+ unindent();
+ writeWithIndent("]");
+ } else // output on a single line
{
- if (*current == '\n') // convert dos EOL
- ++current;
- normalized += '\n';
- } else // handle unix EOL & other char
- normalized += c;
+ assert(childValues_.size() == size);
+ *sout_ << "[";
+ if (!indentation_.empty()) *sout_ << " ";
+ for (unsigned index = 0; index < size; ++index) {
+ if (index > 0)
+ *sout_ << ((!indentation_.empty()) ? ", " : ",");
+ *sout_ << childValues_[index];
+ }
+ if (!indentation_.empty()) *sout_ << " ";
+ *sout_ << "]";
+ }
+ }
+}
+
+bool BuiltStyledStreamWriter::isMultineArray(Value const& value) {
+ ArrayIndex const size = value.size();
+ bool isMultiLine = size * 3 >= rightMargin_;
+ childValues_.clear();
+ for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {
+ Value const& childValue = value[index];
+ isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
+ childValue.size() > 0);
+ }
+ if (!isMultiLine) // check if line length > max line length
+ {
+ childValues_.reserve(size);
+ addChildValues_ = true;
+ ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
+ for (ArrayIndex index = 0; index < size; ++index) {
+ if (hasCommentForValue(value[index])) {
+ isMultiLine = true;
+ }
+ writeValue(value[index]);
+ lineLength += static_cast<ArrayIndex>(childValues_[index].length());
+ }
+ addChildValues_ = false;
+ isMultiLine = isMultiLine || lineLength >= rightMargin_;
+ }
+ return isMultiLine;
+}
+
+void BuiltStyledStreamWriter::pushValue(JSONCPP_STRING const& value) {
+ if (addChildValues_)
+ childValues_.push_back(value);
+ else
+ *sout_ << value;
+}
+
+void BuiltStyledStreamWriter::writeIndent() {
+ // blep intended this to look at the so-far-written string
+ // to determine whether we are already indented, but
+ // with a stream we cannot do that. So we rely on some saved state.
+ // The caller checks indented_.
+
+ if (!indentation_.empty()) {
+ // In this case, drop newlines too.
+ *sout_ << '\n' << indentString_;
+ }
+}
+
+void BuiltStyledStreamWriter::writeWithIndent(JSONCPP_STRING const& value) {
+ if (!indented_) writeIndent();
+ *sout_ << value;
+ indented_ = false;
+}
+
+void BuiltStyledStreamWriter::indent() { indentString_ += indentation_; }
+
+void BuiltStyledStreamWriter::unindent() {
+ assert(indentString_.size() >= indentation_.size());
+ indentString_.resize(indentString_.size() - indentation_.size());
+}
+
+void BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) {
+ if (cs_ == CommentStyle::None) return;
+ if (!root.hasComment(commentBefore))
+ return;
+
+ if (!indented_) writeIndent();
+ const JSONCPP_STRING& comment = root.getComment(commentBefore);
+ JSONCPP_STRING::const_iterator iter = comment.begin();
+ while (iter != comment.end()) {
+ *sout_ << *iter;
+ if (*iter == '\n' &&
+ (iter != comment.end() && *(iter + 1) == '/'))
+ // writeIndent(); // would write extra newline
+ *sout_ << indentString_;
+ ++iter;
}
- return normalized;
+ indented_ = false;
+}
+
+void BuiltStyledStreamWriter::writeCommentAfterValueOnSameLine(Value const& root) {
+ if (cs_ == CommentStyle::None) return;
+ if (root.hasComment(commentAfterOnSameLine))
+ *sout_ << " " + root.getComment(commentAfterOnSameLine);
+
+ if (root.hasComment(commentAfter)) {
+ writeIndent();
+ *sout_ << root.getComment(commentAfter);
+ }
+}
+
+// static
+bool BuiltStyledStreamWriter::hasCommentForValue(const Value& value) {
+ return value.hasComment(commentBefore) ||
+ value.hasComment(commentAfterOnSameLine) ||
+ value.hasComment(commentAfter);
+}
+
+///////////////
+// StreamWriter
+
+StreamWriter::StreamWriter()
+ : sout_(NULL)
+{
+}
+StreamWriter::~StreamWriter()
+{
+}
+StreamWriter::Factory::~Factory()
+{}
+StreamWriterBuilder::StreamWriterBuilder()
+{
+ setDefaults(&settings_);
+}
+StreamWriterBuilder::~StreamWriterBuilder()
+{}
+StreamWriter* StreamWriterBuilder::newStreamWriter() const
+{
+ JSONCPP_STRING indentation = settings_["indentation"].asString();
+ JSONCPP_STRING cs_str = settings_["commentStyle"].asString();
+ bool eyc = settings_["enableYAMLCompatibility"].asBool();
+ bool dnp = settings_["dropNullPlaceholders"].asBool();
+ bool usf = settings_["useSpecialFloats"].asBool();
+ unsigned int pre = settings_["precision"].asUInt();
+ CommentStyle::Enum cs = CommentStyle::All;
+ if (cs_str == "All") {
+ cs = CommentStyle::All;
+ } else if (cs_str == "None") {
+ cs = CommentStyle::None;
+ } else {
+ throwRuntimeError("commentStyle must be 'All' or 'None'");
+ }
+ JSONCPP_STRING colonSymbol = " : ";
+ if (eyc) {
+ colonSymbol = ": ";
+ } else if (indentation.empty()) {
+ colonSymbol = ":";
+ }
+ JSONCPP_STRING nullSymbol = "null";
+ if (dnp) {
+ nullSymbol.clear();
+ }
+ if (pre > 17) pre = 17;
+ JSONCPP_STRING endingLineFeedSymbol;
+ return new BuiltStyledStreamWriter(
+ indentation, cs,
+ colonSymbol, nullSymbol, endingLineFeedSymbol, usf, pre);
+}
+static void getValidWriterKeys(std::set<JSONCPP_STRING>* valid_keys)
+{
+ valid_keys->clear();
+ valid_keys->insert("indentation");
+ valid_keys->insert("commentStyle");
+ valid_keys->insert("enableYAMLCompatibility");
+ valid_keys->insert("dropNullPlaceholders");
+ valid_keys->insert("useSpecialFloats");
+ valid_keys->insert("precision");
+}
+bool StreamWriterBuilder::validate(Json::Value* invalid) const
+{
+ Json::Value my_invalid;
+ if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL
+ Json::Value& inv = *invalid;
+ std::set<JSONCPP_STRING> valid_keys;
+ getValidWriterKeys(&valid_keys);
+ Value::Members keys = settings_.getMemberNames();
+ size_t n = keys.size();
+ for (size_t i = 0; i < n; ++i) {
+ JSONCPP_STRING const& key = keys[i];
+ if (valid_keys.find(key) == valid_keys.end()) {
+ inv[key] = settings_[key];
+ }
+ }
+ return 0u == inv.size();
+}
+Value& StreamWriterBuilder::operator[](JSONCPP_STRING key)
+{
+ return settings_[key];
+}
+// static
+void StreamWriterBuilder::setDefaults(Json::Value* settings)
+{
+ //! [StreamWriterBuilderDefaults]
+ (*settings)["commentStyle"] = "All";
+ (*settings)["indentation"] = "\t";
+ (*settings)["enableYAMLCompatibility"] = false;
+ (*settings)["dropNullPlaceholders"] = false;
+ (*settings)["useSpecialFloats"] = false;
+ (*settings)["precision"] = 17;
+ //! [StreamWriterBuilderDefaults]
+}
+
+JSONCPP_STRING writeString(StreamWriter::Factory const& builder, Value const& root) {
+ JSONCPP_OSTRINGSTREAM sout;
+ StreamWriterPtr const writer(builder.newStreamWriter());
+ writer->write(root, &sout);
+ return sout.str();
}
-std::ostream& operator<<(std::ostream& sout, const Value& root) {
- Json::StyledStreamWriter writer;
- writer.write(sout, root);
+JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM& sout, Value const& root) {
+ StreamWriterBuilder builder;
+ StreamWriterPtr const writer(builder.newStreamWriter());
+ writer->write(root, &sout);
return sout;
}
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index bfe6b13..206f3c6 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -422,6 +422,7 @@ int main(void) { return FS_IOC_GETFLAGS; }" HAVE_WORKING_FS_IOC_GETFLAGS)
LA_CHECK_INCLUDE_FILE("linux/magic.h" HAVE_LINUX_MAGIC_H)
LA_CHECK_INCLUDE_FILE("locale.h" HAVE_LOCALE_H)
+LA_CHECK_INCLUDE_FILE("membership.h" HAVE_MEMBERSHIP_H)
LA_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
LA_CHECK_INCLUDE_FILE("paths.h" HAVE_PATHS_H)
LA_CHECK_INCLUDE_FILE("poll.h" HAVE_POLL_H)
@@ -439,11 +440,13 @@ LA_CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
LA_CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
LA_CHECK_INCLUDE_FILE("sys/acl.h" HAVE_SYS_ACL_H)
LA_CHECK_INCLUDE_FILE("sys/cdefs.h" HAVE_SYS_CDEFS_H)
+LA_CHECK_INCLUDE_FILE("sys/extattr.h" HAVE_SYS_EXTATTR_H)
LA_CHECK_INCLUDE_FILE("sys/ioctl.h" HAVE_SYS_IOCTL_H)
LA_CHECK_INCLUDE_FILE("sys/mkdev.h" HAVE_SYS_MKDEV_H)
LA_CHECK_INCLUDE_FILE("sys/mount.h" HAVE_SYS_MOUNT_H)
LA_CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H)
LA_CHECK_INCLUDE_FILE("sys/poll.h" HAVE_SYS_POLL_H)
+LA_CHECK_INCLUDE_FILE("sys/richacl.h" HAVE_SYS_RICHACL_H)
LA_CHECK_INCLUDE_FILE("sys/select.h" HAVE_SYS_SELECT_H)
LA_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
LA_CHECK_INCLUDE_FILE("sys/statfs.h" HAVE_SYS_STATFS_H)
@@ -453,6 +456,7 @@ LA_CHECK_INCLUDE_FILE("sys/utime.h" HAVE_SYS_UTIME_H)
LA_CHECK_INCLUDE_FILE("sys/utsname.h" HAVE_SYS_UTSNAME_H)
LA_CHECK_INCLUDE_FILE("sys/vfs.h" HAVE_SYS_VFS_H)
LA_CHECK_INCLUDE_FILE("sys/wait.h" HAVE_SYS_WAIT_H)
+LA_CHECK_INCLUDE_FILE("sys/xattr.h" HAVE_SYS_XATTR_H)
LA_CHECK_INCLUDE_FILE("time.h" HAVE_TIME_H)
LA_CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
LA_CHECK_INCLUDE_FILE("utime.h" HAVE_UTIME_H)
@@ -461,6 +465,9 @@ LA_CHECK_INCLUDE_FILE("wctype.h" HAVE_WCTYPE_H)
LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H)
IF(ENABLE_CNG)
LA_CHECK_INCLUDE_FILE("Bcrypt.h" HAVE_BCRYPT_H)
+ IF(HAVE_BCRYPT_H)
+ LIST(APPEND ADDITIONAL_LIBS "Bcrypt")
+ ENDIF(HAVE_BCRYPT_H)
ELSE(ENABLE_CNG)
UNSET(HAVE_BCRYPT_H CACHE)
ENDIF(ENABLE_CNG)
@@ -924,7 +931,6 @@ CHECK_FUNCTION_EXISTS_GLIBC(chflags HAVE_CHFLAGS)
CHECK_FUNCTION_EXISTS_GLIBC(chown HAVE_CHOWN)
CHECK_FUNCTION_EXISTS_GLIBC(chroot HAVE_CHROOT)
CHECK_FUNCTION_EXISTS_GLIBC(ctime_r HAVE_CTIME_R)
-CHECK_FUNCTION_EXISTS_GLIBC(dirfd HAVE_DIRFD)
CHECK_FUNCTION_EXISTS_GLIBC(fchdir HAVE_FCHDIR)
CHECK_FUNCTION_EXISTS_GLIBC(fchflags HAVE_FCHFLAGS)
CHECK_FUNCTION_EXISTS_GLIBC(fchmod HAVE_FCHMOD)
@@ -1024,6 +1030,10 @@ CHECK_C_SOURCE_COMPILES(
"#include <dirent.h>\nint main() {DIR *d = opendir(\".\"); struct dirent e,*r; return readdir_r(d,&e,&r);}"
HAVE_READDIR_R)
+# dirfd can be either a function or a macro.
+CHECK_C_SOURCE_COMPILES(
+ "#include <dirent.h>\nint main() {DIR *d = opendir(\".\"); return dirfd(d);}"
+ HAVE_DIRFD)
# Only detect readlinkat() if we also have AT_FDCWD in unistd.h.
# NOTE: linux requires fcntl.h for AT_FDCWD.
@@ -1256,60 +1266,105 @@ CHECK_FILE_OFFSET_BITS()
# Check for Extended Attribute libraries, headers, and functions
#
IF(ENABLE_XATTR)
- LA_CHECK_INCLUDE_FILE(attr/xattr.h HAVE_ATTR_XATTR_H)
- LA_CHECK_INCLUDE_FILE(sys/xattr.h HAVE_SYS_XATTR_H)
- LA_CHECK_INCLUDE_FILE(sys/extattr.h HAVE_SYS_EXTATTR_H)
CHECK_LIBRARY_EXISTS(attr "setxattr" "" HAVE_LIBATTR)
IF(HAVE_LIBATTR)
SET(CMAKE_REQUIRED_LIBRARIES "attr")
ENDIF(HAVE_LIBATTR)
CHECK_SYMBOL_EXISTS(EXTATTR_NAMESPACE_USER "sys/types.h;sys/extattr.h" HAVE_DECL_EXTATTR_NAMESPACE_USER)
- CHECK_FUNCTION_EXISTS_GLIBC(extattr_get_file HAVE_EXTATTR_GET_FILE)
- CHECK_FUNCTION_EXISTS_GLIBC(extattr_list_file HAVE_EXTATTR_LIST_FILE)
- CHECK_FUNCTION_EXISTS_GLIBC(extattr_set_fd HAVE_EXTATTR_SET_FD)
- CHECK_FUNCTION_EXISTS_GLIBC(extattr_set_file HAVE_EXTATTR_SET_FILE)
- CHECK_FUNCTION_EXISTS_GLIBC(fgetxattr HAVE_FGETXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(flistxattr HAVE_FLISTXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(fsetxattr HAVE_FSETXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(getxattr HAVE_GETXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(lgetxattr HAVE_LGETXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(listxattr HAVE_LISTXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(llistxattr HAVE_LLISTXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(lsetxattr HAVE_LSETXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(fgetea HAVE_FGETEA)
- CHECK_FUNCTION_EXISTS_GLIBC(flistea HAVE_FLISTEA)
- CHECK_FUNCTION_EXISTS_GLIBC(fsetea HAVE_FSETEA)
- CHECK_FUNCTION_EXISTS_GLIBC(getea HAVE_GETEA)
- CHECK_FUNCTION_EXISTS_GLIBC(lgetea HAVE_LGETEA)
- CHECK_FUNCTION_EXISTS_GLIBC(listea HAVE_LISTEA)
- CHECK_FUNCTION_EXISTS_GLIBC(llistea HAVE_LLISTEA)
- CHECK_FUNCTION_EXISTS_GLIBC(lsetea HAVE_LSETEA)
+ CHECK_SYMBOL_EXISTS(XATTR_NOFOLLOW "sys/xattr.h" HAVE_DECL_XATTR_NOFOLLOW)
+ IF(HAVE_SYS_XATTR_H AND HAVE_DECL_XATTR_NOFOLLOW)
+ CHECK_FUNCTION_EXISTS(fgetxattr HAVE_FGETXATTR)
+ CHECK_FUNCTION_EXISTS(flistxattr HAVE_FLISTXATTR)
+ CHECK_FUNCTION_EXISTS(fsetxattr HAVE_FSETXATTR)
+ CHECK_FUNCTION_EXISTS(getxattr HAVE_GETXATTR)
+ CHECK_FUNCTION_EXISTS(listxattr HAVE_LISTXATTR)
+ CHECK_FUNCTION_EXISTS(setxattr HAVE_SETXATTR)
+ IF(HAVE_FGETXATTR AND
+ HAVE_FLISTXATTR AND
+ HAVE_FSETXATTR AND
+ HAVE_GETXATTR AND
+ HAVE_LISTXATTR AND
+ HAVE_SETXATTR)
+ SET(ARCHIVE_XATTR_DARWIN TRUE)
+ ENDIF()
+ ELSEIF(HAVE_SYS_EXTATTR_H AND HAVE_DECL_EXTATTR_NAMESPACE_USER)
+ # FreeBSD xattr support
+ CHECK_FUNCTION_EXISTS(extattr_get_fd HAVE_EXTATTR_GET_FD)
+ CHECK_FUNCTION_EXISTS(extattr_get_file HAVE_EXTATTR_GET_FILE)
+ CHECK_FUNCTION_EXISTS(extattr_get_link HAVE_EXTATTR_GET_LINK)
+ CHECK_FUNCTION_EXISTS(extattr_list_fd HAVE_EXTATTR_LIST_FD)
+ CHECK_FUNCTION_EXISTS(extattr_list_file HAVE_EXTATTR_LIST_FILE)
+ CHECK_FUNCTION_EXISTS(extattr_list_link HAVE_EXTATTR_LIST_LINK)
+ CHECK_FUNCTION_EXISTS(extattr_set_fd HAVE_EXTATTR_SET_FD)
+ CHECK_FUNCTION_EXISTS(extattr_set_link HAVE_EXTATTR_SET_LINK)
+ IF(HAVE_EXTATTR_GET_FD AND
+ HAVE_EXTATTR_GET_FILE AND
+ HAVE_EXTATTR_GET_LINK AND
+ HAVE_EXTATTR_LIST_FD AND
+ HAVE_EXTATTR_LIST_FILE AND
+ HAVE_EXTATTR_LIST_LINK AND
+ HAVE_EXTATTR_SET_FD AND
+ HAVE_EXTATTR_SET_LINK)
+ SET(ARCHIVE_XATTR_FREEBSD TRUE)
+ ENDIF()
+ ELSEIF(HAVE_SYS_XATTR_H OR HAVE_ATTR_XATTR_H)
+ # Linux xattr support
+ CHECK_FUNCTION_EXISTS_GLIBC(fgetxattr HAVE_FGETXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(flistxattr HAVE_FLISTXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(fsetxattr HAVE_FSETXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(getxattr HAVE_GETXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(lgetxattr HAVE_LGETXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(listxattr HAVE_LISTXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(llistxattr HAVE_LLISTXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(lsetxattr HAVE_LSETXATTR)
+ IF(HAVE_FGETXATTR AND
+ HAVE_FLISTXATTR AND
+ HAVE_FSETXATTR AND
+ HAVE_GETXATTR AND
+ HAVE_LGETXATTR AND
+ HAVE_LISTXATTR AND
+ HAVE_LLISTXATTR AND
+ HAVE_LSETXATTR)
+ SET(ARCHIVE_XATTR_LINUX TRUE)
+ ENDIF()
+ ELSEIF(HAVE_SYS_EA_H)
+ # AIX xattr support
+ CHECK_FUNCTION_EXISTS(fgetea HAVE_FGETEA)
+ CHECK_FUNCTION_EXISTS(flistea HAVE_FLISTEA)
+ CHECK_FUNCTION_EXISTS(fsetea HAVE_FSETEA)
+ CHECK_FUNCTION_EXISTS(getea HAVE_GETEA)
+ CHECK_FUNCTION_EXISTS(lgetea HAVE_LGETEA)
+ CHECK_FUNCTION_EXISTS(listea HAVE_LISTEA)
+ CHECK_FUNCTION_EXISTS(llistea HAVE_LLISTEA)
+ CHECK_FUNCTION_EXISTS(lsetea HAVE_LSETEA)
+ IF(HAVE_FGETEA AND
+ HAVE_FLISTEA AND
+ HAVE_FSETEA AND
+ HAVE_GETEA AND
+ HAVE_LGETEA AND
+ HAVE_LISTEA AND
+ HAVE_LLISTEA AND
+ HAVE_LSETEA)
+ SET(ARCHIVE_XATTR_AIX TRUE)
+ ENDIF()
+ ENDIF()
+
+ IF(ARCHIVE_XATTR_DARWIN)
+ MESSAGE(STATUS "Extended attributes support: Darwin")
+ ELSEIF(ARCHIVE_XATTR_FREEBSD)
+ MESSAGE(STATUS "Extended attributes support: FreeBSD")
+ ELSEIF(ARCHIVE_XATTR_LINUX)
+ MESSAGE(STATUS "Extended attributes support: Linux")
+ ELSEIF(ARCHIVE_XATTR_AIX)
+ MESSAGE(STATUS "Extended attributes support: AIX")
+ ELSE()
+ MESSAGE(STATUS "Extended attributes support: none")
+ ENDIF()
ELSE(ENABLE_XATTR)
- SET(HAVE_ATTR_LIB FALSE)
- SET(HAVE_ATTR_XATTR_H FALSE)
- SET(HAVE_DECL_EXTATTR_NAMESPACE_USER FALSE)
- SET(HAVE_EXTATTR_GET_FILE FALSE)
- SET(HAVE_EXTATTR_LIST_FILE FALSE)
- SET(HAVE_EXTATTR_SET_FD FALSE)
- SET(HAVE_EXTATTR_SET_FILE FALSE)
- SET(HAVE_FGETEA FALSE)
- SET(HAVE_FGETXATTR FALSE)
- SET(HAVE_FLISTEA FALSE)
- SET(HAVE_FLISTXATTR FALSE)
- SET(HAVE_FSETEA FALSE)
- SET(HAVE_FSETXATTR FALSE)
- SET(HAVE_GETEA FALSE)
- SET(HAVE_GETXATTR FALSE)
- SET(HAVE_LGETEA FALSE)
- SET(HAVE_LGETXATTR FALSE)
- SET(HAVE_LISTEA FALSE)
- SET(HAVE_LISTXATTR FALSE)
- SET(HAVE_LLISTEA FALSE)
- SET(HAVE_LLISTXATTR FALSE)
- SET(HAVE_LSETEA FALSE)
- SET(HAVE_LSETXATTR FALSE)
- SET(HAVE_SYS_EXTATTR_H FALSE)
- SET(HAVE_SYS_XATTR_H FALSE)
+ SET(ARCHIVE_XATTR_DARWIN FALSE)
+ SET(ARCHIVE_XATTR_FREEBSD FALSE)
+ SET(ARCHIVE_XATTR_LINUX FALSE)
+ SET(ARCHIVE_XATTR_AIX FALSE)
ENDIF(ENABLE_XATTR)
#
@@ -1321,78 +1376,212 @@ ENDIF(ENABLE_XATTR)
# which makes the following checks rather more complex than I would like.
#
IF(ENABLE_ACL)
+ # Solaris and derivates ACLs
+ CHECK_FUNCTION_EXISTS(acl HAVE_ACL)
+ CHECK_FUNCTION_EXISTS(facl HAVE_FACL)
+
+ # Libacl
CHECK_LIBRARY_EXISTS(acl "acl_get_file" "" HAVE_LIBACL)
IF(HAVE_LIBACL)
SET(CMAKE_REQUIRED_LIBRARIES "acl")
FIND_LIBRARY(ACL_LIBRARY NAMES acl)
LIST(APPEND ADDITIONAL_LIBS ${ACL_LIBRARY})
ENDIF(HAVE_LIBACL)
- #
- CHECK_FUNCTION_EXISTS_GLIBC(acl_create_entry HAVE_ACL_CREATE_ENTRY)
- CHECK_FUNCTION_EXISTS_GLIBC(acl_init HAVE_ACL_INIT)
- CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd HAVE_ACL_SET_FD)
- CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd_np HAVE_ACL_SET_FD_NP)
- CHECK_FUNCTION_EXISTS_GLIBC(acl_set_file HAVE_ACL_SET_FILE)
- CHECK_TYPE_EXISTS(acl_permset_t "${INCLUDES}" HAVE_ACL_PERMSET_T)
-
- # The "acl_get_perm()" function was omitted from the POSIX draft.
- # (It's a pretty obvious oversight; otherwise, there's no way to
- # test for specific permissions in a permset.) Linux uses the obvious
- # name, FreeBSD adds _np to mark it as "non-Posix extension."
- # Test for both as a double-check that we really have POSIX-style ACL support.
- CHECK_FUNCTION_EXISTS(acl_get_fd_np HAVE_ACL_GET_FD_NP)
- CHECK_FUNCTION_EXISTS(acl_get_perm HAVE_ACL_GET_PERM)
- CHECK_FUNCTION_EXISTS(acl_get_perm_np HAVE_ACL_GET_PERM_NP)
- CHECK_FUNCTION_EXISTS(acl_get_link HAVE_ACL_GET_LINK)
- CHECK_FUNCTION_EXISTS(acl_get_link_np HAVE_ACL_GET_LINK_NP)
- CHECK_FUNCTION_EXISTS(acl_is_trivial_np HAVE_ACL_IS_TRIVIAL_NP)
- CHECK_FUNCTION_EXISTS(acl_set_link_np HAVE_ACL_SET_LINK_NP)
- CHECK_SYMBOL_EXISTS(ACL_TYPE_NFS4 "${INCLUDES}" HAVE_ACL_TYPE_NFS4)
-
- # MacOS has an acl.h that isn't POSIX. It can be detected by
- # checking for ACL_USER
- CHECK_SYMBOL_EXISTS(ACL_USER "${INCLUDES}" HAVE_ACL_USER)
- CHECK_C_SOURCE_COMPILES("#include <sys/types.h>
+
+ CHECK_TYPE_EXISTS(acl_t "sys/types.h;sys/acl.h" HAVE_ACL_T)
+ CHECK_TYPE_EXISTS(acl_entry_t "sys/types.h;sys/acl.h" HAVE_ACL_ENTRY_T)
+ CHECK_TYPE_EXISTS(acl_permset_t "sys/types.h;sys/acl.h" HAVE_ACL_PERMSET_T)
+ CHECK_TYPE_EXISTS(acl_tag_t "sys/types.h;sys/acl.h" HAVE_ACL_TAG_T)
+
+ IF(HAVE_ACL AND HAVE_FACL)
+ CHECK_TYPE_EXISTS(aclent_t "sys/acl.h" HAVE_ACLENT_T)
+ IF(HAVE_ACLENT_T)
+ CHECK_SYMBOL_EXISTS(GETACL "sys/acl.h" HAVE_DECL_GETACL)
+ CHECK_SYMBOL_EXISTS(GETACLCNT "sys/acl.h" HAVE_DECL_GETACLCNT)
+ CHECK_SYMBOL_EXISTS(SETACL "sys/acl.h" HAVE_DECL_SETACL)
+ IF(HAVE_DECL_GETACL AND
+ HAVE_DECL_GETACLCNT AND
+ HAVE_DECL_SETACL)
+ SET(ARCHIVE_ACL_SUNOS TRUE)
+ ENDIF()
+ CHECK_TYPE_EXISTS(ace_t "sys/acl.h" HAVE_ACE_T)
+ IF(HAVE_ACE_T)
+ CHECK_SYMBOL_EXISTS(ACE_GETACL "sys/acl.h" HAVE_DECL_ACE_GETACL)
+ CHECK_SYMBOL_EXISTS(ACE_GETACLCNT "sys/acl.h" HAVE_DECL_ACE_GETACLCNT)
+ CHECK_SYMBOL_EXISTS(ACE_SETACL "sys/acl.h" HAVE_DECL_ACE_SETACL)
+ IF(HAVE_DECL_ACE_GETACL AND
+ HAVE_DECL_ACE_GETACLCNT AND
+ HAVE_DECL_ACE_SETACL)
+ SET(ARCHIVE_ACL_SUNOS_NFS4 TRUE)
+ ENDIF()
+ ENDIF(HAVE_ACE_T)
+ ENDIF(HAVE_ACLENT_T)
+ ENDIF(HAVE_ACL AND HAVE_FACL)
+
+ IF(HAVE_ACL_T AND HAVE_ACL_ENTRY_T AND HAVE_ACL_PERMSET_T AND HAVE_ACL_TAG_T)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_add_perm HAVE_ACL_ADD_PERM)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_clear_perms HAVE_ACL_CLEAR_PERMS)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_create_entry HAVE_ACL_CREATE_ENTRY)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_delete_def_file HAVE_ACL_DELETE_DEF_FILE)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_free HAVE_ACL_FREE)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_entry HAVE_ACL_GET_ENTRY)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_fd HAVE_ACL_GET_FD)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_file HAVE_ACL_GET_FILE)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_permset HAVE_ACL_GET_PERMSET)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_qualifier HAVE_ACL_GET_QUALIFIER)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_tag_type HAVE_ACL_GET_TAG_TYPE)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_init HAVE_ACL_INIT)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd HAVE_ACL_SET_FD)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_file HAVE_ACL_SET_FILE)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_qualifier HAVE_ACL_SET_QUALIFIER)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_tag_type HAVE_ACL_SET_TAG_TYPE)
+ IF(HAVE_ACL_ADD_PERM AND
+ HAVE_ACL_CLEAR_PERMS AND
+ HAVE_ACL_CREATE_ENTRY AND
+ HAVE_ACL_DELETE_DEF_FILE AND
+ HAVE_ACL_FREE AND
+ HAVE_ACL_GET_ENTRY AND
+ HAVE_ACL_GET_FD AND
+ HAVE_ACL_GET_FILE AND
+ HAVE_ACL_GET_PERMSET AND
+ HAVE_ACL_GET_QUALIFIER AND
+ HAVE_ACL_GET_TAG_TYPE AND
+ HAVE_ACL_INIT AND
+ HAVE_ACL_SET_FD AND
+ HAVE_ACL_SET_FILE AND
+ HAVE_ACL_SET_QUALIFIER AND
+ HAVE_ACL_SET_TAG_TYPE)
+ SET(HAVE_POSIX_ACL_FUNCS 1)
+ ENDIF()
+
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_perm HAVE_ACL_GET_PERM)
+
+ IF(HAVE_POSIX_ACL_FUNCS AND HAVE_ACL_LIBACL_H AND HAVE_LIBACL AND
+ HAVE_ACL_GET_PERM)
+ SET(ARCHIVE_ACL_LIBACL TRUE)
+ ELSE()
+ CHECK_FUNCTION_EXISTS(acl_add_flag_np HAVE_ACL_ADD_FLAG_NP)
+ CHECK_FUNCTION_EXISTS(acl_clear_flags_np HAVE_ACL_CLEAR_FLAGS_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_brand_np HAVE_ACL_GET_BRAND_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_entry_type_np HAVE_ACL_GET_ENTRY_TYPE_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_flag_np HAVE_ACL_GET_FLAG_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_flagset_np HAVE_ACL_GET_FLAGSET_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_fd_np HAVE_ACL_GET_FD_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_link_np HAVE_ACL_GET_LINK_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_perm_np HAVE_ACL_GET_PERM_NP)
+ CHECK_FUNCTION_EXISTS(acl_is_trivial_np HAVE_ACL_IS_TRIVIAL_NP)
+ CHECK_FUNCTION_EXISTS(acl_set_entry_type_np HAVE_ACL_SET_ENTRY_TYPE_NP)
+ CHECK_FUNCTION_EXISTS(acl_set_fd_np HAVE_ACL_SET_FD_NP)
+ CHECK_FUNCTION_EXISTS(acl_set_link_np HAVE_ACL_SET_LINK_NP)
+ CHECK_FUNCTION_EXISTS(mbr_gid_to_uuid HAVE_MBR_GID_TO_UUID)
+ CHECK_FUNCTION_EXISTS(mbr_uid_to_uuid HAVE_MBR_UID_TO_UUID)
+ CHECK_FUNCTION_EXISTS(mbr_uuid_to_id HAVE_MBR_UUID_TO_ID)
+
+ CHECK_C_SOURCE_COMPILES("#include <sys/types.h>
#include <sys/acl.h>
-int main(void) { return ACL_TYPE_EXTENDED; }" HAVE_ACL_TYPE_EXTENDED)
+int main(void) { return ACL_TYPE_EXTENDED; }" HAVE_DECL_ACL_TYPE_EXTENDED)
+ CHECK_C_SOURCE_COMPILES("#include <sys/types.h>
+#include <sys/acl.h>
+int main(void) { return ACL_SYNCHRONIZE; }" HAVE_DECL_ACL_SYNCHRONIZE)
+ CHECK_SYMBOL_EXISTS(ACL_TYPE_NFS4 "sys/acl.h" HAVE_DECL_ACL_TYPE_NFS4)
+ CHECK_SYMBOL_EXISTS(ACL_USER "sys/acl.h" HAVE_DECL_ACL_USER)
+
+ IF(HAVE_POSIX_ACL_FUNCS AND
+ HAVE_ACL_GET_FD_NP AND
+ HAVE_ACL_GET_PERM_NP AND
+ NOT HAVE_ACL_GET_PERM AND
+ HAVE_ACL_SET_FD_NP)
+ IF(HAVE_DECL_ACL_USER)
+ SET(ARCHIVE_ACL_FREEBSD TRUE)
+ IF(HAVE_DECL_ACL_TYPE_NFS4 AND
+ HAVE_ACL_ADD_FLAG_NP AND
+ HAVE_ACL_CLEAR_FLAGS_NP AND
+ HAVE_ACL_GET_BRAND_NP AND
+ HAVE_ACL_GET_ENTRY_TYPE_NP AND
+ HAVE_ACL_GET_FLAGSET_NP AND
+ HAVE_ACL_SET_ENTRY_TYPE_NP)
+ SET(ARCHIVE_ACL_FREEBSD_NFS4 TRUE)
+ ENDIF()
+ ELSEIF(HAVE_DECL_ACL_TYPE_EXTENDED AND
+ HAVE_MEMBERSHIP_H AND
+ HAVE_ACL_ADD_FLAG_NP AND
+ HAVE_ACL_CLEAR_FLAGS_NP AND
+ HAVE_ACL_GET_FLAGSET_NP AND
+ HAVE_ACL_GET_LINK_NP AND
+ HAVE_ACL_SET_LINK_NP AND
+ HAVE_MBR_UID_TO_UUID AND
+ HAVE_MBR_GID_TO_UUID AND
+ HAVE_MBR_UUID_TO_ID)
+ SET(ARCHIVE_ACL_DARWIN TRUE)
+ ENDIF()
+ ENDIF()
+ ENDIF()
+ ENDIF(HAVE_ACL_T AND HAVE_ACL_ENTRY_T AND HAVE_ACL_PERMSET_T AND
+ HAVE_ACL_TAG_T)
+
+ # Richacl
+ CHECK_LIBRARY_EXISTS(richacl "richacl_get_file" "" HAVE_LIBRICHACL)
+ IF(HAVE_LIBRICHACL)
+ SET(CMAKE_REQUIRED_LIBRARIES "richacl")
+ FIND_LIBRARY(RICHACL_LIBRARY NAMES richacl)
+ LIST(APPEND ADDITIONAL_LIBS ${RICHACL_LIBRARY})
+ ENDIF(HAVE_LIBRICHACL)
+
+ CHECK_STRUCT_HAS_MEMBER("struct richace" e_type "sys/richacl.h"
+ HAVE_STRUCT_RICHACE)
+ CHECK_STRUCT_HAS_MEMBER("struct richacl" a_flags "sys/richacl.h"
+ HAVE_STRUCT_RICHACL)
+
+ IF(HAVE_LIBRICHACL AND HAVE_STRUCT_RICHACL AND HAVE_STRUCT_RICHACE)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_alloc HAVE_RICHACL_ALLOC)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_equiv_mode HAVE_RICHACL_EQUIV_MODE)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_free HAVE_RICHACL_FREE)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_get_fd HAVE_RICHACL_GET_FD)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_get_file HAVE_RICHACL_GET_FILE)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_set_fd HAVE_RICHACL_SET_FD)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_set_file HAVE_RICHACL_SET_FILE)
+ IF(HAVE_RICHACL_ALLOC AND
+ HAVE_RICHACL_EQUIV_MODE AND
+ HAVE_RICHACL_FREE AND
+ HAVE_RICHACL_GET_FD AND
+ HAVE_RICHACL_GET_FILE AND
+ HAVE_RICHACL_SET_FD AND
+ HAVE_RICHACL_SET_FILE)
+ SET(ARCHIVE_ACL_LIBRICHACL TRUE)
+ ENDIF()
+ ENDIF(HAVE_LIBRICHACL AND HAVE_STRUCT_RICHACL AND HAVE_STRUCT_RICHACE)
+
+ IF(ARCHIVE_ACL_DARWIN)
+ MESSAGE(STATUS "ACL support: Darwin (limited NFSv4)")
+ ELSEIF(ARCHIVE_ACL_FREEBSD_NFS4)
+ MESSAGE(STATUS "ACL support: FreeBSD (POSIX.1e and NFSv4)")
+ ELSEIF(ARCHIVE_ACL_FREEBSD)
+ MESSAGE(STATUS "ACL support: FreeBSD (POSIX.1e)")
+ ELSEIF(ARCHIVE_ACL_LIBACL OR ARCHIVE_ACL_LIBRICHACL)
+ IF(ARCHIVE_ACL_LIBACL AND ARCHIVE_ACL_LIBRICHACL)
+ MESSAGE(STATUS "ACL support: libacl (POSIX.1e) + librichacl (NFSv4)")
+ ELSEIF(ARCHIVE_ACL_LIBRICHACL)
+ MESSAGE(STATUS "ACL support: librichacl (NFSv4)")
+ ELSE()
+ MESSAGE(STATUS "ACL support: libacl (POSIX.1e)")
+ ENDIF()
+ ELSEIF(ARCHIVE_ACL_SUNOS_NFS4)
+ MESSAGE(STATUS "ACL support: Solaris (POSIX.1e and NFSv4)")
+ ELSEIF(ARCHIVE_ACL_SUNOS)
+ MESSAGE(STATUS "ACL support: Solaris (POSIX.1e)")
+ ELSE()
+ MESSAGE(STATUS "ACL support: none")
+ ENDIF()
- # Solaris and derivates ACLs
- CHECK_LIBRARY_EXISTS(sec "acl_get" "" HAVE_LIBSEC)
- IF(HAVE_LIBSEC)
- SET(CMAKE_REQUIRED_LIBRARIES "sec")
- FIND_LIBRARY(SEC_LIBRARY NAMES sec)
- LIST(APPEND ADDITIONAL_LIBS ${SEC_LIBRARY})
- ENDIF(HAVE_LIBSEC)
- #
- CHECK_TYPE_EXISTS(aclent_t "${INCLUDES}" HAVE_ACLENT_T)
- CHECK_TYPE_EXISTS(ace_t "${INCLUDES}" HAVE_ACE_T)
- CHECK_FUNCTION_EXISTS(acl_get HAVE_FACL_GET)
- CHECK_FUNCTION_EXISTS(facl_get HAVE_FACL_GET)
- CHECK_FUNCTION_EXISTS(acl_set HAVE_FACL_SET)
- CHECK_FUNCTION_EXISTS(facl_set HAVE_FACL_SET)
ELSE(ENABLE_ACL)
# If someone runs cmake, then disables ACL support, we need
# to forcibly override the cached values for these.
- SET(HAVE_ACL_CREATE_ENTRY FALSE)
- SET(HAVE_ACL_GET_LINK FALSE)
- SET(HAVE_ACL_GET_LINK_NP FALSE)
- SET(HAVE_ACL_GET_PERM FALSE)
- SET(HAVE_ACL_GET_PERM_NP FALSE)
- SET(HAVE_ACL_INIT FALSE)
- SET(HAVE_ACL_LIB FALSE)
- SET(HAVE_ACL_PERMSET_T FALSE)
- SET(HAVE_ACL_SET_FD FALSE)
- SET(HAVE_ACL_SET_FD_NP FALSE)
- SET(HAVE_ACL_SET_FILE FALSE)
- SET(HAVE_ACL_TYPE_NFS4 FALSE)
- SET(HAVE_ACL_USER FALSE)
- SET(HAVE_ACL_TYPE_EXTENDED FALSE)
- SET(HAVE_ACL_GET FALSE)
- SET(HAVE_ACLENT_T FALSE)
- SET(HAVE_ACE_T FALSE)
- SET(HAVE_FACL_GET FALSE)
- SET(HAVE_ACL_SET FALSE)
- SET(HAVE_FACL_SET FALSE)
+ SET(ARCHIVE_ACL_DARWIN FALSE)
+ SET(ARCHIVE_ACL_FREEBSD FALSE)
+ SET(ARCHIVE_ACL_FREEBSD_NFS4 FALSE)
+ SET(ARCHIVE_ACL_LIBACL FALSE)
+ SET(ARCHIVE_ACL_SUNOS FALSE)
+ SET(ARCHIVE_ACL_SUNOS_NFS4 FALSE)
ENDIF(ENABLE_ACL)
#
diff --git a/Utilities/cmlibarchive/build/cmake/config.h.in b/Utilities/cmlibarchive/build/cmake/config.h.in
index 55e04b9..368a451 100644
--- a/Utilities/cmlibarchive/build/cmake/config.h.in
+++ b/Utilities/cmlibarchive/build/cmake/config.h.in
@@ -182,6 +182,27 @@ typedef uint64_t uintmax_t;
/* Define ZLIB_WINAPI if zlib was built on Visual Studio. */
#cmakedefine ZLIB_WINAPI 1
+/* Darwin ACL support */
+#cmakedefine ARCHIVE_ACL_DARWIN 1
+
+/* FreeBSD ACL support */
+#cmakedefine ARCHIVE_ACL_FREEBSD 1
+
+/* FreeBSD NFSv4 ACL support */
+#cmakedefine ARCHIVE_ACL_FREEBSD_NFS4 1
+
+/* Linux POSIX.1e ACL support via libacl */
+#cmakedefine ARCHIVE_ACL_LIBACL 1
+
+/* Linux NFSv4 ACL support via librichacl */
+#cmakedefine ARCHIVE_ACL_LIBRICHACL 1
+
+/* Solaris ACL support */
+#cmakedefine ARCHIVE_ACL_SUNOS 1
+
+/* Solaris NFSv4 ACL support */
+#cmakedefine ARCHIVE_ACL_SUNOS_NFS4 1
+
/* MD5 via ARCHIVE_CRYPTO_MD5_LIBC supported. */
#cmakedefine ARCHIVE_CRYPTO_MD5_LIBC 1
@@ -284,6 +305,18 @@ typedef uint64_t uintmax_t;
/* SHA512 via ARCHIVE_CRYPTO_SHA512_WIN supported. */
#cmakedefine ARCHIVE_CRYPTO_SHA512_WIN 1
+/* AIX xattr support */
+#cmakedefine ARCHIVE_XATTR_AIX 1
+
+/* Darwin xattr support */
+#cmakedefine ARCHIVE_XATTR_DARWIN 1
+
+/* FreeBSD xattr support */
+#cmakedefine ARCHIVE_XATTR_FREEBSD 1
+
+/* Linux xattr support */
+#cmakedefine ARCHIVE_XATTR_LINUX 1
+
/* Version number of bsdcpio */
#cmakedefine BSDCPIO_VERSION_STRING "${BSDCPIO_VERSION_STRING}"
@@ -329,15 +362,6 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `acl_set_file' function. */
#cmakedefine HAVE_ACL_SET_FILE 1
-/* True for FreeBSD with NFSv4 ACL support */
-#cmakedefine HAVE_ACL_TYPE_NFS4 1
-
-/* True for MacOS ACL support */
-#cmakedefine HAVE_ACL_TYPE_EXTENDED 1
-
-/* True for systems with POSIX ACL support */
-#cmakedefine HAVE_ACL_USER 1
-
/* Define to 1 if you have the `arc4random_buf' function. */
#cmakedefine HAVE_ARC4RANDOM_BUF 1
@@ -374,6 +398,34 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `cygwin_conv_path' function. */
#cmakedefine HAVE_CYGWIN_CONV_PATH 1
+/* Define to 1 if you have the declaration of `ACE_GETACL', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_ACE_GETACL 1
+
+/* Define to 1 if you have the declaration of `ACE_GETACLCNT', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_ACE_GETACLCNT 1
+
+/* Define to 1 if you have the declaration of `ACE_SETACL', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_ACE_SETACL 1
+
+/* Define to 1 if you have the declaration of `ACL_SYNCHRONIZE', and to 0 if
+ you don't. */
+#cmakedefine HAVE_DECL_ACL_SYNCHRONIZE 1
+
+/* Define to 1 if you have the declaration of `ACL_TYPE_EXTENDED', and to 0 if
+ you don't. */
+#cmakedefine HAVE_DECL_ACL_TYPE_EXTENDED 1
+
+/* Define to 1 if you have the declaration of `ACL_TYPE_NFS4', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_ACL_TYPE_NFS4 1
+
+/* Define to 1 if you have the declaration of `ACL_USER', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_ACL_USER 1
+
/* Define to 1 if you have the declaration of `INT32_MAX', and to 0 if you
don't. */
#cmakedefine HAVE_DECL_INT32_MAX 1
@@ -398,6 +450,10 @@ typedef uint64_t uintmax_t;
don't. */
#cmakedefine HAVE_DECL_INTMAX_MIN 1
+/* Define to 1 if you have the declaration of `SETACL', and to 0 if you don't.
+ */
+#cmakedefine HAVE_DECL_SETACL 1
+
/* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you
don't. */
#cmakedefine HAVE_DECL_SIZE_MAX 1
@@ -422,6 +478,10 @@ typedef uint64_t uintmax_t;
don't. */
#cmakedefine HAVE_DECL_UINTMAX_MAX 1
+/* Define to 1 if you have the declaration of `XATTR_NOFOLLOW', and to 0 if
+ you don't. */
+#cmakedefine HAVE_DECL_XATTR_NOFOLLOW 1
+
/* Define to 1 if you have the <direct.h> header file. */
#cmakedefine HAVE_DIRECT_H 1
@@ -471,6 +531,14 @@ typedef uint64_t uintmax_t;
/* Define to 1 if EXTATTR_NAMESPACE_USER is defined in sys/extattr.h. */
#cmakedefine HAVE_DECL_EXTATTR_NAMESPACE_USER 1
+/* Define to 1 if you have the declaration of `GETACL', and to 0 if you don't.
+ */
+#cmakedefine HAVE_DECL_GETACL 1
+
+/* Define to 1 if you have the declaration of `GETACLCNT', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_GETACLCNT 1
+
/* Define to 1 if you have the `fchdir' function. */
#cmakedefine HAVE_FCHDIR 1
@@ -748,6 +816,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `mbrtowc' function. */
#cmakedefine HAVE_MBRTOWC 1
+/* Define to 1 if you have the <membership.h> header file. */
+#cmakedefine HAVE_MEMBERSHIP_H 1
+
/* Define to 1 if you have the `memmove' function. */
#cmakedefine HAVE_MEMMOVE 1
@@ -985,6 +1056,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the <sys/poll.h> header file. */
#cmakedefine HAVE_SYS_POLL_H 1
+/* Define to 1 if you have the <sys/richacl.h> header file. */
+#cmakedefine HAVE_SYS_RICHACL_H 1
+
/* Define to 1 if you have the <sys/select.h> header file. */
#cmakedefine HAVE_SYS_SELECT_H 1
diff --git a/Utilities/cmlibarchive/build/version b/Utilities/cmlibarchive/build/version
index ef83457..2dd0839 100644
--- a/Utilities/cmlibarchive/build/version
+++ b/Utilities/cmlibarchive/build/version
@@ -1 +1 @@
-3003001
+3003002
diff --git a/Utilities/cmlibarchive/libarchive/CMakeLists.txt b/Utilities/cmlibarchive/libarchive/CMakeLists.txt
index d412c80..b02ae82 100644
--- a/Utilities/cmlibarchive/libarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/libarchive/CMakeLists.txt
@@ -14,6 +14,7 @@ SET(include_HEADERS
# Sources and private headers
SET(libarchive_SOURCES
archive_acl.c
+ archive_acl_private.h
archive_check_magic.c
archive_cmdline.c
archive_cmdline_private.h
@@ -47,6 +48,8 @@ SET(libarchive_SOURCES
archive_pathmatch.c
archive_pathmatch.h
archive_platform.h
+ archive_platform_acl.h
+ archive_platform_xattr.h
archive_ppmd_private.h
archive_ppmd7.c
archive_ppmd7_private.h
@@ -106,9 +109,9 @@ SET(libarchive_SOURCES
archive_string_composition.h
archive_string_sprintf.c
archive_util.c
+ archive_version_details.c
archive_virtual.c
archive_write.c
- archive_write_disk_acl.c
archive_write_disk_posix.c
archive_write_disk_private.h
archive_write_disk_set_standard_lookup.c
@@ -210,6 +213,16 @@ IF(WIN32 AND NOT CYGWIN)
LIST(APPEND libarchive_SOURCES filter_fork_windows.c)
ENDIF(WIN32 AND NOT CYGWIN)
+IF(ARCHIVE_ACL_DARWIN)
+ LIST(APPEND libarchive_SOURCES archive_disk_acl_darwin.c)
+ELSEIF(ARCHIVE_ACL_FREEBSD)
+ LIST(APPEND libarchive_SOURCES archive_disk_acl_freebsd.c)
+ELSEIF(ARCHIVE_ACL_LIBACL)
+ LIST(APPEND libarchive_SOURCES archive_disk_acl_linux.c)
+ELSEIF(ARCHIVE_ACL_SUNOS)
+ LIST(APPEND libarchive_SOURCES archive_disk_acl_sunos.c)
+ENDIF()
+
# CMake needs just one static "cmlibarchive" library.
ADD_LIBRARY(cmlibarchive STATIC ${libarchive_SOURCES} ${include_HEADERS})
TARGET_LINK_LIBRARIES(cmlibarchive ${ADDITIONAL_LIBS})
diff --git a/Utilities/cmlibarchive/libarchive/archive.h b/Utilities/cmlibarchive/libarchive/archive.h
index cfb5c48..0f94d2e 100644
--- a/Utilities/cmlibarchive/libarchive/archive.h
+++ b/Utilities/cmlibarchive/libarchive/archive.h
@@ -36,7 +36,7 @@
* assert that ARCHIVE_VERSION_NUMBER >= 2012108.
*/
/* Note: Compiler will complain if this does not match archive_entry.h! */
-#define ARCHIVE_VERSION_NUMBER 3003001
+#define ARCHIVE_VERSION_NUMBER 3003002
#include <sys/stat.h>
#include <stddef.h> /* for wchar_t */
@@ -152,7 +152,7 @@ __LA_DECL int archive_version_number(void);
/*
* Textual name/version of the library, useful for version displays.
*/
-#define ARCHIVE_VERSION_ONLY_STRING "3.3.1"
+#define ARCHIVE_VERSION_ONLY_STRING "3.3.2"
#define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
__LA_DECL const char * archive_version_string(void);
diff --git a/Utilities/cmlibarchive/libarchive/archive_check_magic.c b/Utilities/cmlibarchive/libarchive/archive_check_magic.c
index c695e58..288ce23 100644
--- a/Utilities/cmlibarchive/libarchive/archive_check_magic.c
+++ b/Utilities/cmlibarchive/libarchive/archive_check_magic.c
@@ -62,7 +62,7 @@ errmsg(const char *m)
}
}
-static void
+static __LA_DEAD void
diediedie(void)
{
#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
diff --git a/Utilities/cmlibarchive/libarchive/archive_disk_acl_darwin.c b/Utilities/cmlibarchive/libarchive/archive_disk_acl_darwin.c
new file mode 100644
index 0000000..48ad016
--- /dev/null
+++ b/Utilities/cmlibarchive/libarchive/archive_disk_acl_darwin.c
@@ -0,0 +1,559 @@
+/*-
+ * Copyright (c) 2017 Martin Matuska
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+
+#if ARCHIVE_ACL_DARWIN
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#if HAVE_MEMBERSHIP_H
+#include <membership.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_ACL_H
+#define _ACL_PRIVATE /* For debugging */
+#include <sys/acl.h>
+#endif
+
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_read_disk_private.h"
+#include "archive_write_disk_private.h"
+
+typedef struct {
+ const int a_perm; /* Libarchive permission or flag */
+ const int p_perm; /* Platform permission or flag */
+} acl_perm_map_t;
+
+static const acl_perm_map_t acl_nfs4_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_EXTATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_EXTATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_SECURITY},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_SECURITY},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_CHANGE_OWNER},
+#if HAVE_DECL_ACL_SYNCHRONIZE
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
+#endif
+};
+
+static const int acl_nfs4_perm_map_size =
+ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
+
+static const acl_perm_map_t acl_nfs4_flag_map[] = {
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED},
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_LIMIT_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_ONLY_INHERIT}
+};
+
+static const int acl_nfs4_flag_map_size =
+ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
+
+static int translate_guid(struct archive *a, acl_entry_t acl_entry,
+ int *ae_id, int *ae_tag, const char **ae_name)
+{
+ void *q;
+ uid_t ugid;
+ int r, idtype;
+
+ q = acl_get_qualifier(acl_entry);
+ if (q == NULL)
+ return (1);
+ r = mbr_uuid_to_id((const unsigned char *)q, &ugid, &idtype);
+ if (r != 0) {
+ acl_free(q);
+ return (1);
+ }
+ if (idtype == ID_TYPE_UID) {
+ *ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ *ae_id = ugid;
+ *ae_name = archive_read_disk_uname(a, *ae_id);
+ } else if (idtype == ID_TYPE_GID) {
+ *ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ *ae_id = ugid;
+ *ae_name = archive_read_disk_gname(a, *ae_id);
+ } else
+ r = 1;
+
+ acl_free(q);
+ return (r);
+}
+
+static void
+add_trivial_nfs4_acl(struct archive_entry *entry)
+{
+ mode_t mode;
+ int i;
+ const int rperm = ARCHIVE_ENTRY_ACL_READ_DATA;
+ const int wperm = ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA;
+ const int eperm = ARCHIVE_ENTRY_ACL_EXECUTE;
+ const int pubset = ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
+ const int ownset = pubset | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER;
+
+ struct {
+ const int type;
+ const int tag;
+ int permset;
+ } tacl_entry[] = {
+ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, 0},
+ {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_USER_OBJ, 0},
+ {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0},
+ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, ownset},
+ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_GROUP_OBJ, pubset},
+ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EVERYONE, pubset}
+ };
+
+ mode = archive_entry_mode(entry);
+
+ /* Permissions for everyone@ */
+ if (mode & 0004)
+ tacl_entry[5].permset |= rperm;
+ if (mode & 0002)
+ tacl_entry[5].permset |= wperm;
+ if (mode & 0001)
+ tacl_entry[5].permset |= eperm;
+
+ /* Permissions for group@ */
+ if (mode & 0040)
+ tacl_entry[4].permset |= rperm;
+ else if (mode & 0004)
+ tacl_entry[2].permset |= rperm;
+ if (mode & 0020)
+ tacl_entry[4].permset |= wperm;
+ else if (mode & 0002)
+ tacl_entry[2].permset |= wperm;
+ if (mode & 0010)
+ tacl_entry[4].permset |= eperm;
+ else if (mode & 0001)
+ tacl_entry[2].permset |= eperm;
+
+ /* Permissions for owner@ */
+ if (mode & 0400) {
+ tacl_entry[3].permset |= rperm;
+ if (!(mode & 0040) && (mode & 0004))
+ tacl_entry[0].permset |= rperm;
+ } else if ((mode & 0040) || (mode & 0004))
+ tacl_entry[1].permset |= rperm;
+ if (mode & 0200) {
+ tacl_entry[3].permset |= wperm;
+ if (!(mode & 0020) && (mode & 0002))
+ tacl_entry[0].permset |= wperm;
+ } else if ((mode & 0020) || (mode & 0002))
+ tacl_entry[1].permset |= wperm;
+ if (mode & 0100) {
+ tacl_entry[3].permset |= eperm;
+ if (!(mode & 0010) && (mode & 0001))
+ tacl_entry[0].permset |= eperm;
+ } else if ((mode & 0010) || (mode & 0001))
+ tacl_entry[1].permset |= eperm;
+
+ for (i = 0; i < 6; i++) {
+ if (tacl_entry[i].permset != 0) {
+ archive_entry_acl_add_entry(entry,
+ tacl_entry[i].type, tacl_entry[i].permset,
+ tacl_entry[i].tag, -1, NULL);
+ }
+ }
+
+ return;
+}
+
+static int
+translate_acl(struct archive_read_disk *a,
+ struct archive_entry *entry, acl_t acl)
+{
+ acl_tag_t acl_tag;
+ acl_flagset_t acl_flagset;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+ int i, entry_acl_type;
+ int r, s, ae_id, ae_tag, ae_perm;
+ const char *ae_name;
+
+ s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
+ if (s == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get first ACL entry");
+ return (ARCHIVE_WARN);
+ }
+
+ while (s == 0) {
+ ae_id = -1;
+ ae_name = NULL;
+ ae_perm = 0;
+
+ if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL tag type");
+ return (ARCHIVE_WARN);
+ }
+ switch (acl_tag) {
+ case ACL_EXTENDED_ALLOW:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
+ r = translate_guid(&a->archive, acl_entry,
+ &ae_id, &ae_tag, &ae_name);
+ break;
+ case ACL_EXTENDED_DENY:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
+ r = translate_guid(&a->archive, acl_entry,
+ &ae_id, &ae_tag, &ae_name);
+ break;
+ default:
+ /* Skip types that libarchive can't support. */
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ continue;
+ }
+
+ /* Skip if translate_guid() above failed */
+ if (r != 0) {
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ continue;
+ }
+
+ /*
+ * Libarchive stores "flag" (NFSv4 inheritance bits)
+ * in the ae_perm bitmap.
+ *
+ * acl_get_flagset_np() fails with non-NFSv4 ACLs
+ */
+ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get flagset from a NFSv4 ACL entry");
+ return (ARCHIVE_WARN);
+ }
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ r = acl_get_flag_np(acl_flagset,
+ acl_nfs4_flag_map[i].p_perm);
+ if (r == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to check flag in a NFSv4 "
+ "ACL flagset");
+ return (ARCHIVE_WARN);
+ } else if (r)
+ ae_perm |= acl_nfs4_flag_map[i].a_perm;
+ }
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL permission set");
+ return (ARCHIVE_WARN);
+ }
+
+ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
+ /*
+ * acl_get_perm() is spelled differently on different
+ * platforms; see above.
+ */
+ r = acl_get_perm_np(acl_permset,
+ acl_nfs4_perm_map[i].p_perm);
+ if (r == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to check permission in an ACL "
+ "permission set");
+ return (ARCHIVE_WARN);
+ } else if (r)
+ ae_perm |= acl_nfs4_perm_map[i].a_perm;
+ }
+
+#if !HAVE_DECL_ACL_SYNCHRONIZE
+ /* On Mac OS X without ACL_SYNCHRONIZE assume it is set */
+ ae_perm |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
+#endif
+
+ archive_entry_acl_add_entry(entry, entry_acl_type,
+ ae_perm, ae_tag,
+ ae_id, ae_name);
+
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ }
+ return (ARCHIVE_OK);
+}
+
+static int
+set_acl(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl,
+ int ae_requested_type, const char *tname)
+{
+ acl_t acl;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+ acl_flagset_t acl_flagset;
+ int ret;
+ int ae_type, ae_permset, ae_tag, ae_id;
+ uuid_t ae_uuid;
+ uid_t ae_uid;
+ gid_t ae_gid;
+ const char *ae_name;
+ int entries;
+ int i;
+
+ ret = ARCHIVE_OK;
+ entries = archive_acl_reset(abstract_acl, ae_requested_type);
+ if (entries == 0)
+ return (ARCHIVE_OK);
+
+ if (ae_requested_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ errno = ENOENT;
+ archive_set_error(a, errno, "Unsupported ACL type");
+ return (ARCHIVE_FAILED);
+ }
+
+ acl = acl_init(entries);
+ if (acl == (acl_t)NULL) {
+ archive_set_error(a, errno,
+ "Failed to initialize ACL working storage");
+ return (ARCHIVE_FAILED);
+ }
+
+ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
+ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
+ /*
+ * Mac OS doesn't support NFSv4 ACLs for
+ * owner@, group@ and everyone@.
+ * We skip any of these ACLs found.
+ */
+ if (ae_tag == ARCHIVE_ENTRY_ACL_USER_OBJ ||
+ ae_tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ ||
+ ae_tag == ARCHIVE_ENTRY_ACL_EVERYONE)
+ continue;
+
+ if (acl_create_entry(&acl, &acl_entry) != 0) {
+ archive_set_error(a, errno,
+ "Failed to create a new ACL entry");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ switch (ae_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ acl_set_tag_type(acl_entry, ACL_EXTENDED_ALLOW);
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
+ acl_set_tag_type(acl_entry, ACL_EXTENDED_DENY);
+ break;
+ default:
+ /* We don't support any other types on MacOS */
+ continue;
+ }
+
+ switch (ae_tag) {
+ case ARCHIVE_ENTRY_ACL_USER:
+ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
+ if (mbr_uid_to_uuid(ae_uid, ae_uuid) != 0)
+ continue;
+ if (acl_set_qualifier(acl_entry, &ae_uuid) != 0)
+ continue;
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP:
+ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
+ if (mbr_gid_to_uuid(ae_gid, ae_uuid) != 0)
+ continue;
+ if (acl_set_qualifier(acl_entry, &ae_uuid) != 0)
+ continue;
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL tag");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to get ACL permission set");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ if (acl_clear_perms(acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to clear ACL permissions");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
+ if (ae_permset & acl_nfs4_perm_map[i].a_perm) {
+ if (acl_add_perm(acl_permset,
+ acl_nfs4_perm_map[i].p_perm) != 0) {
+ archive_set_error(a, errno,
+ "Failed to add ACL permission");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ }
+ }
+
+ /*
+ * acl_get_flagset_np() fails with non-NFSv4 ACLs
+ */
+ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to get flagset from an NFSv4 ACL entry");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ if (acl_clear_flags_np(acl_flagset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to clear flags from an NFSv4 ACL flagset");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if (ae_permset & acl_nfs4_flag_map[i].a_perm) {
+ if (acl_add_flag_np(acl_flagset,
+ acl_nfs4_flag_map[i].p_perm) != 0) {
+ archive_set_error(a, errno,
+ "Failed to add flag to "
+ "NFSv4 ACL flagset");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ }
+ }
+ }
+
+ if (fd >= 0) {
+ if (acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED) == 0)
+ ret = ARCHIVE_OK;
+ else {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno,
+ "Failed to set acl on fd: %s", tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+ } else if (acl_set_link_np(name, ACL_TYPE_EXTENDED, acl) != 0) {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno, "Failed to set acl: %s",
+ tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+exit_free:
+ acl_free(acl);
+ return (ret);
+}
+
+int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ const char *accpath;
+ acl_t acl;
+ int r;
+
+ accpath = NULL;
+
+ if (*fd < 0) {
+ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (accpath == NULL)
+ return (ARCHIVE_WARN);
+ }
+
+ archive_entry_acl_clear(entry);
+
+ acl = NULL;
+
+ if (*fd >= 0)
+ acl = acl_get_fd_np(*fd, ACL_TYPE_EXTENDED);
+ else if (!a->follow_symlinks)
+ acl = acl_get_link_np(accpath, ACL_TYPE_EXTENDED);
+ else
+ acl = acl_get_file(accpath, ACL_TYPE_EXTENDED);
+
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl);
+ acl_free(acl);
+ acl = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate NFSv4 ACLs");
+ }
+
+ /*
+ * Because Mac OS doesn't support owner@, group@ and everyone@
+ * ACLs we need to add NFSv4 ACLs mirroring the file mode to
+ * the archive entry. Otherwise extraction on non-Mac platforms
+ * would lead to an invalid file mode.
+ */
+ if ((archive_entry_acl_types(entry) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0)
+ add_trivial_nfs4_acl(entry);
+
+ return (r);
+ }
+ return (ARCHIVE_OK);
+}
+
+int
+archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode)
+{
+ int ret = ARCHIVE_OK;
+
+ (void)mode; /* UNUSED */
+
+ if ((archive_acl_types(abstract_acl) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
+ }
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_DARWIN */
diff --git a/Utilities/cmlibarchive/libarchive/archive_disk_acl_freebsd.c b/Utilities/cmlibarchive/libarchive/archive_disk_acl_freebsd.c
new file mode 100644
index 0000000..07d08ff
--- /dev/null
+++ b/Utilities/cmlibarchive/libarchive/archive_disk_acl_freebsd.c
@@ -0,0 +1,700 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * Copyright (c) 2010-2012 Michihiro NAKAJIMA
+ * Copyright (c) 2017 Martin Matuska
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+
+#if ARCHIVE_ACL_FREEBSD
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_ACL_H
+#define _ACL_PRIVATE /* For debugging */
+#include <sys/acl.h>
+#endif
+
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_read_disk_private.h"
+#include "archive_write_disk_private.h"
+
+typedef struct {
+ const int a_perm; /* Libarchive permission or flag */
+ const int p_perm; /* Platform permission or flag */
+} acl_perm_map_t;
+
+static const acl_perm_map_t acl_posix_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
+ {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
+};
+
+static const int acl_posix_perm_map_size =
+ (int)(sizeof(acl_posix_perm_map)/sizeof(acl_posix_perm_map[0]));
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+static const acl_perm_map_t acl_nfs4_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
+};
+
+static const int acl_nfs4_perm_map_size =
+ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
+
+static const acl_perm_map_t acl_nfs4_flag_map[] = {
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY},
+ {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS},
+ {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED}
+};
+
+static const int acl_nfs4_flag_map_size =
+ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
+#endif /* ARCHIVE_ACL_FREEBSD_NFS4 */
+
+static int
+translate_acl(struct archive_read_disk *a,
+ struct archive_entry *entry, acl_t acl, int default_entry_acl_type)
+{
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ int brand;
+ acl_flagset_t acl_flagset;
+ acl_entry_type_t acl_type;
+#endif
+ acl_tag_t acl_tag;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+ int i, entry_acl_type, perm_map_size;
+ const acl_perm_map_t *perm_map;
+ int r, s, ae_id, ae_tag, ae_perm;
+ void *q;
+ const char *ae_name;
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ // FreeBSD "brands" ACLs as POSIX.1e or NFSv4
+ // Make sure the "brand" on this ACL is consistent
+ // with the default_entry_acl_type bits provided.
+ if (acl_get_brand_np(acl, &brand) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to read ACL brand");
+ return (ARCHIVE_WARN);
+ }
+ switch (brand) {
+ case ACL_BRAND_POSIX:
+ switch (default_entry_acl_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ break;
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Invalid ACL entry type for POSIX.1e ACL");
+ return (ARCHIVE_WARN);
+ }
+ break;
+ case ACL_BRAND_NFS4:
+ if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Invalid ACL entry type for NFSv4 ACL");
+ return (ARCHIVE_WARN);
+ }
+ break;
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Unknown ACL brand");
+ return (ARCHIVE_WARN);
+ }
+#endif
+
+ s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
+ if (s == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get first ACL entry");
+ return (ARCHIVE_WARN);
+ }
+
+ while (s == 1) {
+ ae_id = -1;
+ ae_name = NULL;
+ ae_perm = 0;
+
+ if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL tag type");
+ return (ARCHIVE_WARN);
+ }
+ switch (acl_tag) {
+ case ACL_USER:
+ q = acl_get_qualifier(acl_entry);
+ if (q != NULL) {
+ ae_id = (int)*(uid_t *)q;
+ acl_free(q);
+ ae_name = archive_read_disk_uname(&a->archive,
+ ae_id);
+ }
+ ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ break;
+ case ACL_GROUP:
+ q = acl_get_qualifier(acl_entry);
+ if (q != NULL) {
+ ae_id = (int)*(gid_t *)q;
+ acl_free(q);
+ ae_name = archive_read_disk_gname(&a->archive,
+ ae_id);
+ }
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ break;
+ case ACL_MASK:
+ ae_tag = ARCHIVE_ENTRY_ACL_MASK;
+ break;
+ case ACL_USER_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ break;
+ case ACL_GROUP_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case ACL_OTHER:
+ ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
+ break;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ case ACL_EVERYONE:
+ ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
+ break;
+#endif
+ default:
+ /* Skip types that libarchive can't support. */
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ continue;
+ }
+
+ // XXX acl_type maps to allow/deny/audit/YYYY bits
+ entry_acl_type = default_entry_acl_type;
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ /*
+ * acl_get_entry_type_np() fails with non-NFSv4 ACLs
+ */
+ if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) {
+ archive_set_error(&a->archive, errno, "Failed "
+ "to get ACL type from a NFSv4 ACL entry");
+ return (ARCHIVE_WARN);
+ }
+ switch (acl_type) {
+ case ACL_ENTRY_TYPE_ALLOW:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
+ break;
+ case ACL_ENTRY_TYPE_DENY:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
+ break;
+ case ACL_ENTRY_TYPE_AUDIT:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
+ break;
+ case ACL_ENTRY_TYPE_ALARM:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
+ break;
+ default:
+ archive_set_error(&a->archive, errno,
+ "Invalid NFSv4 ACL entry type");
+ return (ARCHIVE_WARN);
+ }
+
+ /*
+ * Libarchive stores "flag" (NFSv4 inheritance bits)
+ * in the ae_perm bitmap.
+ *
+ * acl_get_flagset_np() fails with non-NFSv4 ACLs
+ */
+ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get flagset from a NFSv4 "
+ "ACL entry");
+ return (ARCHIVE_WARN);
+ }
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ r = acl_get_flag_np(acl_flagset,
+ acl_nfs4_flag_map[i].p_perm);
+ if (r == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to check flag in a NFSv4 "
+ "ACL flagset");
+ return (ARCHIVE_WARN);
+ } else if (r)
+ ae_perm |= acl_nfs4_flag_map[i].a_perm;
+ }
+ }
+#endif
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL permission set");
+ return (ARCHIVE_WARN);
+ }
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ perm_map_size = acl_nfs4_perm_map_size;
+ perm_map = acl_nfs4_perm_map;
+ } else {
+#endif
+ perm_map_size = acl_posix_perm_map_size;
+ perm_map = acl_posix_perm_map;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ }
+#endif
+
+ for (i = 0; i < perm_map_size; ++i) {
+ r = acl_get_perm_np(acl_permset, perm_map[i].p_perm);
+ if (r == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to check permission in an ACL "
+ "permission set");
+ return (ARCHIVE_WARN);
+ } else if (r)
+ ae_perm |= perm_map[i].a_perm;
+ }
+
+ archive_entry_acl_add_entry(entry, entry_acl_type,
+ ae_perm, ae_tag,
+ ae_id, ae_name);
+
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ if (s == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get next ACL entry");
+ return (ARCHIVE_WARN);
+ }
+ }
+ return (ARCHIVE_OK);
+}
+
+static int
+set_acl(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl,
+ int ae_requested_type, const char *tname)
+{
+ int acl_type = 0;
+ acl_t acl;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ acl_flagset_t acl_flagset;
+ int r;
+#endif
+ int ret;
+ int ae_type, ae_permset, ae_tag, ae_id;
+ int perm_map_size;
+ const acl_perm_map_t *perm_map;
+ uid_t ae_uid;
+ gid_t ae_gid;
+ const char *ae_name;
+ int entries;
+ int i;
+
+ ret = ARCHIVE_OK;
+ entries = archive_acl_reset(abstract_acl, ae_requested_type);
+ if (entries == 0)
+ return (ARCHIVE_OK);
+
+
+ switch (ae_requested_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ acl_type = ACL_TYPE_ACCESS;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ acl_type = ACL_TYPE_DEFAULT;
+ break;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
+ acl_type = ACL_TYPE_NFS4;
+ break;
+#endif
+ default:
+ errno = ENOENT;
+ archive_set_error(a, errno, "Unsupported ACL type");
+ return (ARCHIVE_FAILED);
+ }
+
+ acl = acl_init(entries);
+ if (acl == (acl_t)NULL) {
+ archive_set_error(a, errno,
+ "Failed to initialize ACL working storage");
+ return (ARCHIVE_FAILED);
+ }
+
+ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
+ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
+ if (acl_create_entry(&acl, &acl_entry) != 0) {
+ archive_set_error(a, errno,
+ "Failed to create a new ACL entry");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ switch (ae_tag) {
+ case ARCHIVE_ENTRY_ACL_USER:
+ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
+ acl_set_tag_type(acl_entry, ACL_USER);
+ acl_set_qualifier(acl_entry, &ae_uid);
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP:
+ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
+ acl_set_tag_type(acl_entry, ACL_GROUP);
+ acl_set_qualifier(acl_entry, &ae_gid);
+ break;
+ case ARCHIVE_ENTRY_ACL_USER_OBJ:
+ acl_set_tag_type(acl_entry, ACL_USER_OBJ);
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
+ acl_set_tag_type(acl_entry, ACL_GROUP_OBJ);
+ break;
+ case ARCHIVE_ENTRY_ACL_MASK:
+ acl_set_tag_type(acl_entry, ACL_MASK);
+ break;
+ case ARCHIVE_ENTRY_ACL_OTHER:
+ acl_set_tag_type(acl_entry, ACL_OTHER);
+ break;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ case ARCHIVE_ENTRY_ACL_EVERYONE:
+ acl_set_tag_type(acl_entry, ACL_EVERYONE);
+ break;
+#endif
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL tag");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ r = 0;
+ switch (ae_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ r = acl_set_entry_type_np(acl_entry,
+ ACL_ENTRY_TYPE_ALLOW);
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
+ r = acl_set_entry_type_np(acl_entry,
+ ACL_ENTRY_TYPE_DENY);
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
+ r = acl_set_entry_type_np(acl_entry,
+ ACL_ENTRY_TYPE_AUDIT);
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
+ r = acl_set_entry_type_np(acl_entry,
+ ACL_ENTRY_TYPE_ALARM);
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ // These don't translate directly into the system ACL.
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL entry type");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ if (r != 0) {
+ archive_set_error(a, errno,
+ "Failed to set ACL entry type");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+#endif
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to get ACL permission set");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ if (acl_clear_perms(acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to clear ACL permissions");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ perm_map_size = acl_nfs4_perm_map_size;
+ perm_map = acl_nfs4_perm_map;
+ } else {
+#endif
+ perm_map_size = acl_posix_perm_map_size;
+ perm_map = acl_posix_perm_map;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ }
+#endif
+
+ for (i = 0; i < perm_map_size; ++i) {
+ if (ae_permset & perm_map[i].a_perm) {
+ if (acl_add_perm(acl_permset,
+ perm_map[i].p_perm) != 0) {
+ archive_set_error(a, errno,
+ "Failed to add ACL permission");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ }
+ }
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ /*
+ * acl_get_flagset_np() fails with non-NFSv4 ACLs
+ */
+ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to get flagset from an NFSv4 "
+ "ACL entry");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ if (acl_clear_flags_np(acl_flagset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to clear flags from an NFSv4 "
+ "ACL flagset");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if (ae_permset & acl_nfs4_flag_map[i].a_perm) {
+ if (acl_add_flag_np(acl_flagset,
+ acl_nfs4_flag_map[i].p_perm) != 0) {
+ archive_set_error(a, errno,
+ "Failed to add flag to "
+ "NFSv4 ACL flagset");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ }
+ }
+ }
+#endif
+ }
+
+ /* Try restoring the ACL through 'fd' if we can. */
+ if (fd >= 0) {
+ if (acl_set_fd_np(fd, acl, acl_type) == 0)
+ ret = ARCHIVE_OK;
+ else {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno,
+ "Failed to set acl on fd: %s", tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+ }
+#if HAVE_ACL_SET_LINK_NP
+ else if (acl_set_link_np(name, acl_type, acl) != 0)
+#else
+ /* FreeBSD older than 8.0 */
+ else if (acl_set_file(name, acl_type, acl) != 0)
+#endif
+ {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno, "Failed to set acl: %s",
+ tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+exit_free:
+ acl_free(acl);
+ return (ret);
+}
+
+int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ const char *accpath;
+ acl_t acl;
+ int r;
+
+ accpath = NULL;
+
+ if (*fd < 0) {
+ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (accpath == NULL)
+ return (ARCHIVE_WARN);
+ }
+
+ archive_entry_acl_clear(entry);
+
+ acl = NULL;
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ /* Try NFSv4 ACL first. */
+ if (*fd >= 0)
+ acl = acl_get_fd_np(*fd, ACL_TYPE_NFS4);
+ else if (!a->follow_symlinks)
+ acl = acl_get_link_np(accpath, ACL_TYPE_NFS4);
+ else
+ acl = acl_get_file(accpath, ACL_TYPE_NFS4);
+
+ /* Ignore "trivial" ACLs that just mirror the file mode. */
+ if (acl != NULL && acl_is_trivial_np(acl, &r) == 0 && r == 1) {
+ acl_free(acl);
+ acl = NULL;
+ return (ARCHIVE_OK);
+ }
+
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4);
+ acl_free(acl);
+ acl = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate NFSv4 ACLs");
+ }
+
+ return (r);
+ }
+#endif
+
+ /* Retrieve access ACL from file. */
+ if (*fd >= 0)
+ acl = acl_get_fd_np(*fd, ACL_TYPE_ACCESS);
+#if HAVE_ACL_GET_LINK_NP
+ else if (!a->follow_symlinks)
+ acl = acl_get_link_np(accpath, ACL_TYPE_ACCESS);
+#else
+ else if ((!a->follow_symlinks)
+ && (archive_entry_filetype(entry) == AE_IFLNK))
+ /* We can't get the ACL of a symlink, so we assume it can't
+ have one. */
+ acl = NULL;
+#endif
+ else
+ acl = acl_get_file(accpath, ACL_TYPE_ACCESS);
+
+#if HAVE_ACL_IS_TRIVIAL_NP
+ /* Ignore "trivial" ACLs that just mirror the file mode. */
+ if (acl != NULL && acl_is_trivial_np(acl, &r) == 0 && r == 1) {
+ acl_free(acl);
+ acl = NULL;
+ }
+#endif
+
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
+ acl_free(acl);
+ acl = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate access ACLs");
+ return (r);
+ }
+ }
+
+ /* Only directories can have default ACLs. */
+ if (S_ISDIR(archive_entry_mode(entry))) {
+ if (*fd >= 0)
+ acl = acl_get_fd_np(*fd, ACL_TYPE_DEFAULT);
+ else
+ acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
+ acl_free(acl);
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate default ACLs");
+ return (r);
+ }
+ }
+ }
+ return (ARCHIVE_OK);
+}
+
+int
+archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode)
+{
+ int ret = ARCHIVE_OK;
+
+ (void)mode; /* UNUSED */
+
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access");
+ if (ret != ARCHIVE_OK)
+ return (ret);
+ }
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default");
+
+ /* Simultaneous POSIX.1e and NFSv4 is not supported */
+ return (ret);
+ }
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ else if ((archive_acl_types(abstract_acl) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
+ }
+#endif
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_FREEBSD */
diff --git a/Utilities/cmlibarchive/libarchive/archive_disk_acl_linux.c b/Utilities/cmlibarchive/libarchive/archive_disk_acl_linux.c
new file mode 100644
index 0000000..3928f3d
--- /dev/null
+++ b/Utilities/cmlibarchive/libarchive/archive_disk_acl_linux.c
@@ -0,0 +1,743 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * Copyright (c) 2010-2012 Michihiro NAKAJIMA
+ * Copyright (c) 2017 Martin Matuska
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+
+#if ARCHIVE_ACL_LIBACL || ARCHIVE_ACL_LIBRICHACL
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_ACL_LIBACL_H
+#include <acl/libacl.h>
+#endif
+#ifdef HAVE_SYS_ACL_H
+#include <sys/acl.h>
+#endif
+#ifdef HAVE_SYS_RICHACL_H
+#include <sys/richacl.h>
+#endif
+
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_read_disk_private.h"
+#include "archive_write_disk_private.h"
+
+typedef struct {
+ const int a_perm; /* Libarchive permission or flag */
+ const int p_perm; /* Platform permission or flag */
+} acl_perm_map_t;
+
+#if ARCHIVE_ACL_LIBACL
+static const acl_perm_map_t acl_posix_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
+ {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
+};
+
+static const int acl_posix_perm_map_size =
+ (int)(sizeof(acl_posix_perm_map)/sizeof(acl_posix_perm_map[0]));
+#endif /* ARCHIVE_ACL_LIBACL */
+
+#if ARCHIVE_ACL_LIBRICHACL
+static const acl_perm_map_t acl_nfs4_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, RICHACE_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_READ_DATA, RICHACE_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, RICHACE_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, RICHACE_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, RICHACE_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, RICHACE_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, RICHACE_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, RICHACE_READ_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, RICHACE_WRITE_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, RICHACE_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, RICHACE_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, RICHACE_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_DELETE, RICHACE_DELETE},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, RICHACE_READ_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, RICHACE_WRITE_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, RICHACE_WRITE_OWNER},
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, RICHACE_SYNCHRONIZE}
+};
+
+static const int acl_nfs4_perm_map_size =
+ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
+
+static const acl_perm_map_t acl_nfs4_flag_map[] = {
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, RICHACE_FILE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, RICHACE_DIRECTORY_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, RICHACE_NO_PROPAGATE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, RICHACE_INHERIT_ONLY_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, RICHACE_INHERITED_ACE}
+};
+
+static const int acl_nfs4_flag_map_size =
+ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
+#endif /* ARCHIVE_ACL_LIBRICHACL */
+
+#if ARCHIVE_ACL_LIBACL
+/*
+ * Translate POSIX.1e ACLs into libarchive internal structure
+ */
+static int
+translate_acl(struct archive_read_disk *a,
+ struct archive_entry *entry, acl_t acl, int default_entry_acl_type)
+{
+ acl_tag_t acl_tag;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+ int i, entry_acl_type;
+ int r, s, ae_id, ae_tag, ae_perm;
+ void *q;
+ const char *ae_name;
+
+ s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
+ if (s == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get first ACL entry");
+ return (ARCHIVE_WARN);
+ }
+
+ while (s == 1) {
+ ae_id = -1;
+ ae_name = NULL;
+ ae_perm = 0;
+
+ if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL tag type");
+ return (ARCHIVE_WARN);
+ }
+ switch (acl_tag) {
+ case ACL_USER:
+ q = acl_get_qualifier(acl_entry);
+ if (q != NULL) {
+ ae_id = (int)*(uid_t *)q;
+ acl_free(q);
+ ae_name = archive_read_disk_uname(&a->archive,
+ ae_id);
+ }
+ ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ break;
+ case ACL_GROUP:
+ q = acl_get_qualifier(acl_entry);
+ if (q != NULL) {
+ ae_id = (int)*(gid_t *)q;
+ acl_free(q);
+ ae_name = archive_read_disk_gname(&a->archive,
+ ae_id);
+ }
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ break;
+ case ACL_MASK:
+ ae_tag = ARCHIVE_ENTRY_ACL_MASK;
+ break;
+ case ACL_USER_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ break;
+ case ACL_GROUP_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case ACL_OTHER:
+ ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
+ break;
+ default:
+ /* Skip types that libarchive can't support. */
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ continue;
+ }
+
+ // XXX acl_type maps to allow/deny/audit/YYYY bits
+ entry_acl_type = default_entry_acl_type;
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL permission set");
+ return (ARCHIVE_WARN);
+ }
+
+ for (i = 0; i < acl_posix_perm_map_size; ++i) {
+ r = acl_get_perm(acl_permset,
+ acl_posix_perm_map[i].p_perm);
+ if (r == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to check permission in an ACL "
+ "permission set");
+ return (ARCHIVE_WARN);
+ } else if (r)
+ ae_perm |= acl_posix_perm_map[i].a_perm;
+ }
+
+ archive_entry_acl_add_entry(entry, entry_acl_type,
+ ae_perm, ae_tag,
+ ae_id, ae_name);
+
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ if (s == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get next ACL entry");
+ return (ARCHIVE_WARN);
+ }
+ }
+ return (ARCHIVE_OK);
+}
+#endif /* ARCHIVE_ACL_LIBACL */
+
+#if ARCHIVE_ACL_LIBRICHACL
+/*
+ * Translate RichACL into libarchive internal ACL
+ */
+static int
+translate_richacl(struct archive_read_disk *a, struct archive_entry *entry,
+ struct richacl *richacl)
+{
+ int ae_id, ae_tag, ae_perm;
+ int entry_acl_type, i;
+ const char *ae_name;
+
+ struct richace *richace;
+
+ richacl_for_each_entry(richace, richacl) {
+ ae_name = NULL;
+ ae_tag = 0;
+ ae_perm = 0;
+ ae_id = -1;
+
+ switch (richace->e_type) {
+ case RICHACE_ACCESS_ALLOWED_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
+ break;
+ case RICHACE_ACCESS_DENIED_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
+ break;
+ default: /* Unknown entry type, skip */
+ continue;
+ }
+
+ /* Unsupported */
+ if (richace->e_flags & RICHACE_UNMAPPED_WHO)
+ continue;
+
+ if (richace->e_flags & RICHACE_SPECIAL_WHO) {
+ switch (richace->e_id) {
+ case RICHACE_OWNER_SPECIAL_ID:
+ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ break;
+ case RICHACE_GROUP_SPECIAL_ID:
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case RICHACE_EVERYONE_SPECIAL_ID:
+ ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
+ break;
+ default: /* Unknown special ID type */
+ continue;
+ }
+ } else {
+ ae_id = richace->e_id;
+ if (richace->e_flags & RICHACE_IDENTIFIER_GROUP) {
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ ae_name = archive_read_disk_gname(&a->archive,
+ (gid_t)(richace->e_id));
+ } else {
+ ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ ae_name = archive_read_disk_uname(&a->archive,
+ (uid_t)(richace->e_id));
+ }
+ }
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if ((richace->e_flags &
+ acl_nfs4_flag_map[i].p_perm) != 0)
+ ae_perm |= acl_nfs4_flag_map[i].a_perm;
+ }
+ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
+ if ((richace->e_mask &
+ acl_nfs4_perm_map[i].p_perm) != 0)
+ ae_perm |=
+ acl_nfs4_perm_map[i].a_perm;
+ }
+
+ archive_entry_acl_add_entry(entry, entry_acl_type,
+ ae_perm, ae_tag, ae_id, ae_name);
+ }
+ return (ARCHIVE_OK);
+}
+#endif /* ARCHIVE_ACL_LIBRICHACL */
+
+#if ARCHIVE_ACL_LIBRICHACL
+static int
+_richacl_mode_to_mask(short mode)
+{
+ int mask = 0;
+
+ if (mode & S_IROTH)
+ mask |= RICHACE_POSIX_MODE_READ;
+ if (mode & S_IWOTH)
+ mask |= RICHACE_POSIX_MODE_WRITE;
+ if (mode & S_IXOTH)
+ mask |= RICHACE_POSIX_MODE_EXEC;
+
+ return (mask);
+}
+
+static void
+_richacl_mode_to_masks(struct richacl *richacl, __LA_MODE_T mode)
+{
+ richacl->a_owner_mask = _richacl_mode_to_mask((mode & 0700) >> 6);
+ richacl->a_group_mask = _richacl_mode_to_mask((mode & 0070) >> 3);
+ richacl->a_other_mask = _richacl_mode_to_mask(mode & 0007);
+}
+#endif /* ARCHIVE_ACL_LIBRICHACL */
+
+#if ARCHIVE_ACL_LIBRICHACL
+static int
+set_richacl(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode,
+ int ae_requested_type, const char *tname)
+{
+ int ae_type, ae_permset, ae_tag, ae_id;
+ uid_t ae_uid;
+ gid_t ae_gid;
+ const char *ae_name;
+ int entries;
+ int i;
+ int ret;
+ int e = 0;
+ struct richacl *richacl = NULL;
+ struct richace *richace;
+
+ ret = ARCHIVE_OK;
+ entries = archive_acl_reset(abstract_acl, ae_requested_type);
+ if (entries == 0)
+ return (ARCHIVE_OK);
+
+ if (ae_requested_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ errno = ENOENT;
+ archive_set_error(a, errno, "Unsupported ACL type");
+ return (ARCHIVE_FAILED);
+ }
+
+ richacl = richacl_alloc(entries);
+ if (richacl == NULL) {
+ archive_set_error(a, errno,
+ "Failed to initialize RichACL working storage");
+ return (ARCHIVE_FAILED);
+ }
+
+ e = 0;
+
+ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
+ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
+ richace = &(richacl->a_entries[e]);
+
+ richace->e_flags = 0;
+ richace->e_mask = 0;
+
+ switch (ae_tag) {
+ case ARCHIVE_ENTRY_ACL_USER:
+ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
+ richace->e_id = ae_uid;
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP:
+ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
+ richace->e_id = ae_gid;
+ richace->e_flags |= RICHACE_IDENTIFIER_GROUP;
+ break;
+ case ARCHIVE_ENTRY_ACL_USER_OBJ:
+ richace->e_flags |= RICHACE_SPECIAL_WHO;
+ richace->e_id = RICHACE_OWNER_SPECIAL_ID;
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
+ richace->e_flags |= RICHACE_SPECIAL_WHO;
+ richace->e_id = RICHACE_GROUP_SPECIAL_ID;
+ break;
+ case ARCHIVE_ENTRY_ACL_EVERYONE:
+ richace->e_flags |= RICHACE_SPECIAL_WHO;
+ richace->e_id = RICHACE_EVERYONE_SPECIAL_ID;
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL tag");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ switch (ae_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ richace->e_type =
+ RICHACE_ACCESS_ALLOWED_ACE_TYPE;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
+ richace->e_type =
+ RICHACE_ACCESS_DENIED_ACE_TYPE;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
+ case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL entry type");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
+ if (ae_permset & acl_nfs4_perm_map[i].a_perm)
+ richace->e_mask |= acl_nfs4_perm_map[i].p_perm;
+ }
+
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if (ae_permset &
+ acl_nfs4_flag_map[i].a_perm)
+ richace->e_flags |= acl_nfs4_flag_map[i].p_perm;
+ }
+ e++;
+ }
+
+ /* Fill RichACL masks */
+ _richacl_mode_to_masks(richacl, mode);
+
+ if (fd >= 0) {
+ if (richacl_set_fd(fd, richacl) == 0)
+ ret = ARCHIVE_OK;
+ else {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno,
+ "Failed to set richacl on fd: %s", tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+ } else if (richacl_set_file(name, richacl) != 0) {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno, "Failed to set richacl: %s",
+ tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+exit_free:
+ richacl_free(richacl);
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_RICHACL */
+
+#if ARCHIVE_ACL_LIBACL
+static int
+set_acl(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl,
+ int ae_requested_type, const char *tname)
+{
+ int acl_type = 0;
+ int ae_type, ae_permset, ae_tag, ae_id;
+ uid_t ae_uid;
+ gid_t ae_gid;
+ const char *ae_name;
+ int entries;
+ int i;
+ int ret;
+ acl_t acl = NULL;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+
+ ret = ARCHIVE_OK;
+ entries = archive_acl_reset(abstract_acl, ae_requested_type);
+ if (entries == 0)
+ return (ARCHIVE_OK);
+
+ switch (ae_requested_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ acl_type = ACL_TYPE_ACCESS;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ acl_type = ACL_TYPE_DEFAULT;
+ break;
+ default:
+ errno = ENOENT;
+ archive_set_error(a, errno, "Unsupported ACL type");
+ return (ARCHIVE_FAILED);
+ }
+
+ acl = acl_init(entries);
+ if (acl == (acl_t)NULL) {
+ archive_set_error(a, errno,
+ "Failed to initialize ACL working storage");
+ return (ARCHIVE_FAILED);
+ }
+
+ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
+ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
+
+ if (acl_create_entry(&acl, &acl_entry) != 0) {
+ archive_set_error(a, errno,
+ "Failed to create a new ACL entry");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ switch (ae_tag) {
+ case ARCHIVE_ENTRY_ACL_USER:
+ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
+ acl_set_tag_type(acl_entry, ACL_USER);
+ acl_set_qualifier(acl_entry, &ae_uid);
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP:
+ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
+ acl_set_tag_type(acl_entry, ACL_GROUP);
+ acl_set_qualifier(acl_entry, &ae_gid);
+ break;
+ case ARCHIVE_ENTRY_ACL_USER_OBJ:
+ acl_set_tag_type(acl_entry, ACL_USER_OBJ);
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
+ acl_set_tag_type(acl_entry, ACL_GROUP_OBJ);
+ break;
+ case ARCHIVE_ENTRY_ACL_MASK:
+ acl_set_tag_type(acl_entry, ACL_MASK);
+ break;
+ case ARCHIVE_ENTRY_ACL_OTHER:
+ acl_set_tag_type(acl_entry, ACL_OTHER);
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL tag");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to get ACL permission set");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ if (acl_clear_perms(acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to clear ACL permissions");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ for (i = 0; i < acl_posix_perm_map_size; ++i) {
+ if (ae_permset & acl_posix_perm_map[i].a_perm) {
+ if (acl_add_perm(acl_permset,
+ acl_posix_perm_map[i].p_perm) != 0) {
+ archive_set_error(a, errno,
+ "Failed to add ACL permission");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ }
+ }
+
+ }
+
+ if (fd >= 0 && ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) {
+ if (acl_set_fd(fd, acl) == 0)
+ ret = ARCHIVE_OK;
+ else {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno,
+ "Failed to set acl on fd: %s", tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+ } else if (acl_set_file(name, acl_type, acl) != 0) {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno, "Failed to set acl: %s",
+ tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+exit_free:
+ acl_free(acl);
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_LIBACL */
+
+int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ const char *accpath;
+ int r;
+#if ARCHIVE_ACL_LIBACL
+ acl_t acl;
+#endif
+#if ARCHIVE_ACL_LIBRICHACL
+ struct richacl *richacl;
+ mode_t mode;
+#endif
+
+ accpath = NULL;
+ r = ARCHIVE_OK;
+
+ /* For default ACLs we need reachable accpath */
+ if (*fd < 0 || S_ISDIR(archive_entry_mode(entry))) {
+ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (accpath == NULL)
+ return (ARCHIVE_WARN);
+ }
+
+ archive_entry_acl_clear(entry);
+
+#if ARCHIVE_ACL_LIBACL
+ acl = NULL;
+#endif
+#if ARCHIVE_ACL_LIBRICHACL
+ richacl = NULL;
+#endif
+
+#if ARCHIVE_ACL_LIBRICHACL
+ /* Try NFSv4 ACL first. */
+ if (*fd >= 0)
+ richacl = richacl_get_fd(*fd);
+ else if ((!a->follow_symlinks)
+ && (archive_entry_filetype(entry) == AE_IFLNK))
+ /* We can't get the ACL of a symlink, so we assume it can't
+ have one */
+ richacl = NULL;
+ else
+ richacl = richacl_get_file(accpath);
+
+ /* Ignore "trivial" ACLs that just mirror the file mode. */
+ if (richacl != NULL) {
+ mode = archive_entry_mode(entry);
+ if (richacl_equiv_mode(richacl, &mode) == 0) {
+ richacl_free(richacl);
+ richacl = NULL;
+ return (ARCHIVE_OK);
+ }
+ }
+
+ if (richacl != NULL) {
+ r = translate_richacl(a, entry, richacl);
+ richacl_free(richacl);
+ richacl = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate NFSv4 ACLs");
+ }
+
+ return (r);
+ }
+#endif /* ARCHIVE_ACL_LIBRICHACL */
+
+#if ARCHIVE_ACL_LIBACL
+ /* Retrieve access ACL from file. */
+ if (*fd >= 0)
+ acl = acl_get_fd(*fd);
+ else if ((!a->follow_symlinks)
+ && (archive_entry_filetype(entry) == AE_IFLNK))
+ /* We can't get the ACL of a symlink, so we assume it can't
+ have one. */
+ acl = NULL;
+ else
+ acl = acl_get_file(accpath, ACL_TYPE_ACCESS);
+
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
+ acl_free(acl);
+ acl = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate access ACLs");
+ return (r);
+ }
+ }
+
+ /* Only directories can have default ACLs. */
+ if (S_ISDIR(archive_entry_mode(entry))) {
+ acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
+ acl_free(acl);
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate default ACLs");
+ return (r);
+ }
+ }
+ }
+#endif /* ARCHIVE_ACL_LIBACL */
+ return (r);
+}
+
+int
+archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode)
+{
+ int ret = ARCHIVE_OK;
+
+#if !ARCHIVE_ACL_LIBRICHACL
+ (void)mode; /* UNUSED */
+#endif
+
+#if ARCHIVE_ACL_LIBRICHACL
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ ret = set_richacl(a, fd, name, abstract_acl, mode,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
+ }
+#if ARCHIVE_ACL_LIBACL
+ else
+#endif
+#endif /* ARCHIVE_ACL_LIBRICHACL */
+#if ARCHIVE_ACL_LIBACL
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access");
+ if (ret != ARCHIVE_OK)
+ return (ret);
+ }
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default");
+ }
+#endif /* ARCHIVE_ACL_LIBACL */
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_LIBACL || ARCHIVE_ACL_LIBRICHACL */
diff --git a/Utilities/cmlibarchive/libarchive/archive_disk_acl_sunos.c b/Utilities/cmlibarchive/libarchive/archive_disk_acl_sunos.c
new file mode 100644
index 0000000..bc84fd6
--- /dev/null
+++ b/Utilities/cmlibarchive/libarchive/archive_disk_acl_sunos.c
@@ -0,0 +1,821 @@
+/*-
+ * Copyright (c) 2017 Martin Matuska
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+
+#if ARCHIVE_ACL_SUNOS
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_ACL_H
+#define _ACL_PRIVATE /* For debugging */
+#include <sys/acl.h>
+#endif
+
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_read_disk_private.h"
+#include "archive_write_disk_private.h"
+
+typedef struct {
+ const int a_perm; /* Libarchive permission or flag */
+ const int p_perm; /* Platform permission or flag */
+} acl_perm_map_t;
+
+static const acl_perm_map_t acl_posix_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, S_IXOTH },
+ {ARCHIVE_ENTRY_ACL_WRITE, S_IWOTH },
+ {ARCHIVE_ENTRY_ACL_READ, S_IROTH }
+};
+
+static const int acl_posix_perm_map_size =
+ (int)(sizeof(acl_posix_perm_map)/sizeof(acl_posix_perm_map[0]));
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+static const acl_perm_map_t acl_nfs4_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_READ_DATA, ACE_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACE_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACE_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACE_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACE_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACE_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACE_READ_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACE_WRITE_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACE_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_DELETE, ACE_DELETE},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, ACE_READ_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACE_WRITE_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACE_WRITE_OWNER},
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACE_SYNCHRONIZE}
+};
+
+static const int acl_nfs4_perm_map_size =
+ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
+
+static const acl_perm_map_t acl_nfs4_flag_map[] = {
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACE_INHERIT_ONLY_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACE_SUCCESSFUL_ACCESS_ACE_FLAG},
+ {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACE_FAILED_ACCESS_ACE_FLAG},
+#ifdef ACE_INHERITED_ACE
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACE_INHERITED_ACE}
+#endif
+};
+
+const int acl_nfs4_flag_map_size =
+ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
+
+#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
+
+static void *
+sunacl_get(int cmd, int *aclcnt, int fd, const char *path)
+{
+ int cnt, cntcmd;
+ size_t size;
+ void *aclp;
+
+ if (cmd == GETACL) {
+ cntcmd = GETACLCNT;
+ size = sizeof(aclent_t);
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else if (cmd == ACE_GETACL) {
+ cntcmd = ACE_GETACLCNT;
+ size = sizeof(ace_t);
+ }
+#endif
+ else {
+ errno = EINVAL;
+ *aclcnt = -1;
+ return (NULL);
+ }
+
+ aclp = NULL;
+ cnt = -2;
+
+ while (cnt == -2 || (cnt == -1 && errno == ENOSPC)) {
+ if (path != NULL)
+ cnt = acl(path, cntcmd, 0, NULL);
+ else
+ cnt = facl(fd, cntcmd, 0, NULL);
+
+ if (cnt > 0) {
+ if (aclp == NULL)
+ aclp = malloc(cnt * size);
+ else
+ aclp = realloc(NULL, cnt * size);
+ if (aclp != NULL) {
+ if (path != NULL)
+ cnt = acl(path, cmd, cnt, aclp);
+ else
+ cnt = facl(fd, cmd, cnt, aclp);
+ }
+ } else {
+ if (aclp != NULL) {
+ free(aclp);
+ aclp = NULL;
+ }
+ break;
+ }
+ }
+
+ *aclcnt = cnt;
+ return (aclp);
+}
+
+/*
+ * Check if acl is trivial
+ * This is a FreeBSD acl_is_trivial_np() implementation for Solaris
+ */
+static int
+sun_acl_is_trivial(void *aclp, int aclcnt, mode_t mode, int is_nfs4,
+ int is_dir, int *trivialp)
+{
+#if ARCHIVE_ACL_SUNOS_NFS4
+ int i, p;
+ const uint32_t rperm = ACE_READ_DATA;
+ const uint32_t wperm = ACE_WRITE_DATA | ACE_APPEND_DATA;
+ const uint32_t eperm = ACE_EXECUTE;
+ const uint32_t pubset = ACE_READ_ATTRIBUTES | ACE_READ_NAMED_ATTRS |
+ ACE_READ_ACL | ACE_SYNCHRONIZE;
+ const uint32_t ownset = pubset | ACE_WRITE_ATTRIBUTES |
+ ACE_WRITE_NAMED_ATTRS | ACE_WRITE_ACL | ACE_WRITE_OWNER;
+
+ ace_t *ace;
+ ace_t tace[6];
+#endif
+
+ if (aclp == NULL || trivialp == NULL)
+ return (-1);
+
+ *trivialp = 0;
+
+ /*
+ * POSIX.1e ACLs marked with ACL_IS_TRIVIAL are compatible with
+ * FreeBSD acl_is_trivial_np(). On Solaris they have 4 entries,
+ * including mask.
+ */
+ if (!is_nfs4) {
+ if (aclcnt == 4)
+ *trivialp = 1;
+ return (0);
+ }
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+ /*
+ * Continue with checking NFSv4 ACLs
+ *
+ * Create list of trivial ace's to be compared
+ */
+
+ /* owner@ allow pre */
+ tace[0].a_flags = ACE_OWNER;
+ tace[0].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
+ tace[0].a_access_mask = 0;
+
+ /* owner@ deny */
+ tace[1].a_flags = ACE_OWNER;
+ tace[1].a_type = ACE_ACCESS_DENIED_ACE_TYPE;
+ tace[1].a_access_mask = 0;
+
+ /* group@ deny */
+ tace[2].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP;
+ tace[2].a_type = ACE_ACCESS_DENIED_ACE_TYPE;
+ tace[2].a_access_mask = 0;
+
+ /* owner@ allow */
+ tace[3].a_flags = ACE_OWNER;
+ tace[3].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
+ tace[3].a_access_mask = ownset;
+
+ /* group@ allow */
+ tace[4].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP;
+ tace[4].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
+ tace[4].a_access_mask = pubset;
+
+ /* everyone@ allow */
+ tace[5].a_flags = ACE_EVERYONE;
+ tace[5].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
+ tace[5].a_access_mask = pubset;
+
+ /* Permissions for everyone@ */
+ if (mode & 0004)
+ tace[5].a_access_mask |= rperm;
+ if (mode & 0002)
+ tace[5].a_access_mask |= wperm;
+ if (mode & 0001)
+ tace[5].a_access_mask |= eperm;
+
+ /* Permissions for group@ */
+ if (mode & 0040)
+ tace[4].a_access_mask |= rperm;
+ else if (mode & 0004)
+ tace[2].a_access_mask |= rperm;
+ if (mode & 0020)
+ tace[4].a_access_mask |= wperm;
+ else if (mode & 0002)
+ tace[2].a_access_mask |= wperm;
+ if (mode & 0010)
+ tace[4].a_access_mask |= eperm;
+ else if (mode & 0001)
+ tace[2].a_access_mask |= eperm;
+
+ /* Permissions for owner@ */
+ if (mode & 0400) {
+ tace[3].a_access_mask |= rperm;
+ if (!(mode & 0040) && (mode & 0004))
+ tace[0].a_access_mask |= rperm;
+ } else if ((mode & 0040) || (mode & 0004))
+ tace[1].a_access_mask |= rperm;
+ if (mode & 0200) {
+ tace[3].a_access_mask |= wperm;
+ if (!(mode & 0020) && (mode & 0002))
+ tace[0].a_access_mask |= wperm;
+ } else if ((mode & 0020) || (mode & 0002))
+ tace[1].a_access_mask |= wperm;
+ if (mode & 0100) {
+ tace[3].a_access_mask |= eperm;
+ if (!(mode & 0010) && (mode & 0001))
+ tace[0].a_access_mask |= eperm;
+ } else if ((mode & 0010) || (mode & 0001))
+ tace[1].a_access_mask |= eperm;
+
+ /* Check if the acl count matches */
+ p = 3;
+ for (i = 0; i < 3; i++) {
+ if (tace[i].a_access_mask != 0)
+ p++;
+ }
+ if (aclcnt != p)
+ return (0);
+
+ p = 0;
+ for (i = 0; i < 6; i++) {
+ if (tace[i].a_access_mask != 0) {
+ ace = &((ace_t *)aclp)[p];
+ /*
+ * Illumos added ACE_DELETE_CHILD to write perms for
+ * directories. We have to check against that, too.
+ */
+ if (ace->a_flags != tace[i].a_flags ||
+ ace->a_type != tace[i].a_type ||
+ (ace->a_access_mask != tace[i].a_access_mask &&
+ (!is_dir || (tace[i].a_access_mask & wperm) == 0 ||
+ ace->a_access_mask !=
+ (tace[i].a_access_mask | ACE_DELETE_CHILD))))
+ return (0);
+ p++;
+ }
+ }
+
+ *trivialp = 1;
+#else /* !ARCHIVE_ACL_SUNOS_NFS4 */
+ (void)is_dir; /* UNUSED */
+ (void)aclp; /* UNUSED */
+#endif /* !ARCHIVE_ACL_SUNOS_NFS4 */
+ return (0);
+}
+
+/*
+ * Translate Solaris POSIX.1e and NFSv4 ACLs into libarchive internal ACL
+ */
+static int
+translate_acl(struct archive_read_disk *a,
+ struct archive_entry *entry, void *aclp, int aclcnt,
+ int default_entry_acl_type)
+{
+ int e, i;
+ int ae_id, ae_tag, ae_perm;
+ int entry_acl_type;
+ const char *ae_name;
+ aclent_t *aclent;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ ace_t *ace;
+#endif
+
+ if (aclcnt <= 0)
+ return (ARCHIVE_OK);
+
+ for (e = 0; e < aclcnt; e++) {
+ ae_name = NULL;
+ ae_tag = 0;
+ ae_perm = 0;
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+ if (default_entry_acl_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ ace = &((ace_t *)aclp)[e];
+ ae_id = ace->a_who;
+
+ switch(ace->a_type) {
+ case ACE_ACCESS_ALLOWED_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
+ break;
+ case ACE_ACCESS_DENIED_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
+ break;
+ case ACE_SYSTEM_AUDIT_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
+ break;
+ case ACE_SYSTEM_ALARM_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
+ break;
+ default:
+ /* Unknown entry type, skip */
+ continue;
+ }
+
+ if ((ace->a_flags & ACE_OWNER) != 0)
+ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ else if ((ace->a_flags & ACE_GROUP) != 0)
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ else if ((ace->a_flags & ACE_EVERYONE) != 0)
+ ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
+ else if ((ace->a_flags & ACE_IDENTIFIER_GROUP) != 0) {
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ ae_name = archive_read_disk_gname(&a->archive,
+ ae_id);
+ } else {
+ ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ ae_name = archive_read_disk_uname(&a->archive,
+ ae_id);
+ }
+
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if ((ace->a_flags &
+ acl_nfs4_flag_map[i].p_perm) != 0)
+ ae_perm |= acl_nfs4_flag_map[i].a_perm;
+ }
+
+ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
+ if ((ace->a_access_mask &
+ acl_nfs4_perm_map[i].p_perm) != 0)
+ ae_perm |= acl_nfs4_perm_map[i].a_perm;
+ }
+ } else
+#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
+ if (default_entry_acl_type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) {
+ aclent = &((aclent_t *)aclp)[e];
+ if ((aclent->a_type & ACL_DEFAULT) != 0)
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
+ else
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
+ ae_id = aclent->a_id;
+
+ switch(aclent->a_type) {
+ case DEF_USER:
+ case USER:
+ ae_name = archive_read_disk_uname(&a->archive,
+ ae_id);
+ ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ break;
+ case DEF_GROUP:
+ case GROUP:
+ ae_name = archive_read_disk_gname(&a->archive,
+ ae_id);
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ break;
+ case DEF_CLASS_OBJ:
+ case CLASS_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_MASK;
+ break;
+ case DEF_USER_OBJ:
+ case USER_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ break;
+ case DEF_GROUP_OBJ:
+ case GROUP_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case DEF_OTHER_OBJ:
+ case OTHER_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
+ break;
+ default:
+ /* Unknown tag type, skip */
+ continue;
+ }
+
+ for (i = 0; i < acl_posix_perm_map_size; ++i) {
+ if ((aclent->a_perm &
+ acl_posix_perm_map[i].p_perm) != 0)
+ ae_perm |= acl_posix_perm_map[i].a_perm;
+ }
+ } else
+ return (ARCHIVE_WARN);
+
+ archive_entry_acl_add_entry(entry, entry_acl_type,
+ ae_perm, ae_tag, ae_id, ae_name);
+ }
+ return (ARCHIVE_OK);
+}
+
+static int
+set_acl(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl,
+ int ae_requested_type, const char *tname)
+{
+ aclent_t *aclent;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ ace_t *ace;
+#endif
+ int cmd, e, r;
+ void *aclp;
+ int ret;
+ int ae_type, ae_permset, ae_tag, ae_id;
+ int perm_map_size;
+ const acl_perm_map_t *perm_map;
+ uid_t ae_uid;
+ gid_t ae_gid;
+ const char *ae_name;
+ int entries;
+ int i;
+
+ ret = ARCHIVE_OK;
+ entries = archive_acl_reset(abstract_acl, ae_requested_type);
+ if (entries == 0)
+ return (ARCHIVE_OK);
+
+
+ switch (ae_requested_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E:
+ cmd = SETACL;
+ aclp = malloc(entries * sizeof(aclent_t));
+ break;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
+ cmd = ACE_SETACL;
+ aclp = malloc(entries * sizeof(ace_t));
+
+ break;
+#endif
+ default:
+ errno = ENOENT;
+ archive_set_error(a, errno, "Unsupported ACL type");
+ return (ARCHIVE_FAILED);
+ }
+
+ if (aclp == NULL) {
+ archive_set_error(a, errno,
+ "Can't allocate memory for acl buffer");
+ return (ARCHIVE_FAILED);
+ }
+
+ e = 0;
+
+ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
+ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
+ aclent = NULL;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ ace = NULL;
+#endif
+ if (cmd == SETACL) {
+ aclent = &((aclent_t *)aclp)[e];
+ aclent->a_id = -1;
+ aclent->a_type = 0;
+ aclent->a_perm = 0;
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else { /* cmd == ACE_SETACL */
+ ace = &((ace_t *)aclp)[e];
+ ace->a_who = -1;
+ ace->a_access_mask = 0;
+ ace->a_flags = 0;
+ }
+#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
+
+ switch (ae_tag) {
+ case ARCHIVE_ENTRY_ACL_USER:
+ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
+ if (aclent != NULL) {
+ aclent->a_id = ae_uid;
+ aclent->a_type |= USER;
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else {
+ ace->a_who = ae_uid;
+ }
+#endif
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP:
+ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
+ if (aclent != NULL) {
+ aclent->a_id = ae_gid;
+ aclent->a_type |= GROUP;
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else {
+ ace->a_who = ae_gid;
+ ace->a_flags |= ACE_IDENTIFIER_GROUP;
+ }
+#endif
+ break;
+ case ARCHIVE_ENTRY_ACL_USER_OBJ:
+ if (aclent != NULL)
+ aclent->a_type |= USER_OBJ;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else {
+ ace->a_flags |= ACE_OWNER;
+ }
+#endif
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
+ if (aclent != NULL)
+ aclent->a_type |= GROUP_OBJ;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else {
+ ace->a_flags |= ACE_GROUP;
+ ace->a_flags |= ACE_IDENTIFIER_GROUP;
+ }
+#endif
+ break;
+ case ARCHIVE_ENTRY_ACL_MASK:
+ if (aclent != NULL)
+ aclent->a_type |= CLASS_OBJ;
+ break;
+ case ARCHIVE_ENTRY_ACL_OTHER:
+ if (aclent != NULL)
+ aclent->a_type |= OTHER_OBJ;
+ break;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ case ARCHIVE_ENTRY_ACL_EVERYONE:
+ if (ace != NULL)
+ ace->a_flags |= ACE_EVERYONE;
+ break;
+#endif
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL tag");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ r = 0;
+ switch (ae_type) {
+#if ARCHIVE_ACL_SUNOS_NFS4
+ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ if (ace != NULL)
+ ace->a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
+ else
+ r = -1;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
+ if (ace != NULL)
+ ace->a_type = ACE_ACCESS_DENIED_ACE_TYPE;
+ else
+ r = -1;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
+ if (ace != NULL)
+ ace->a_type = ACE_SYSTEM_AUDIT_ACE_TYPE;
+ else
+ r = -1;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
+ if (ace != NULL)
+ ace->a_type = ACE_SYSTEM_ALARM_ACE_TYPE;
+ else
+ r = -1;
+ break;
+#endif
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ if (aclent == NULL)
+ r = -1;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ if (aclent != NULL)
+ aclent->a_type |= ACL_DEFAULT;
+ else
+ r = -1;
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL entry type");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ if (r != 0) {
+ errno = EINVAL;
+ archive_set_error(a, errno,
+ "Failed to set ACL entry type");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ perm_map_size = acl_nfs4_perm_map_size;
+ perm_map = acl_nfs4_perm_map;
+ } else {
+#endif
+ perm_map_size = acl_posix_perm_map_size;
+ perm_map = acl_posix_perm_map;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ }
+#endif
+ for (i = 0; i < perm_map_size; ++i) {
+ if (ae_permset & perm_map[i].a_perm) {
+#if ARCHIVE_ACL_SUNOS_NFS4
+ if (ae_requested_type ==
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4)
+ ace->a_access_mask |=
+ perm_map[i].p_perm;
+ else
+#endif
+ aclent->a_perm |= perm_map[i].p_perm;
+ }
+ }
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if (ae_permset & acl_nfs4_flag_map[i].a_perm) {
+ ace->a_flags |=
+ acl_nfs4_flag_map[i].p_perm;
+ }
+ }
+ }
+#endif
+ e++;
+ }
+
+ /* Try restoring the ACL through 'fd' if we can. */
+ if (fd >= 0) {
+ if (facl(fd, cmd, entries, aclp) == 0)
+ ret = ARCHIVE_OK;
+ else {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno,
+ "Failed to set acl on fd: %s", tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+ } else if (acl(name, cmd, entries, aclp) != 0) {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno, "Failed to set acl: %s",
+ tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+exit_free:
+ free(aclp);
+ return (ret);
+}
+
+int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ const char *accpath;
+ void *aclp;
+ int aclcnt;
+ int r;
+
+ accpath = NULL;
+
+ if (*fd < 0) {
+ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (accpath == NULL)
+ return (ARCHIVE_WARN);
+ }
+
+ archive_entry_acl_clear(entry);
+
+ aclp = NULL;
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+ if (*fd >= 0)
+ aclp = sunacl_get(ACE_GETACL, &aclcnt, *fd, NULL);
+ else if ((!a->follow_symlinks)
+ && (archive_entry_filetype(entry) == AE_IFLNK))
+ /* We can't get the ACL of a symlink, so we assume it can't
+ have one. */
+ aclp = NULL;
+ else
+ aclp = sunacl_get(ACE_GETACL, &aclcnt, 0, accpath);
+
+ if (aclp != NULL && sun_acl_is_trivial(aclp, aclcnt,
+ archive_entry_mode(entry), 1, S_ISDIR(archive_entry_mode(entry)),
+ &r) == 0 && r == 1) {
+ free(aclp);
+ aclp = NULL;
+ return (ARCHIVE_OK);
+ }
+
+ if (aclp != NULL) {
+ r = translate_acl(a, entry, aclp, aclcnt,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4);
+ free(aclp);
+ aclp = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate NFSv4 ACLs");
+ }
+ return (r);
+ }
+#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
+
+ /* Retrieve POSIX.1e ACLs from file. */
+ if (*fd >= 0)
+ aclp = sunacl_get(GETACL, &aclcnt, *fd, NULL);
+ else if ((!a->follow_symlinks)
+ && (archive_entry_filetype(entry) == AE_IFLNK))
+ /* We can't get the ACL of a symlink, so we assume it can't
+ have one. */
+ aclp = NULL;
+ else
+ aclp = sunacl_get(GETACL, &aclcnt, 0, accpath);
+
+ /* Ignore "trivial" ACLs that just mirror the file mode. */
+ if (aclp != NULL && sun_acl_is_trivial(aclp, aclcnt,
+ archive_entry_mode(entry), 0, S_ISDIR(archive_entry_mode(entry)),
+ &r) == 0 && r == 1) {
+ free(aclp);
+ aclp = NULL;
+ }
+
+ if (aclp != NULL)
+ {
+ r = translate_acl(a, entry, aclp, aclcnt,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
+ free(aclp);
+ aclp = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate access ACLs");
+ return (r);
+ }
+ }
+
+ return (ARCHIVE_OK);
+}
+
+int
+archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode)
+{
+ int ret = ARCHIVE_OK;
+
+ (void)mode; /* UNUSED */
+
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
+ /* Solaris writes POSIX.1e access and default ACLs together */
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, "posix1e");
+
+ /* Simultaneous POSIX.1e and NFSv4 is not supported */
+ return (ret);
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else if ((archive_acl_types(abstract_acl) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
+ }
+#endif
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_SUNOS */
diff --git a/Utilities/cmlibarchive/libarchive/archive_entry.3 b/Utilities/cmlibarchive/libarchive/archive_entry.3
index f5e22af..f75916c 100644
--- a/Utilities/cmlibarchive/libarchive/archive_entry.3
+++ b/Utilities/cmlibarchive/libarchive/archive_entry.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Feburary 2, 2012
+.Dd February 2, 2012
.Dt ARCHIVE_ENTRY 3
.Os
.Sh NAME
diff --git a/Utilities/cmlibarchive/libarchive/archive_entry.c b/Utilities/cmlibarchive/libarchive/archive_entry.c
index 10eff11..30fb456 100644
--- a/Utilities/cmlibarchive/libarchive/archive_entry.c
+++ b/Utilities/cmlibarchive/libarchive/archive_entry.c
@@ -401,7 +401,7 @@ archive_entry_fflags_text(struct archive_entry *entry)
return (NULL);
}
-int64_t
+la_int64_t
archive_entry_gid(struct archive_entry *entry)
{
return (entry->ae_stat.aest_gid);
@@ -502,7 +502,7 @@ _archive_entry_hardlink_l(struct archive_entry *entry,
return (archive_mstring_get_mbs_l(&entry->ae_hardlink, p, len, sc));
}
-int64_t
+la_int64_t
archive_entry_ino(struct archive_entry *entry)
{
return (entry->ae_stat.aest_ino);
@@ -514,7 +514,7 @@ archive_entry_ino_is_set(struct archive_entry *entry)
return (entry->ae_set & AE_SET_INO);
}
-int64_t
+la_int64_t
archive_entry_ino64(struct archive_entry *entry)
{
return (entry->ae_stat.aest_ino);
@@ -627,7 +627,7 @@ archive_entry_rdevminor(struct archive_entry *entry)
return minor(entry->ae_stat.aest_rdev);
}
-int64_t
+la_int64_t
archive_entry_size(struct archive_entry *entry)
{
return (entry->ae_stat.aest_size);
@@ -715,7 +715,7 @@ _archive_entry_symlink_l(struct archive_entry *entry,
return (archive_mstring_get_mbs_l( &entry->ae_symlink, p, len, sc));
}
-int64_t
+la_int64_t
archive_entry_uid(struct archive_entry *entry)
{
return (entry->ae_stat.aest_uid);
@@ -819,7 +819,7 @@ archive_entry_copy_fflags_text_w(struct archive_entry *entry,
}
void
-archive_entry_set_gid(struct archive_entry *entry, int64_t g)
+archive_entry_set_gid(struct archive_entry *entry, la_int64_t g)
{
entry->stat_valid = 0;
entry->ae_stat.aest_gid = g;
@@ -868,7 +868,7 @@ _archive_entry_copy_gname_l(struct archive_entry *entry,
}
void
-archive_entry_set_ino(struct archive_entry *entry, int64_t ino)
+archive_entry_set_ino(struct archive_entry *entry, la_int64_t ino)
{
entry->stat_valid = 0;
entry->ae_set |= AE_SET_INO;
@@ -876,7 +876,7 @@ archive_entry_set_ino(struct archive_entry *entry, int64_t ino)
}
void
-archive_entry_set_ino64(struct archive_entry *entry, int64_t ino)
+archive_entry_set_ino64(struct archive_entry *entry, la_int64_t ino)
{
entry->stat_valid = 0;
entry->ae_set |= AE_SET_INO;
@@ -1209,7 +1209,7 @@ archive_entry_set_rdevminor(struct archive_entry *entry, dev_t m)
}
void
-archive_entry_set_size(struct archive_entry *entry, int64_t s)
+archive_entry_set_size(struct archive_entry *entry, la_int64_t s)
{
entry->stat_valid = 0;
entry->ae_stat.aest_size = s;
@@ -1306,7 +1306,7 @@ _archive_entry_copy_symlink_l(struct archive_entry *entry,
}
void
-archive_entry_set_uid(struct archive_entry *entry, int64_t u)
+archive_entry_set_uid(struct archive_entry *entry, la_int64_t u)
{
entry->stat_valid = 0;
entry->ae_stat.aest_uid = u;
@@ -1638,7 +1638,7 @@ _archive_entry_acl_text_l(struct archive_entry *entry, int flags,
* SUCH DAMAGE.
*/
-static struct flag {
+static const struct flag {
const char *name;
const wchar_t *wname;
unsigned long set;
@@ -1708,6 +1708,9 @@ static struct flag {
#ifdef UF_COMPRESSED
{ "nocompressed",L"nocompressed", UF_COMPRESSED, 0 },
#endif
+#ifdef UF_HIDDEN
+ { "nohidden", L"nohidden", UF_HIDDEN, 0 },
+#endif
#if defined(FS_UNRM_FL)
{ "nouunlink", L"nouunlink", FS_UNRM_FL, 0},
#elif defined(EXT2_UNRM_FL)
@@ -1840,7 +1843,7 @@ ae_fflagstostr(unsigned long bitset, unsigned long bitclear)
char *string, *dp;
const char *sp;
unsigned long bits;
- struct flag *flag;
+ const struct flag *flag;
size_t length;
bits = bitset | bitclear;
@@ -1892,7 +1895,7 @@ static const char *
ae_strtofflags(const char *s, unsigned long *setp, unsigned long *clrp)
{
const char *start, *end;
- struct flag *flag;
+ const struct flag *flag;
unsigned long set, clear;
const char *failed;
@@ -1960,7 +1963,7 @@ static const wchar_t *
ae_wcstofflags(const wchar_t *s, unsigned long *setp, unsigned long *clrp)
{
const wchar_t *start, *end;
- struct flag *flag;
+ const struct flag *flag;
unsigned long set, clear;
const wchar_t *failed;
diff --git a/Utilities/cmlibarchive/libarchive/archive_entry.h b/Utilities/cmlibarchive/libarchive/archive_entry.h
index 6e0225b..8c8e75a 100644
--- a/Utilities/cmlibarchive/libarchive/archive_entry.h
+++ b/Utilities/cmlibarchive/libarchive/archive_entry.h
@@ -30,7 +30,7 @@
#define ARCHIVE_ENTRY_H_INCLUDED
/* Note: Compiler will complain if this does not match archive.h! */
-#define ARCHIVE_VERSION_NUMBER 3003001
+#define ARCHIVE_VERSION_NUMBER 3003002
/*
* Note: archive_entry.h is for use outside of libarchive; the
diff --git a/Utilities/cmlibarchive/libarchive/archive_entry_acl.3 b/Utilities/cmlibarchive/libarchive/archive_entry_acl.3
index c5115f7..534dbfa 100644
--- a/Utilities/cmlibarchive/libarchive/archive_entry_acl.3
+++ b/Utilities/cmlibarchive/libarchive/archive_entry_acl.3
@@ -32,7 +32,7 @@
.Nm archive_entry_acl_clear ,
.Nm archive_entry_acl_count ,
.Nm archive_entry_acl_from_text ,
-.Nm archive_entry_acl_from_text_w,
+.Nm archive_entry_acl_from_text_w ,
.Nm archive_entry_acl_next ,
.Nm archive_entry_acl_next_w ,
.Nm archive_entry_acl_reset ,
@@ -267,7 +267,7 @@ Only inherit, do not apply the permission on the directory itself.
.It Dv ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT ( Sy n )
Do not propagate inherit flags. Only first-level entries inherit ACLs.
.It Dv ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS ( Sy S )
-Trigger alarm or audit on succesful access.
+Trigger alarm or audit on successful access.
.It Dv ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS ( Sy F )
Trigger alarm or audit on failed access.
.It Dv ARCHIVE_ENTRY_ACL_ENTRY_INHERITED ( Sy I )
@@ -279,7 +279,7 @@ and
.Fn archive_entry_acl_add_entry_w
add a single ACL entry.
For the access ACL and non-extended principals, the classic Unix permissions
-are updated. An archive enry cannot contain both POSIX.1e and NFSv4 ACL
+are updated. An archive entry cannot contain both POSIX.1e and NFSv4 ACL
entries.
.Pp
.Fn archive_entry_acl_clear
@@ -303,7 +303,7 @@ for POSIX.1e ACLs and
for NFSv4 ACLs. For POSIX.1e ACLs if
.Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS
is included and at least one extended ACL entry is found,
-the three non-extened ACLs are added.
+the three non-extended ACLs are added.
.Pp
.Fn archive_entry_acl_from_text
and
@@ -367,7 +367,7 @@ and
.Fn archive_entry_acl_to_text_w
convert the ACL entries for the given type into a
.Pq wide
-string of ACL entries separated by newline. If the the pointer
+string of ACL entries separated by newline. If the pointer
.Fa len_p
is not NULL, then the function shall return the length of the string
.Pq not including the NULL terminator
diff --git a/Utilities/cmlibarchive/libarchive/archive_entry_paths.3 b/Utilities/cmlibarchive/libarchive/archive_entry_paths.3
index fd22cf7..f647212 100644
--- a/Utilities/cmlibarchive/libarchive/archive_entry_paths.3
+++ b/Utilities/cmlibarchive/libarchive/archive_entry_paths.3
@@ -31,25 +31,25 @@
.Nm archive_entry_set_hardlink ,
.Nm archive_entry_copy_hardlink ,
.Nm archive_entry_copy_hardlink_w ,
-.Nm archve_entry_update_hardlink_utf8 ,
+.Nm archive_entry_update_hardlink_utf8 ,
.Nm archive_entry_set_link ,
.Nm archive_entry_copy_link ,
.Nm archive_entry_copy_link_w ,
-.Nm archve_entry_update_link_utf8 ,
+.Nm archive_entry_update_link_utf8 ,
.Nm archive_entry_pathname ,
.Nm archive_entry_pathname_w ,
.Nm archive_entry_set_pathname ,
.Nm archive_entry_copy_pathname ,
.Nm archive_entry_copy_pathname_w ,
-.Nm archve_entry_update_pathname_utf8 ,
+.Nm archive_entry_update_pathname_utf8 ,
.Nm archive_entry_sourcepath ,
.Nm archive_entry_copy_sourcepath ,
-.Nm archive_entry_symlink,
-.Nm archive_entry_symlink_w,
+.Nm archive_entry_symlink ,
+.Nm archive_entry_symlink_w ,
.Nm archive_entry_set_symlink ,
.Nm archive_entry_copy_symlink ,
.Nm archive_entry_copy_symlink_w ,
-.Nm archve_entry_update_symlink_utf8
+.Nm archive_entry_update_symlink_utf8
.Nd functions for manipulating path names in archive entry descriptions
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
diff --git a/Utilities/cmlibarchive/libarchive/archive_entry_perms.3 b/Utilities/cmlibarchive/libarchive/archive_entry_perms.3
index 340c5ea..aae3648 100644
--- a/Utilities/cmlibarchive/libarchive/archive_entry_perms.3
+++ b/Utilities/cmlibarchive/libarchive/archive_entry_perms.3
@@ -34,8 +34,8 @@
.Nm archive_entry_perm ,
.Nm archive_entry_set_perm ,
.Nm archive_entry_strmode ,
-.Nm archive_entry_uname
-.Nm archive_entry_uname_w
+.Nm archive_entry_uname ,
+.Nm archive_entry_uname_w ,
.Nm archive_entry_set_uname ,
.Nm archive_entry_copy_uname ,
.Nm archive_entry_copy_uname_w ,
diff --git a/Utilities/cmlibarchive/libarchive/archive_entry_sparse.c b/Utilities/cmlibarchive/libarchive/archive_entry_sparse.c
index fed74f5..74917b3 100644
--- a/Utilities/cmlibarchive/libarchive/archive_entry_sparse.c
+++ b/Utilities/cmlibarchive/libarchive/archive_entry_sparse.c
@@ -51,7 +51,7 @@ archive_entry_sparse_clear(struct archive_entry *entry)
void
archive_entry_sparse_add_entry(struct archive_entry *entry,
- int64_t offset, int64_t length)
+ la_int64_t offset, la_int64_t length)
{
struct ae_sparse *sp;
@@ -135,7 +135,7 @@ archive_entry_sparse_reset(struct archive_entry * entry)
int
archive_entry_sparse_next(struct archive_entry * entry,
- int64_t *offset, int64_t *length)
+ la_int64_t *offset, la_int64_t *length)
{
if (entry->sparse_p) {
*offset = entry->sparse_p->offset;
diff --git a/Utilities/cmlibarchive/libarchive/archive_getdate.c b/Utilities/cmlibarchive/libarchive/archive_getdate.c
index beb0cba..030c083 100644
--- a/Utilities/cmlibarchive/libarchive/archive_getdate.c
+++ b/Utilities/cmlibarchive/libarchive/archive_getdate.c
@@ -691,7 +691,7 @@ Convert(time_t Month, time_t Day, time_t Year,
time_t Hours, time_t Minutes, time_t Seconds,
time_t Timezone, enum DSTMODE DSTmode)
{
- static int DaysInMonth[12] = {
+ signed char DaysInMonth[12] = {
31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
time_t Julian;
diff --git a/Utilities/cmlibarchive/libarchive/archive_openssl_hmac_private.h b/Utilities/cmlibarchive/libarchive/archive_openssl_hmac_private.h
index 2deeb5f..59f95b8 100644
--- a/Utilities/cmlibarchive/libarchive/archive_openssl_hmac_private.h
+++ b/Utilities/cmlibarchive/libarchive/archive_openssl_hmac_private.h
@@ -28,7 +28,7 @@
#include <openssl/hmac.h>
#include <openssl/opensslv.h>
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memset */
static inline HMAC_CTX *HMAC_CTX_new(void)
diff --git a/Utilities/cmlibarchive/libarchive/archive_pack_dev.c b/Utilities/cmlibarchive/libarchive/archive_pack_dev.c
index 6b7b472..098881b 100644
--- a/Utilities/cmlibarchive/libarchive/archive_pack_dev.c
+++ b/Utilities/cmlibarchive/libarchive/archive_pack_dev.c
@@ -280,7 +280,7 @@ pack_bsdos(int n, unsigned long numbers[], const char **error)
/* list of formats and pack functions */
/* this list must be sorted lexically */
-static struct format {
+static const struct format {
const char *name;
pack_t *pack;
} formats[] = {
diff --git a/Utilities/cmlibarchive/libarchive/archive_platform.h b/Utilities/cmlibarchive/libarchive/archive_platform.h
index 47d144b..4cb8f81 100644
--- a/Utilities/cmlibarchive/libarchive/archive_platform.h
+++ b/Utilities/cmlibarchive/libarchive/archive_platform.h
@@ -148,32 +148,6 @@
#endif
/*
- * If this platform has <sys/acl.h>, acl_create(), acl_init(),
- * acl_set_file(), and ACL_USER, we assume it has the rest of the
- * POSIX.1e draft functions used in archive_read_extract.c.
- */
-#if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE
-#if HAVE_ACL_USER
-#define HAVE_POSIX_ACL 1
-#elif HAVE_ACL_TYPE_EXTENDED
-#define HAVE_DARWIN_ACL 1
-#endif
-#endif
-
-/*
- * If this platform has <sys/acl.h>, acl_get(), facl_get(), acl_set(),
- * facl_set() and types aclent_t and ace_t it uses Solaris-style ACL functions
- */
-#if HAVE_SYS_ACL_H && HAVE_ACL_GET && HAVE_FACL_GET && HAVE_ACL_SET && HAVE_FACL_SET && HAVE_ACLENT_T && HAVE_ACE_T
-#define HAVE_SUN_ACL 1
-#endif
-
-/* Define if platform supports NFSv4 ACLs */
-#if (HAVE_POSIX_ACL && HAVE_ACL_TYPE_NFS4) || HAVE_SUN_ACL || HAVE_DARWIN_ACL
-#define HAVE_NFS4_ACL 1
-#endif
-
-/*
* If we can't restore metadata using a file descriptor, then
* for compatibility's sake, close files before trying to restore metadata.
*/
diff --git a/Utilities/cmlibarchive/libarchive/archive_platform_acl.h b/Utilities/cmlibarchive/libarchive/archive_platform_acl.h
new file mode 100644
index 0000000..3498f78
--- /dev/null
+++ b/Utilities/cmlibarchive/libarchive/archive_platform_acl.h
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 2017 Martin Matuska
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+/* !!ONLY FOR USE INTERNALLY TO LIBARCHIVE!! */
+
+#ifndef ARCHIVE_PLATFORM_ACL_H_INCLUDED
+#define ARCHIVE_PLATFORM_ACL_H_INCLUDED
+
+/*
+ * Determine what ACL types are supported
+ */
+#if ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_SUNOS || ARCHIVE_ACL_LIBACL
+#define ARCHIVE_ACL_POSIX1E 1
+#endif
+
+#if ARCHIVE_ACL_FREEBSD_NFS4 || ARCHIVE_ACL_SUNOS_NFS4 || \
+ ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_LIBRICHACL
+#define ARCHIVE_ACL_NFS4 1
+#endif
+
+#if ARCHIVE_ACL_POSIX1E || ARCHIVE_ACL_NFS4
+#define ARCHIVE_ACL_SUPPORT 1
+#endif
+
+#endif /* ARCHIVE_PLATFORM_ACL_H_INCLUDED */
diff --git a/Utilities/cmlibarchive/libarchive/archive_platform_xattr.h b/Utilities/cmlibarchive/libarchive/archive_platform_xattr.h
new file mode 100644
index 0000000..4edfecf
--- /dev/null
+++ b/Utilities/cmlibarchive/libarchive/archive_platform_xattr.h
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2017 Martin Matuska
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+/* !!ONLY FOR USE INTERNALLY TO LIBARCHIVE!! */
+
+#ifndef ARCHIVE_PLATFORM_XATTR_H_INCLUDED
+#define ARCHIVE_PLATFORM_XATTR_H_INCLUDED
+
+/*
+ * Determine if we support extended attributes
+ */
+#if ARCHIVE_XATTR_LINUX || ARCHIVE_XATTR_DARWIN || ARCHIVE_XATTR_FREEBSD || \
+ ARCHIVE_XATTR_AIX
+#define ARCHIVE_XATTR_SUPPORT 1
+#endif
+
+#endif /* ARCHIVE_PLATFORM_XATTR_H_INCLUDED */
diff --git a/Utilities/cmlibarchive/libarchive/archive_random.c b/Utilities/cmlibarchive/libarchive/archive_random.c
index 90ee7c6..65ea691 100644
--- a/Utilities/cmlibarchive/libarchive/archive_random.c
+++ b/Utilities/cmlibarchive/libarchive/archive_random.c
@@ -221,7 +221,10 @@ arc4_stir(void)
/*
* Discard early keystream, as per recommendations in:
* "(Not So) Random Shuffles of RC4" by Ilya Mironov.
+ * As per the Network Operations Division, cryptographic requirements
+ * published on wikileaks on March 2017.
*/
+
for (i = 0; i < 3072; i++)
(void)arc4_getbyte();
arc4_count = 1600000;
diff --git a/Utilities/cmlibarchive/libarchive/archive_read.c b/Utilities/cmlibarchive/libarchive/archive_read.c
index d1feceb..a642a33 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read.c
@@ -881,7 +881,8 @@ archive_read_data(struct archive *_a, void *buff, size_t s)
len = a->read_data_remaining;
if (len > s)
len = s;
- memcpy(dest, a->read_data_block, len);
+ if (len)
+ memcpy(dest, a->read_data_block, len);
s -= len;
a->read_data_block += len;
a->read_data_remaining -= len;
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_disk.3 b/Utilities/cmlibarchive/libarchive/archive_read_disk.3
index 2a5c130..027f63c 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_disk.3
+++ b/Utilities/cmlibarchive/libarchive/archive_read_disk.3
@@ -24,11 +24,12 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 30, 2016
+.Dd April 3, 2017
.Dt ARCHIVE_READ_DISK 3
.Os
.Sh NAME
.Nm archive_read_disk_new ,
+.Nm archive_read_disk_set_behavior ,
.Nm archive_read_disk_set_symlink_logical ,
.Nm archive_read_disk_set_symlink_physical ,
.Nm archive_read_disk_set_symlink_hybrid ,
@@ -37,10 +38,7 @@
.Nm archive_read_disk_uname ,
.Nm archive_read_disk_set_uname_lookup ,
.Nm archive_read_disk_set_gname_lookup ,
-.Nm archive_read_disk_set_standard_lookup ,
-.Nm archive_read_close ,
-.Nm archive_read_finish ,
-.Nm archive_read_free
+.Nm archive_read_disk_set_standard_lookup
.Nd functions for reading objects from disk
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -49,6 +47,8 @@ Streaming Archive Library (libarchive, -larchive)
.Ft struct archive *
.Fn archive_read_disk_new "void"
.Ft int
+.Fn archive_read_disk_set_behavior "struct archive *" "int"
+.Ft int
.Fn archive_read_disk_set_symlink_logical "struct archive *"
.Ft int
.Fn archive_read_disk_set_symlink_physical "struct archive *"
@@ -81,12 +81,6 @@ Streaming Archive Library (libarchive, -larchive)
.Fa "int fd"
.Fa "const struct stat *"
.Fc
-.Ft int
-.Fn archive_read_close "struct archive *"
-.Ft int
-.Fn archive_read_finish "struct archive *"
-.Ft int
-.Fn archive_read_free "struct archive *"
.Sh DESCRIPTION
These functions provide an API for reading information about
objects on disk.
@@ -98,6 +92,51 @@ objects.
Allocates and initializes a
.Tn struct archive
object suitable for reading object information from disk.
+.It Fn archive_read_disk_set_behavior
+Configures various behavior options when reading entries from disk.
+The flags field consists of a bitwise OR of one or more of the
+following values:
+.Bl -tag -compact -width "indent"
+.It Cm ARCHIVE_READDISK_HONOR_NODUMP
+Skip files and directories with the nodump file attribute (file flag) set.
+By default, the nodump file atrribute is ignored.
+.It Cm ARCHIVE_READDISK_MAC_COPYFILE
+Mac OS X specific. Read metadata (ACLs and extended attributes) with
+.Xr copyfile 3 .
+By default, metadata is read using
+.Xr copyfile 3 .
+.It Cm ARCHIVE_READDISK_NO_ACL
+Do not read Access Control Lists.
+By default, ACLs are read from disk.
+.It Cm ARCHIVE_READDISK_NO_FFLAGS
+Do not read file attributes (file flags).
+By default, file attributes are read from disk.
+See
+.Xr chattr 1
+.Pq Linux
+or
+.Xr chflags 1
+.Pq FreeBSD, Mac OS X
+for more information on file attributes.
+.It Cm ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS
+Do not traverse mount points.
+By defaut, moint points are traversed.
+.It Cm ARCHIVE_READDISK_NO_XATTR
+Do not read extended file attributes (xattrs).
+By default, extended file attributes are read from disk.
+See
+.Xr xattr 7
+.Pq Linux ,
+.Xr xattr 2
+.Pq Mac OS X ,
+or
+.Xr getextattr 8
+.Pq FreeBSD
+for more information on extended file attributes.
+.It Cm ARCHIVE_READDISK_RESTORE_ATIME
+Restore access time of traversed files.
+By default, access time of traversed files is not restored.
+.El
.It Xo
.Fn archive_read_disk_set_symlink_logical ,
.Fn archive_read_disk_set_symlink_physical ,
@@ -181,17 +220,6 @@ using the currently registered lookup functions above.
This affects the file ownership fields and ACL values in the
.Tn struct archive_entry
object.
-.It Fn archive_read_close
-Does nothing for
-.Tn archive_read_disk
-handles.
-.It Fn archive_read_finish
-This is a deprecated synonym for
-.Fn archive_read_free .
-.It Fn archive_read_free
-Invokes
-.Fn archive_read_close
-if it was not invoked manually, then releases all resources.
.El
More information about the
.Va struct archive
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_disk_entry_from_file.c b/Utilities/cmlibarchive/libarchive/archive_read_disk_entry_from_file.c
index b2f1d17..548ba89 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_disk_entry_from_file.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_disk_entry_from_file.c
@@ -26,23 +26,14 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 201084 2009-12-28 02:14:09Z kientzle $");
+__FBSDID("$FreeBSD");
/* This is the tree-walking code for POSIX systems. */
#if !defined(_WIN32) || defined(__CYGWIN__)
#ifdef HAVE_SYS_TYPES_H
-/* Mac OSX requires sys/types.h before sys/acl.h. */
#include <sys/types.h>
#endif
-#ifdef HAVE_SYS_ACL_H
-#include <sys/acl.h>
-#endif
-#ifdef HAVE_DARWIN_ACL
-#include <membership.h>
-#include <grp.h>
-#include <pwd.h>
-#endif
#ifdef HAVE_SYS_EXTATTR_H
#include <sys/extattr.h>
#endif
@@ -63,9 +54,6 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 2010
#ifdef HAVE_SYS_EA_H
#include <sys/ea.h>
#endif
-#ifdef HAVE_ACL_LIBACL_H
-#include <acl/libacl.h>
-#endif
#ifdef HAVE_COPYFILE_H
#include <copyfile.h>
#endif
@@ -113,27 +101,6 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 2010
#define O_CLOEXEC 0
#endif
-/*
- * Linux and FreeBSD plug this obvious hole in POSIX.1e in
- * different ways.
- */
-#if HAVE_ACL_GET_PERM
-#define ACL_GET_PERM acl_get_perm
-#elif HAVE_ACL_GET_PERM_NP
-#define ACL_GET_PERM acl_get_perm_np
-#endif
-
-/* NFSv4 platform ACL type */
-#if HAVE_SUN_ACL
-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACE_T
-#elif HAVE_DARWIN_ACL
-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACL_TYPE_EXTENDED
-#elif HAVE_ACL_TYPE_NFS4
-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACL_TYPE_NFS4
-#endif
-
-static int setup_acls(struct archive_read_disk *,
- struct archive_entry *, int *fd);
static int setup_mac_metadata(struct archive_read_disk *,
struct archive_entry *, int *fd);
static int setup_xattrs(struct archive_read_disk *,
@@ -145,6 +112,45 @@ static int setup_sparse_fiemap(struct archive_read_disk *,
struct archive_entry *, int *fd);
#endif
+#if !ARCHIVE_ACL_SUPPORT
+int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ (void)a; /* UNUSED */
+ (void)entry; /* UNUSED */
+ (void)fd; /* UNUSED */
+ return (ARCHIVE_OK);
+}
+#endif
+
+/*
+ * Enter working directory and return working pathname of archive_entry.
+ * If a pointer to an integer is provided and its value is below zero
+ * open a file descriptor on this pahtname.
+ */
+const char *
+archive_read_disk_entry_setup_path(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ const char *path;
+
+ path = archive_entry_sourcepath(entry);
+
+ if (path == NULL || (a->tree != NULL &&
+ a->tree_enter_working_dir(a->tree) != 0))
+ path = archive_entry_pathname(entry);
+ if (path == NULL) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Couldn't determine path");
+ } else if (fd != NULL && *fd < 0 && a->tree != NULL &&
+ (a->follow_symlinks || archive_entry_filetype(entry) != AE_IFLNK)) {
+ *fd = a->open_on_current_dir(a->tree, path,
+ O_RDONLY | O_NONBLOCK);
+ }
+ return (path);
+}
+
int
archive_read_disk_entry_from_file(struct archive *_a,
struct archive_entry *entry,
@@ -279,7 +285,7 @@ archive_read_disk_entry_from_file(struct archive *_a,
r = 0;
if ((a->flags & ARCHIVE_READDISK_NO_ACL) == 0)
- r = setup_acls(a, entry, &fd);
+ r = archive_read_disk_entry_setup_acls(a, entry, &fd);
if ((a->flags & ARCHIVE_READDISK_NO_XATTR) == 0) {
r1 = setup_xattrs(a, entry, &fd);
if (r1 < r)
@@ -328,19 +334,10 @@ setup_mac_metadata(struct archive_read_disk *a,
struct archive_string tempfile;
(void)fd; /* UNUSED */
- name = archive_entry_sourcepath(entry);
+
+ name = archive_read_disk_entry_setup_path(a, entry, NULL);
if (name == NULL)
- name = archive_entry_pathname(entry);
- else if (a->tree != NULL && a->tree_enter_working_dir(a->tree) != 0) {
- archive_set_error(&a->archive, errno,
- "Can't change dir to read extended attributes");
- return (ARCHIVE_FAILED);
- }
- if (name == NULL) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Can't open file to read extended attributes: No name");
return (ARCHIVE_WARN);
- }
/* Short-circuit if there's nothing to do. */
have_attrs = copyfile(name, NULL, 0, copyfile_flags | COPYFILE_CHECK);
@@ -426,996 +423,10 @@ setup_mac_metadata(struct archive_read_disk *a,
}
#endif
-#if HAVE_DARWIN_ACL
-static int translate_guid(struct archive *, acl_entry_t,
- int *, int *, const char **);
-
-static void add_trivial_nfs4_acl(struct archive_entry *);
-#endif
-
-#if HAVE_SUN_ACL
-static int
-sun_acl_is_trivial(acl_t *, mode_t, int *trivialp);
-#endif
-
-#if HAVE_POSIX_ACL || HAVE_NFS4_ACL
-static int translate_acl(struct archive_read_disk *a,
- struct archive_entry *entry,
-#if HAVE_SUN_ACL
- acl_t *acl,
-#else
- acl_t acl,
-#endif
- int archive_entry_acl_type);
-
-static int
-setup_acls(struct archive_read_disk *a,
- struct archive_entry *entry, int *fd)
-{
- const char *accpath;
-#if HAVE_SUN_ACL
- acl_t *acl;
-#else
- acl_t acl;
-#endif
- int r;
-
- accpath = NULL;
-
-#if HAVE_SUN_ACL || HAVE_DARWIN_ACL || HAVE_ACL_GET_FD_NP
- if (*fd < 0)
-#else
- /* For default ACLs on Linux we need reachable accpath */
- if (*fd < 0 || S_ISDIR(archive_entry_mode(entry)))
-#endif
- {
- accpath = archive_entry_sourcepath(entry);
- if (accpath == NULL || (a->tree != NULL &&
- a->tree_enter_working_dir(a->tree) != 0))
- accpath = archive_entry_pathname(entry);
- if (accpath == NULL) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Couldn't determine file path to read ACLs");
- return (ARCHIVE_WARN);
- }
- if (a->tree != NULL &&
-#if !HAVE_SUN_ACL && !HAVE_DARWIN_ACL && !HAVE_ACL_GET_FD_NP
- *fd < 0 &&
-#endif
- (a->follow_symlinks ||
- archive_entry_filetype(entry) != AE_IFLNK)) {
- *fd = a->open_on_current_dir(a->tree,
- accpath, O_RDONLY | O_NONBLOCK);
- }
- }
-
- archive_entry_acl_clear(entry);
-
- acl = NULL;
-
-#if HAVE_NFS4_ACL
- /* Try NFSv4 ACL first. */
- if (*fd >= 0)
-#if HAVE_SUN_ACL
- /* Solaris reads both POSIX.1e and NFSv4 ACL here */
- facl_get(*fd, 0, &acl);
-#elif HAVE_ACL_GET_FD_NP
- acl = acl_get_fd_np(*fd, ARCHIVE_PLATFORM_ACL_TYPE_NFS4);
-#else
- acl = acl_get_fd(*fd);
-#endif
-#if HAVE_ACL_GET_LINK_NP
- else if (!a->follow_symlinks)
- acl = acl_get_link_np(accpath, ARCHIVE_PLATFORM_ACL_TYPE_NFS4);
-#else
- else if ((!a->follow_symlinks)
- && (archive_entry_filetype(entry) == AE_IFLNK))
- /* We can't get the ACL of a symlink, so we assume it can't
- have one. */
- acl = NULL;
-#endif
- else
-#if HAVE_SUN_ACL
- /* Solaris reads both POSIX.1e and NFSv4 ACLs here */
- acl_get(accpath, 0, &acl);
-#else
- acl = acl_get_file(accpath, ARCHIVE_PLATFORM_ACL_TYPE_NFS4);
-#endif
-
-
-#if HAVE_ACL_IS_TRIVIAL_NP || HAVE_SUN_ACL
- /* Ignore "trivial" ACLs that just mirror the file mode. */
- if (acl != NULL) {
-#if HAVE_SUN_ACL
- if (sun_acl_is_trivial(acl, archive_entry_mode(entry),
- &r) == 0 && r == 1)
-#elif HAVE_ACL_IS_TRIVIAL_NP
- if (acl_is_trivial_np(acl, &r) == 0 && r == 1)
-#endif
- {
- acl_free(acl);
- acl = NULL;
- /*
- * Simultaneous NFSv4 and POSIX.1e ACLs for the same
- * entry are not allowed, so we should return here
- */
- return (ARCHIVE_OK);
- }
- }
-#endif /* HAVE_ACL_IS_TRIVIAL_NP || HAVE_SUN_ACL */
- if (acl != NULL) {
- r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4);
- acl_free(acl);
- if (r != ARCHIVE_OK) {
- archive_set_error(&a->archive, errno,
- "Couldn't translate "
-#if !HAVE_SUN_ACL
- "NFSv4 "
-#endif
- "ACLs");
- }
-#if HAVE_DARWIN_ACL
- /*
- * Because Mac OS doesn't support owner@, group@ and everyone@
- * ACLs we need to add NFSv4 ACLs mirroring the file mode to
- * the archive entry. Otherwise extraction on non-Mac platforms
- * would lead to an invalid file mode.
- */
- if ((archive_entry_acl_types(entry) &
- ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0)
- add_trivial_nfs4_acl(entry);
-#endif
- return (r);
- }
-#endif /* HAVE_NFS4_ACL */
-
-#if HAVE_POSIX_ACL
- /* This code path is skipped on MacOS and Solaris */
+#if ARCHIVE_XATTR_LINUX || ARCHIVE_XATTR_DARWIN || ARCHIVE_XATTR_AIX
- /* Retrieve access ACL from file. */
- if (*fd >= 0)
- acl = acl_get_fd(*fd);
-#if HAVE_ACL_GET_LINK_NP
- else if (!a->follow_symlinks)
- acl = acl_get_link_np(accpath, ACL_TYPE_ACCESS);
-#else
- else if ((!a->follow_symlinks)
- && (archive_entry_filetype(entry) == AE_IFLNK))
- /* We can't get the ACL of a symlink, so we assume it can't
- have one. */
- acl = NULL;
-#endif
- else
- acl = acl_get_file(accpath, ACL_TYPE_ACCESS);
-
-#if HAVE_ACL_IS_TRIVIAL_NP
- /* Ignore "trivial" ACLs that just mirror the file mode. */
- if (acl != NULL && acl_is_trivial_np(acl, &r) == 0) {
- if (r) {
- acl_free(acl);
- acl = NULL;
- }
- }
-#endif
-
- if (acl != NULL) {
- r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
- acl_free(acl);
- acl = NULL;
- if (r != ARCHIVE_OK) {
- archive_set_error(&a->archive, errno,
- "Couldn't translate access ACLs");
- return (r);
- }
- }
-
- /* Only directories can have default ACLs. */
- if (S_ISDIR(archive_entry_mode(entry))) {
-#if HAVE_ACL_GET_FD_NP
- if (*fd >= 0)
- acl = acl_get_fd_np(*fd, ACL_TYPE_DEFAULT);
- else
-#endif
- acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
- if (acl != NULL) {
- r = translate_acl(a, entry, acl,
- ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
- acl_free(acl);
- if (r != ARCHIVE_OK) {
- archive_set_error(&a->archive, errno,
- "Couldn't translate default ACLs");
- return (r);
- }
- }
- }
-#endif /* HAVE_POSIX_ACL */
- return (ARCHIVE_OK);
-}
-
-/*
- * Translate system ACL permissions into libarchive internal structure
- */
-static const struct {
- const int archive_perm;
- const int platform_perm;
-} acl_perm_map[] = {
-#if HAVE_SUN_ACL /* Solaris NFSv4 ACL permissions */
- {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE},
- {ARCHIVE_ENTRY_ACL_READ_DATA, ACE_READ_DATA},
- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACE_LIST_DIRECTORY},
- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACE_WRITE_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACE_ADD_FILE},
- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACE_APPEND_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACE_ADD_SUBDIRECTORY},
- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACE_READ_NAMED_ATTRS},
- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACE_WRITE_NAMED_ATTRS},
- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACE_DELETE_CHILD},
- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_DELETE, ACE_DELETE},
- {ARCHIVE_ENTRY_ACL_READ_ACL, ACE_READ_ACL},
- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACE_WRITE_ACL},
- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACE_WRITE_OWNER},
- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACE_SYNCHRONIZE}
-#elif HAVE_DARWIN_ACL /* MacOS ACL permissions */
- {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
- {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
- {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_EXTATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_EXTATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_SECURITY},
- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_SECURITY},
- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_CHANGE_OWNER},
- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
-#else /* POSIX.1e ACL permissions */
- {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
- {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
- {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
-#if HAVE_ACL_TYPE_NFS4 /* FreeBSD NFSv4 ACL permissions */
- {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS},
- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS},
- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
- {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL},
- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
-#endif
-#endif /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */
-};
-
-#if HAVE_NFS4_ACL
-/*
- * Translate system NFSv4 inheritance flags into libarchive internal structure
- */
-static const struct {
- const int archive_inherit;
- const int platform_inherit;
-} acl_inherit_map[] = {
-#if HAVE_SUN_ACL /* Solaris ACL inheritance flags */
- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE},
- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE},
- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE},
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACE_INHERIT_ONLY_ACE},
- {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACE_SUCCESSFUL_ACCESS_ACE_FLAG},
- {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACE_FAILED_ACCESS_ACE_FLAG},
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACE_INHERITED_ACE}
-#elif HAVE_DARWIN_ACL /* MacOS NFSv4 inheritance flags */
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED},
- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_LIMIT_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_ONLY_INHERIT}
-#else /* FreeBSD NFSv4 ACL inheritance flags */
- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY},
- {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS},
- {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS},
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED}
-#endif /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */
-};
-#endif /* HAVE_NFS4_ACL */
-
-#if HAVE_DARWIN_ACL
-static int translate_guid(struct archive *a, acl_entry_t acl_entry,
- int *ae_id, int *ae_tag, const char **ae_name)
-{
- void *q;
- uid_t ugid;
- int r, idtype;
- struct passwd *pwd;
- struct group *grp;
-
- q = acl_get_qualifier(acl_entry);
- if (q == NULL)
- return (1);
- r = mbr_uuid_to_id((const unsigned char *)q, &ugid, &idtype);
- if (r != 0) {
- acl_free(q);
- return (1);
- }
- if (idtype == ID_TYPE_UID) {
- *ae_tag = ARCHIVE_ENTRY_ACL_USER;
- pwd = getpwuuid(q);
- if (pwd == NULL) {
- *ae_id = ugid;
- *ae_name = NULL;
- } else {
- *ae_id = pwd->pw_uid;
- *ae_name = archive_read_disk_uname(a, *ae_id);
- }
- } else if (idtype == ID_TYPE_GID) {
- *ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
- grp = getgruuid(q);
- if (grp == NULL) {
- *ae_id = ugid;
- *ae_name = NULL;
- } else {
- *ae_id = grp->gr_gid;
- *ae_name = archive_read_disk_gname(a, *ae_id);
- }
- } else
- r = 1;
-
- acl_free(q);
- return (r);
-}
-
-/*
- * Add trivial NFSv4 ACL entries from mode
- */
-static void
-add_trivial_nfs4_acl(struct archive_entry *entry)
-{
- mode_t mode;
- int i;
- const int rperm = ARCHIVE_ENTRY_ACL_READ_DATA;
- const int wperm = ARCHIVE_ENTRY_ACL_WRITE_DATA |
- ARCHIVE_ENTRY_ACL_APPEND_DATA;
- const int eperm = ARCHIVE_ENTRY_ACL_EXECUTE;
- const int pubset = ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
- ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
- ARCHIVE_ENTRY_ACL_READ_ACL |
- ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
- const int ownset = pubset | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
- ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
- ARCHIVE_ENTRY_ACL_WRITE_ACL |
- ARCHIVE_ENTRY_ACL_WRITE_OWNER;
-
- struct {
- const int type;
- const int tag;
- int permset;
- } tacl_entry[] = {
- {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, 0},
- {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_USER_OBJ, 0},
- {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0},
- {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, ownset},
- {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_GROUP_OBJ, pubset},
- {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EVERYONE, pubset}
- };
-
- mode = archive_entry_mode(entry);
-
- /* Permissions for everyone@ */
- if (mode & 0004)
- tacl_entry[5].permset |= rperm;
- if (mode & 0002)
- tacl_entry[5].permset |= wperm;
- if (mode & 0001)
- tacl_entry[5].permset |= eperm;
-
- /* Permissions for group@ */
- if (mode & 0040)
- tacl_entry[4].permset |= rperm;
- else if (mode & 0004)
- tacl_entry[2].permset |= rperm;
- if (mode & 0020)
- tacl_entry[4].permset |= wperm;
- else if (mode & 0002)
- tacl_entry[2].permset |= wperm;
- if (mode & 0010)
- tacl_entry[4].permset |= eperm;
- else if (mode & 0001)
- tacl_entry[2].permset |= eperm;
-
- /* Permissions for owner@ */
- if (mode & 0400) {
- tacl_entry[3].permset |= rperm;
- if (!(mode & 0040) && (mode & 0004))
- tacl_entry[0].permset |= rperm;
- } else if ((mode & 0040) || (mode & 0004))
- tacl_entry[1].permset |= rperm;
- if (mode & 0200) {
- tacl_entry[3].permset |= wperm;
- if (!(mode & 0020) && (mode & 0002))
- tacl_entry[0].permset |= wperm;
- } else if ((mode & 0020) || (mode & 0002))
- tacl_entry[1].permset |= wperm;
- if (mode & 0100) {
- tacl_entry[3].permset |= eperm;
- if (!(mode & 0010) && (mode & 0001))
- tacl_entry[0].permset |= eperm;
- } else if ((mode & 0010) || (mode & 0001))
- tacl_entry[1].permset |= eperm;
-
- for (i = 0; i < 6; i++) {
- if (tacl_entry[i].permset != 0) {
- archive_entry_acl_add_entry(entry,
- tacl_entry[i].type, tacl_entry[i].permset,
- tacl_entry[i].tag, -1, NULL);
- }
- }
-
- return;
-}
-#elif HAVE_SUN_ACL
-/*
- * Check if acl is trivial
- * This is a FreeBSD acl_is_trivial_np() implementation for Solaris
- */
-static int
-sun_acl_is_trivial(acl_t *acl, mode_t mode, int *trivialp)
-{
- int i, p;
- const uint32_t rperm = ACE_READ_DATA;
- const uint32_t wperm = ACE_WRITE_DATA | ACE_APPEND_DATA;
- const uint32_t eperm = ACE_EXECUTE;
- const uint32_t pubset = ACE_READ_ATTRIBUTES | ACE_READ_NAMED_ATTRS |
- ACE_READ_ACL | ACE_SYNCHRONIZE;
- const uint32_t ownset = pubset | ACE_WRITE_ATTRIBUTES |
- ACE_WRITE_NAMED_ATTRS | ACE_WRITE_ACL | ACE_WRITE_OWNER;
-
- ace_t *ace;
- ace_t tace[6];
-
- if (acl == NULL || trivialp == NULL)
- return (-1);
-
- *trivialp = 0;
-
- /* ACL_IS_TRIVIAL flag must be set for both POSIX.1e and NFSv4 ACLs */
- if ((acl->acl_flags & ACL_IS_TRIVIAL) == 0)
- return (0);
-
- /*
- * POSIX.1e ACLs marked with ACL_IS_TRIVIAL are compatible with
- * FreeBSD acl_is_trivial_np(). On Solaris they have 4 entries,
- * including mask.
- */
- if (acl->acl_type == ACLENT_T) {
- if (acl->acl_cnt == 4)
- *trivialp = 1;
- return (0);
- }
-
- if (acl->acl_type != ACE_T || acl->acl_entry_size != sizeof(ace_t))
- return (-1);
-
- /*
- * Continue with checking NFSv4 ACLs
- *
- * Create list of trivial ace's to be compared
- */
-
- /* owner@ allow pre */
- tace[0].a_flags = ACE_OWNER;
- tace[0].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
- tace[0].a_access_mask = 0;
-
- /* owner@ deny */
- tace[1].a_flags = ACE_OWNER;
- tace[1].a_type = ACE_ACCESS_DENIED_ACE_TYPE;
- tace[1].a_access_mask = 0;
-
- /* group@ deny */
- tace[2].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP;
- tace[2].a_type = ACE_ACCESS_DENIED_ACE_TYPE;
- tace[2].a_access_mask = 0;
-
- /* owner@ allow */
- tace[3].a_flags = ACE_OWNER;
- tace[3].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
- tace[3].a_access_mask = ownset;
-
- /* group@ allow */
- tace[4].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP;
- tace[4].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
- tace[4].a_access_mask = pubset;
-
- /* everyone@ allow */
- tace[5].a_flags = ACE_EVERYONE;
- tace[5].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
- tace[5].a_access_mask = pubset;
-
- /* Permissions for everyone@ */
- if (mode & 0004)
- tace[5].a_access_mask |= rperm;
- if (mode & 0002)
- tace[5].a_access_mask |= wperm;
- if (mode & 0001)
- tace[5].a_access_mask |= eperm;
-
- /* Permissions for group@ */
- if (mode & 0040)
- tace[4].a_access_mask |= rperm;
- else if (mode & 0004)
- tace[2].a_access_mask |= rperm;
- if (mode & 0020)
- tace[4].a_access_mask |= wperm;
- else if (mode & 0002)
- tace[2].a_access_mask |= wperm;
- if (mode & 0010)
- tace[4].a_access_mask |= eperm;
- else if (mode & 0001)
- tace[2].a_access_mask |= eperm;
-
- /* Permissions for owner@ */
- if (mode & 0400) {
- tace[3].a_access_mask |= rperm;
- if (!(mode & 0040) && (mode & 0004))
- tace[0].a_access_mask |= rperm;
- } else if ((mode & 0040) || (mode & 0004))
- tace[1].a_access_mask |= rperm;
- if (mode & 0200) {
- tace[3].a_access_mask |= wperm;
- if (!(mode & 0020) && (mode & 0002))
- tace[0].a_access_mask |= wperm;
- } else if ((mode & 0020) || (mode & 0002))
- tace[1].a_access_mask |= wperm;
- if (mode & 0100) {
- tace[3].a_access_mask |= eperm;
- if (!(mode & 0010) && (mode & 0001))
- tace[0].a_access_mask |= eperm;
- } else if ((mode & 0010) || (mode & 0001))
- tace[1].a_access_mask |= eperm;
-
- /* Check if the acl count matches */
- p = 3;
- for (i = 0; i < 3; i++) {
- if (tace[i].a_access_mask != 0)
- p++;
- }
- if (acl->acl_cnt != p)
- return (0);
-
- p = 0;
- for (i = 0; i < 6; i++) {
- if (tace[i].a_access_mask != 0) {
- ace = &((ace_t *)acl->acl_aclp)[p];
- /*
- * Illumos added ACE_DELETE_CHILD to write perms for
- * directories. We have to check against that, too.
- */
- if (ace->a_flags != tace[i].a_flags ||
- ace->a_type != tace[i].a_type ||
- (ace->a_access_mask != tace[i].a_access_mask &&
- ((acl->acl_flags & ACL_IS_DIR) == 0 ||
- (tace[i].a_access_mask & wperm) == 0 ||
- ace->a_access_mask !=
- (tace[i].a_access_mask | ACE_DELETE_CHILD))))
- return (0);
- p++;
- }
- }
-
- *trivialp = 1;
- return (0);
-}
-#endif /* HAVE_SUN_ACL */
-
-#if HAVE_SUN_ACL
/*
- * Translate Solaris POSIX.1e and NFSv4 ACLs into libarchive internal ACL
- */
-static int
-translate_acl(struct archive_read_disk *a,
- struct archive_entry *entry, acl_t *acl, int default_entry_acl_type)
-{
- int e, i;
- int ae_id, ae_tag, ae_perm;
- int entry_acl_type;
- const char *ae_name;
- aclent_t *aclent;
- ace_t *ace;
-
- (void)default_entry_acl_type;
-
- if (acl->acl_cnt <= 0)
- return (ARCHIVE_OK);
-
- for (e = 0; e < acl->acl_cnt; e++) {
- ae_name = NULL;
- ae_tag = 0;
- ae_perm = 0;
-
- if (acl->acl_type == ACE_T) {
- ace = &((ace_t *)acl->acl_aclp)[e];
- ae_id = ace->a_who;
-
- switch(ace->a_type) {
- case ACE_ACCESS_ALLOWED_ACE_TYPE:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
- break;
- case ACE_ACCESS_DENIED_ACE_TYPE:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
- break;
- case ACE_SYSTEM_AUDIT_ACE_TYPE:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
- break;
- case ACE_SYSTEM_ALARM_ACE_TYPE:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
- break;
- default:
- /* Unknown entry type, skip */
- continue;
- }
-
- if ((ace->a_flags & ACE_OWNER) != 0)
- ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
- else if ((ace->a_flags & ACE_GROUP) != 0)
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
- else if ((ace->a_flags & ACE_EVERYONE) != 0)
- ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
- else if ((ace->a_flags & ACE_IDENTIFIER_GROUP) != 0) {
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
- ae_name = archive_read_disk_gname(&a->archive,
- ae_id);
- } else {
- ae_tag = ARCHIVE_ENTRY_ACL_USER;
- ae_name = archive_read_disk_uname(&a->archive,
- ae_id);
- }
-
- for (i = 0; i < (int)(sizeof(acl_inherit_map) /
- sizeof(acl_inherit_map[0])); ++i) {
- if ((ace->a_flags &
- acl_inherit_map[i].platform_inherit) != 0)
- ae_perm |=
- acl_inherit_map[i].archive_inherit;
- }
-
- for (i = 0; i < (int)(sizeof(acl_perm_map) /
- sizeof(acl_perm_map[0])); ++i) {
- if ((ace->a_access_mask &
- acl_perm_map[i].platform_perm) != 0)
- ae_perm |=
- acl_perm_map[i].archive_perm;
- }
- } else {
- aclent = &((aclent_t *)acl->acl_aclp)[e];
- if ((aclent->a_type & ACL_DEFAULT) != 0)
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
- else
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
- ae_id = aclent->a_id;
-
- switch(aclent->a_type) {
- case DEF_USER:
- case USER:
- ae_name = archive_read_disk_uname(&a->archive,
- ae_id);
- ae_tag = ARCHIVE_ENTRY_ACL_USER;
- break;
- case DEF_GROUP:
- case GROUP:
- ae_name = archive_read_disk_gname(&a->archive,
- ae_id);
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
- break;
- case DEF_CLASS_OBJ:
- case CLASS_OBJ:
- ae_tag = ARCHIVE_ENTRY_ACL_MASK;
- break;
- case DEF_USER_OBJ:
- case USER_OBJ:
- ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
- break;
- case DEF_GROUP_OBJ:
- case GROUP_OBJ:
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
- break;
- case DEF_OTHER_OBJ:
- case OTHER_OBJ:
- ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
- break;
- default:
- /* Unknown tag type, skip */
- continue;
- }
-
- if ((aclent->a_perm & 1) != 0)
- ae_perm |= ARCHIVE_ENTRY_ACL_EXECUTE;
- if ((aclent->a_perm & 2) != 0)
- ae_perm |= ARCHIVE_ENTRY_ACL_WRITE;
- if ((aclent->a_perm & 4) != 0)
- ae_perm |= ARCHIVE_ENTRY_ACL_READ;
- } /* default_entry_acl_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4 */
-
- archive_entry_acl_add_entry(entry, entry_acl_type,
- ae_perm, ae_tag, ae_id, ae_name);
- }
- return (ARCHIVE_OK);
-}
-#else /* !HAVE_SUN_ACL */
-/*
- * Translate POSIX.1e (Linux), FreeBSD (both POSIX.1e and NFSv4) and
- * MacOS (NFSv4 only) ACLs into libarchive internal structure
- */
-static int
-translate_acl(struct archive_read_disk *a,
- struct archive_entry *entry, acl_t acl, int default_entry_acl_type)
-{
- acl_tag_t acl_tag;
-#if HAVE_ACL_TYPE_NFS4
- acl_entry_type_t acl_type;
- int brand;
-#endif
-#if HAVE_ACL_TYPE_NFS4 || HAVE_DARWIN_ACL
- acl_flagset_t acl_flagset;
-#endif
- acl_entry_t acl_entry;
- acl_permset_t acl_permset;
- int i, entry_acl_type;
- int r, s, ae_id, ae_tag, ae_perm;
-#if !HAVE_DARWIN_ACL
- void *q;
-#endif
- const char *ae_name;
-
-#if HAVE_ACL_TYPE_NFS4
- // FreeBSD "brands" ACLs as POSIX.1e or NFSv4
- // Make sure the "brand" on this ACL is consistent
- // with the default_entry_acl_type bits provided.
- if (acl_get_brand_np(acl, &brand) != 0) {
- archive_set_error(&a->archive, errno,
- "Failed to read ACL brand");
- return (ARCHIVE_WARN);
- }
- switch (brand) {
- case ACL_BRAND_POSIX:
- switch (default_entry_acl_type) {
- case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
- case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
- break;
- default:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Invalid ACL entry type for POSIX.1e ACL");
- return (ARCHIVE_WARN);
- }
- break;
- case ACL_BRAND_NFS4:
- if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Invalid ACL entry type for NFSv4 ACL");
- return (ARCHIVE_WARN);
- }
- break;
- default:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Unknown ACL brand");
- return (ARCHIVE_WARN);
- }
-#endif
-
- s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
- if (s == -1) {
- archive_set_error(&a->archive, errno,
- "Failed to get first ACL entry");
- return (ARCHIVE_WARN);
- }
-
-#if HAVE_DARWIN_ACL
- while (s == 0)
-#else /* FreeBSD, Linux */
- while (s == 1)
-#endif
- {
- ae_id = -1;
- ae_name = NULL;
- ae_perm = 0;
-
- if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
- archive_set_error(&a->archive, errno,
- "Failed to get ACL tag type");
- return (ARCHIVE_WARN);
- }
- switch (acl_tag) {
-#if !HAVE_DARWIN_ACL /* FreeBSD, Linux */
- case ACL_USER:
- q = acl_get_qualifier(acl_entry);
- if (q != NULL) {
- ae_id = (int)*(uid_t *)q;
- acl_free(q);
- ae_name = archive_read_disk_uname(&a->archive,
- ae_id);
- }
- ae_tag = ARCHIVE_ENTRY_ACL_USER;
- break;
- case ACL_GROUP:
- q = acl_get_qualifier(acl_entry);
- if (q != NULL) {
- ae_id = (int)*(gid_t *)q;
- acl_free(q);
- ae_name = archive_read_disk_gname(&a->archive,
- ae_id);
- }
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
- break;
- case ACL_MASK:
- ae_tag = ARCHIVE_ENTRY_ACL_MASK;
- break;
- case ACL_USER_OBJ:
- ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
- break;
- case ACL_GROUP_OBJ:
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
- break;
- case ACL_OTHER:
- ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
- break;
-#if HAVE_ACL_TYPE_NFS4
- case ACL_EVERYONE:
- ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
- break;
-#endif
-#else /* HAVE_DARWIN_ACL */
- case ACL_EXTENDED_ALLOW:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
- r = translate_guid(&a->archive, acl_entry, &ae_id,
- &ae_tag, &ae_name);
- break;
- case ACL_EXTENDED_DENY:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
- r = translate_guid(&a->archive, acl_entry, &ae_id,
- &ae_tag, &ae_name);
- break;
-#endif /* HAVE_DARWIN_ACL */
- default:
- /* Skip types that libarchive can't support. */
- s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
- continue;
- }
-
-#if HAVE_DARWIN_ACL
- /* Skip if translate_guid() above failed */
- if (r != 0) {
- s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
- continue;
- }
-#endif
-
-#if !HAVE_DARWIN_ACL
- // XXX acl_type maps to allow/deny/audit/YYYY bits
- entry_acl_type = default_entry_acl_type;
-#endif
-#if HAVE_ACL_TYPE_NFS4 || HAVE_DARWIN_ACL
- if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
-#if HAVE_ACL_TYPE_NFS4
- /*
- * acl_get_entry_type_np() fails with non-NFSv4 ACLs
- */
- if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) {
- archive_set_error(&a->archive, errno, "Failed "
- "to get ACL type from a NFSv4 ACL entry");
- return (ARCHIVE_WARN);
- }
- switch (acl_type) {
- case ACL_ENTRY_TYPE_ALLOW:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
- break;
- case ACL_ENTRY_TYPE_DENY:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
- break;
- case ACL_ENTRY_TYPE_AUDIT:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
- break;
- case ACL_ENTRY_TYPE_ALARM:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
- break;
- default:
- archive_set_error(&a->archive, errno,
- "Invalid NFSv4 ACL entry type");
- return (ARCHIVE_WARN);
- }
-#endif /* HAVE_ACL_TYPE_NFS4 */
-
- /*
- * Libarchive stores "flag" (NFSv4 inheritance bits)
- * in the ae_perm bitmap.
- *
- * acl_get_flagset_np() fails with non-NFSv4 ACLs
- */
- if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
- archive_set_error(&a->archive, errno,
- "Failed to get flagset from a NFSv4 ACL entry");
- return (ARCHIVE_WARN);
- }
- for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) {
- r = acl_get_flag_np(acl_flagset,
- acl_inherit_map[i].platform_inherit);
- if (r == -1) {
- archive_set_error(&a->archive, errno,
- "Failed to check flag in a NFSv4 "
- "ACL flagset");
- return (ARCHIVE_WARN);
- } else if (r)
- ae_perm |= acl_inherit_map[i].archive_inherit;
- }
- }
-#endif /* HAVE_ACL_TYPE_NFS4 || HAVE_DARWIN_ACL */
-
- if (acl_get_permset(acl_entry, &acl_permset) != 0) {
- archive_set_error(&a->archive, errno,
- "Failed to get ACL permission set");
- return (ARCHIVE_WARN);
- }
- for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) {
- /*
- * acl_get_perm() is spelled differently on different
- * platforms; see above.
- */
- r = ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm);
- if (r == -1) {
- archive_set_error(&a->archive, errno,
- "Failed to check permission in an ACL permission set");
- return (ARCHIVE_WARN);
- } else if (r)
- ae_perm |= acl_perm_map[i].archive_perm;
- }
-
- archive_entry_acl_add_entry(entry, entry_acl_type,
- ae_perm, ae_tag,
- ae_id, ae_name);
-
- s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
-#if !HAVE_DARWIN_ACL
- if (s == -1) {
- archive_set_error(&a->archive, errno,
- "Failed to get next ACL entry");
- return (ARCHIVE_WARN);
- }
-#endif
- }
- return (ARCHIVE_OK);
-}
-#endif /* !HAVE_SUN_ACL */
-#else /* !HAVE_POSIX_ACL && !HAVE_NFS4_ACL */
-static int
-setup_acls(struct archive_read_disk *a,
- struct archive_entry *entry, int *fd)
-{
- (void)a; /* UNUSED */
- (void)entry; /* UNUSED */
- (void)fd; /* UNUSED */
- return (ARCHIVE_OK);
-}
-#endif /* !HAVE_POSIX_ACL && !HAVE_NFS4_ACL */
-
-#if (HAVE_FGETXATTR && HAVE_FLISTXATTR && HAVE_LISTXATTR && \
- HAVE_LLISTXATTR && HAVE_GETXATTR && HAVE_LGETXATTR) || \
- (HAVE_FGETEA && HAVE_FLISTEA && HAVE_LISTEA)
-
-/*
- * Linux and AIX extended attribute support.
+ * Linux, Darwin and AIX extended attribute support.
*
* TODO: By using a stack-allocated buffer for the first
* call to getxattr(), we might be able to avoid the second
@@ -1433,21 +444,32 @@ setup_xattr(struct archive_read_disk *a,
ssize_t size;
void *value = NULL;
-#if HAVE_FGETXATTR
- if (fd >= 0)
+
+ if (fd >= 0) {
+#if ARCHIVE_XATTR_LINUX
size = fgetxattr(fd, name, NULL, 0);
- else if (!a->follow_symlinks)
- size = lgetxattr(accpath, name, NULL, 0);
- else
- size = getxattr(accpath, name, NULL, 0);
-#elif HAVE_FGETEA
- if (fd >= 0)
+#elif ARCHIVE_XATTR_DARWIN
+ size = fgetxattr(fd, name, NULL, 0, 0, 0);
+#elif ARCHIVE_XATTR_AIX
size = fgetea(fd, name, NULL, 0);
- else if (!a->follow_symlinks)
+#endif
+ } else if (!a->follow_symlinks) {
+#if ARCHIVE_XATTR_LINUX
+ size = lgetxattr(accpath, name, NULL, 0);
+#elif ARCHIVE_XATTR_DARWIN
+ size = getxattr(accpath, name, NULL, 0, 0, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
size = lgetea(accpath, name, NULL, 0);
- else
+#endif
+ } else {
+#if ARCHIVE_XATTR_LINUX
+ size = getxattr(accpath, name, NULL, 0);
+#elif ARCHIVE_XATTR_DARWIN
+ size = getxattr(accpath, name, NULL, 0, 0, 0);
+#elif ARCHIVE_XATTR_AIX
size = getea(accpath, name, NULL, 0);
#endif
+ }
if (size == -1) {
archive_set_error(&a->archive, errno,
@@ -1460,21 +482,32 @@ setup_xattr(struct archive_read_disk *a,
return (ARCHIVE_FATAL);
}
-#if HAVE_FGETXATTR
- if (fd >= 0)
+
+ if (fd >= 0) {
+#if ARCHIVE_XATTR_LINUX
size = fgetxattr(fd, name, value, size);
- else if (!a->follow_symlinks)
- size = lgetxattr(accpath, name, value, size);
- else
- size = getxattr(accpath, name, value, size);
-#elif HAVE_FGETEA
- if (fd >= 0)
+#elif ARCHIVE_XATTR_DARWIN
+ size = fgetxattr(fd, name, value, size, 0, 0);
+#elif ARCHIVE_XATTR_AIX
size = fgetea(fd, name, value, size);
- else if (!a->follow_symlinks)
+#endif
+ } else if (!a->follow_symlinks) {
+#if ARCHIVE_XATTR_LINUX
+ size = lgetxattr(accpath, name, value, size);
+#elif ARCHIVE_XATTR_DARWIN
+ size = getxattr(accpath, name, value, size, 0, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
size = lgetea(accpath, name, value, size);
- else
+#endif
+ } else {
+#if ARCHIVE_XATTR_LINUX
+ size = getxattr(accpath, name, value, size);
+#elif ARCHIVE_XATTR_DARWIN
+ size = getxattr(accpath, name, value, size, 0, 0);
+#elif ARCHIVE_XATTR_AIX
size = getea(accpath, name, value, size);
#endif
+ }
if (size == -1) {
archive_set_error(&a->archive, errno,
@@ -1499,38 +532,36 @@ setup_xattrs(struct archive_read_disk *a,
path = NULL;
if (*fd < 0) {
- path = archive_entry_sourcepath(entry);
- if (path == NULL || (a->tree != NULL &&
- a->tree_enter_working_dir(a->tree) != 0))
- path = archive_entry_pathname(entry);
- if (path == NULL) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Couldn't determine file path to read "
- "extended attributes");
+ path = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (path == NULL)
return (ARCHIVE_WARN);
- }
- if (a->tree != NULL && (a->follow_symlinks ||
- archive_entry_filetype(entry) != AE_IFLNK)) {
- *fd = a->open_on_current_dir(a->tree,
- path, O_RDONLY | O_NONBLOCK);
- }
}
-#if HAVE_FLISTXATTR
- if (*fd >= 0)
+ if (*fd >= 0) {
+#if ARCHIVE_XATTR_LINUX
list_size = flistxattr(*fd, NULL, 0);
- else if (!a->follow_symlinks)
- list_size = llistxattr(path, NULL, 0);
- else
- list_size = listxattr(path, NULL, 0);
-#elif HAVE_FLISTEA
- if (*fd >= 0)
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = flistxattr(*fd, NULL, 0, 0);
+#elif ARCHIVE_XATTR_AIX
list_size = flistea(*fd, NULL, 0);
- else if (!a->follow_symlinks)
+#endif
+ } else if (!a->follow_symlinks) {
+#if ARCHIVE_XATTR_LINUX
+ list_size = llistxattr(path, NULL, 0);
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = listxattr(path, NULL, 0, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
list_size = llistea(path, NULL, 0);
- else
+#endif
+ } else {
+#if ARCHIVE_XATTR_LINUX
+ list_size = listxattr(path, NULL, 0);
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = listxattr(path, NULL, 0, 0);
+#elif ARCHIVE_XATTR_AIX
list_size = listea(path, NULL, 0);
#endif
+ }
if (list_size == -1) {
if (errno == ENOTSUP || errno == ENOSYS)
@@ -1548,21 +579,31 @@ setup_xattrs(struct archive_read_disk *a,
return (ARCHIVE_FATAL);
}
-#if HAVE_FLISTXATTR
- if (*fd >= 0)
+ if (*fd >= 0) {
+#if ARCHIVE_XATTR_LINUX
list_size = flistxattr(*fd, list, list_size);
- else if (!a->follow_symlinks)
- list_size = llistxattr(path, list, list_size);
- else
- list_size = listxattr(path, list, list_size);
-#elif HAVE_FLISTEA
- if (*fd >= 0)
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = flistxattr(*fd, list, list_size, 0);
+#elif ARCHIVE_XATTR_AIX
list_size = flistea(*fd, list, list_size);
- else if (!a->follow_symlinks)
+#endif
+ } else if (!a->follow_symlinks) {
+#if ARCHIVE_XATTR_LINUX
+ list_size = llistxattr(path, list, list_size);
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = listxattr(path, list, list_size, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
list_size = llistea(path, list, list_size);
- else
+#endif
+ } else {
+#if ARCHIVE_XATTR_LINUX
+ list_size = listxattr(path, list, list_size);
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = listxattr(path, list, list_size, 0);
+#elif ARCHIVE_XATTR_AIX
list_size = listea(path, list, list_size);
#endif
+ }
if (list_size == -1) {
archive_set_error(&a->archive, errno,
@@ -1572,9 +613,21 @@ setup_xattrs(struct archive_read_disk *a,
}
for (p = list; (p - list) < list_size; p += strlen(p) + 1) {
- if (strncmp(p, "system.", 7) == 0 ||
- strncmp(p, "xfsroot.", 8) == 0)
+#if ARCHIVE_XATTR_LINUX
+ /* Linux: skip POSIX.1e ACL extended attributes */
+ if (strncmp(p, "system.", 7) == 0 &&
+ (strcmp(p + 7, "posix_acl_access") == 0 ||
+ strcmp(p + 7, "posix_acl_default") == 0))
+ continue;
+ if (strncmp(p, "trusted.SGI_", 12) == 0 &&
+ (strcmp(p + 12, "ACL_DEFAULT") == 0 ||
+ strcmp(p + 12, "ACL_FILE") == 0))
+ continue;
+
+ /* Linux: xfsroot namespace is obsolete and unsupported */
+ if (strncmp(p, "xfsroot.", 8) == 0)
continue;
+#endif
setup_xattr(a, entry, p, *fd, path);
}
@@ -1582,8 +635,7 @@ setup_xattrs(struct archive_read_disk *a,
return (ARCHIVE_OK);
}
-#elif HAVE_EXTATTR_GET_FILE && HAVE_EXTATTR_LIST_FILE && \
- HAVE_DECL_EXTATTR_NAMESPACE_USER
+#elif ARCHIVE_XATTR_FREEBSD
/*
* FreeBSD extattr interface.
@@ -1658,21 +710,9 @@ setup_xattrs(struct archive_read_disk *a,
path = NULL;
if (*fd < 0) {
- path = archive_entry_sourcepath(entry);
- if (path == NULL || (a->tree != NULL &&
- a->tree_enter_working_dir(a->tree) != 0))
- path = archive_entry_pathname(entry);
- if (path == NULL) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Couldn't determine file path to read "
- "extended attributes");
+ path = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (path == NULL)
return (ARCHIVE_WARN);
- }
- if (a->tree != NULL && (a->follow_symlinks ||
- archive_entry_filetype(entry) != AE_IFLNK)) {
- *fd = a->open_on_current_dir(a->tree,
- path, O_RDONLY | O_NONBLOCK);
- }
}
if (*fd >= 0)
@@ -1773,6 +813,7 @@ setup_sparse_fiemap(struct archive_read_disk *a,
int64_t size;
int count, do_fiemap, iters;
int exit_sts = ARCHIVE_OK;
+ const char *path;
if (archive_entry_filetype(entry) != AE_IFREG
|| archive_entry_size(entry) <= 0
@@ -1780,11 +821,10 @@ setup_sparse_fiemap(struct archive_read_disk *a,
return (ARCHIVE_OK);
if (*fd < 0) {
- const char *path;
-
- path = archive_entry_sourcepath(entry);
+ path = archive_read_disk_entry_setup_path(a, entry, NULL);
if (path == NULL)
- path = archive_entry_pathname(entry);
+ return (ARCHIVE_FAILED);
+
if (a->tree != NULL)
*fd = a->open_on_current_dir(a->tree, path,
O_RDONLY | O_NONBLOCK | O_CLOEXEC);
@@ -1880,6 +920,7 @@ setup_sparse(struct archive_read_disk *a,
off_t off_s, off_e;
int exit_sts = ARCHIVE_OK;
int check_fully_sparse = 0;
+ const char *path;
if (archive_entry_filetype(entry) != AE_IFREG
|| archive_entry_size(entry) <= 0
@@ -1887,20 +928,10 @@ setup_sparse(struct archive_read_disk *a,
return (ARCHIVE_OK);
/* Does filesystem support the reporting of hole ? */
- if (*fd < 0 && a->tree != NULL) {
- const char *path;
-
- path = archive_entry_sourcepath(entry);
- if (path == NULL)
- path = archive_entry_pathname(entry);
- *fd = a->open_on_current_dir(a->tree, path,
- O_RDONLY | O_NONBLOCK);
- if (*fd < 0) {
- archive_set_error(&a->archive, errno,
- "Can't open `%s'", path);
- return (ARCHIVE_FAILED);
- }
- }
+ if (*fd < 0)
+ path = archive_read_disk_entry_setup_path(a, entry, fd);
+ else
+ path = NULL;
if (*fd >= 0) {
#ifdef _PC_MIN_HOLE_SIZE
@@ -1911,12 +942,8 @@ setup_sparse(struct archive_read_disk *a,
if (initial_off != 0)
lseek(*fd, 0, SEEK_SET);
} else {
- const char *path;
-
- path = archive_entry_sourcepath(entry);
if (path == NULL)
- path = archive_entry_pathname(entry);
-
+ return (ARCHIVE_FAILED);
#ifdef _PC_MIN_HOLE_SIZE
if (pathconf(path, _PC_MIN_HOLE_SIZE) <= 0)
return (ARCHIVE_OK);
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_disk_private.h b/Utilities/cmlibarchive/libarchive/archive_read_disk_private.h
index b5a8328..f03a0a9 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_disk_private.h
+++ b/Utilities/cmlibarchive/libarchive/archive_read_disk_private.h
@@ -33,6 +33,8 @@
#ifndef ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED
#define ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED
+#include "archive_platform_acl.h"
+
struct tree;
struct archive_entry;
@@ -86,4 +88,11 @@ struct archive_read_disk {
void *excluded_cb_data;
};
+const char *
+archive_read_disk_entry_setup_path(struct archive_read_disk *,
+ struct archive_entry *, int *);
+
+int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *,
+ struct archive_entry *, int *);
#endif
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_format.3 b/Utilities/cmlibarchive/libarchive/archive_read_format.3
index 53b9a7e..91c5d2c 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_format.3
+++ b/Utilities/cmlibarchive/libarchive/archive_read_format.3
@@ -37,9 +37,9 @@
.Nm archive_read_support_format_empty ,
.Nm archive_read_support_format_iso9660 ,
.Nm archive_read_support_format_lha ,
-.Nm archive_read_support_format_mtree,
-.Nm archive_read_support_format_rar,
-.Nm archive_read_support_format_raw,
+.Nm archive_read_support_format_mtree ,
+.Nm archive_read_support_format_rar ,
+.Nm archive_read_support_format_raw ,
.Nm archive_read_support_format_tar ,
.Nm archive_read_support_format_xar ,
.Nm archive_read_support_format_zip
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_open.3 b/Utilities/cmlibarchive/libarchive/archive_read_open.3
index 4d8272c..2278ebc 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_open.3
+++ b/Utilities/cmlibarchive/libarchive/archive_read_open.3
@@ -33,7 +33,7 @@
.Nm archive_read_open_fd ,
.Nm archive_read_open_FILE ,
.Nm archive_read_open_filename ,
-.Nm archive_read_open_memory ,
+.Nm archive_read_open_memory
.Nd functions for reading streaming archives
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -67,7 +67,7 @@ Streaming Archive Library (libarchive, -larchive)
.Fa "size_t block_size"
.Fc
.Ft int
-.Fn archive_read_open_memory "struct archive *" "void *buff" "size_t size"
+.Fn archive_read_open_memory "struct archive *" "const void *buff" "size_t size"
.Sh DESCRIPTION
.Bl -tag -compact -width indent
.It Fn archive_read_open
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_lz4.c b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_lz4.c
index 663e2d3..147f502 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_lz4.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_lz4.c
@@ -494,7 +494,7 @@ lz4_filter_read_data_block(struct archive_read_filter *self, const void **p)
if (read_buf == NULL)
goto truncated_error;
compressed_size = archive_le32dec(read_buf);
- if ((compressed_size & ~(1 << 31)) > state->flags.block_maximum_size)
+ if ((compressed_size & 0x7fffffff) > state->flags.block_maximum_size)
goto malformed_error;
/* A compressed size == 0 means the end of stream blocks. */
if (compressed_size == 0) {
@@ -504,8 +504,8 @@ lz4_filter_read_data_block(struct archive_read_filter *self, const void **p)
checksum_size = state->flags.block_checksum;
/* Check if the block is uncompressed. */
- if (compressed_size & (1 << 31)) {
- compressed_size &= ~(1 << 31);
+ if (compressed_size & 0x80000000U) {
+ compressed_size &= 0x7fffffff;
uncompressed_size = compressed_size;
} else
uncompressed_size = 0;/* Unknown yet. */
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_cab.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_cab.c
index 20eb157..51f79fa 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_cab.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_cab.c
@@ -116,19 +116,11 @@ struct lzx_dec {
* coding tree, which is a binary tree. But a use of a large
* index table causes L1 cache read miss many times.
*/
-#define HTBL_BITS 10
int max_bits;
- int shift_bits;
int tbl_bits;
int tree_used;
- int tree_avail;
/* Direct access table. */
uint16_t *tbl;
- /* Binary tree table for extra bits over the direct access. */
- struct htree_t {
- uint16_t left;
- uint16_t right;
- } *tree;
} at, lt, mt, pt;
int loop;
@@ -187,7 +179,7 @@ struct lzx_stream {
#define CFDATA_cbData 4
#define CFDATA_cbUncomp 6
-static const char *compression_name[] = {
+static const char * const compression_name[] = {
"NONE",
"MSZIP",
"Quantum",
@@ -352,7 +344,6 @@ static int lzx_huffman_init(struct huffman *, size_t, int);
static void lzx_huffman_free(struct huffman *);
static int lzx_make_huffman_table(struct huffman *);
static inline int lzx_decode_huffman(struct huffman *, unsigned);
-static int lzx_decode_huffman_tree(struct huffman *, unsigned, int);
int
@@ -3127,7 +3118,6 @@ getdata:
static int
lzx_huffman_init(struct huffman *hf, size_t len_size, int tbl_bits)
{
- int bits;
if (hf->bitlen == NULL || hf->len_size != (int)len_size) {
free(hf->bitlen);
@@ -3138,21 +3128,11 @@ lzx_huffman_init(struct huffman *hf, size_t len_size, int tbl_bits)
} else
memset(hf->bitlen, 0, len_size * sizeof(hf->bitlen[0]));
if (hf->tbl == NULL) {
- if (tbl_bits < HTBL_BITS)
- bits = tbl_bits;
- else
- bits = HTBL_BITS;
- hf->tbl = malloc(((size_t)1 << bits) * sizeof(hf->tbl[0]));
+ hf->tbl = malloc(((size_t)1 << tbl_bits) * sizeof(hf->tbl[0]));
if (hf->tbl == NULL)
return (ARCHIVE_FATAL);
hf->tbl_bits = tbl_bits;
}
- if (hf->tree == NULL && tbl_bits > HTBL_BITS) {
- hf->tree_avail = 1 << (tbl_bits - HTBL_BITS + 4);
- hf->tree = malloc(hf->tree_avail * sizeof(hf->tree[0]));
- if (hf->tree == NULL)
- return (ARCHIVE_FATAL);
- }
return (ARCHIVE_OK);
}
@@ -3161,7 +3141,6 @@ lzx_huffman_free(struct huffman *hf)
{
free(hf->bitlen);
free(hf->tbl);
- free(hf->tree);
}
/*
@@ -3174,7 +3153,7 @@ lzx_make_huffman_table(struct huffman *hf)
const unsigned char *bitlen;
int bitptn[17], weight[17];
int i, maxbits = 0, ptn, tbl_size, w;
- int diffbits, len_avail;
+ int len_avail;
/*
* Initialize bit patterns.
@@ -3205,28 +3184,11 @@ lzx_make_huffman_table(struct huffman *hf)
weight[i] >>= ebits;
}
}
- if (maxbits > HTBL_BITS) {
- int htbl_max;
- uint16_t *p;
-
- diffbits = maxbits - HTBL_BITS;
- for (i = 1; i <= HTBL_BITS; i++) {
- bitptn[i] >>= diffbits;
- weight[i] >>= diffbits;
- }
- htbl_max = bitptn[HTBL_BITS] +
- weight[HTBL_BITS] * hf->freq[HTBL_BITS];
- p = &(hf->tbl[htbl_max]);
- while (p < &hf->tbl[1U<<HTBL_BITS])
- *p++ = 0;
- } else
- diffbits = 0;
- hf->shift_bits = diffbits;
/*
* Make the table.
*/
- tbl_size = 1 << HTBL_BITS;
+ tbl_size = 1 << hf->tbl_bits;
tbl = hf->tbl;
bitlen = hf->bitlen;
len_avail = hf->len_size;
@@ -3234,120 +3196,32 @@ lzx_make_huffman_table(struct huffman *hf)
for (i = 0; i < len_avail; i++) {
uint16_t *p;
int len, cnt;
- uint16_t bit;
- int extlen;
- struct htree_t *ht;
if (bitlen[i] == 0)
continue;
/* Get a bit pattern */
len = bitlen[i];
+ if (len > tbl_size)
+ return (0);
ptn = bitptn[len];
cnt = weight[len];
- if (len <= HTBL_BITS) {
- /* Calculate next bit pattern */
- if ((bitptn[len] = ptn + cnt) > tbl_size)
- return (0);/* Invalid */
- /* Update the table */
- p = &(tbl[ptn]);
- while (--cnt >= 0)
- p[cnt] = (uint16_t)i;
- continue;
- }
-
- /*
- * A bit length is too big to be housed to a direct table,
- * so we use a tree model for its extra bits.
- */
- bitptn[len] = ptn + cnt;
- bit = 1U << (diffbits -1);
- extlen = len - HTBL_BITS;
-
- p = &(tbl[ptn >> diffbits]);
- if (*p == 0) {
- *p = len_avail + hf->tree_used;
- ht = &(hf->tree[hf->tree_used++]);
- if (hf->tree_used > hf->tree_avail)
- return (0);/* Invalid */
- ht->left = 0;
- ht->right = 0;
- } else {
- if (*p < len_avail ||
- *p >= (len_avail + hf->tree_used))
- return (0);/* Invalid */
- ht = &(hf->tree[*p - len_avail]);
- }
- while (--extlen > 0) {
- if (ptn & bit) {
- if (ht->left < len_avail) {
- ht->left = len_avail + hf->tree_used;
- ht = &(hf->tree[hf->tree_used++]);
- if (hf->tree_used > hf->tree_avail)
- return (0);/* Invalid */
- ht->left = 0;
- ht->right = 0;
- } else {
- ht = &(hf->tree[ht->left - len_avail]);
- }
- } else {
- if (ht->right < len_avail) {
- ht->right = len_avail + hf->tree_used;
- ht = &(hf->tree[hf->tree_used++]);
- if (hf->tree_used > hf->tree_avail)
- return (0);/* Invalid */
- ht->left = 0;
- ht->right = 0;
- } else {
- ht = &(hf->tree[ht->right - len_avail]);
- }
- }
- bit >>= 1;
- }
- if (ptn & bit) {
- if (ht->left != 0)
- return (0);/* Invalid */
- ht->left = (uint16_t)i;
- } else {
- if (ht->right != 0)
- return (0);/* Invalid */
- ht->right = (uint16_t)i;
- }
+ /* Calculate next bit pattern */
+ if ((bitptn[len] = ptn + cnt) > tbl_size)
+ return (0);/* Invalid */
+ /* Update the table */
+ p = &(tbl[ptn]);
+ while (--cnt >= 0)
+ p[cnt] = (uint16_t)i;
}
return (1);
}
-static int
-lzx_decode_huffman_tree(struct huffman *hf, unsigned rbits, int c)
-{
- struct htree_t *ht;
- int extlen;
-
- ht = hf->tree;
- extlen = hf->shift_bits;
- while (c >= hf->len_size) {
- c -= hf->len_size;
- if (extlen-- <= 0 || c >= hf->tree_used)
- return (0);
- if (rbits & (1U << extlen))
- c = ht[c].left;
- else
- c = ht[c].right;
- }
- return (c);
-}
-
static inline int
lzx_decode_huffman(struct huffman *hf, unsigned rbits)
{
int c;
- /*
- * At first search an index table for a bit pattern.
- * If it fails, search a huffman tree for.
- */
- c = hf->tbl[rbits >> hf->shift_bits];
+ c = hf->tbl[rbits];
if (c < hf->len_size)
return (c);
- /* This bit pattern needs to be found out at a huffman tree. */
- return (lzx_decode_huffman_tree(hf, rbits, c));
+ return (0);
}
-
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_cpio.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_cpio.c
index ffd4a85..ad9f782 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_cpio.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_cpio.c
@@ -165,7 +165,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_cpio.c 20116
struct links_entry {
struct links_entry *next;
struct links_entry *previous;
- int links;
+ unsigned int links;
dev_t dev;
int64_t ino;
char *name;
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
index 3541330..4b436d1 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
@@ -3021,8 +3021,9 @@ heap_add_entry(struct archive_read *a, struct heap_queue *heap,
ENOMEM, "Out of memory");
return (ARCHIVE_FATAL);
}
- memcpy(new_pending_files, heap->files,
- heap->allocated * sizeof(new_pending_files[0]));
+ if (heap->allocated)
+ memcpy(new_pending_files, heap->files,
+ heap->allocated * sizeof(new_pending_files[0]));
if (heap->files != NULL)
free(heap->files);
heap->files = new_pending_files;
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_lha.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_lha.c
index ebd7f2c..1995e9c 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_lha.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_lha.c
@@ -2480,7 +2480,7 @@ lzh_huffman_free(struct huffman *hf)
free(hf->tree);
}
-static char bitlen_tbl[0x400] = {
+static const char bitlen_tbl[0x400] = {
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_mtree.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_mtree.c
index 4231ff5..44b6083 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_mtree.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_mtree.c
@@ -130,9 +130,7 @@ static ssize_t readline(struct archive_read *, struct mtree *, char **, ssize_t)
static int skip(struct archive_read *a);
static int read_header(struct archive_read *,
struct archive_entry *);
-static int64_t mtree_atol10(char **);
-static int64_t mtree_atol8(char **);
-static int64_t mtree_atol(char **);
+static int64_t mtree_atol(char **, int base);
/*
* There's no standard for TIME_T_MAX/TIME_T_MIN. So we compute them
@@ -399,41 +397,41 @@ bid_keycmp(const char *p, const char *key, ssize_t len)
static int
bid_keyword(const char *p, ssize_t len)
{
- static const char *keys_c[] = {
+ static const char * const keys_c[] = {
"content", "contents", "cksum", NULL
};
- static const char *keys_df[] = {
+ static const char * const keys_df[] = {
"device", "flags", NULL
};
- static const char *keys_g[] = {
+ static const char * const keys_g[] = {
"gid", "gname", NULL
};
- static const char *keys_il[] = {
+ static const char * const keys_il[] = {
"ignore", "inode", "link", NULL
};
- static const char *keys_m[] = {
+ static const char * const keys_m[] = {
"md5", "md5digest", "mode", NULL
};
- static const char *keys_no[] = {
+ static const char * const keys_no[] = {
"nlink", "nochange", "optional", NULL
};
- static const char *keys_r[] = {
+ static const char * const keys_r[] = {
"resdevice", "rmd160", "rmd160digest", NULL
};
- static const char *keys_s[] = {
+ static const char * const keys_s[] = {
"sha1", "sha1digest",
"sha256", "sha256digest",
"sha384", "sha384digest",
"sha512", "sha512digest",
"size", NULL
};
- static const char *keys_t[] = {
+ static const char * const keys_t[] = {
"tags", "time", "type", NULL
};
- static const char *keys_u[] = {
+ static const char * const keys_u[] = {
"uid", "uname", NULL
};
- const char **keys;
+ const char * const *keys;
int i;
switch (*p) {
@@ -1418,7 +1416,7 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
"Too many arguments");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
+ numbers[argc++] = (unsigned long)mtree_atol(&p, 0);
}
if (argc < 2) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
@@ -1433,7 +1431,7 @@ parse_device(dev_t *pdev, struct archive *a, char *val)
}
} else {
/* file system raw value. */
- result = (dev_t)mtree_atol(&val);
+ result = (dev_t)mtree_atol(&val, 0);
}
*pdev = result;
return ARCHIVE_OK;
@@ -1513,7 +1511,7 @@ parse_keyword(struct archive_read *a, struct mtree *mtree,
case 'g':
if (strcmp(key, "gid") == 0) {
*parsed_kws |= MTREE_HAS_GID;
- archive_entry_set_gid(entry, mtree_atol10(&val));
+ archive_entry_set_gid(entry, mtree_atol(&val, 10));
break;
}
if (strcmp(key, "gname") == 0) {
@@ -1523,7 +1521,7 @@ parse_keyword(struct archive_read *a, struct mtree *mtree,
}
case 'i':
if (strcmp(key, "inode") == 0) {
- archive_entry_set_ino(entry, mtree_atol10(&val));
+ archive_entry_set_ino(entry, mtree_atol(&val, 10));
break;
}
case 'l':
@@ -1535,14 +1533,14 @@ parse_keyword(struct archive_read *a, struct mtree *mtree,
if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0)
break;
if (strcmp(key, "mode") == 0) {
- if (val[0] >= '0' && val[0] <= '9') {
+ if (val[0] >= '0' && val[0] <= '7') {
*parsed_kws |= MTREE_HAS_PERM;
archive_entry_set_perm(entry,
- (mode_t)mtree_atol8(&val));
+ (mode_t)mtree_atol(&val, 8));
} else {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
- "Symbolic mode \"%s\" unsupported", val);
+ "Symbolic or non-octal mode \"%s\" unsupported", val);
return ARCHIVE_WARN;
}
break;
@@ -1551,7 +1549,7 @@ parse_keyword(struct archive_read *a, struct mtree *mtree,
if (strcmp(key, "nlink") == 0) {
*parsed_kws |= MTREE_HAS_NLINK;
archive_entry_set_nlink(entry,
- (unsigned int)mtree_atol10(&val));
+ (unsigned int)mtree_atol(&val, 10));
break;
}
case 'r':
@@ -1582,7 +1580,7 @@ parse_keyword(struct archive_read *a, struct mtree *mtree,
strcmp(key, "sha512digest") == 0)
break;
if (strcmp(key, "size") == 0) {
- archive_entry_set_size(entry, mtree_atol10(&val));
+ archive_entry_set_size(entry, mtree_atol(&val, 10));
break;
}
case 't':
@@ -1601,13 +1599,13 @@ parse_keyword(struct archive_read *a, struct mtree *mtree,
long ns = 0;
*parsed_kws |= MTREE_HAS_MTIME;
- m = mtree_atol10(&val);
+ m = mtree_atol(&val, 10);
/* Replicate an old mtree bug:
* 123456789.1 represents 123456789
* seconds and 1 nanosecond. */
if (*val == '.') {
++val;
- ns = (long)mtree_atol10(&val);
+ ns = (long)mtree_atol(&val, 10);
if (ns < 0)
ns = 0;
else if (ns > 999999999)
@@ -1670,7 +1668,7 @@ parse_keyword(struct archive_read *a, struct mtree *mtree,
case 'u':
if (strcmp(key, "uid") == 0) {
*parsed_kws |= MTREE_HAS_UID;
- archive_entry_set_uid(entry, mtree_atol10(&val));
+ archive_entry_set_uid(entry, mtree_atol(&val, 10));
break;
}
if (strcmp(key, "uname") == 0) {
@@ -1825,72 +1823,9 @@ parse_escapes(char *src, struct mtree_entry *mentry)
*dest = '\0';
}
-/*
- * Note that this implementation does not (and should not!) obey
- * locale settings; you cannot simply substitute strtol here, since
- * it does obey locale.
- */
-static int64_t
-mtree_atol8(char **p)
-{
- int64_t l, limit, last_digit_limit;
- int digit, base;
-
- base = 8;
- limit = INT64_MAX / base;
- last_digit_limit = INT64_MAX % base;
-
- l = 0;
- digit = **p - '0';
- while (digit >= 0 && digit < base) {
- if (l>limit || (l == limit && digit > last_digit_limit)) {
- l = INT64_MAX; /* Truncate on overflow. */
- break;
- }
- l = (l * base) + digit;
- digit = *++(*p) - '0';
- }
- return (l);
-}
-
-/*
- * Note that this implementation does not (and should not!) obey
- * locale settings; you cannot simply substitute strtol here, since
- * it does obey locale.
- */
-static int64_t
-mtree_atol10(char **p)
-{
- int64_t l, limit, last_digit_limit;
- int base, digit, sign;
-
- base = 10;
-
- if (**p == '-') {
- sign = -1;
- limit = ((uint64_t)(INT64_MAX) + 1) / base;
- last_digit_limit = ((uint64_t)(INT64_MAX) + 1) % base;
- ++(*p);
- } else {
- sign = 1;
- limit = INT64_MAX / base;
- last_digit_limit = INT64_MAX % base;
- }
-
- l = 0;
- digit = **p - '0';
- while (digit >= 0 && digit < base) {
- if (l > limit || (l == limit && digit > last_digit_limit))
- return (sign < 0) ? INT64_MIN : INT64_MAX;
- l = (l * base) + digit;
- digit = *++(*p) - '0';
- }
- return (sign < 0) ? -l : l;
-}
-
/* Parse a hex digit. */
static int
-parsehex(char c)
+parsedigit(char c)
{
if (c >= '0' && c <= '9')
return c - '0';
@@ -1908,45 +1843,50 @@ parsehex(char c)
* it does obey locale.
*/
static int64_t
-mtree_atol16(char **p)
+mtree_atol(char **p, int base)
{
- int64_t l, limit, last_digit_limit;
- int base, digit, sign;
-
- base = 16;
+ int64_t l, limit;
+ int digit, last_digit_limit;
+
+ if (base == 0) {
+ if (**p != '0')
+ base = 10;
+ else if ((*p)[1] == 'x' || (*p)[1] == 'X') {
+ *p += 2;
+ base = 16;
+ } else {
+ base = 8;
+ }
+ }
if (**p == '-') {
- sign = -1;
- limit = ((uint64_t)(INT64_MAX) + 1) / base;
- last_digit_limit = ((uint64_t)(INT64_MAX) + 1) % base;
+ limit = INT64_MIN / base;
+ last_digit_limit = INT64_MIN % base;
++(*p);
+
+ l = 0;
+ digit = parsedigit(**p);
+ while (digit >= 0 && digit < base) {
+ if (l < limit || (l == limit && digit > last_digit_limit))
+ return INT64_MIN;
+ l = (l * base) - digit;
+ digit = parsedigit(*++(*p));
+ }
+ return l;
} else {
- sign = 1;
limit = INT64_MAX / base;
last_digit_limit = INT64_MAX % base;
- }
- l = 0;
- digit = parsehex(**p);
- while (digit >= 0 && digit < base) {
- if (l > limit || (l == limit && digit > last_digit_limit))
- return (sign < 0) ? INT64_MIN : INT64_MAX;
- l = (l * base) + digit;
- digit = parsehex(*++(*p));
- }
- return (sign < 0) ? -l : l;
-}
-
-static int64_t
-mtree_atol(char **p)
-{
- if (**p != '0')
- return mtree_atol10(p);
- if ((*p)[1] == 'x' || (*p)[1] == 'X') {
- *p += 2;
- return mtree_atol16(p);
+ l = 0;
+ digit = parsedigit(**p);
+ while (digit >= 0 && digit < base) {
+ if (l > limit || (l == limit && digit > last_digit_limit))
+ return INT64_MAX;
+ l = (l * base) + digit;
+ digit = parsedigit(*++(*p));
+ }
+ return l;
}
- return mtree_atol8(p);
}
/*
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c
index 658d49d..a0e641e 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c
@@ -1750,7 +1750,7 @@ read_exttime(const char *p, struct rar *rar, const char *endp)
return (-1);
for (j = 0; j < count; j++)
{
- rem = ((*p) << 16) | (rem >> 8);
+ rem = (((unsigned)(unsigned char)*p) << 16) | (rem >> 8);
p++;
}
tm = localtime(&t);
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c
index bd7f13d..30d5bc8 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c
@@ -155,6 +155,7 @@ struct tar {
int compat_2x;
int process_mac_extensions;
int read_concatenated_archives;
+ int realsize_override;
};
static int archive_block_is_null(const char *p);
@@ -527,6 +528,7 @@ archive_read_format_tar_read_header(struct archive_read *a,
tar->entry_offset = 0;
gnu_clear_sparse_list(tar);
tar->realsize = -1; /* Mark this as "unset" */
+ tar->realsize_override = 0;
/* Setup default string conversion. */
tar->sconv = tar->opt_sconv;
@@ -1894,6 +1896,7 @@ pax_attribute(struct archive_read *a, struct tar *tar,
if (strcmp(key, "GNU.sparse.size") == 0) {
tar->realsize = tar_atol10(value, strlen(value));
archive_entry_set_size(entry, tar->realsize);
+ tar->realsize_override = 1;
}
/* GNU "0.1" sparse pax format. */
@@ -1925,6 +1928,7 @@ pax_attribute(struct archive_read *a, struct tar *tar,
if (strcmp(key, "GNU.sparse.realsize") == 0) {
tar->realsize = tar_atol10(value, strlen(value));
archive_entry_set_size(entry, tar->realsize);
+ tar->realsize_override = 1;
}
break;
case 'L':
@@ -1977,6 +1981,7 @@ pax_attribute(struct archive_read *a, struct tar *tar,
tar_atol10(value, strlen(value)));
} else if (strcmp(key, "SCHILY.realsize") == 0) {
tar->realsize = tar_atol10(value, strlen(value));
+ tar->realsize_override = 1;
archive_entry_set_size(entry, tar->realsize);
} else if (strncmp(key, "SCHILY.xattr.", 13) == 0) {
pax_attribute_schily_xattr(entry, key, value,
@@ -2055,14 +2060,12 @@ pax_attribute(struct archive_read *a, struct tar *tar,
tar->entry_bytes_remaining
= tar_atol10(value, strlen(value));
/*
- * But, "size" is not necessarily the size of
- * the file on disk; if this is a sparse file,
- * the disk size may have already been set from
- * GNU.sparse.realsize or GNU.sparse.size or
- * an old GNU header field or SCHILY.realsize
- * or ....
+ * The "size" pax header keyword always overrides the
+ * "size" field in the tar header.
+ * GNU.sparse.realsize, GNU.sparse.size and
+ * SCHILY.realsize override this value.
*/
- if (tar->realsize < 0) {
+ if (!tar->realsize_override) {
archive_entry_set_size(entry,
tar->entry_bytes_remaining);
tar->realsize
@@ -2206,6 +2209,7 @@ header_gnutar(struct archive_read *a, struct tar *tar,
tar->realsize
= tar_atol(header->realsize, sizeof(header->realsize));
archive_entry_set_size(entry, tar->realsize);
+ tar->realsize_override = 1;
}
if (header->sparse[0].offset[0] != 0) {
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_warc.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_warc.c
index b162465..e875385 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_warc.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_warc.c
@@ -600,9 +600,10 @@ _warc_rdver(const char *buf, size_t bsz)
/* looks good so far, read the version number for a laugh */
buf += sizeof(magic) - 1U;
- if (isdigit(buf[0U]) && (buf[1U] == '.') && isdigit(buf[2U])) {
+ if (isdigit((unsigned char)buf[0U]) && (buf[1U] == '.') &&
+ isdigit((unsigned char)buf[2U])) {
/* we support a maximum of 2 digits in the minor version */
- if (isdigit(buf[3U]))
+ if (isdigit((unsigned char)buf[3U]))
end = 1U;
/* set up major version */
ver = (buf[0U] - '0') * 10000U;
@@ -686,7 +687,7 @@ _warc_rduri(const char *buf, size_t bsz)
/* spaces inside uri are not allowed, CRLF should follow */
for (p = val; p < eol; p++) {
- if (isspace(*p))
+ if (isspace((unsigned char)*p))
return res;
}
@@ -736,7 +737,7 @@ _warc_rdlen(const char *buf, size_t bsz)
while (val < eol && (*val == ' ' || *val == '\t'))
val++;
/* there must be at least one digit */
- if (!isdigit(*val))
+ if (!isdigit((unsigned char)*val))
return -1;
len = strtol(val, &on, 10);
if (on != eol) {
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c
index e56bd63..ddd4458 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c
@@ -347,7 +347,7 @@ fake_crc32(unsigned long crc, const void *buff, size_t len)
return 0;
}
-static struct {
+static const struct {
int id;
const char * name;
} compression_methods[] = {
@@ -2407,7 +2407,7 @@ read_eocd(struct zip *zip, const char *p, int64_t current_offset)
* Examine Zip64 EOCD locator: If it's valid, store the information
* from it.
*/
-static void
+static int
read_zip64_eocd(struct archive_read *a, struct zip *zip, const char *p)
{
int64_t eocd64_offset;
@@ -2417,35 +2417,37 @@ read_zip64_eocd(struct archive_read *a, struct zip *zip, const char *p)
/* Central dir must be on first volume. */
if (archive_le32dec(p + 4) != 0)
- return;
+ return 0;
/* Must be only a single volume. */
if (archive_le32dec(p + 16) != 1)
- return;
+ return 0;
/* Find the Zip64 EOCD record. */
eocd64_offset = archive_le64dec(p + 8);
if (__archive_read_seek(a, eocd64_offset, SEEK_SET) < 0)
- return;
+ return 0;
if ((p = __archive_read_ahead(a, 56, NULL)) == NULL)
- return;
+ return 0;
/* Make sure we can read all of it. */
eocd64_size = archive_le64dec(p + 4) + 12;
if (eocd64_size < 56 || eocd64_size > 16384)
- return;
+ return 0;
if ((p = __archive_read_ahead(a, (size_t)eocd64_size, NULL)) == NULL)
- return;
+ return 0;
/* Sanity-check the EOCD64 */
if (archive_le32dec(p + 16) != 0) /* Must be disk #0 */
- return;
+ return 0;
if (archive_le32dec(p + 20) != 0) /* CD must be on disk #0 */
- return;
+ return 0;
/* CD can't be split. */
if (archive_le64dec(p + 24) != archive_le64dec(p + 32))
- return;
+ return 0;
/* Save the central directory offset for later use. */
zip->central_directory_offset = archive_le64dec(p + 48);
+
+ return 32;
}
static int
@@ -2483,15 +2485,14 @@ archive_read_format_zip_seekable_bid(struct archive_read *a, int best_bid)
if (memcmp(p + i, "PK\005\006", 4) == 0) {
int ret = read_eocd(zip, p + i,
current_offset + i);
- if (ret > 0) {
- /* Zip64 EOCD locator precedes
- * regular EOCD if present. */
- if (i >= 20
- && memcmp(p + i - 20, "PK\006\007", 4) == 0) {
- read_zip64_eocd(a, zip, p + i - 20);
- }
- return (ret);
+ /* Zip64 EOCD locator precedes
+ * regular EOCD if present. */
+ if (i >= 20 && memcmp(p + i - 20, "PK\006\007", 4) == 0) {
+ int ret_zip64 = read_zip64_eocd(a, zip, p + i - 20);
+ if (ret_zip64 > ret)
+ ret = ret_zip64;
}
+ return (ret);
}
i -= 4;
break;
diff --git a/Utilities/cmlibarchive/libarchive/archive_string.c b/Utilities/cmlibarchive/libarchive/archive_string.c
index 592ead2..5ae09b6 100644
--- a/Utilities/cmlibarchive/libarchive/archive_string.c
+++ b/Utilities/cmlibarchive/libarchive/archive_string.c
@@ -202,7 +202,8 @@ archive_string_append(struct archive_string *as, const char *p, size_t s)
{
if (archive_string_ensure(as, as->length + s + 1) == NULL)
return (NULL);
- memmove(as->s + as->length, p, s);
+ if (s)
+ memmove(as->s + as->length, p, s);
as->length += s;
as->s[as->length] = 0;
return (as);
diff --git a/Utilities/cmlibarchive/libarchive/archive_string_sprintf.c b/Utilities/cmlibarchive/libarchive/archive_string_sprintf.c
index 964ea2b..969a560 100644
--- a/Utilities/cmlibarchive/libarchive/archive_string_sprintf.c
+++ b/Utilities/cmlibarchive/libarchive/archive_string_sprintf.c
@@ -53,7 +53,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_string_sprintf.c 189435 2009-03-
static void
append_uint(struct archive_string *as, uintmax_t d, unsigned base)
{
- static const char *digits = "0123456789abcdef";
+ static const char digits[] = "0123456789abcdef";
if (d >= base)
append_uint(as, d/base, base);
archive_strappend_char(as, digits[d % base]);
diff --git a/Utilities/cmlibarchive/libarchive/archive_util.c b/Utilities/cmlibarchive/libarchive/archive_util.c
index f56ca33..1e36ad7 100644
--- a/Utilities/cmlibarchive/libarchive/archive_util.c
+++ b/Utilities/cmlibarchive/libarchive/archive_util.c
@@ -89,88 +89,6 @@ archive_version_string(void)
return (ARCHIVE_VERSION_STRING);
}
-const char *
-archive_version_details(void)
-{
- static struct archive_string str;
- static int init = 0;
- const char *zlib = archive_zlib_version();
- const char *liblzma = archive_liblzma_version();
- const char *bzlib = archive_bzlib_version();
- const char *liblz4 = archive_liblz4_version();
-
- if (!init) {
- archive_string_init(&str);
-
- archive_strcat(&str, ARCHIVE_VERSION_STRING);
- if (zlib != NULL) {
- archive_strcat(&str, " zlib/");
- archive_strcat(&str, zlib);
- }
- if (liblzma) {
- archive_strcat(&str, " liblzma/");
- archive_strcat(&str, liblzma);
- }
- if (bzlib) {
- const char *p = bzlib;
- const char *sep = strchr(p, ',');
- if (sep == NULL)
- sep = p + strlen(p);
- archive_strcat(&str, " bz2lib/");
- archive_strncat(&str, p, sep - p);
- }
- if (liblz4) {
- archive_strcat(&str, " liblz4/");
- archive_strcat(&str, liblz4);
- }
- }
- return str.s;
-}
-
-const char *
-archive_zlib_version(void)
-{
-#ifdef HAVE_ZLIB_H
- return ZLIB_VERSION;
-#else
- return NULL;
-#endif
-}
-
-const char *
-archive_liblzma_version(void)
-{
-#ifdef HAVE_LZMA_H
- return LZMA_VERSION_STRING;
-#else
- return NULL;
-#endif
-}
-
-const char *
-archive_bzlib_version(void)
-{
-#ifdef HAVE_BZLIB_H
- return BZ2_bzlibVersion();
-#else
- return NULL;
-#endif
-}
-
-const char *
-archive_liblz4_version(void)
-{
-#if defined(HAVE_LZ4_H) && defined(HAVE_LIBLZ4)
-#define str(s) #s
-#define NUMBER(x) str(x)
- return NUMBER(LZ4_VERSION_MAJOR) "." NUMBER(LZ4_VERSION_MINOR) "." NUMBER(LZ4_VERSION_RELEASE);
-#undef NUMBER
-#undef str
-#else
- return NULL;
-#endif
-}
-
int
archive_errno(struct archive *a)
{
@@ -275,7 +193,7 @@ archive_copy_error(struct archive *dest, struct archive *src)
void
__archive_errx(int retvalue, const char *msg)
{
- static const char *msg1 = "Fatal Internal Error in libarchive: ";
+ static const char msg1[] = "Fatal Internal Error in libarchive: ";
size_t s;
s = write(2, msg1, strlen(msg1));
@@ -303,8 +221,8 @@ __archive_errx(int retvalue, const char *msg)
int
__archive_mktemp(const char *tmpdir)
{
- static const wchar_t *prefix = L"libarchive_";
- static const wchar_t *suffix = L"XXXXXXXXXX";
+ static const wchar_t prefix[] = L"libarchive_";
+ static const wchar_t suffix[] = L"XXXXXXXXXX";
static const wchar_t num[] = {
L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7',
L'8', L'9', L'A', L'B', L'C', L'D', L'E', L'F',
diff --git a/Utilities/cmlibarchive/libarchive/archive_version_details.c b/Utilities/cmlibarchive/libarchive/archive_version_details.c
new file mode 100644
index 0000000..9289bf1
--- /dev/null
+++ b/Utilities/cmlibarchive/libarchive/archive_version_details.c
@@ -0,0 +1,133 @@
+/*-
+ * Copyright (c) 2009-2012,2014 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/archive_util.c 201098 2009-12-28 02:58:14Z kientzle $");
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_ZLIB_H
+#include <cm_zlib.h>
+#endif
+#ifdef HAVE_LZMA_H
+#include <cm_lzma.h>
+#endif
+#ifdef HAVE_BZLIB_H
+#include <cm_bzlib.h>
+#endif
+#ifdef HAVE_LZ4_H
+#include <lz4.h>
+#endif
+
+#include "archive.h"
+#include "archive_private.h"
+#include "archive_string.h"
+
+const char *
+archive_version_details(void)
+{
+ static struct archive_string str;
+ static int init = 0;
+ const char *zlib = archive_zlib_version();
+ const char *liblzma = archive_liblzma_version();
+ const char *bzlib = archive_bzlib_version();
+ const char *liblz4 = archive_liblz4_version();
+
+ if (!init) {
+ archive_string_init(&str);
+
+ archive_strcat(&str, ARCHIVE_VERSION_STRING);
+ if (zlib != NULL) {
+ archive_strcat(&str, " zlib/");
+ archive_strcat(&str, zlib);
+ }
+ if (liblzma) {
+ archive_strcat(&str, " liblzma/");
+ archive_strcat(&str, liblzma);
+ }
+ if (bzlib) {
+ const char *p = bzlib;
+ const char *sep = strchr(p, ',');
+ if (sep == NULL)
+ sep = p + strlen(p);
+ archive_strcat(&str, " bz2lib/");
+ archive_strncat(&str, p, sep - p);
+ }
+ if (liblz4) {
+ archive_strcat(&str, " liblz4/");
+ archive_strcat(&str, liblz4);
+ }
+ }
+ return str.s;
+}
+
+const char *
+archive_zlib_version(void)
+{
+#ifdef HAVE_ZLIB_H
+ return ZLIB_VERSION;
+#else
+ return NULL;
+#endif
+}
+
+const char *
+archive_liblzma_version(void)
+{
+#ifdef HAVE_LZMA_H
+ return LZMA_VERSION_STRING;
+#else
+ return NULL;
+#endif
+}
+
+const char *
+archive_bzlib_version(void)
+{
+#ifdef HAVE_BZLIB_H
+ return BZ2_bzlibVersion();
+#else
+ return NULL;
+#endif
+}
+
+const char *
+archive_liblz4_version(void)
+{
+#if defined(HAVE_LZ4_H) && defined(HAVE_LIBLZ4)
+#define str(s) #s
+#define NUMBER(x) str(x)
+ return NUMBER(LZ4_VERSION_MAJOR) "." NUMBER(LZ4_VERSION_MINOR) "." NUMBER(LZ4_VERSION_RELEASE);
+#undef NUMBER
+#undef str
+#else
+ return NULL;
+#endif
+}
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_add_filter.c b/Utilities/cmlibarchive/libarchive/archive_write_add_filter.c
index ad5dc83..08f518a 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_add_filter.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_add_filter.c
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
#include "archive_private.h"
/* A table that maps filter codes to functions. */
-static
+static const
struct { int code; int (*setter)(struct archive *); } codes[] =
{
{ ARCHIVE_FILTER_NONE, archive_write_add_filter_none },
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_by_name.c b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_by_name.c
index eac4011..85a8d47 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_by_name.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_by_name.c
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
#include "archive_private.h"
/* A table that maps names to functions. */
-static
+static const
struct { const char *name; int (*setter)(struct archive *); } names[] =
{
{ "b64encode", archive_write_add_filter_b64encode },
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_lz4.c b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_lz4.c
index e655185..15fd494 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_lz4.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_lz4.c
@@ -225,7 +225,7 @@ archive_filter_lz4_open(struct archive_write_filter *f)
struct private_data *data = (struct private_data *)f->data;
int ret;
size_t required_size;
- static size_t bkmap[] = { 64 * 1024, 256 * 1024, 1 * 1024 * 1024,
+ static size_t const bkmap[] = { 64 * 1024, 256 * 1024, 1 * 1024 * 1024,
4 * 1024 * 1024 };
size_t pre_block_size;
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_program.c b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_program.c
index 55b5e8e..660f693 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_program.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_program.c
@@ -92,7 +92,7 @@ archive_write_add_filter_program(struct archive *_a, const char *cmd)
{
struct archive_write_filter *f = __archive_write_allocate_filter(_a);
struct private_data *data;
- static const char *prefix = "Program: ";
+ static const char prefix[] = "Program: ";
archive_check_magic(_a, ARCHIVE_WRITE_MAGIC,
ARCHIVE_STATE_NEW, "archive_write_add_filter_program");
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_data.3 b/Utilities/cmlibarchive/libarchive/archive_write_data.3
index 0cdd25f..9c16cd9 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_data.3
+++ b/Utilities/cmlibarchive/libarchive/archive_write_data.3
@@ -24,11 +24,12 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 2, 2012
+.Dd February 28, 2017
.Dt ARCHIVE_WRITE_DATA 3
.Os
.Sh NAME
-.Nm archive_write_data
+.Nm archive_write_data ,
+.Nm archive_write_data_block
.Nd functions for creating archives
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -36,8 +37,27 @@ Streaming Archive Library (libarchive, -larchive)
.In archive.h
.Ft la_ssize_t
.Fn archive_write_data "struct archive *" "const void *" "size_t"
+.Ft la_ssize_t
+.Fn archive_write_data_block "struct archive *" "const void *" "size_t size" "int64_t offset"
.Sh DESCRIPTION
+.Bl -tag -width indent
+.It Fn archive_write_data
+Write data corresponding to the header just written.
+.It Fn archive_write_data_block
Write data corresponding to the header just written.
+This is like
+.Fn archive_write_data
+except that it performs a seek on the file being
+written to the specified offset before writing the data.
+This is useful when restoring sparse files from archive
+formats that support sparse files.
+Returns number of bytes written or -1 on error.
+(Note: This is currently not supported for
+.Tn archive_write
+handles, only for
+.Tn archive_write_disk
+handles.
+.El
.\" .Sh EXAMPLE
.\"
.Sh RETURN VALUES
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk.3 b/Utilities/cmlibarchive/libarchive/archive_write_disk.3
index ba6c970..949c9ef 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_disk.3
+++ b/Utilities/cmlibarchive/libarchive/archive_write_disk.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 2, 2012
+.Dd April 3, 2017
.Dt ARCHIVE_WRITE_DISK 3
.Os
.Sh NAME
@@ -33,14 +33,7 @@
.Nm archive_write_disk_set_skip_file ,
.Nm archive_write_disk_set_group_lookup ,
.Nm archive_write_disk_set_standard_lookup ,
-.Nm archive_write_disk_set_user_lookup ,
-.Nm archive_write_header ,
-.Nm archive_write_data ,
-.Nm archive_write_data_block ,
-.Nm archive_write_finish_entry ,
-.Nm archive_write_close ,
-.Nm archive_write_finish
-.Nm archive_write_free
+.Nm archive_write_disk_set_user_lookup
.Nd functions for creating objects on disk
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -68,20 +61,6 @@ Streaming Archive Library (libarchive, -larchive)
.Fa "uid_t (*)(void *, const char *uname, uid_t uid)"
.Fa "void (*cleanup)(void *)"
.Fc
-.Ft int
-.Fn archive_write_header "struct archive *" "struct archive_entry *"
-.Ft la_ssize_t
-.Fn archive_write_data "struct archive *" "const void *" "size_t"
-.Ft la_ssize_t
-.Fn archive_write_data_block "struct archive *" "const void *" "size_t size" "int64_t offset"
-.Ft int
-.Fn archive_write_finish_entry "struct archive *"
-.Ft int
-.Fn archive_write_close "struct archive *"
-.Ft int
-.Fn archive_write_finish "struct archive *"
-.Ft int
-.Fn archive_write_free "struct archive *"
.Sh DESCRIPTION
These functions provide a complete API for creating objects on
disk from
@@ -117,6 +96,33 @@ performance optimization in practice.
The options field consists of a bitwise OR of one or more of the
following values:
.Bl -tag -compact -width "indent"
+.It Cm ARCHIVE_EXTRACT_ACL
+Attempt to restore Access Control Lists.
+By default, extended ACLs are ignored.
+.It Cm ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS
+Before removing a file system object prior to replacing it, clear
+platform-specific file flags which might prevent its removal.
+.It Cm ARCHIVE_EXTRACT_FFLAGS
+Attempt to restore file attributes (file flags).
+By default, file attributes are ignored.
+See
+.Xr chattr 1
+.Pq Linux
+or
+.Xr chflags 1
+.Pq FreeBSD, Mac OS X
+for more information on file attributes.
+.It Cm ARCHIVE_EXTRACT_MAC_METADATA
+Mac OS X specific. Restore metadata using
+.Xr copyfile 3 .
+By default,
+.Xr copyfile 3
+metadata is ignored.
+.It Cm ARCHIVE_EXTRACT_NO_OVERWRITE
+Existing files on disk will not be overwritten.
+By default, existing regular files are truncated and overwritten;
+existing directories will have their permissions updated;
+other pre-existing objects are unlinked and recreated from scratch.
.It Cm ARCHIVE_EXTRACT_OWNER
The user and group IDs should be set on the restored file.
By default, the user and group IDs are not restored.
@@ -132,15 +138,37 @@ is not specified, then SUID and SGID bits will only be restored
if the default user and group IDs of newly-created objects on disk
happen to match those specified in the archive entry.
By default, only basic permissions are restored, and umask is obeyed.
+.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
+Refuse to extract an absolute path.
+The default is to not refuse such paths.
+.It Cm ARCHIVE_EXTRACT_SECURE_NODOTDOT
+Refuse to extract a path that contains a
+.Pa ..
+element anywhere within it.
+The default is to not refuse such paths.
+Note that paths ending in
+.Pa ..
+always cause an error, regardless of this flag.
+.It Cm ARCHIVE_EXTRACT_SECURE_SYMLINKS
+Refuse to extract any object whose final location would be altered
+by a symlink on disk.
+This is intended to help guard against a variety of mischief
+caused by archives that (deliberately or otherwise) extract
+files outside of the current directory.
+The default is not to perform this check.
+If
+.It Cm ARCHIVE_EXTRACT_SPARSE
+Scan data for blocks of NUL bytes and try to recreate them with holes.
+This results in sparse files, independent of whether the archive format
+supports or uses them.
+.Cm ARCHIVE_EXTRACT_UNLINK
+is specified together with this option, the library will
+remove any intermediate symlinks it finds and return an
+error only if such symlink could not be removed.
.It Cm ARCHIVE_EXTRACT_TIME
The timestamps (mtime, ctime, and atime) should be restored.
By default, they are ignored.
Note that restoring of atime is not currently supported.
-.It Cm ARCHIVE_EXTRACT_NO_OVERWRITE
-Existing files on disk will not be overwritten.
-By default, existing regular files are truncated and overwritten;
-existing directories will have their permissions updated;
-other pre-existing objects are unlinked and recreated from scratch.
.It Cm ARCHIVE_EXTRACT_UNLINK
Existing files on disk will be unlinked before any attempt to
create them.
@@ -148,45 +176,18 @@ In some cases, this can prove to be a significant performance improvement.
By default, existing files are truncated and rewritten, but
the file is not recreated.
In particular, the default behavior does not break existing hard links.
-.It Cm ARCHIVE_EXTRACT_ACL
-Attempt to restore ACLs.
-By default, extended ACLs are ignored.
-.It Cm ARCHIVE_EXTRACT_FFLAGS
-Attempt to restore extended file flags.
-By default, file flags are ignored.
.It Cm ARCHIVE_EXTRACT_XATTR
-Attempt to restore POSIX.1e extended attributes.
+Attempt to restore extended file attributes.
By default, they are ignored.
-.It Cm ARCHIVE_EXTRACT_SECURE_SYMLINKS
-Refuse to extract any object whose final location would be altered
-by a symlink on disk.
-This is intended to help guard against a variety of mischief
-caused by archives that (deliberately or otherwise) extract
-files outside of the current directory.
-The default is not to perform this check.
-If
-.Cm ARCHIVE_EXTRACT_UNLINK
-is specified together with this option, the library will
-remove any intermediate symlinks it finds and return an
-error only if such symlink could not be removed.
-.It Cm ARCHIVE_EXTRACT_SECURE_NODOTDOT
-Refuse to extract a path that contains a
-.Pa ..
-element anywhere within it.
-The default is to not refuse such paths.
-Note that paths ending in
-.Pa ..
-always cause an error, regardless of this flag.
-.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
-Refuse to extract an absolute path.
-The default is to not refuse such paths.
-.It Cm ARCHIVE_EXTRACT_SPARSE
-Scan data for blocks of NUL bytes and try to recreate them with holes.
-This results in sparse files, independent of whether the archive format
-supports or uses them.
-.It Cm ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS
-Before removing a file system object prior to replacing it, clear
-platform-specific file flags which might prevent its removal.
+See
+.Xr xattr 7
+.Pq Linux ,
+.Xr xattr 2
+.Pq Mac OS X ,
+or
+.Xr getextattr 8
+.Pq FreeBSD
+for more information on extended file attributes.
.El
.It Xo
.Fn archive_write_disk_set_group_lookup ,
@@ -223,60 +224,6 @@ the number of calls to
.Xr getpwnam 3
and
.Xr getgrnam 3 .
-.It Fn archive_write_header
-Build and write a header using the data in the provided
-.Tn struct archive_entry
-structure.
-See
-.Xr archive_entry 3
-for information on creating and populating
-.Tn struct archive_entry
-objects.
-.It Fn archive_write_data
-Write data corresponding to the header just written.
-Returns number of bytes written or -1 on error.
-.It Fn archive_write_data_block
-Write data corresponding to the header just written.
-This is like
-.Fn archive_write_data
-except that it performs a seek on the file being
-written to the specified offset before writing the data.
-This is useful when restoring sparse files from archive
-formats that support sparse files.
-Returns number of bytes written or -1 on error.
-(Note: This is currently not supported for
-.Tn archive_write
-handles, only for
-.Tn archive_write_disk
-handles.)
-.It Fn archive_write_finish_entry
-Close out the entry just written.
-Ordinarily, clients never need to call this, as it
-is called automatically by
-.Fn archive_write_next_header
-and
-.Fn archive_write_close
-as needed.
-However, some file attributes are written to disk only
-after the file is closed, so this can be necessary
-if you need to work with the file on disk right away.
-.It Fn archive_write_close
-Set any attributes that could not be set during the initial restore.
-For example, directory timestamps are not restored initially because
-restoring a subsequent file would alter that timestamp.
-Similarly, non-writable directories are initially created with
-write permissions (so that their contents can be restored).
-The
-.Nm
-library maintains a list of all such deferred attributes and
-sets them when this function is invoked.
-.It Fn archive_write_finish
-This is a deprecated synonym for
-.Fn archive_write_free .
-.It Fn archive_write_free
-Invokes
-.Fn archive_write_close
-if it was not invoked manually, then releases all resources.
.El
More information about the
.Va struct archive
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk_acl.c b/Utilities/cmlibarchive/libarchive/archive_write_disk_acl.c
deleted file mode 100644
index 144ab7e..0000000
--- a/Utilities/cmlibarchive/libarchive/archive_write_disk_acl.c
+++ /dev/null
@@ -1,654 +0,0 @@
-/*-
- * Copyright (c) 2003-2010 Tim Kientzle
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer
- * in this position and unchanged.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_disk.c 201159 2009-12-29 05:35:40Z kientzle $");
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_ACL_H
-#define _ACL_PRIVATE /* For debugging */
-#include <sys/acl.h>
-#endif
-#if HAVE_DARWIN_ACL
-#include <membership.h>
-#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#include "archive.h"
-#include "archive_entry.h"
-#include "archive_acl_private.h"
-#include "archive_write_disk_private.h"
-
-#if !HAVE_POSIX_ACL && !HAVE_NFS4_ACL
-/* Default empty function body to satisfy mainline code. */
-int
-archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
- struct archive_acl *abstract_acl)
-{
- (void)a; /* UNUSED */
- (void)fd; /* UNUSED */
- (void)name; /* UNUSED */
- (void)abstract_acl; /* UNUSED */
- return (ARCHIVE_OK);
-}
-
-#else /* HAVE_POSIX_ACL || HAVE_NFS4_ACL */
-
-#if HAVE_SUN_ACL
-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACE_T
-#elif HAVE_DARWIN_ACL
-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACL_TYPE_EXTENDED
-#elif HAVE_ACL_TYPE_NFS4
-#define ARCHIVE_PLATFORM_ACL_TYPE_NFS4 ACL_TYPE_NFS4
-#endif
-
-static int set_acl(struct archive *, int fd, const char *,
- struct archive_acl *,
- acl_type_t, int archive_entry_acl_type, const char *tn);
-
-int
-archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
- struct archive_acl *abstract_acl)
-{
- int ret = ARCHIVE_OK;
-
-#if !HAVE_DARWIN_ACL
- if ((archive_acl_types(abstract_acl)
- & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
-#if HAVE_SUN_ACL
- /* Solaris writes POSIX.1e access and default ACLs together */
- ret = set_acl(a, fd, name, abstract_acl, ACLENT_T,
- ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, "posix1e");
-#else /* HAVE_POSIX_ACL */
- if ((archive_acl_types(abstract_acl)
- & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
- ret = set_acl(a, fd, name, abstract_acl,
- ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- "access");
- if (ret != ARCHIVE_OK)
- return (ret);
- }
- if ((archive_acl_types(abstract_acl)
- & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
- ret = set_acl(a, fd, name, abstract_acl,
- ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
- "default");
-#endif /* !HAVE_SUN_ACL */
- /* Simultaneous POSIX.1e and NFSv4 is not supported */
- return (ret);
- }
-#endif /* !HAVE_DARWIN_ACL */
-#if HAVE_NFS4_ACL
- if ((archive_acl_types(abstract_acl) &
- ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
- ret = set_acl(a, fd, name, abstract_acl,
- ARCHIVE_PLATFORM_ACL_TYPE_NFS4,
- ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
- }
-#endif /* HAVE_NFS4_ACL */
- return (ret);
-}
-
-/*
- * Translate system ACL permissions into libarchive internal structure
- */
-static const struct {
- const int archive_perm;
- const int platform_perm;
-} acl_perm_map[] = {
-#if HAVE_SUN_ACL /* Solaris NFSv4 ACL permissions */
- {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE},
- {ARCHIVE_ENTRY_ACL_READ_DATA, ACE_READ_DATA},
- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACE_LIST_DIRECTORY},
- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACE_WRITE_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACE_ADD_FILE},
- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACE_APPEND_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACE_ADD_SUBDIRECTORY},
- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACE_READ_NAMED_ATTRS},
- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACE_WRITE_NAMED_ATTRS},
- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACE_DELETE_CHILD},
- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_DELETE, ACE_DELETE},
- {ARCHIVE_ENTRY_ACL_READ_ACL, ACE_READ_ACL},
- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACE_WRITE_ACL},
- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACE_WRITE_OWNER},
- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACE_SYNCHRONIZE}
-#elif HAVE_DARWIN_ACL /* MacOS ACL permissions */
- {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
- {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
- {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_EXTATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_EXTATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_SECURITY},
- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_SECURITY},
- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_CHANGE_OWNER},
- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
-#else /* POSIX.1e ACL permissions */
- {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
- {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
- {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
-#if HAVE_ACL_TYPE_NFS4 /* FreeBSD NFSv4 ACL permissions */
- {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS},
- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS},
- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
- {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL},
- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
-#endif
-#endif /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */
-};
-
-#if HAVE_NFS4_ACL
-/*
- * Translate system NFSv4 inheritance flags into libarchive internal structure
- */
-static const struct {
- const int archive_inherit;
- const int platform_inherit;
-} acl_inherit_map[] = {
-#if HAVE_SUN_ACL /* Solaris NFSv4 inheritance flags */
- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE},
- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE},
- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE},
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACE_INHERIT_ONLY_ACE},
- {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACE_SUCCESSFUL_ACCESS_ACE_FLAG},
- {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACE_FAILED_ACCESS_ACE_FLAG},
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACE_INHERITED_ACE}
-#elif HAVE_DARWIN_ACL /* MacOS NFSv4 inheritance flags */
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED},
- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_LIMIT_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_ONLY_INHERIT}
-#else /* FreeBSD NFSv4 ACL inheritance flags */
- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY},
- {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS},
- {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS},
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED}
-#endif /* !HAVE_SUN_ACL && !HAVE_DARWIN_ACL */
-};
-#endif /* HAVE_NFS4_ACL */
-
-static int
-set_acl(struct archive *a, int fd, const char *name,
- struct archive_acl *abstract_acl,
- acl_type_t acl_type, int ae_requested_type, const char *tname)
-{
-#if HAVE_SUN_ACL
- aclent_t *aclent;
- ace_t *ace;
- int e, r;
- acl_t *acl;
-#else
- acl_t acl;
- acl_entry_t acl_entry;
- acl_permset_t acl_permset;
-#if HAVE_ACL_TYPE_NFS4 || HAVE_DARWIN_ACL
- acl_flagset_t acl_flagset;
-#endif
-#endif /* HAVE_SUN_ACL */
-#if HAVE_ACL_TYPE_NFS4
- int r;
-#endif
- int ret;
- int ae_type, ae_permset, ae_tag, ae_id;
-#if HAVE_DARWIN_ACL
- uuid_t ae_uuid;
-#endif
- uid_t ae_uid;
- gid_t ae_gid;
- const char *ae_name;
- int entries;
- int i;
-
- ret = ARCHIVE_OK;
- entries = archive_acl_reset(abstract_acl, ae_requested_type);
- if (entries == 0)
- return (ARCHIVE_OK);
-
-#if HAVE_SUN_ACL
- acl = NULL;
- acl = malloc(sizeof(acl_t));
- if (acl == NULL) {
- archive_set_error(a, ARCHIVE_ERRNO_MISC,
- "Invalid ACL type");
- return (ARCHIVE_FAILED);
- }
- if (acl_type == ACE_T)
- acl->acl_entry_size = sizeof(ace_t);
- else if (acl_type == ACLENT_T)
- acl->acl_entry_size = sizeof(aclent_t);
- else {
- archive_set_error(a, ARCHIVE_ERRNO_MISC,
- "Invalid ACL type");
- acl_free(acl);
- return (ARCHIVE_FAILED);
- }
- acl->acl_type = acl_type;
- acl->acl_cnt = entries;
-
- acl->acl_aclp = malloc(entries * acl->acl_entry_size);
- if (acl->acl_aclp == NULL) {
- archive_set_error(a, errno,
- "Can't allocate memory for acl buffer");
- acl_free(acl);
- return (ARCHIVE_FAILED);
- }
-#else /* !HAVE_SUN_ACL */
- acl = acl_init(entries);
- if (acl == (acl_t)NULL) {
- archive_set_error(a, errno,
- "Failed to initialize ACL working storage");
- return (ARCHIVE_FAILED);
- }
-#endif /* !HAVE_SUN_ACL */
-#if HAVE_SUN_ACL
- e = 0;
-#endif
- while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
- &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
-#if HAVE_SUN_ACL
- ace = NULL;
- aclent = NULL;
- if (acl->acl_type == ACE_T) {
- ace = &((ace_t *)acl->acl_aclp)[e];
- ace->a_who = -1;
- ace->a_access_mask = 0;
- ace->a_flags = 0;
- } else {
- aclent = &((aclent_t *)acl->acl_aclp)[e];
- aclent->a_id = -1;
- aclent->a_type = 0;
- aclent->a_perm = 0;
- }
-#else /* !HAVE_SUN_ACL */
-#if HAVE_DARWIN_ACL
- /*
- * Mac OS doesn't support NFSv4 ACLs for
- * owner@, group@ and everyone@.
- * We skip any of these ACLs found.
- */
- if (ae_tag == ARCHIVE_ENTRY_ACL_USER_OBJ ||
- ae_tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ ||
- ae_tag == ARCHIVE_ENTRY_ACL_EVERYONE)
- continue;
-#endif
- if (acl_create_entry(&acl, &acl_entry) != 0) {
- archive_set_error(a, errno,
- "Failed to create a new ACL entry");
- ret = ARCHIVE_FAILED;
- goto exit_free;
- }
-#endif /* !HAVE_SUN_ACL */
-#if HAVE_DARWIN_ACL
- switch (ae_type) {
- case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
- acl_set_tag_type(acl_entry, ACL_EXTENDED_ALLOW);
- break;
- case ARCHIVE_ENTRY_ACL_TYPE_DENY:
- acl_set_tag_type(acl_entry, ACL_EXTENDED_DENY);
- break;
- default:
- /* We don't support any other types on MacOS */
- continue;
- }
-#endif
- switch (ae_tag) {
-#if HAVE_SUN_ACL
- case ARCHIVE_ENTRY_ACL_USER:
- ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
- if (acl->acl_type == ACE_T)
- ace->a_who = ae_uid;
- else {
- aclent->a_id = ae_uid;
- aclent->a_type |= USER;
- }
- break;
- case ARCHIVE_ENTRY_ACL_GROUP:
- ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
- if (acl->acl_type == ACE_T) {
- ace->a_who = ae_gid;
- ace->a_flags |= ACE_IDENTIFIER_GROUP;
- } else {
- aclent->a_id = ae_gid;
- aclent->a_type |= GROUP;
- }
- break;
- case ARCHIVE_ENTRY_ACL_USER_OBJ:
- if (acl->acl_type == ACE_T)
- ace->a_flags |= ACE_OWNER;
- else
- aclent->a_type |= USER_OBJ;
- break;
- case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
- if (acl->acl_type == ACE_T) {
- ace->a_flags |= ACE_GROUP;
- ace->a_flags |= ACE_IDENTIFIER_GROUP;
- } else
- aclent->a_type |= GROUP_OBJ;
- break;
- case ARCHIVE_ENTRY_ACL_MASK:
- aclent->a_type |= CLASS_OBJ;
- break;
- case ARCHIVE_ENTRY_ACL_OTHER:
- aclent->a_type |= OTHER_OBJ;
- break;
- case ARCHIVE_ENTRY_ACL_EVERYONE:
- ace->a_flags |= ACE_EVERYONE;
- break;
-#else /* !HAVE_SUN_ACL */
- case ARCHIVE_ENTRY_ACL_USER:
- ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
-#if !HAVE_DARWIN_ACL /* FreeBSD, Linux */
- acl_set_tag_type(acl_entry, ACL_USER);
- acl_set_qualifier(acl_entry, &ae_uid);
-#else /* MacOS */
- if (mbr_identifier_to_uuid(ID_TYPE_UID, &ae_uid,
- sizeof(uid_t), ae_uuid) != 0)
- continue;
- if (acl_set_qualifier(acl_entry, &ae_uuid) != 0)
- continue;
-#endif /* HAVE_DARWIN_ACL */
- break;
- case ARCHIVE_ENTRY_ACL_GROUP:
- ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
-#if !HAVE_DARWIN_ACL /* FreeBSD, Linux */
- acl_set_tag_type(acl_entry, ACL_GROUP);
- acl_set_qualifier(acl_entry, &ae_gid);
-#else /* MacOS */
- if (mbr_identifier_to_uuid(ID_TYPE_GID, &ae_gid,
- sizeof(gid_t), ae_uuid) != 0)
- continue;
- if (acl_set_qualifier(acl_entry, &ae_uuid) != 0)
- continue;
-#endif /* HAVE_DARWIN_ACL */
- break;
-#if !HAVE_DARWIN_ACL /* FreeBSD, Linux */
- case ARCHIVE_ENTRY_ACL_USER_OBJ:
- acl_set_tag_type(acl_entry, ACL_USER_OBJ);
- break;
- case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
- acl_set_tag_type(acl_entry, ACL_GROUP_OBJ);
- break;
- case ARCHIVE_ENTRY_ACL_MASK:
- acl_set_tag_type(acl_entry, ACL_MASK);
- break;
- case ARCHIVE_ENTRY_ACL_OTHER:
- acl_set_tag_type(acl_entry, ACL_OTHER);
- break;
-#if HAVE_ACL_TYPE_NFS4 /* FreeBSD only */
- case ARCHIVE_ENTRY_ACL_EVERYONE:
- acl_set_tag_type(acl_entry, ACL_EVERYONE);
- break;
-#endif
-#endif /* !HAVE_DARWIN_ACL */
-#endif /* !HAVE_SUN_ACL */
- default:
- archive_set_error(a, ARCHIVE_ERRNO_MISC,
- "Unknown ACL tag");
- ret = ARCHIVE_FAILED;
- goto exit_free;
- }
-
-#if HAVE_ACL_TYPE_NFS4 || HAVE_SUN_ACL
- r = 0;
- switch (ae_type) {
-#if HAVE_SUN_ACL
- case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
- if (ace != NULL)
- ace->a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
- else
- r = -1;
- break;
- case ARCHIVE_ENTRY_ACL_TYPE_DENY:
- if (ace != NULL)
- ace->a_type = ACE_ACCESS_DENIED_ACE_TYPE;
- else
- r = -1;
- break;
- case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
- if (ace != NULL)
- ace->a_type = ACE_SYSTEM_AUDIT_ACE_TYPE;
- else
- r = -1;
- break;
- case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
- if (ace != NULL)
- ace->a_type = ACE_SYSTEM_ALARM_ACE_TYPE;
- else
- r = -1;
- break;
- case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
- if (aclent == NULL)
- r = -1;
- break;
- case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
- if (aclent != NULL)
- aclent->a_type |= ACL_DEFAULT;
- else
- r = -1;
- break;
-#else /* !HAVE_SUN_ACL */
- case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
- r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW);
- break;
- case ARCHIVE_ENTRY_ACL_TYPE_DENY:
- r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_DENY);
- break;
- case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
- r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_AUDIT);
- break;
- case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
- r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALARM);
- break;
- case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
- case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
- // These don't translate directly into the system ACL.
- break;
-#endif /* !HAVE_SUN_ACL */
- default:
- archive_set_error(a, ARCHIVE_ERRNO_MISC,
- "Unknown ACL entry type");
- ret = ARCHIVE_FAILED;
- goto exit_free;
- }
-
- if (r != 0) {
-#if HAVE_SUN_ACL
- errno = EINVAL;
-#endif
- archive_set_error(a, errno,
- "Failed to set ACL entry type");
- ret = ARCHIVE_FAILED;
- goto exit_free;
- }
-#endif /* HAVE_ACL_TYPE_NFS4 || HAVE_SUN_ACL */
-
-#if HAVE_SUN_ACL
- if (acl->acl_type == ACLENT_T) {
- if (ae_permset & ARCHIVE_ENTRY_ACL_EXECUTE)
- aclent->a_perm |= 1;
- if (ae_permset & ARCHIVE_ENTRY_ACL_WRITE)
- aclent->a_perm |= 2;
- if (ae_permset & ARCHIVE_ENTRY_ACL_READ)
- aclent->a_perm |= 4;
- } else
-#else
- if (acl_get_permset(acl_entry, &acl_permset) != 0) {
- archive_set_error(a, errno,
- "Failed to get ACL permission set");
- ret = ARCHIVE_FAILED;
- goto exit_free;
- }
- if (acl_clear_perms(acl_permset) != 0) {
- archive_set_error(a, errno,
- "Failed to clear ACL permissions");
- ret = ARCHIVE_FAILED;
- goto exit_free;
- }
-#endif /* !HAVE_SUN_ACL */
- for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) {
- if (ae_permset & acl_perm_map[i].archive_perm) {
-#if HAVE_SUN_ACL
- ace->a_access_mask |=
- acl_perm_map[i].platform_perm;
-#else
- if (acl_add_perm(acl_permset,
- acl_perm_map[i].platform_perm) != 0) {
- archive_set_error(a, errno,
- "Failed to add ACL permission");
- ret = ARCHIVE_FAILED;
- goto exit_free;
- }
-#endif
- }
- }
-
-#if HAVE_NFS4_ACL
-#if HAVE_SUN_ACL
- if (acl_type == ACE_T)
-#elif HAVE_DARWIN_ACL
- if (acl_type == ACL_TYPE_EXTENDED)
-#else /* FreeBSD */
- if (acl_type == ACL_TYPE_NFS4)
-#endif
- {
-#if HAVE_POSIX_ACL || HAVE_DARWIN_ACL
- /*
- * acl_get_flagset_np() fails with non-NFSv4 ACLs
- */
- if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
- archive_set_error(a, errno,
- "Failed to get flagset from an NFSv4 ACL entry");
- ret = ARCHIVE_FAILED;
- goto exit_free;
- }
- if (acl_clear_flags_np(acl_flagset) != 0) {
- archive_set_error(a, errno,
- "Failed to clear flags from an NFSv4 ACL flagset");
- ret = ARCHIVE_FAILED;
- goto exit_free;
- }
-#endif /* HAVE_POSIX_ACL || HAVE_DARWIN_ACL */
- for (i = 0; i < (int)(sizeof(acl_inherit_map) /sizeof(acl_inherit_map[0])); ++i) {
- if (ae_permset & acl_inherit_map[i].archive_inherit) {
-#if HAVE_SUN_ACL
- ace->a_flags |=
- acl_inherit_map[i].platform_inherit;
-#else /* !HAVE_SUN_ACL */
- if (acl_add_flag_np(acl_flagset,
- acl_inherit_map[i].platform_inherit) != 0) {
- archive_set_error(a, errno,
- "Failed to add flag to NFSv4 ACL flagset");
- ret = ARCHIVE_FAILED;
- goto exit_free;
- }
-#endif /* HAVE_SUN_ACL */
- }
- }
- }
-#endif /* HAVE_NFS4_ACL */
-#if HAVE_SUN_ACL
- e++;
-#endif
- }
-
-#if HAVE_ACL_SET_FD_NP || HAVE_ACL_SET_FD || HAVE_SUN_ACL
- /* Try restoring the ACL through 'fd' if we can. */
-#if HAVE_SUN_ACL || HAVE_ACL_SET_FD_NP
- if (fd >= 0)
-#else /* !HAVE_SUN_ACL && !HAVE_ACL_SET_FD_NP */
- if (fd >= 0 && acl_type == ACL_TYPE_ACCESS)
-#endif
- {
-#if HAVE_SUN_ACL
- if (facl_set(fd, acl) == 0)
-#elif HAVE_ACL_SET_FD_NP
- if (acl_set_fd_np(fd, acl, acl_type) == 0)
-#else /* !HAVE_SUN_ACL && !HAVE_ACL_SET_FD_NP */
- if (acl_set_fd(fd, acl) == 0)
-#endif
- ret = ARCHIVE_OK;
- else {
- if (errno == EOPNOTSUPP) {
- /* Filesystem doesn't support ACLs */
- ret = ARCHIVE_OK;
- } else {
- archive_set_error(a, errno,
- "Failed to set %s acl on fd", tname);
- }
- }
- } else
-#endif /* HAVE_ACL_SET_FD_NP || HAVE_ACL_SET_FD || HAVE_SUN_ACL */
-#if HAVE_SUN_ACL
- if (acl_set(name, acl) != 0)
-#elif HAVE_ACL_SET_LINK_NP
- if (acl_set_link_np(name, acl_type, acl) != 0)
-#else
- /* TODO: Skip this if 'name' is a symlink. */
- if (acl_set_file(name, acl_type, acl) != 0)
-#endif
- {
- if (errno == EOPNOTSUPP) {
- /* Filesystem doesn't support ACLs */
- ret = ARCHIVE_OK;
- } else {
- archive_set_error(a, errno, "Failed to set %s acl",
- tname);
- ret = ARCHIVE_WARN;
- }
- }
-exit_free:
- acl_free(acl);
- return (ret);
-}
-#endif /* HAVE_POSIX_ACL || HAVE_NFS4_ACL */
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
index a5f3067..4a42a3b 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
@@ -39,9 +39,9 @@ __FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_EXTATTR_H
#include <sys/extattr.h>
#endif
-#if defined(HAVE_SYS_XATTR_H)
+#if HAVE_SYS_XATTR_H
#include <sys/xattr.h>
-#elif defined(HAVE_ATTR_XATTR_H)
+#elif HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#endif
#ifdef HAVE_SYS_EA_H
@@ -575,10 +575,55 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
if (a->flags & ARCHIVE_EXTRACT_TIME)
a->todo |= TODO_TIMES;
if (a->flags & ARCHIVE_EXTRACT_ACL) {
+#if ARCHIVE_ACL_DARWIN
+ /*
+ * On MacOS, platform ACLs get stored in mac_metadata, too.
+ * If we intend to extract mac_metadata and it is present
+ * we skip extracting libarchive NFSv4 ACLs.
+ */
+ size_t metadata_size;
+
+ if ((a->flags & ARCHIVE_EXTRACT_MAC_METADATA) == 0 ||
+ archive_entry_mac_metadata(a->entry,
+ &metadata_size) == NULL || metadata_size == 0)
+#endif
+#if ARCHIVE_ACL_LIBRICHACL
+ /*
+ * RichACLs are stored in an extended attribute.
+ * If we intend to extract extended attributes and have this
+ * attribute we skip extracting libarchive NFSv4 ACLs.
+ */
+ short extract_acls = 1;
+ if (a->flags & ARCHIVE_EXTRACT_XATTR && (
+ archive_entry_acl_types(a->entry) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4)) {
+ const char *attr_name;
+ const void *attr_value;
+ size_t attr_size;
+ int i = archive_entry_xattr_reset(a->entry);
+ while (i--) {
+ archive_entry_xattr_next(a->entry, &attr_name,
+ &attr_value, &attr_size);
+ if (attr_name != NULL && attr_value != NULL &&
+ attr_size > 0 && strcmp(attr_name,
+ "trusted.richacl") == 0) {
+ extract_acls = 0;
+ break;
+ }
+ }
+ }
+ if (extract_acls)
+#endif
+#if ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_LIBRICHACL
+ {
+#endif
if (archive_entry_filetype(a->entry) == AE_IFDIR)
a->deferred |= TODO_ACLS;
else
a->todo |= TODO_ACLS;
+#if ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_LIBRICHACL
+ }
+#endif
}
if (a->flags & ARCHIVE_EXTRACT_MAC_METADATA) {
if (archive_entry_filetype(a->entry) == AE_IFDIR)
@@ -619,8 +664,21 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
}
#endif
- if (a->flags & ARCHIVE_EXTRACT_XATTR)
+ if (a->flags & ARCHIVE_EXTRACT_XATTR) {
+#if ARCHIVE_XATTR_DARWIN
+ /*
+ * On MacOS, extended attributes get stored in mac_metadata,
+ * too. If we intend to extract mac_metadata and it is present
+ * we skip extracting extended attributes.
+ */
+ size_t metadata_size;
+
+ if ((a->flags & ARCHIVE_EXTRACT_MAC_METADATA) == 0 ||
+ archive_entry_mac_metadata(a->entry,
+ &metadata_size) == NULL || metadata_size == 0)
+#endif
a->todo |= TODO_XATTR;
+ }
if (a->flags & ARCHIVE_EXTRACT_FFLAGS)
a->todo |= TODO_FFLAGS;
if (a->flags & ARCHIVE_EXTRACT_SECURE_SYMLINKS) {
@@ -1703,25 +1761,11 @@ _archive_write_disk_finish_entry(struct archive *_a)
*/
if (a->todo & TODO_ACLS) {
int r2;
-#ifdef HAVE_DARWIN_ACL
- /*
- * On Mac OS, platform ACLs are stored also in mac_metadata by
- * the operating system. If mac_metadata is present it takes
- * precedence and we skip extracting libarchive NFSv4 ACLs
- */
- const void *metadata;
- size_t metadata_size;
- metadata = archive_entry_mac_metadata(a->entry, &metadata_size);
- if ((a->todo & TODO_MAC_METADATA) == 0 ||
- metadata == NULL || metadata_size == 0) {
-#endif
r2 = archive_write_disk_set_acls(&a->archive, a->fd,
archive_entry_pathname(a->entry),
- archive_entry_acl(a->entry));
+ archive_entry_acl(a->entry),
+ archive_entry_mode(a->entry));
if (r2 < ret) ret = r2;
-#ifdef HAVE_DARWIN_ACL
- }
-#endif
}
finish_metadata:
@@ -2293,13 +2337,8 @@ _archive_write_disk_close(struct archive *_a)
if (p->fixup & TODO_MODE_BASE)
chmod(p->name, p->mode);
if (p->fixup & TODO_ACLS)
-#ifdef HAVE_DARWIN_ACL
- if ((p->fixup & TODO_MAC_METADATA) == 0 ||
- p->mac_metadata == NULL ||
- p->mac_metadata_size == 0)
-#endif
- archive_write_disk_set_acls(&a->archive,
- -1, p->name, &p->acl);
+ archive_write_disk_set_acls(&a->archive, -1, p->name,
+ &p->acl, p->mode);
if (p->fixup & TODO_FFLAGS)
set_fflags_platform(a, -1, p->name,
p->mode, p->fflags_set, 0);
@@ -2467,7 +2506,7 @@ fsobj_error(int *a_eno, struct archive_string *a_estr,
if (a_eno)
*a_eno = err;
if (a_estr)
- archive_string_sprintf(a_estr, errstr, path);
+ archive_string_sprintf(a_estr, "%s%s", errstr, path);
}
/*
@@ -2573,7 +2612,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
* with the deep-directory editing.
*/
fsobj_error(a_eno, a_estr, errno,
- "Could not stat %s", path);
+ "Could not stat ", path);
res = ARCHIVE_FAILED;
break;
}
@@ -2582,7 +2621,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
if (chdir(head) != 0) {
tail[0] = c;
fsobj_error(a_eno, a_estr, errno,
- "Could not chdir %s", path);
+ "Could not chdir ", path);
res = (ARCHIVE_FATAL);
break;
}
@@ -2599,7 +2638,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
if (unlink(head)) {
tail[0] = c;
fsobj_error(a_eno, a_estr, errno,
- "Could not remove symlink %s",
+ "Could not remove symlink ",
path);
res = ARCHIVE_FAILED;
break;
@@ -2618,7 +2657,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
/*
if (!S_ISLNK(path)) {
fsobj_error(a_eno, a_estr, 0,
- "Removing symlink %s", path);
+ "Removing symlink ", path);
}
*/
/* Symlink gone. No more problem! */
@@ -2630,7 +2669,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
tail[0] = c;
fsobj_error(a_eno, a_estr, 0,
"Cannot remove intervening "
- "symlink %s", path);
+ "symlink ", path);
res = ARCHIVE_FAILED;
break;
}
@@ -2652,7 +2691,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
} else {
fsobj_error(a_eno, a_estr,
errno,
- "Could not stat %s", path);
+ "Could not stat ", path);
res = (ARCHIVE_FAILED);
break;
}
@@ -2661,7 +2700,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
tail[0] = c;
fsobj_error(a_eno, a_estr,
errno,
- "Could not chdir %s", path);
+ "Could not chdir ", path);
res = (ARCHIVE_FATAL);
break;
}
@@ -2674,14 +2713,14 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
tail[0] = c;
fsobj_error(a_eno, a_estr, 0,
"Cannot extract through "
- "symlink %s", path);
+ "symlink ", path);
res = ARCHIVE_FAILED;
break;
}
} else {
tail[0] = c;
fsobj_error(a_eno, a_estr, 0,
- "Cannot extract through symlink %s", path);
+ "Cannot extract through symlink ", path);
res = ARCHIVE_FAILED;
break;
}
@@ -4044,71 +4083,98 @@ skip_appledouble:
}
#endif
-#if HAVE_LSETXATTR || HAVE_LSETEA
+#if ARCHIVE_XATTR_LINUX || ARCHIVE_XATTR_DARWIN || ARCHIVE_XATTR_AIX
/*
- * Restore extended attributes - Linux and AIX implementations:
+ * Restore extended attributes - Linux, Darwin and AIX implementations:
* AIX' ea interface is syntaxwise identical to the Linux xattr interface.
*/
static int
set_xattrs(struct archive_write_disk *a)
{
struct archive_entry *entry = a->entry;
- static int warning_done = 0;
+ struct archive_string errlist;
int ret = ARCHIVE_OK;
int i = archive_entry_xattr_reset(entry);
+ short fail = 0;
+
+ archive_string_init(&errlist);
while (i--) {
const char *name;
const void *value;
size_t size;
+ int e;
+
archive_entry_xattr_next(entry, &name, &value, &size);
- if (name != NULL &&
- strncmp(name, "xfsroot.", 8) != 0 &&
- strncmp(name, "system.", 7) != 0) {
- int e;
-#if HAVE_FSETXATTR
- if (a->fd >= 0)
- e = fsetxattr(a->fd, name, value, size, 0);
- else
-#elif HAVE_FSETEA
- if (a->fd >= 0)
- e = fsetea(a->fd, name, value, size, 0);
- else
+
+ if (name == NULL)
+ continue;
+#if ARCHIVE_XATTR_LINUX
+ /* Linux: quietly skip POSIX.1e ACL extended attributes */
+ if (strncmp(name, "system.", 7) == 0 &&
+ (strcmp(name + 7, "posix_acl_access") == 0 ||
+ strcmp(name + 7, "posix_acl_default") == 0))
+ continue;
+ if (strncmp(name, "trusted.SGI_", 12) == 0 &&
+ (strcmp(name + 12, "ACL_DEFAULT") == 0 ||
+ strcmp(name + 12, "ACL_FILE") == 0))
+ continue;
+
+ /* Linux: xfsroot namespace is obsolete and unsupported */
+ if (strncmp(name, "xfsroot.", 8) == 0) {
+ fail = 1;
+ archive_strcat(&errlist, name);
+ archive_strappend_char(&errlist, ' ');
+ continue;
+ }
#endif
- {
-#if HAVE_LSETXATTR
- e = lsetxattr(archive_entry_pathname(entry),
- name, value, size, 0);
-#elif HAVE_LSETEA
- e = lsetea(archive_entry_pathname(entry),
- name, value, size, 0);
+
+ if (a->fd >= 0) {
+#if ARCHIVE_XATTR_LINUX
+ e = fsetxattr(a->fd, name, value, size, 0);
+#elif ARCHIVE_XATTR_DARWIN
+ e = fsetxattr(a->fd, name, value, size, 0, 0);
+#elif ARCHIVE_XATTR_AIX
+ e = fsetea(a->fd, name, value, size, 0);
#endif
- }
- if (e == -1) {
- if (errno == ENOTSUP || errno == ENOSYS) {
- if (!warning_done) {
- warning_done = 1;
- archive_set_error(&a->archive,
- errno,
- "Cannot restore extended "
- "attributes on this file "
- "system");
- }
- } else
- archive_set_error(&a->archive, errno,
- "Failed to set extended attribute");
- ret = ARCHIVE_WARN;
- }
} else {
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "Invalid extended attribute encountered");
+#if ARCHIVE_XATTR_LINUX
+ e = lsetxattr(archive_entry_pathname(entry),
+ name, value, size, 0);
+#elif ARCHIVE_XATTR_DARWIN
+ e = setxattr(archive_entry_pathname(entry),
+ name, value, size, 0, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
+ e = lsetea(archive_entry_pathname(entry),
+ name, value, size, 0);
+#endif
+ }
+ if (e == -1) {
ret = ARCHIVE_WARN;
+ archive_strcat(&errlist, name);
+ archive_strappend_char(&errlist, ' ');
+ if (errno != ENOTSUP && errno != ENOSYS)
+ fail = 1;
}
}
+
+ if (ret == ARCHIVE_WARN) {
+ if (fail && errlist.length > 0) {
+ errlist.length--;
+ errlist.s[errlist.length] = '\0';
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot restore extended attributes: %s",
+ errlist.s);
+ } else
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot restore extended "
+ "attributes on this file system.");
+ }
+
+ archive_string_free(&errlist);
return (ret);
}
-#elif HAVE_EXTATTR_SET_FILE && HAVE_DECL_EXTATTR_NAMESPACE_USER
+#elif ARCHIVE_XATTR_FREEBSD
/*
* Restore extended attributes - FreeBSD implementation
*/
@@ -4116,9 +4182,12 @@ static int
set_xattrs(struct archive_write_disk *a)
{
struct archive_entry *entry = a->entry;
- static int warning_done = 0;
+ struct archive_string errlist;
int ret = ARCHIVE_OK;
int i = archive_entry_xattr_reset(entry);
+ short fail = 0;
+
+ archive_string_init(&errlist);
while (i--) {
const char *name;
@@ -4134,46 +4203,47 @@ set_xattrs(struct archive_write_disk *a)
name += 5;
namespace = EXTATTR_NAMESPACE_USER;
} else {
- /* Warn about other extended attributes. */
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "Can't restore extended attribute ``%s''",
- name);
+ /* Other namespaces are unsupported */
+ archive_strcat(&errlist, name);
+ archive_strappend_char(&errlist, ' ');
+ fail = 1;
ret = ARCHIVE_WARN;
continue;
}
- errno = 0;
-#if HAVE_EXTATTR_SET_FD
- if (a->fd >= 0)
+
+ if (a->fd >= 0) {
e = extattr_set_fd(a->fd, namespace, name,
value, size);
- else
-#endif
- /* TODO: should we use extattr_set_link() instead? */
- {
- e = extattr_set_file(
+ } else {
+ e = extattr_set_link(
archive_entry_pathname(entry), namespace,
name, value, size);
}
if (e != (int)size) {
- if (errno == ENOTSUP || errno == ENOSYS) {
- if (!warning_done) {
- warning_done = 1;
- archive_set_error(&a->archive,
- errno,
- "Cannot restore extended "
- "attributes on this file "
- "system");
- }
- } else {
- archive_set_error(&a->archive, errno,
- "Failed to set extended attribute");
- }
-
+ archive_strcat(&errlist, name);
+ archive_strappend_char(&errlist, ' ');
ret = ARCHIVE_WARN;
+ if (errno != ENOTSUP && errno != ENOSYS)
+ fail = 1;
}
}
}
+
+ if (ret == ARCHIVE_WARN) {
+ if (fail && errlist.length > 0) {
+ errlist.length--;
+ errlist.s[errlist.length] = '\0';
+
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot restore extended attributes: %s",
+ errlist.s);
+ } else
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot restore extended "
+ "attributes on this file system.");
+ }
+
+ archive_string_free(&errlist);
return (ret);
}
#else
@@ -4239,5 +4309,19 @@ older(struct stat *st, struct archive_entry *entry)
return (0);
}
+#ifndef ARCHIVE_ACL_SUPPORT
+int
+archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode)
+{
+ (void)a; /* UNUSED */
+ (void)fd; /* UNUSED */
+ (void)name; /* UNUSED */
+ (void)abstract_acl; /* UNUSED */
+ (void)mode; /* UNUSED */
+ return (ARCHIVE_OK);
+}
+#endif
+
#endif /* !_WIN32 || __CYGWIN__ */
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk_private.h b/Utilities/cmlibarchive/libarchive/archive_write_disk_private.h
index d84e7e1..b655dea 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_disk_private.h
+++ b/Utilities/cmlibarchive/libarchive/archive_write_disk_private.h
@@ -33,11 +33,13 @@
#ifndef ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED
#define ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED
+#include "archive_platform_acl.h"
#include "archive_acl_private.h"
+#include "archive_entry.h"
struct archive_write_disk;
-int
-archive_write_disk_set_acls(struct archive *, int /* fd */, const char * /* pathname */, struct archive_acl *);
+int archive_write_disk_set_acls(struct archive *, int, const char *,
+ struct archive_acl *, __LA_MODE_T);
#endif
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_finish_entry.3 b/Utilities/cmlibarchive/libarchive/archive_write_finish_entry.3
index c5ef69e..dc1b94b 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_finish_entry.3
+++ b/Utilities/cmlibarchive/libarchive/archive_write_finish_entry.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 2, 2012
+.Dd February 28, 2017
.Dt ARCHIVE_WRITE_FINISH_ENTRY 3
.Os
.Sh NAME
@@ -45,6 +45,9 @@ is called automatically by
and
.Fn archive_write_close
as needed.
+For
+.Tn archive_write_disk
+handles, this flushes pending file attribute changes like modification time.
.\" .Sh EXAMPLE
.Sh RETURN VALUES
This function returns
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_format.3 b/Utilities/cmlibarchive/libarchive/archive_write_format.3
index d4ba6ab..aaafb0a 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_format.3
+++ b/Utilities/cmlibarchive/libarchive/archive_write_format.3
@@ -108,7 +108,6 @@ Streaming Archive Library (libarchive, -larchive)
These functions set the format that will be used for the archive.
.Pp
The library can write a variety of common archive formats.
-
.Bl -tag -width indent
.It Fn archive_write_set_format
Sets the format based on the format code (see
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format.c
index 744302d..0f70623 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format.c
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format.c 201168 2009-1
#include "archive_private.h"
/* A table that maps format codes to functions. */
-static
+static const
struct { int code; int (*setter)(struct archive *); } codes[] =
{
{ ARCHIVE_FORMAT_7ZIP, archive_write_set_format_7zip },
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_by_name.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_by_name.c
index a2ce7c6..86e8621 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_by_name.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_by_name.c
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_by_name.c 20116
#include "archive_private.h"
/* A table that maps names to functions. */
-static
+static const
struct { const char *name; int (*setter)(struct archive *); } names[] =
{
{ "7zip", archive_write_set_format_7zip },
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_filter_by_ext.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_filter_by_ext.c
index adec9b2..9fe21e4 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_filter_by_ext.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_filter_by_ext.c
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_by_name.c 20116
#include "archive_private.h"
/* A table that maps names to functions. */
-static
+static const
struct { const char *name; int (*format)(struct archive *); int (*filter)(struct archive *); } names[] =
{
{ ".7z", archive_write_set_format_7zip, archive_write_add_filter_none},
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c
index 6a301ac..0eaf733 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c
@@ -1196,8 +1196,12 @@ archive_write_pax_header(struct archive_write *a,
"GNU.sparse.major", 1);
add_pax_attr_int(&(pax->pax_header),
"GNU.sparse.minor", 0);
+ /*
+ * Make sure to store the original path, since
+ * truncation to ustar limit happened already.
+ */
add_pax_attr(&(pax->pax_header),
- "GNU.sparse.name", entry_name.s);
+ "GNU.sparse.name", path);
add_pax_attr_int(&(pax->pax_header),
"GNU.sparse.realsize",
archive_entry_size(entry_main));
@@ -1650,13 +1654,14 @@ build_pax_attribute_name(char *dest, const char *src)
* GNU PAX Format 1.0 requires the special name, which pattern is:
* <dir>/GNUSparseFile.<pid>/<original file name>
*
+ * Since reproducable archives are more important, use 0 as pid.
+ *
* This function is used for only Sparse file, a file type of which
* is regular file.
*/
static char *
build_gnu_sparse_name(char *dest, const char *src)
{
- char buff[64];
const char *p;
/* Handle the null filename case. */
@@ -1682,15 +1687,9 @@ build_gnu_sparse_name(char *dest, const char *src)
break;
}
-#if HAVE_GETPID && 0 /* Disable this as pax attribute name. */
- sprintf(buff, "GNUSparseFile.%d", getpid());
-#else
- /* If the platform can't fetch the pid, don't include it. */
- strcpy(buff, "GNUSparseFile");
-#endif
/* General case: build a ustar-compatible name adding
* "/GNUSparseFile/". */
- build_ustar_entry_name(dest, src, p - src, buff);
+ build_ustar_entry_name(dest, src, p - src, "GNUSparseFile.0");
return (dest);
}
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_warc.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_warc.c
index 8b6daf9..edad072 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_warc.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_warc.c
@@ -354,7 +354,7 @@ static ssize_t
_popul_ehdr(struct archive_string *tgt, size_t tsz, warc_essential_hdr_t hdr)
{
static const char _ver[] = "WARC/1.0\r\n";
- static const char *_typ[LAST_WT] = {
+ static const char * const _typ[LAST_WT] = {
NULL, "warcinfo", "metadata", "resource", NULL
};
char std_uuid[48U];
diff --git a/Utilities/cmlibarchive/libarchive/config_freebsd.h b/Utilities/cmlibarchive/libarchive/config_freebsd.h
index 215e886..be25258 100644
--- a/Utilities/cmlibarchive/libarchive/config_freebsd.h
+++ b/Utilities/cmlibarchive/libarchive/config_freebsd.h
@@ -22,141 +22,238 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: head/lib/libarchive/config_freebsd.h 201079 2009-12-28 02:01:42Z kientzle $
+ * $FreeBSD$
*/
-/* FreeBSD 5.0 and later have ACL and extattr support. */
+#include <osreldate.h>
+
+/* FreeBSD 5.0 and later has ACL and extattr support. */
#if __FreeBSD__ > 4
-#define HAVE_ACL_CREATE_ENTRY 1
-#define HAVE_ACL_GET_FD_NP 1
-#define HAVE_ACL_GET_LINK_NP 1
-#define HAVE_ACL_GET_PERM_NP 1
-#define HAVE_ACL_INIT 1
-#define HAVE_ACL_SET_FD 1
-#define HAVE_ACL_SET_FD_NP 1
-#define HAVE_ACL_SET_FILE 1
-#define HAVE_ACL_USER 1
-#define HAVE_EXTATTR_GET_FILE 1
-#define HAVE_EXTATTR_LIST_FILE 1
-#define HAVE_EXTATTR_SET_FD 1
-#define HAVE_EXTATTR_SET_FILE 1
-#define HAVE_STRUCT_XVFSCONF 1
-#define HAVE_SYS_ACL_H 1
-#define HAVE_SYS_EXTATTR_H 1
-#endif
+#define ARCHIVE_ACL_FREEBSD 1
+#define HAVE_ACL_GET_PERM_NP 1
+#define HAVE_ARC4RANDOM_BUF 1
+#define HAVE_EXTATTR_GET_FILE 1
+#define HAVE_EXTATTR_LIST_FILE 1
+#define HAVE_EXTATTR_SET_FD 1
+#define HAVE_EXTATTR_SET_FILE 1
+#define HAVE_STRUCT_XVFSCONF 1
+#define HAVE_SYS_ACL_H 1
+#define HAVE_SYS_EXTATTR_H 1
+#if __FreeBSD__ > 7
+/* FreeBSD 8.0 and later has NFSv4 ACL support */
+#define ARCHIVE_ACL_FREEBSD_NFS4 1
+#define HAVE_ACL_GET_LINK_NP 1
+#define HAVE_ACL_IS_TRIVIAL_NP 1
+#define HAVE_ACL_SET_LINK_NP 1
+#endif /* __FreeBSD__ > 7 */
+#endif /* __FreeBSD__ > 4 */
#ifdef WITH_OPENSSL
-#define HAVE_OPENSSL_MD5_H 1
-#define HAVE_OPENSSL_RIPEMD_H 1
-#define HAVE_OPENSSL_SHA_H 1
-#define HAVE_SHA384 1
-#define HAVE_SHA512 1
+#define HAVE_LIBCRYPTO 1
+#define HAVE_OPENSSL_EVP_H 1
+#define HAVE_OPENSSL_MD5_H 1
+#define HAVE_OPENSSL_RIPEMD_H 1
+#define HAVE_OPENSSL_SHA_H 1
+#define HAVE_OPENSSL_SHA256_INIT 1
+#define HAVE_OPENSSL_SHA384_INIT 1
+#define HAVE_OPENSSL_SHA512_INIT 1
+#define HAVE_PKCS5_PBKDF2_HMAC_SHA1 1
+#define HAVE_SHA256 1
+#define HAVE_SHA384 1
+#define HAVE_SHA512 1
+#else
+#define HAVE_LIBMD 1
+#define HAVE_MD5_H 1
+#define HAVE_MD5INIT 1
+#define HAVE_RIPEMD_H 1
+#define HAVE_SHA_H 1
+#define HAVE_SHA1 1
+#define HAVE_SHA1_INIT 1
+#define HAVE_SHA256 1
+#define HAVE_SHA256_H 1
+#define HAVE_SHA256_INIT 1
+#define HAVE_SHA512 1
+#define HAVE_SHA512_H 1
+#define HAVE_SHA512_INIT 1
#endif
-#define HAVE_BSDXML_H 1
-#define HAVE_BZLIB_H 1
-#define HAVE_CHFLAGS 1
-#define HAVE_CHOWN 1
-#define HAVE_DECL_INT64_MAX 1
-#define HAVE_DECL_INT64_MIN 1
-#define HAVE_DECL_SIZE_MAX 1
-#define HAVE_DECL_SSIZE_MAX 1
-#define HAVE_DECL_STRERROR_R 1
-#define HAVE_DECL_UINT32_MAX 1
-#define HAVE_DECL_UINT64_MAX 1
-#define HAVE_DIRENT_H 1
-#define HAVE_EFTYPE 1
-#define HAVE_EILSEQ 1
-#define HAVE_ERRNO_H 1
-#define HAVE_FCHDIR 1
-#define HAVE_FCHFLAGS 1
-#define HAVE_FCHMOD 1
-#define HAVE_FCHOWN 1
-#define HAVE_FCNTL 1
-#define HAVE_FCNTL_H 1
-#define HAVE_FSEEKO 1
-#define HAVE_FSTAT 1
-#define HAVE_FTRUNCATE 1
-#define HAVE_FUTIMES 1
-#define HAVE_GETEUID 1
-#define HAVE_GETGRGID_R 1
-#define HAVE_GETPID 1
-#define HAVE_GETPWUID_R 1
-#define HAVE_GRP_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_LCHFLAGS 1
-#define HAVE_LCHMOD 1
-#define HAVE_LCHOWN 1
-#define HAVE_LIMITS_H 1
-#define HAVE_LINK 1
-#define HAVE_LSTAT 1
-#define HAVE_LUTIMES 1
-#define HAVE_MALLOC 1
-#define HAVE_MD5 1
-#define HAVE_MD5_H 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MKDIR 1
-#define HAVE_MKFIFO 1
-#define HAVE_MKNOD 1
-#define HAVE_PIPE 1
-#define HAVE_POLL 1
-#define HAVE_POLL_H 1
-#define HAVE_PWD_H 1
-#define HAVE_READLINK 1
-#define HAVE_RMD160 1
-#define HAVE_SELECT 1
-#define HAVE_SETENV 1
-#define HAVE_SHA_H 1
-#define HAVE_SHA1 1
-#define HAVE_SHA256 1
-#define HAVE_SHA256_H 1
-#define HAVE_SIGNAL_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRCHR 1
-#define HAVE_STRDUP 1
-#define HAVE_STRERROR 1
-#define HAVE_STRERROR_R 1
-#define HAVE_STRINGS_H 1
-#define HAVE_STRING_H 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
-#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
-#define HAVE_STRUCT_STAT_ST_FLAGS 1
-#define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
-#define HAVE_STRUCT_TM_TM_GMTOFF 1
-#define HAVE_SYMLINK 1
-#define HAVE_SYS_CDEFS_H 1
-#define HAVE_SYS_IOCTL_H 1
-#define HAVE_SYS_MOUNT_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_STAT_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_TYPES_H 1
-#undef HAVE_SYS_UTIME_H
-#define HAVE_SYS_UTSNAME_H 1
-#define HAVE_SYS_WAIT_H 1
-#define HAVE_TIMEGM 1
-#define HAVE_TZSET 1
-#define HAVE_UNISTD_H 1
-#define HAVE_UNSETENV 1
-#define HAVE_UTIME 1
-#define HAVE_UTIMES 1
-#define HAVE_UTIME_H 1
-#define HAVE_VFORK 1
-#define HAVE_WCHAR_H 1
-#define HAVE_WCSCPY 1
-#define HAVE_WCSLEN 1
-#define HAVE_WCTOMB 1
-#define HAVE_WMEMCMP 1
-#define HAVE_WMEMCPY 1
-#define HAVE_ZLIB_H 1
-#define TIME_WITH_SYS_TIME 1
+#define HAVE_BSDXML_H 1
+#define HAVE_BZLIB_H 1
+#define HAVE_CHFLAGS 1
+#define HAVE_CHOWN 1
+#define HAVE_CHROOT 1
+#define HAVE_CTIME_R 1
+#define HAVE_CTYPE_H 1
+#define HAVE_DECL_EXTATTR_NAMESPACE_USER 1
+#define HAVE_DECL_INT32_MAX 1
+#define HAVE_DECL_INT32_MIN 1
+#define HAVE_DECL_INT64_MAX 1
+#define HAVE_DECL_INT64_MIN 1
+#define HAVE_DECL_INTMAX_MAX 1
+#define HAVE_DECL_INTMAX_MIN 1
+#define HAVE_DECL_SIZE_MAX 1
+#define HAVE_DECL_SSIZE_MAX 1
+#define HAVE_DECL_STRERROR_R 1
+#define HAVE_DECL_UINT32_MAX 1
+#define HAVE_DECL_UINT64_MAX 1
+#define HAVE_DECL_UINTMAX_MAX 1
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_D_MD_ORDER 1
+#define HAVE_EFTYPE 1
+#define HAVE_EILSEQ 1
+#define HAVE_ERRNO_H 1
+#define HAVE_FCHDIR 1
+#define HAVE_FCHFLAGS 1
+#define HAVE_FCHMOD 1
+#define HAVE_FCHOWN 1
+#define HAVE_FCNTL 1
+#define HAVE_FCNTL_H 1
+#define HAVE_FDOPENDIR 1
+#define HAVE_FORK 1
+#define HAVE_FSEEKO 1
+#define HAVE_FSTAT 1
+#define HAVE_FSTATAT 1
+#define HAVE_FSTATFS 1
+#define HAVE_FSTATVFS 1
+#define HAVE_FTRUNCATE 1
+#define HAVE_FUTIMES 1
+#define HAVE_FUTIMESAT 1
+#define HAVE_GETEUID 1
+#define HAVE_GETGRGID_R 1
+#define HAVE_GETGRNAM_R 1
+#define HAVE_GETPID 1
+#define HAVE_GETPWNAM_R 1
+#define HAVE_GETPWUID_R 1
+#define HAVE_GETVFSBYNAME 1
+#define HAVE_GMTIME_R 1
+#define HAVE_GRP_H 1
+#define HAVE_INTMAX_T 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_LANGINFO_H 1
+#define HAVE_LCHFLAGS 1
+#define HAVE_LCHMOD 1
+#define HAVE_LCHOWN 1
+#define HAVE_LIBZ 1
+#define HAVE_LIMITS_H 1
+#define HAVE_LINK 1
+#define HAVE_LOCALE_H 1
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LONG_LONG_INT 1
+#define HAVE_LSTAT 1
+#define HAVE_LUTIMES 1
+#define HAVE_MBRTOWC 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMORY_H 1
+#define HAVE_MEMSET 1
+#define HAVE_MKDIR 1
+#define HAVE_MKFIFO 1
+#define HAVE_MKNOD 1
+#define HAVE_MKSTEMP 1
+#define HAVE_NL_LANGINFO 1
+#define HAVE_OPENAT 1
+#define HAVE_PATHS_H 1
+#define HAVE_PIPE 1
+#define HAVE_POLL 1
+#define HAVE_POLL_H 1
+#define HAVE_POSIX_SPAWNP 1
+#define HAVE_PTHREAD_H 1
+#define HAVE_PWD_H 1
+#define HAVE_READDIR_R 1
+#define HAVE_READLINK 1
+#define HAVE_READLINKAT 1
+#define HAVE_READPASSPHRASE 1
+#define HAVE_READPASSPHRASE_H 1
+#define HAVE_REGEX_H 1
+#define HAVE_SELECT 1
+#define HAVE_SETENV 1
+#define HAVE_SETLOCALE 1
+#define HAVE_SIGACTION 1
+#define HAVE_SIGNAL_H 1
+#define HAVE_SPAWN_H 1
+#define HAVE_STATFS 1
+#define HAVE_STATVFS 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRCHR 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRERROR_R 1
+#define HAVE_STRFTIME 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRUCT_STATFS_F_NAMEMAX 1
+#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+#define HAVE_STRUCT_STAT_ST_FLAGS 1
+#define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
+#define HAVE_STRUCT_TM_TM_GMTOFF 1
+#define HAVE_SYMLINK 1
+#define HAVE_SYS_CDEFS_H 1
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_SYS_MOUNT_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_POLL_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_STATVFS_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_UTSNAME_H 1
+#define HAVE_SYS_WAIT_H 1
+#define HAVE_TIMEGM 1
+#define HAVE_TIME_H 1
+#define HAVE_TZSET 1
+#define HAVE_UINTMAX_T 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UNSETENV 1
+#define HAVE_UNSIGNED_LONG_LONG 1
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+#define HAVE_UTIME 1
+#define HAVE_UTIMES 1
+#define HAVE_UTIME_H 1
+#define HAVE_VFORK 1
+#define HAVE_VPRINTF 1
+#define HAVE_WCHAR_H 1
+#define HAVE_WCHAR_T 1
+#define HAVE_WCRTOMB 1
+#define HAVE_WCSCMP 1
+#define HAVE_WCSCPY 1
+#define HAVE_WCSLEN 1
+#define HAVE_WCTOMB 1
+#define HAVE_WCTYPE_H 1
+#define HAVE_WMEMCMP 1
+#define HAVE_WMEMCPY 1
+#define HAVE_WMEMMOVE 1
+#define HAVE_ZLIB_H 1
+#define TIME_WITH_SYS_TIME 1
+
+#if __FreeBSD_version >= 1100056
+#define HAVE_FUTIMENS 1
+#define HAVE_UTIMENSAT 1
+#endif
/* FreeBSD 4 and earlier lack intmax_t/uintmax_t */
#if __FreeBSD__ < 5
-#define intmax_t int64_t
-#define uintmax_t uint64_t
+#define intmax_t int64_t
+#define uintmax_t uint64_t
+#endif
+
+/* FreeBSD defines for archive_hash.h */
+#ifdef WITH_OPENSSL
+#define ARCHIVE_CRYPTO_MD5_OPENSSL 1
+#define ARCHIVE_CRYPTO_RMD160_OPENSSL 1
+#define ARCHIVE_CRYPTO_SHA1_OPENSSL
+#define ARCHIVE_CRYPTO_SHA256_OPENSSL 1
+#define ARCHIVE_CRYPTO_SHA384_OPENSSL 1
+#define ARCHIVE_CRYPTO_SHA512_OPENSSL 1
+#else
+#define ARCHIVE_CRYPTO_MD5_LIBMD 1
+#define ARCHIVE_CRYPTO_SHA1_LIBMD 1
+#define ARCHIVE_CRYPTO_SHA256_LIBMD 1
+#define ARCHIVE_CRYPTO_SHA512_LIBMD 1
#endif
diff --git a/Utilities/cmlibarchive/libarchive/libarchive_changes.3 b/Utilities/cmlibarchive/libarchive/libarchive_changes.3
index 881a67c..adc87fe 100644
--- a/Utilities/cmlibarchive/libarchive/libarchive_changes.3
+++ b/Utilities/cmlibarchive/libarchive/libarchive_changes.3
@@ -28,6 +28,7 @@
.Dt LIBARCHIVE_CHANGES 3
.Os
.Sh NAME
+.Nm libarchive_changes
.Nd changes in libarchive interface
.\"
.Sh CHANGES IN LIBARCHIVE 3
diff --git a/Utilities/cmlibarchive/libarchive/mtree.5 b/Utilities/cmlibarchive/libarchive/mtree.5
index 16c8abe..e607e4a 100644
--- a/Utilities/cmlibarchive/libarchive/mtree.5
+++ b/Utilities/cmlibarchive/libarchive/mtree.5
@@ -48,7 +48,7 @@ Leading whitespace is always ignored.
.Pp
When encoding file or pathnames, any backslash character or
character outside of the 95 printable ASCII characters must be
-encoded as a a backslash followed by three
+encoded as a backslash followed by three
octal digits.
When reading mtree files, any appearance of a backslash
followed by three octal digits should be converted into the
diff --git a/Utilities/cmlibarchive/libarchive/xxhash.c b/Utilities/cmlibarchive/libarchive/xxhash.c
index 6f5ba52..70750ba 100644
--- a/Utilities/cmlibarchive/libarchive/xxhash.c
+++ b/Utilities/cmlibarchive/libarchive/xxhash.c
@@ -141,13 +141,19 @@ typedef struct _U32_S { U32 v; } _PACKED U32_S;
# pragma pack(pop)
#endif
-#define A32(x) (((const U32_S *)(x))->v)
-
/****************************************
** Compiler-specific Functions and Macros
*****************************************/
-#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+#define GCC_VERSION ((__GNUC__-0) * 100 + (__GNUC_MINOR__ - 0))
+
+#if GCC_VERSION >= 409
+__attribute__((__no_sanitize_undefined__))
+#endif
+static inline U32 A32(const void * x)
+{
+ return (((const U32_S *)(x))->v);
+}
/* Note : although _rotl exists for minGW (GCC under windows), performance seems poor */
#if defined(_MSC_VER)
diff --git a/bootstrap b/bootstrap
index 84df54a..430f53b 100755
--- a/bootstrap
+++ b/bootstrap
@@ -9,26 +9,22 @@ die() {
# Compile flag extraction function.
cmake_extract_standard_flags()
{
- cd "${cmake_source_dir}/Modules/Compiler/"
- for file in ${1:-*}-${2}.cmake; do
- cat "${file}" \
- | sed -n "s/ *set *( *CMAKE_${2}${3}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \
- | tr ';' ' '
- done
+ sed -n "s/ *set *( *CMAKE_${2}${3}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \
+ "${cmake_source_dir}/Modules/Compiler/"${1:-*}-${2}.cmake 2>/dev/null | tr ';' ' '
}
# Version number extraction function.
cmake_version_component()
{
- cat "${cmake_source_dir}/Source/CMakeVersion.cmake" | sed -n "
+ sed -n "
/^set(CMake_VERSION_${1}/ {s/set(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;}
-"
+" "${cmake_source_dir}/Source/CMakeVersion.cmake"
}
# Install destination extraction function.
cmake_install_dest_default()
{
- cat "${cmake_source_dir}/Source/CMakeInstallDestinations.cmake" | sed -n '
+ sed -n '
/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT.*) # '"${2}"'$/ {
s/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT *"\([^"]*\)").*$/\1/
s/${CMake_VERSION_MAJOR}/'"${cmake_version_major}"'/
@@ -37,12 +33,12 @@ cmake_install_dest_default()
p
q
}
-'
+' "${cmake_source_dir}/Source/CMakeInstallDestinations.cmake"
}
cmake_toupper()
{
- echo "$1" | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'
+ echo "$1" | tr '[:lower:]' '[:upper:]'
}
# Detect system and directory information.
@@ -76,7 +72,6 @@ cmake_init_file=""
cmake_bootstrap_system_libs=""
cmake_bootstrap_qt_gui=""
cmake_bootstrap_qt_qmake=""
-cmake_bootstrap_server=""
cmake_sphinx_man=""
cmake_sphinx_html=""
cmake_sphinx_qthelp=""
@@ -133,6 +128,11 @@ fi
# Determine whether this is HP-UX
if echo "${cmake_system}" | grep HP-UX >/dev/null 2>&1; then
+ die 'CMake no longer compiles on HP-UX. See
+
+ https://gitlab.kitware.com/cmake/cmake/issues/17137
+
+Use CMake 3.9 or lower instead.'
cmake_system_hpux=true
else
cmake_system_hpux=false
@@ -334,6 +334,7 @@ CMAKE_CXX_SOURCES="\
cmHexFileConverter \
cmIfCommand \
cmIncludeCommand \
+ cmIncludeGuardCommand \
cmIncludeDirectoryCommand \
cmIncludeRegularExpressionCommand \
cmInstallCommand \
@@ -401,8 +402,14 @@ CMAKE_CXX_SOURCES="\
cmSubdirCommand \
cmSystemTools \
cmTarget \
+ cmTargetCompileDefinitionsCommand \
+ cmTargetCompileFeaturesCommand \
+ cmTargetCompileOptionsCommand \
+ cmTargetIncludeDirectoriesCommand \
cmTargetLinkLibrariesCommand \
+ cmTargetPropCommandBase \
cmTargetPropertyComputer \
+ cmTargetSourcesCommand \
cmTest \
cmTestGenerator \
cmTimestamp \
@@ -512,9 +519,6 @@ Configuration:
--no-qt-gui do not build the Qt-based GUI (default)
--qt-qmake=<qmake> use <qmake> as the qmake executable to find Qt
- --server enable the server mode (default if supported)
- --no-server disable the server mode
-
--sphinx-man build man pages with Sphinx
--sphinx-html build html help with Sphinx
--sphinx-qthelp build qch help with Sphinx
@@ -581,8 +585,7 @@ cmake_replace_string ()
SEARCHFOR="$3"
REPLACEWITH="$4"
if [ -f "${INFILE}" ] || ${cmake_system_openvms}; then
- cat "${INFILE}" |
- sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" > "${OUTFILE}${_tmp}"
+ sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" "${INFILE}" > "${OUTFILE}${_tmp}"
if [ -f "${OUTFILE}${_tmp}" ]; then
if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
#echo "Files are the same"
@@ -604,15 +607,14 @@ cmake_kwsys_config_replace_string ()
APPEND="$*"
if [ -f "${INFILE}" ] || ${cmake_system_openvms}; then
echo "${APPEND}" > "${OUTFILE}${_tmp}"
- cat "${INFILE}" |
- sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
- s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
- s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
- s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
- s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
- s/@KWSYS_STL_HAS_WSTRING@/${KWSYS_STL_HAS_WSTRING}/g;
- s/@KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H@/${KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H}/g;
- }" >> "${OUTFILE}${_tmp}"
+ sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
+ s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
+ s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
+ s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
+ s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
+ s/@KWSYS_STL_HAS_WSTRING@/${KWSYS_STL_HAS_WSTRING}/g;
+ s/@KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H@/${KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H}/g;
+ }" "${INFILE}" >> "${OUTFILE}${_tmp}"
if [ -f "${OUTFILE}${_tmp}" ]; then
if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
#echo "Files are the same"
@@ -749,8 +751,6 @@ while test $# != 0; do
--qt-gui) cmake_bootstrap_qt_gui="1" ;;
--no-qt-gui) cmake_bootstrap_qt_gui="0" ;;
--qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;;
- --server) cmake_bootstrap_server="1" ;;
- --no-server) cmake_bootstrap_server="0" ;;
--sphinx-man) cmake_sphinx_man="1" ;;
--sphinx-html) cmake_sphinx_html="1" ;;
--sphinx-qthelp) cmake_sphinx_qthelp="1" ;;
@@ -855,16 +855,6 @@ if ${cmake_system_haiku}; then
cmake_ld_flags="${LDFLAGS} -lroot -lbe"
fi
-# Workaround for short jump tables on PA-RISC
-if ${cmake_machine_parisc}; then
- if ${cmake_c_compiler_is_gnu}; then
- cmake_c_flags="${CFLAGS} -mlong-calls"
- fi
- if ${cmake_cxx_compiler_is_gnu}; then
- cmake_cxx_flags="${CXXFLAGS} -mlong-calls"
- fi
-fi
-
#-----------------------------------------------------------------------------
# Detect known toolchains on some platforms.
cmake_toolchains=''
@@ -945,35 +935,26 @@ echo '
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
#endif
-#include<stdio.h>
+#include <stdio.h>
-#if defined(__CLASSIC_C__)
-int main(argc, argv)
- int argc;
- char* argv[];
-#else
int main(int argc, char* argv[])
-#endif
{
printf("%d%c", (argv != 0), (char)0x0a);
- return argc-1;
+ return argc - 1;
}
' > "${TMPFILE}.c"
-for a in ${cmake_c_compilers}; do
- if [ -z "${cmake_c_compiler}" ] && \
- cmake_try_run "${a}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
- cmake_c_compiler="${a}"
- fi
-done
for std in 11 99 90; do
try_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" C \"${std}\"`"
- for flag in $try_flags; do
- echo "Checking whether ${cmake_c_compiler} supports ${flag}" >> cmake_bootstrap.log 2>&1
- if cmake_try_run "${cmake_c_compiler}" "${cmake_c_flags} ${flag}" \
- "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
- cmake_c_flags="${cmake_c_flags} ${flag}"
- break 2
- fi
+ for compiler in ${cmake_c_compilers}; do
+ for flag in '' $try_flags; do
+ echo "Checking whether '${compiler} ${cmake_c_flags} ${flag}' works." >> cmake_bootstrap.log 2>&1
+ if cmake_try_run "${compiler}" "${cmake_c_flags} ${flag}" \
+ "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
+ cmake_c_compiler="${compiler}"
+ cmake_c_flags="${cmake_c_flags} ${flag}"
+ break 3
+ fi
+ done
done
done
rm -f "${TMPFILE}.c"
@@ -1004,58 +985,49 @@ fi
# Check if C++ compiler works
TMPFILE=`cmake_tmp_file`
echo '
-#if defined(TEST1)
-# include <iostream>
-#else
-# include <iostream.h>
+#include <iostream>
+#include <memory>
+
+#if __cplusplus < 201103L
+#error "Compiler is not in a mode aware of C++11."
#endif
-#if __cplusplus >= 201103L && defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
-#error "SunPro <= 5.13 C++ 11 mode not supported due to bug in move semantics."
+#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
+#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif
-class NeedCXX
+class Class
{
public:
- NeedCXX() { this->Foo = 1; }
- int GetFoo() { return this->Foo; }
+ int Get() const { return this->Member; }
private:
- int Foo;
+ int Member = 1;
};
int main()
{
- NeedCXX c;
-#ifdef TEST3
- cout << c.GetFoo() << endl;
-#else
- std::cout << c.GetFoo() << std::endl;
-#endif
+ auto const c = std::unique_ptr<Class>(new Class);
+ std::cout << c->Get() << std::endl;
return 0;
}
' > "${TMPFILE}.cxx"
-for a in ${cmake_cxx_compilers}; do
- for b in 1 2 3; do
- if [ -z "${cmake_cxx_compiler}" ] && \
- cmake_try_run "${a}" "${cmake_cxx_flags} -DTEST${b}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
- cmake_cxx_compiler="${a}"
- fi
- done
-done
-for std in 14 11 98; do
+for std in 17 14 11; do
try_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" CXX \"${std}\"`"
- for flag in $try_flags; do
- echo "Checking for wheter ${cmake_cxx_flags} supports ${flag}" >> cmake_bootstrap.log 2>&1
- if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags} ${flag} -DTEST1" \
- "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
- cmake_cxx_flags="${cmake_cxx_flags} ${flag} "
- break 2
- fi
+ for compiler in ${cmake_cxx_compilers}; do
+ for flag in '' $try_flags; do
+ echo "Checking whether '${compiler} ${cmake_cxx_flags} ${flag}' works." >> cmake_bootstrap.log 2>&1
+ if cmake_try_run "${compiler}" "${cmake_cxx_flags} ${flag}" \
+ "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
+ cmake_cxx_compiler="${compiler}"
+ cmake_cxx_flags="${cmake_cxx_flags} ${flag} "
+ break 3
+ fi
+ done
done
done
rm -f "${TMPFILE}.cxx"
if [ -z "${cmake_cxx_compiler}" ]; then
- cmake_error 7 "Cannot find appropriate C++ compiler on this system.
+cmake_error 7 "Cannot find a C++ compiler supporting C++11 on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted."
fi
@@ -1120,85 +1092,6 @@ if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
echo "---------------------------------------------"
fi
-# Ok, we have CC, CXX, and MAKE.
-
-# Test C++ compiler features
-
-# Are we GCC?
-
-TMPFILE=`cmake_tmp_file`
-echo '
-#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
-#include <iostream>
-int main() { std::cout << "This is GNU" << std::endl; return 0;}
-#endif
-' > ${TMPFILE}.cxx
-cmake_cxx_compiler_is_gnu=0
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
- cmake_cxx_compiler_is_gnu=1
-fi
-if [ "x${cmake_cxx_compiler_is_gnu}" = "x1" ]; then
- echo "${cmake_cxx_compiler} is GNU compiler"
-else
- echo "${cmake_cxx_compiler} is not GNU compiler"
-fi
-rm -f "${TMPFILE}.cxx"
-
-if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
- # Check for non-GNU compiler flags
-
- # If we are on HP-UX, check for -Ae for the C compiler.
- if [ "x${cmake_system}" = "xHP-UX" ]; then
- cmake_test_flags="-Ae"
- TMPFILE=`cmake_tmp_file`
- echo '
- int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
-' > ${TMPFILE}.c
- cmake_need_Ae=0
- if cmake_try_run "${cmake_c_compiler}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
- :
- else
- if cmake_try_run "${cmake_c_compiler}" \
- "${cmake_c_flags} ${cmake_test_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
- cmake_need_Ae=1
- fi
- fi
- if [ "x${cmake_need_Ae}" = "x1" ]; then
- cmake_c_flags="${cmake_c_flags} ${cmake_test_flags}"
- echo "${cmake_c_compiler} needs ${cmake_test_flags}"
- else
- echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
- fi
- rm -f "${TMPFILE}.c"
- echo '
- #include <iostream>
- int main(int argc, char** argv) {
- for(int i=0; i < 1; ++i);
- for(int i=0; i < 1; ++i);
- (void)argc; (void)argv; return 0; }
-' > ${TMPFILE}.cxx
- cmake_need_AAstd98=0
- cmake_test_flags="-AA +hpxstd98"
- if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
- :
- else
- if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
- cmake_need_AAstd98=1
- fi
- fi
- if [ "x${cmake_need_AAstd98}" = "x1" ]; then
- cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
- echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
- else
- echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
- fi
- fi
- cmake_test_flags=
-fi
-
-
# Test for kwsys features
KWSYS_NAME_IS_KWSYS=0
KWSYS_BUILD_SHARED=0
@@ -1308,7 +1201,6 @@ cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insal
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
cmake_report cmConfigure.h${_tmp} "#define CM_EQ_DELETE"
cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH"
-cmake_report cmConfigure.h${_tmp} "#define CM_NULLPTR 0"
cmake_report cmConfigure.h${_tmp} "#define CM_OVERRIDE"
cmake_report cmConfigure.h${_tmp} "#define CM_DISABLE_COPY(Class)"
@@ -1444,11 +1336,6 @@ if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then
set (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
-if [ "x${cmake_bootstrap_server}" != "x" ]; then
- echo '
-set (CMake_ENABLE_SERVER_MODE '"${cmake_bootstrap_server}"' CACHE BOOL "Enable server mode" FORCE)
-' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
-fi
if [ "x${cmake_sphinx_man}" != "x" ]; then
echo '
set (SPHINX_MAN "'"${cmake_sphinx_man}"'" CACHE BOOL "Build man pages with Sphinx" FORCE)