summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt277
-rwxr-xr-xSource/CMakeVersion.bash2
-rw-r--r--Source/CMakeVersion.cmake10
-rw-r--r--Source/CPack/OSXScriptLauncher.cxx8
-rw-r--r--Source/CPack/bills-comments.txt22
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.h2
-rw-r--r--Source/CPack/cmCPackBundleGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackComponentGroup.cxx2
-rw-r--r--Source/CPack/cmCPackComponentGroup.h4
-rw-r--r--Source/CPack/cmCPackCygwinBinaryGenerator.cxx10
-rw-r--r--Source/CPack/cmCPackCygwinSourceGenerator.cxx16
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx22
-rw-r--r--Source/CPack/cmCPackDocumentVariables.cxx25
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx34
-rw-r--r--Source/CPack/cmCPackGenerator.cxx90
-rw-r--r--Source/CPack/cmCPackGenerator.h2
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx80
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx24
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx92
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.h10
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackTarBZip2Generator.cxx2
-rw-r--r--Source/CPack/cmCPackTarCompressGenerator.cxx2
-rw-r--r--Source/CPack/cygwin.readme6
-rw-r--r--Source/CTest/cmCTestBatchTestHandler.cxx2
-rw-r--r--Source/CTest/cmCTestBatchTestHandler.h2
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx26
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.h6
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx2
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx12
-rw-r--r--Source/CTest/cmCTestConfigureHandler.cxx2
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx78
-rw-r--r--Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx4
-rw-r--r--Source/CTest/cmCTestGenericHandler.cxx6
-rw-r--r--Source/CTest/cmCTestGenericHandler.h2
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx2
-rw-r--r--Source/CTest/cmCTestMemCheckCommand.h2
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx211
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.h10
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx14
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h6
-rw-r--r--Source/CTest/cmCTestReadCustomFilesCommand.h6
-rw-r--r--Source/CTest/cmCTestRunScriptCommand.h6
-rw-r--r--Source/CTest/cmCTestRunTest.cxx52
-rw-r--r--Source/CTest/cmCTestRunTest.h2
-rw-r--r--Source/CTest/cmCTestSVN.cxx333
-rw-r--r--Source/CTest/cmCTestSVN.h54
-rw-r--r--Source/CTest/cmCTestScriptHandler.h2
-rw-r--r--Source/CTest/cmCTestSleepCommand.cxx2
-rw-r--r--Source/CTest/cmCTestSleepCommand.h6
-rw-r--r--Source/CTest/cmCTestTestCommand.cxx4
-rw-r--r--Source/CTest/cmCTestTestCommand.h2
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx5
-rw-r--r--Source/CTest/cmCTestUpdateCommand.cxx2
-rw-r--r--Source/CTest/cmCTestVC.h4
-rw-r--r--Source/CTest/cmProcess.cxx10
-rw-r--r--Source/CTest/cmProcess.h4
-rw-r--r--Source/CursesDialog/CMakeLists.txt14
-rw-r--r--Source/CursesDialog/cmCursesBoolWidget.cxx12
-rw-r--r--Source/CursesDialog/cmCursesBoolWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.cxx10
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.h2
-rw-r--r--Source/CursesDialog/cmCursesDummyWidget.cxx2
-rw-r--r--Source/CursesDialog/cmCursesDummyWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesFilePathWidget.cxx2
-rw-r--r--Source/CursesDialog/cmCursesForm.h4
-rw-r--r--Source/CursesDialog/cmCursesLabelWidget.cxx2
-rw-r--r--Source/CursesDialog/cmCursesLabelWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.cxx18
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.h4
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h10
-rw-r--r--Source/CursesDialog/cmCursesPathWidget.cxx6
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.cxx30
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesWidget.h2
-rw-r--r--Source/CursesDialog/form/CMakeLists.txt22
-rw-r--r--Source/QtDialog/CMakeLists.txt218
-rw-r--r--Source/QtDialog/CMakeSetup.cxx18
-rw-r--r--Source/QtDialog/Compilers.h2
-rw-r--r--Source/QtDialog/FirstConfigure.cxx16
-rw-r--r--Source/QtDialog/FirstConfigure.h26
-rw-r--r--Source/QtDialog/QCMake.cxx28
-rw-r--r--Source/QtDialog/QCMake.h12
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx70
-rw-r--r--Source/QtDialog/QCMakeCacheView.h18
-rw-r--r--Source/QtDialog/QCMakeWidgets.cxx2
-rw-r--r--Source/QtDialog/QMacInstallDialog.cxx18
-rw-r--r--Source/QtDialog/QtDialogCPack.cmake.in22
-rw-r--r--Source/cmAddCustomCommandCommand.h10
-rw-r--r--Source/cmAddCustomTargetCommand.h10
-rw-r--r--Source/cmAddDependenciesCommand.h6
-rw-r--r--Source/cmAddLibraryCommand.h10
-rw-r--r--Source/cmAddSubDirectoryCommand.cxx4
-rw-r--r--Source/cmAddSubDirectoryCommand.h6
-rw-r--r--Source/cmAddTestCommand.h8
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx10
-rw-r--r--Source/cmAuxSourceDirectoryCommand.h8
-rw-r--r--Source/cmBreakCommand.h8
-rw-r--r--Source/cmBuildCommand.h2
-rw-r--r--Source/cmBuildNameCommand.cxx6
-rw-r--r--Source/cmCMakeMinimumRequired.cxx2
-rw-r--r--Source/cmCMakeMinimumRequired.h8
-rw-r--r--Source/cmCMakePolicyCommand.h12
-rw-r--r--Source/cmCPluginAPI.cxx6
-rw-r--r--Source/cmCPluginAPI.h4
-rw-r--r--Source/cmCTest.cxx78
-rw-r--r--Source/cmCTest.h10
-rw-r--r--Source/cmCacheManager.cxx18
-rw-r--r--Source/cmCacheManager.h36
-rw-r--r--Source/cmCommand.h22
-rw-r--r--Source/cmCommandArgumentLexer.h6
-rw-r--r--Source/cmCommandArgumentLexer.in.l48
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx10
-rw-r--r--Source/cmCommandArgumentParserHelper.h6
-rw-r--r--Source/cmCommandArgumentsHelper.cxx46
-rw-r--r--Source/cmCommandArgumentsHelper.h38
-rw-r--r--Source/cmComputeLinkInformation.cxx2
-rw-r--r--Source/cmConfigureFileCommand.cxx4
-rw-r--r--Source/cmConfigureFileCommand.h6
-rw-r--r--Source/cmCreateTestSourceList.h10
-rw-r--r--Source/cmCustomCommandGenerator.cxx7
-rw-r--r--Source/cmDefinePropertyCommand.h6
-rw-r--r--Source/cmDepends.cxx65
-rw-r--r--Source/cmDepends.h7
-rw-r--r--Source/cmDependsFortran.cxx2
-rw-r--r--Source/cmDependsJava.cxx2
-rw-r--r--Source/cmDependsJava.h3
-rw-r--r--Source/cmDependsJavaLexer.h4
-rw-r--r--Source/cmDependsJavaLexer.in.l16
-rw-r--r--Source/cmDependsJavaParserHelper.cxx26
-rw-r--r--Source/cmDependsJavaParserHelper.h12
-rw-r--r--Source/cmDocumentGeneratorExpressions.h30
-rw-r--r--Source/cmDocumentLocationUndefined.h4
-rw-r--r--Source/cmDocumentVariables.cxx129
-rw-r--r--Source/cmDocumentation.cxx9
-rw-r--r--Source/cmDocumentationFormatter.cxx2
-rw-r--r--Source/cmDocumentationFormatterDocbook.cxx191
-rw-r--r--Source/cmDocumentationFormatterDocbook.h2
-rw-r--r--Source/cmDocumentationFormatterHTML.cxx16
-rw-r--r--Source/cmDocumentationFormatterHTML.h2
-rw-r--r--Source/cmDocumentationFormatterText.cxx20
-rw-r--r--Source/cmDocumentationFormatterUsage.cxx4
-rw-r--r--Source/cmDocumentationSection.h14
-rw-r--r--Source/cmElseCommand.h6
-rw-r--r--Source/cmElseIfCommand.h6
-rw-r--r--Source/cmEnableLanguageCommand.cxx2
-rw-r--r--Source/cmEnableLanguageCommand.h8
-rw-r--r--Source/cmEnableTestingCommand.cxx2
-rw-r--r--Source/cmEnableTestingCommand.h10
-rw-r--r--Source/cmEndForEachCommand.cxx2
-rw-r--r--Source/cmEndForEachCommand.h8
-rw-r--r--Source/cmEndFunctionCommand.h8
-rw-r--r--Source/cmEndIfCommand.cxx2
-rw-r--r--Source/cmEndIfCommand.h6
-rw-r--r--Source/cmEndMacroCommand.h8
-rw-r--r--Source/cmEndWhileCommand.h8
-rw-r--r--Source/cmExecProgramCommand.cxx14
-rw-r--r--Source/cmExecProgramCommand.h12
-rw-r--r--Source/cmExecuteProcessCommand.cxx8
-rw-r--r--Source/cmExecutionStatus.h14
-rw-r--r--Source/cmExportBuildFileGenerator.cxx23
-rw-r--r--Source/cmExportBuildFileGenerator.h10
-rw-r--r--Source/cmExportFileGenerator.cxx56
-rw-r--r--Source/cmExportFileGenerator.h19
-rw-r--r--Source/cmExportInstallFileGenerator.cxx124
-rw-r--r--Source/cmExportInstallFileGenerator.h59
-rw-r--r--Source/cmExportLibraryDependencies.cxx2
-rw-r--r--Source/cmExportLibraryDependencies.h10
-rw-r--r--Source/cmExportSet.cxx32
-rw-r--r--Source/cmExportSet.h46
-rw-r--r--Source/cmExportSetMap.cxx34
-rw-r--r--Source/cmExportSetMap.h33
-rw-r--r--Source/cmExprLexer.h4
-rw-r--r--Source/cmExprLexer.in.l22
-rw-r--r--Source/cmExprParserHelper.cxx4
-rw-r--r--Source/cmExprParserHelper.h2
-rw-r--r--Source/cmExternalMakefileProjectGenerator.cxx2
-rw-r--r--Source/cmExternalMakefileProjectGenerator.h12
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx93
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx95
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h5
-rw-r--r--Source/cmFLTKWrapUICommand.cxx26
-rw-r--r--Source/cmFLTKWrapUICommand.h10
-rw-r--r--Source/cmFileCommand.cxx150
-rw-r--r--Source/cmFileCommand.h21
-rw-r--r--Source/cmFileTimeComparison.cxx4
-rw-r--r--Source/cmFileTimeComparison.h4
-rw-r--r--Source/cmFindBase.cxx22
-rw-r--r--Source/cmFindBase.h4
-rw-r--r--Source/cmFindFileCommand.h6
-rw-r--r--Source/cmFindLibraryCommand.cxx116
-rw-r--r--Source/cmFindLibraryCommand.h9
-rw-r--r--Source/cmFindPackageCommand.cxx12
-rw-r--r--Source/cmFindPathCommand.cxx8
-rw-r--r--Source/cmFindPathCommand.h2
-rw-r--r--Source/cmFindProgramCommand.cxx40
-rw-r--r--Source/cmFindProgramCommand.h6
-rw-r--r--Source/cmForEachCommand.cxx14
-rw-r--r--Source/cmForEachCommand.h8
-rw-r--r--Source/cmFunctionBlocker.h2
-rw-r--r--Source/cmFunctionCommand.cxx20
-rw-r--r--Source/cmFunctionCommand.h4
-rw-r--r--Source/cmGeneratedFileStream.cxx6
-rw-r--r--Source/cmGeneratorExpression.cxx261
-rw-r--r--Source/cmGeneratorExpression.h75
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx106
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h44
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx769
-rw-r--r--Source/cmGeneratorExpressionEvaluator.h127
-rw-r--r--Source/cmGeneratorExpressionLexer.cxx85
-rw-r--r--Source/cmGeneratorExpressionLexer.h58
-rw-r--r--Source/cmGeneratorExpressionParser.cxx276
-rw-r--r--Source/cmGeneratorExpressionParser.h45
-rw-r--r--Source/cmGeneratorTarget.cxx184
-rw-r--r--Source/cmGeneratorTarget.h26
-rw-r--r--Source/cmGetCMakePropertyCommand.h6
-rw-r--r--Source/cmGetDirectoryPropertyCommand.cxx8
-rw-r--r--Source/cmGetDirectoryPropertyCommand.h6
-rw-r--r--Source/cmGetFilenameComponentCommand.cxx8
-rw-r--r--Source/cmGetFilenameComponentCommand.h8
-rw-r--r--Source/cmGetPropertyCommand.h6
-rw-r--r--Source/cmGetSourceFilePropertyCommand.h6
-rw-r--r--Source/cmGetTargetPropertyCommand.h6
-rw-r--r--Source/cmGetTestPropertyCommand.h2
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.cxx6
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.h8
-rw-r--r--Source/cmGlobalGenerator.cxx131
-rw-r--r--Source/cmGlobalGenerator.h34
-rw-r--r--Source/cmGlobalJOMMakefileGenerator.cxx10
-rw-r--r--Source/cmGlobalJOMMakefileGenerator.h4
-rw-r--r--Source/cmGlobalKdevelopGenerator.cxx70
-rw-r--r--Source/cmGlobalMSYSMakefileGenerator.cxx6
-rw-r--r--Source/cmGlobalMSYSMakefileGenerator.h6
-rw-r--r--Source/cmGlobalMinGWMakefileGenerator.cxx6
-rw-r--r--Source/cmGlobalMinGWMakefileGenerator.h6
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.cxx10
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.h4
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx12
-rw-r--r--Source/cmGlobalNinjaGenerator.h1
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx19
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h18
-rw-r--r--Source/cmGlobalVisualStudio10IA64Generator.cxx3
-rw-r--r--Source/cmGlobalVisualStudio10Win64Generator.cxx3
-rw-r--r--Source/cmGlobalVisualStudio11ARMGenerator.cxx15
-rw-r--r--Source/cmGlobalVisualStudio11ARMGenerator.h4
-rw-r--r--Source/cmGlobalVisualStudio11Generator.cxx13
-rw-r--r--Source/cmGlobalVisualStudio11Generator.h1
-rw-r--r--Source/cmGlobalVisualStudio11Win64Generator.cxx8
-rw-r--r--Source/cmGlobalVisualStudio11Win64Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio6Generator.cxx40
-rw-r--r--Source/cmGlobalVisualStudio6Generator.h20
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx40
-rw-r--r--Source/cmGlobalVisualStudio71Generator.h13
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx71
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h1
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx15
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h9
-rw-r--r--Source/cmGlobalVisualStudio8Win64Generator.cxx13
-rw-r--r--Source/cmGlobalVisualStudio8Win64Generator.h11
-rw-r--r--Source/cmGlobalVisualStudio9Generator.cxx10
-rw-r--r--Source/cmGlobalVisualStudio9Generator.h13
-rw-r--r--Source/cmGlobalVisualStudio9IA64Generator.cxx11
-rw-r--r--Source/cmGlobalVisualStudio9IA64Generator.h3
-rw-r--r--Source/cmGlobalVisualStudio9Win64Generator.cxx11
-rw-r--r--Source/cmGlobalVisualStudio9Win64Generator.h11
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx10
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h6
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.cxx6
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.h6
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx56
-rw-r--r--Source/cmGlobalXCodeGenerator.h36
-rw-r--r--Source/cmHexFileConverter.cxx12
-rw-r--r--Source/cmHexFileConverter.h2
-rw-r--r--Source/cmIfCommand.cxx16
-rw-r--r--Source/cmIfCommand.h27
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx22
-rw-r--r--Source/cmIncludeDirectoryCommand.h6
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.cxx4
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.h8
-rw-r--r--Source/cmIncludeRegularExpressionCommand.cxx4
-rw-r--r--Source/cmIncludeRegularExpressionCommand.h8
-rw-r--r--Source/cmInstallCommand.cxx19
-rw-r--r--Source/cmInstallCommand.h4
-rw-r--r--Source/cmInstallExportGenerator.cxx18
-rw-r--r--Source/cmInstallExportGenerator.h18
-rw-r--r--Source/cmInstallFilesCommand.h10
-rw-r--r--Source/cmInstallProgramsCommand.h8
-rw-r--r--Source/cmInstallTargetGenerator.cxx30
-rw-r--r--Source/cmInstallTargetGenerator.h9
-rw-r--r--Source/cmInstallTargetsCommand.h8
-rw-r--r--Source/cmLinkDirectoriesCommand.h10
-rw-r--r--Source/cmLinkLibrariesCommand.cxx6
-rw-r--r--Source/cmLinkLibrariesCommand.h8
-rw-r--r--Source/cmListCommand.cxx26
-rw-r--r--Source/cmListFileCache.cxx20
-rw-r--r--Source/cmListFileCache.h8
-rw-r--r--Source/cmListFileLexer.c44
-rw-r--r--Source/cmLoadCacheCommand.cxx18
-rw-r--r--Source/cmLoadCacheCommand.h10
-rw-r--r--Source/cmLoadCommandCommand.cxx32
-rw-r--r--Source/cmLoadCommandCommand.h8
-rw-r--r--Source/cmLocalGenerator.cxx221
-rw-r--r--Source/cmLocalGenerator.h36
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx12
-rw-r--r--Source/cmLocalVisualStudio10Generator.h2
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx309
-rw-r--r--Source/cmLocalVisualStudio6Generator.h12
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx113
-rw-r--r--Source/cmLocalVisualStudio7Generator.h16
-rw-r--r--Source/cmMacroCommand.cxx12
-rw-r--r--Source/cmMacroCommand.h4
-rw-r--r--Source/cmMakeDepend.cxx34
-rw-r--r--Source/cmMakeDepend.h34
-rw-r--r--Source/cmMakeDirectoryCommand.h8
-rw-r--r--Source/cmMakefile.cxx18
-rw-r--r--Source/cmMakefile.h19
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx22
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx19
-rw-r--r--Source/cmMakefileTargetGenerator.cxx71
-rw-r--r--Source/cmMarkAsAdvancedCommand.cxx2
-rw-r--r--Source/cmMarkAsAdvancedCommand.h6
-rw-r--r--Source/cmMathCommand.cxx2
-rw-r--r--Source/cmMathCommand.h8
-rw-r--r--Source/cmMessageCommand.h6
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx87
-rw-r--r--Source/cmNinjaTargetGenerator.cxx195
-rw-r--r--Source/cmNinjaTargetGenerator.h11
-rw-r--r--Source/cmObject.h4
-rw-r--r--Source/cmOptionCommand.cxx4
-rw-r--r--Source/cmOptionCommand.h6
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx18
-rw-r--r--Source/cmOutputRequiredFilesCommand.h6
-rw-r--r--Source/cmProjectCommand.cxx6
-rw-r--r--Source/cmProjectCommand.h8
-rw-r--r--Source/cmProperty.h2
-rw-r--r--Source/cmPropertyDefinition.h6
-rw-r--r--Source/cmPropertyDefinitionMap.cxx8
-rw-r--r--Source/cmPropertyDefinitionMap.h2
-rw-r--r--Source/cmPropertyMap.cxx10
-rw-r--r--Source/cmPropertyMap.h4
-rw-r--r--Source/cmQTWrapCPPCommand.cxx2
-rw-r--r--Source/cmQTWrapCPPCommand.h8
-rw-r--r--Source/cmQTWrapUICommand.cxx2
-rw-r--r--Source/cmQTWrapUICommand.h8
-rw-r--r--Source/cmQtAutomoc.cxx150
-rw-r--r--Source/cmQtAutomoc.h6
-rw-r--r--Source/cmRemoveCommand.cxx10
-rw-r--r--Source/cmRemoveCommand.h10
-rw-r--r--Source/cmRemoveDefinitionsCommand.h12
-rw-r--r--Source/cmReturnCommand.h8
-rw-r--r--Source/cmSeparateArgumentsCommand.h10
-rw-r--r--Source/cmSetCommand.cxx20
-rw-r--r--Source/cmSetCommand.h10
-rw-r--r--Source/cmSetDirectoryPropertiesCommand.cxx14
-rw-r--r--Source/cmSetDirectoryPropertiesCommand.h6
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.cxx8
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.h6
-rw-r--r--Source/cmSetTargetPropertiesCommand.cxx8
-rw-r--r--Source/cmSetTargetPropertiesCommand.h12
-rw-r--r--Source/cmSetTestsPropertiesCommand.cxx12
-rw-r--r--Source/cmSetTestsPropertiesCommand.h4
-rw-r--r--Source/cmSiteNameCommand.cxx10
-rw-r--r--Source/cmSiteNameCommand.h8
-rw-r--r--Source/cmSourceFile.cxx30
-rw-r--r--Source/cmSourceFile.h2
-rw-r--r--Source/cmSourceGroup.cxx10
-rw-r--r--Source/cmSourceGroup.h22
-rw-r--r--Source/cmSourceGroupCommand.cxx8
-rw-r--r--Source/cmSourceGroupCommand.h8
-rw-r--r--Source/cmStandardIncludes.h16
-rw-r--r--Source/cmStringCommand.cxx72
-rw-r--r--Source/cmStringCommand.h9
-rw-r--r--Source/cmSubdirCommand.cxx14
-rw-r--r--Source/cmSubdirCommand.h8
-rw-r--r--Source/cmSubdirDependsCommand.h6
-rw-r--r--Source/cmSystemTools.cxx7
-rw-r--r--Source/cmSystemTools.h3
-rw-r--r--Source/cmTarget.cxx300
-rw-r--r--Source/cmTarget.h34
-rw-r--r--Source/cmTargetExport.h39
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx4
-rw-r--r--Source/cmTest.cxx10
-rw-r--r--Source/cmTest.h2
-rw-r--r--Source/cmTestGenerator.cxx8
-rw-r--r--Source/cmTryRunCommand.h10
-rw-r--r--Source/cmUseMangledMesaCommand.cxx12
-rw-r--r--Source/cmUtilitySourceCommand.cxx22
-rw-r--r--Source/cmUtilitySourceCommand.h4
-rw-r--r--Source/cmVS11CLFlagTable.h291
-rw-r--r--Source/cmVS11LibFlagTable.h102
-rw-r--r--Source/cmVS11LinkFlagTable.h343
-rw-r--r--Source/cmVariableRequiresCommand.cxx10
-rw-r--r--Source/cmVariableRequiresCommand.h10
-rw-r--r--Source/cmVariableWatch.cxx8
-rw-r--r--Source/cmVariableWatch.h4
-rw-r--r--Source/cmVariableWatchCommand.cxx2
-rw-r--r--Source/cmVariableWatchCommand.h6
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx180
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h10
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx4
-rw-r--r--Source/cmWhileCommand.h10
-rw-r--r--Source/cmWin32ProcessExecution.cxx228
-rw-r--r--Source/cmWin32ProcessExecution.h18
-rw-r--r--Source/cmWriteFileCommand.cxx2
-rw-r--r--Source/cmWriteFileCommand.h6
-rw-r--r--Source/cmXCode21Object.cxx8
-rw-r--r--Source/cmXCodeObject.cxx24
-rw-r--r--Source/cmXCodeObject.h28
-rw-r--r--Source/cmXMLParser.cxx10
-rw-r--r--Source/cmXMLParser.h24
-rw-r--r--Source/cmake.cxx34
-rw-r--r--Source/cmakewizard.cxx2
-rw-r--r--Source/cmakewizard.h12
-rw-r--r--Source/cmakexbuild.cxx4
-rw-r--r--Source/cmcldeps.cxx4
-rwxr-xr-xSource/cmparseMSBuildXML.py47
-rw-r--r--Source/cmw9xcom.cxx4
418 files changed, 7629 insertions, 4089 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index e9c5a58..8bf6c40 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -9,33 +9,33 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-INCLUDE(CheckIncludeFile)
+include(CheckIncludeFile)
# Check if we can build support for ELF parsing.
CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
-IF(HAVE_ELF_H)
- SET(CMAKE_USE_ELF_PARSER 1)
-ELSE(HAVE_ELF_H)
- SET(CMAKE_USE_ELF_PARSER)
-ENDIF(HAVE_ELF_H)
+if(HAVE_ELF_H)
+ set(CMAKE_USE_ELF_PARSER 1)
+else()
+ set(CMAKE_USE_ELF_PARSER)
+endif()
-SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
+set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
# configure the .h file
-CONFIGURE_FILE(
+configure_file(
"${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in"
"${CMake_BINARY_DIR}/Source/cmConfigure.h"
)
-CONFIGURE_FILE(
+configure_file(
"${CMake_SOURCE_DIR}/Source/cmVersionConfig.h.in"
"${CMake_BINARY_DIR}/Source/cmVersionConfig.h"
)
-CONFIGURE_FILE(
+configure_file(
"${CMake_SOURCE_DIR}/Source/CPack/cmCPackConfigure.h.in"
"${CMake_BINARY_DIR}/Source/CPack/cmCPackConfigure.h"
)
# add the include path to find the .h
-INCLUDE_DIRECTORIES(
+include_directories(
"${CMake_BINARY_DIR}/Source"
"${CMake_SOURCE_DIR}/Source"
${CMAKE_ZLIB_INCLUDES}
@@ -45,72 +45,72 @@ INCLUDE_DIRECTORIES(
)
# let cmake know it is supposed to use it
-ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE)
+add_definitions(-DCMAKE_BUILD_WITH_CMAKE)
-OPTION(CMAKE_REGENERATE_YACCLEX
+option(CMAKE_REGENERATE_YACCLEX
"Regenerate YACC and LEXX files" OFF)
-MARK_AS_ADVANCED(CMAKE_REGENERATE_YACCLEX)
-IF(CMAKE_REGENERATE_YACCLEX)
- SET(parsersLexers cmDependsFortran cmCommandArgument cmExpr)
- FIND_PROGRAM(YACC_EXECUTABLE
+mark_as_advanced(CMAKE_REGENERATE_YACCLEX)
+if(CMAKE_REGENERATE_YACCLEX)
+ set(parsersLexers cmDependsFortran cmCommandArgument cmExpr)
+ find_program(YACC_EXECUTABLE
NAMES yacc bison
PATHS /usr/bin
DOC "Yacc or Bison executable")
- FIND_PROGRAM(FLEX_EXECUTABLE
+ find_program(FLEX_EXECUTABLE
NAMES flex
PATHS /usr/bin
DOC "Flex executable")
- MARK_AS_ADVANCED(YACC_EXECUTABLE FLEX_EXECUTABLE)
- IF(YACC_EXECUTABLE)
- SET(BISON_FLAGS)
- IF(YACC_EXECUTABLE MATCHES "bison")
- SET(BISON_FLAGS "--yacc")
- ENDIF(YACC_EXECUTABLE MATCHES "bison")
- SET(yacc_files)
- FOREACH(name ${parsersLexers})
- SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y")
- SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Parser.cxx")
- SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}ParserTokens.h")
- ADD_CUSTOM_COMMAND(
+ mark_as_advanced(YACC_EXECUTABLE FLEX_EXECUTABLE)
+ if(YACC_EXECUTABLE)
+ set(BISON_FLAGS)
+ if(YACC_EXECUTABLE MATCHES "bison")
+ set(BISON_FLAGS "--yacc")
+ endif()
+ set(yacc_files)
+ foreach(name ${parsersLexers})
+ set(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y")
+ set(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Parser.cxx")
+ set(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}ParserTokens.h")
+ add_custom_command(
OUTPUT "${dst}"
DEPENDS "${src}"
COMMAND
${YACC_EXECUTABLE}
--name-prefix=${name}_yy --defines=${hdr} -o${dst} ${src}
)
- SET(yacc_files ${yacc_files} "${dst}")
- ENDFOREACH(name)
- ADD_CUSTOM_TARGET(RerunYacc DEPENDS ${yacc_files})
- ENDIF(YACC_EXECUTABLE)
- IF(FLEX_EXECUTABLE)
- SET(lex_files)
- FOREACH(name ${parsersLexers})
- SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Lexer.in.l")
- SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.cxx")
- SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.h")
- ADD_CUSTOM_COMMAND(
+ set(yacc_files ${yacc_files} "${dst}")
+ endforeach()
+ add_custom_target(RerunYacc DEPENDS ${yacc_files})
+ endif()
+ if(FLEX_EXECUTABLE)
+ set(lex_files)
+ foreach(name ${parsersLexers})
+ set(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Lexer.in.l")
+ set(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.cxx")
+ set(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.h")
+ add_custom_command(
OUTPUT "${dst}"
DEPENDS "${src}"
COMMAND
${FLEX_EXECUTABLE}
--prefix=${name}_yy --header-file=${hdr} -o${dst} ${src}
)
- SET(lex_files ${lex_files} "${dst}")
- ENDFOREACH(name)
- ADD_CUSTOM_TARGET(RerunLex DEPENDS ${lex_files})
- ENDIF(FLEX_EXECUTABLE)
+ set(lex_files ${lex_files} "${dst}")
+ endforeach()
+ add_custom_target(RerunLex DEPENDS ${lex_files})
+ endif()
-ENDIF(CMAKE_REGENERATE_YACCLEX)
+endif()
# Check if we can build the ELF parser.
-IF(CMAKE_USE_ELF_PARSER)
- SET(ELF_SRCS cmELF.h cmELF.cxx)
-ENDIF(CMAKE_USE_ELF_PARSER)
+if(CMAKE_USE_ELF_PARSER)
+ set(ELF_SRCS cmELF.h cmELF.cxx)
+endif()
#
# Sources for CMakeLib
#
-SET(SRCS
+set(SRCS
cmStandardIncludes.cxx
cmArchiveWrite.cxx
cmBootstrapCommands.cxx
@@ -176,6 +176,10 @@ SET(SRCS
cmExportFileGenerator.cxx
cmExportInstallFileGenerator.h
cmExportInstallFileGenerator.cxx
+ cmExportSet.h
+ cmExportSet.cxx
+ cmExportSetMap.h
+ cmExportSetMap.cxx
cmExtraCodeBlocksGenerator.cxx
cmExtraCodeBlocksGenerator.h
cmExtraEclipseCDT4Generator.cxx
@@ -183,6 +187,14 @@ SET(SRCS
cmFileTimeComparison.cxx
cmFileTimeComparison.h
cmGeneratedFileStream.cxx
+ cmGeneratorExpressionDAGChecker.cxx
+ cmGeneratorExpressionDAGChecker.h
+ cmGeneratorExpressionEvaluator.cxx
+ cmGeneratorExpressionEvaluator.h
+ cmGeneratorExpressionLexer.cxx
+ cmGeneratorExpressionLexer.h
+ cmGeneratorExpressionParser.cxx
+ cmGeneratorExpressionParser.h
cmGeneratorExpression.cxx
cmGeneratorExpression.h
cmGeneratorTarget.cxx
@@ -251,6 +263,7 @@ SET(SRCS
cmSystemTools.h
cmTarget.cxx
cmTarget.h
+ cmTargetExport.h
cmTest.cxx
cmTest.h
cmTestGenerator.cxx
@@ -275,30 +288,30 @@ SET(SRCS
)
# Kdevelop only works on UNIX and not windows
-IF(UNIX)
- SET(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx)
-ENDIF(UNIX)
+if(UNIX)
+ set(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx)
+endif()
# Xcode only works on Apple
-IF(APPLE)
- SET(SRCS ${SRCS}
+if(APPLE)
+ set(SRCS ${SRCS}
cmXCodeObject.cxx
cmXCode21Object.cxx
cmGlobalXCodeGenerator.cxx
cmGlobalXCodeGenerator.h
cmLocalXCodeGenerator.cxx
cmLocalXCodeGenerator.h)
-ENDIF(APPLE)
+endif()
-IF (WIN32)
- SET(SRCS ${SRCS}
+if (WIN32)
+ set(SRCS ${SRCS}
cmCallVisualStudioMacro.cxx
cmCallVisualStudioMacro.h
)
- IF(NOT UNIX)
- SET(SRCS ${SRCS}
+ if(NOT UNIX)
+ set(SRCS ${SRCS}
cmGlobalBorlandMakefileGenerator.cxx
cmGlobalBorlandMakefileGenerator.h
cmGlobalMSYSMakefileGenerator.cxx
@@ -356,11 +369,11 @@ IF (WIN32)
cmWin32ProcessExecution.cxx
cmWin32ProcessExecution.h
)
- ENDIF(NOT UNIX)
-ENDIF (WIN32)
+ endif()
+endif ()
# Ninja support
-SET(SRCS ${SRCS}
+set(SRCS ${SRCS}
cmGlobalNinjaGenerator.cxx
cmGlobalNinjaGenerator.h
cmNinjaTypes.h
@@ -373,34 +386,34 @@ SET(SRCS ${SRCS}
cmNinjaUtilityTargetGenerator.cxx
cmNinjaUtilityTargetGenerator.h
)
-IF(WIN32 AND NOT CYGWIN AND NOT BORLAND)
- SET_SOURCE_FILES_PROPERTIES(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
- ADD_EXECUTABLE(cmcldeps cmcldeps.cxx)
- TARGET_LINK_LIBRARIES(cmcldeps CMakeLib)
- INSTALL_TARGETS(/bin cmcldeps)
-ENDIF()
+if(WIN32 AND NOT CYGWIN AND NOT BORLAND)
+ set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
+ add_executable(cmcldeps cmcldeps.cxx)
+ target_link_libraries(cmcldeps CMakeLib)
+ install_targets(/bin cmcldeps)
+endif()
# create a library used by the command line and the GUI
-ADD_LIBRARY(CMakeLib ${SRCS})
-TARGET_LINK_LIBRARIES(CMakeLib cmsys
+add_library(CMakeLib ${SRCS})
+target_link_libraries(CMakeLib cmsys
${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
${CMAKE_CURL_LIBRARIES} )
# On Apple we need CoreFoundation
-IF(APPLE)
- TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation")
-ENDIF(APPLE)
+if(APPLE)
+ target_link_libraries(CMakeLib "-framework CoreFoundation")
+endif()
# On some platforms we need the rpcrt4 library for the VS 7 generators.
-IF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
- TARGET_LINK_LIBRARIES(CMakeLib rpcrt4)
-ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
+if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
+ target_link_libraries(CMakeLib rpcrt4)
+endif()
#
# CTestLib
#
-INCLUDE_DIRECTORIES(
+include_directories(
"${CMake_SOURCE_DIR}/Source/CTest"
${CMAKE_XMLRPC_INCLUDES}
${CMAKE_CURL_INCLUDES}
@@ -408,7 +421,7 @@ INCLUDE_DIRECTORIES(
#
# Sources for CTestLib
#
-SET(CTEST_SRCS cmCTest.cxx
+set(CTEST_SRCS cmCTest.cxx
CTest/cmProcess.cxx
CTest/cmCTestBatchTestHandler.cxx
CTest/cmCTestBuildAndTestHandler.cxx
@@ -461,13 +474,13 @@ SET(CTEST_SRCS cmCTest.cxx
)
# Build CTestLib
-ADD_LIBRARY(CTestLib ${CTEST_SRCS})
-TARGET_LINK_LIBRARIES(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
+add_library(CTestLib ${CTEST_SRCS})
+target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
#
# Sources for CPack
#
-SET(CPACK_SRCS
+set(CPACK_SRCS
CPack/cmCPackArchiveGenerator.cxx
CPack/cmCPackComponentGroup.cxx
CPack/cmCPackGeneratorFactory.cxx
@@ -483,82 +496,82 @@ SET(CPACK_SRCS
CPack/cmCPackDocumentMacros.cxx
)
-IF(CYGWIN)
- SET(CPACK_SRCS ${CPACK_SRCS}
+if(CYGWIN)
+ set(CPACK_SRCS ${CPACK_SRCS}
CPack/cmCPackCygwinBinaryGenerator.cxx
CPack/cmCPackCygwinSourceGenerator.cxx
)
-ENDIF(CYGWIN)
+endif()
-IF(UNIX)
- SET(CPACK_SRCS ${CPACK_SRCS}
+if(UNIX)
+ set(CPACK_SRCS ${CPACK_SRCS}
CPack/cmCPackDebGenerator.cxx
CPack/cmCPackRPMGenerator.cxx
)
-ENDIF(UNIX)
+endif()
-IF(APPLE)
- SET(CPACK_SRCS ${CPACK_SRCS}
+if(APPLE)
+ set(CPACK_SRCS ${CPACK_SRCS}
CPack/cmCPackBundleGenerator.cxx
CPack/cmCPackDragNDropGenerator.cxx
CPack/cmCPackOSXX11Generator.cxx
CPack/cmCPackPackageMakerGenerator.cxx
)
-ENDIF(APPLE)
+endif()
# Build CPackLib
-ADD_LIBRARY(CPackLib ${CPACK_SRCS})
-TARGET_LINK_LIBRARIES(CPackLib CMakeLib)
+add_library(CPackLib ${CPACK_SRCS})
+target_link_libraries(CPackLib CMakeLib)
-IF(APPLE)
- ADD_EXECUTABLE(cmakexbuild cmakexbuild.cxx)
- TARGET_LINK_LIBRARIES(cmakexbuild CMakeLib)
- ADD_EXECUTABLE(OSXScriptLauncher
+if(APPLE)
+ add_executable(cmakexbuild cmakexbuild.cxx)
+ target_link_libraries(cmakexbuild CMakeLib)
+ add_executable(OSXScriptLauncher
CPack/OSXScriptLauncher.cxx)
- TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys)
- TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework CoreFoundation")
-ENDIF(APPLE)
+ target_link_libraries(OSXScriptLauncher cmsys)
+ target_link_libraries(OSXScriptLauncher "-framework CoreFoundation")
+endif()
# Build CMake executable
-ADD_EXECUTABLE(cmake cmakemain.cxx)
-TARGET_LINK_LIBRARIES(cmake CMakeLib)
+add_executable(cmake cmakemain.cxx)
+target_link_libraries(cmake CMakeLib)
# Build special executable for running programs on Windows 98
-IF(WIN32)
- IF(NOT UNIX)
- ADD_EXECUTABLE(cmw9xcom cmw9xcom.cxx)
- TARGET_LINK_LIBRARIES(cmw9xcom CMakeLib)
- INSTALL_TARGETS(/bin cmw9xcom)
- ENDIF(NOT UNIX)
-ENDIF(WIN32)
+if(WIN32)
+ if(NOT UNIX)
+ add_executable(cmw9xcom cmw9xcom.cxx)
+ target_link_libraries(cmw9xcom CMakeLib)
+ install_targets(/bin cmw9xcom)
+ endif()
+endif()
# Build CTest executable
-ADD_EXECUTABLE(ctest ctest.cxx)
-TARGET_LINK_LIBRARIES(ctest CTestLib)
+add_executable(ctest ctest.cxx)
+target_link_libraries(ctest CTestLib)
# Build CPack executable
-ADD_EXECUTABLE(cpack CPack/cpack.cxx)
-TARGET_LINK_LIBRARIES(cpack CPackLib)
+add_executable(cpack CPack/cpack.cxx)
+target_link_libraries(cpack CPackLib)
# Curses GUI
-IF(BUILD_CursesDialog)
- INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
-ENDIF(BUILD_CursesDialog)
+if(BUILD_CursesDialog)
+ include(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
+endif()
# Qt GUI
-OPTION(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
-IF(BUILD_QtDialog)
- SUBDIRS(QtDialog)
-ENDIF(BUILD_QtDialog)
-
-INCLUDE (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
-INCLUDE (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
-
-INSTALL_TARGETS(/bin cmake)
-INSTALL_TARGETS(/bin ctest)
-INSTALL_TARGETS(/bin cpack)
-IF(APPLE)
- INSTALL_TARGETS(/bin cmakexbuild)
-ENDIF(APPLE)
-
-INSTALL_FILES(${CMAKE_DATA_DIR}/include cmCPluginAPI.h)
+option(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
+if(BUILD_QtDialog)
+ add_subdirectory(QtDialog)
+endif()
+
+include (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
+include (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
+
+install_targets(/bin cmake)
+install_targets(/bin ctest)
+install_targets(/bin cpack)
+if(APPLE)
+ install_targets(/bin cmakexbuild)
+endif()
+
+install_files(${CMAKE_DATA_DIR}/include cmCPluginAPI.h)
diff --git a/Source/CMakeVersion.bash b/Source/CMakeVersion.bash
index 126adba..4794e60 100755
--- a/Source/CMakeVersion.bash
+++ b/Source/CMakeVersion.bash
@@ -3,5 +3,5 @@
if test "x$1" = "x-f"; then shift ; n='*' ; else n='\{8\}' ; fi
if test "$#" -gt 0; then echo 1>&2 "usage: CMakeVersion.bash [-f]"; exit 1; fi
sed -i -e '
-s/\(^SET(CMake_VERSION_TWEAK\) [0-9]'"$n"'\(.*\)/\1 '"$(date +%Y%m%d)"'\2/
+s/\(^set(CMake_VERSION_TWEAK\) [0-9]'"$n"'\(.*\)/\1 '"$(date +%Y%m%d)"'\2/
' "${BASH_SOURCE%/*}/CMakeVersion.cmake"
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index d124b66..c59c618 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,6 +1,6 @@
# CMake version number components.
-SET(CMake_VERSION_MAJOR 2)
-SET(CMake_VERSION_MINOR 8)
-SET(CMake_VERSION_PATCH 9)
-SET(CMake_VERSION_TWEAK 0)
-#SET(CMake_VERSION_RC 3)
+set(CMake_VERSION_MAJOR 2)
+set(CMake_VERSION_MINOR 8)
+set(CMake_VERSION_PATCH 10)
+set(CMake_VERSION_TWEAK 2)
+#set(CMake_VERSION_RC 3)
diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx
index e0fbe9b..a9842c1 100644
--- a/Source/CPack/OSXScriptLauncher.cxx
+++ b/Source/CPack/OSXScriptLauncher.cxx
@@ -93,7 +93,7 @@ int main(int argc, char* argv[])
cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
cmsysProcess_SetTimeout(cp, 0);
cmsysProcess_Execute(cp);
-
+
std::vector<char> tempOutput;
char* data;
int length;
@@ -111,9 +111,9 @@ int main(int argc, char* argv[])
}
cmsys_ios::cout.write(data, length);
}
-
+
cmsysProcess_WaitForExit(cp, 0);
-
+
bool result = true;
if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exited)
{
@@ -140,7 +140,7 @@ int main(int argc, char* argv[])
std::cerr << error_str << std::endl;
result = false;
}
-
+
cmsysProcess_Delete(cp);
return 0;
diff --git a/Source/CPack/bills-comments.txt b/Source/CPack/bills-comments.txt
index f73499d..c3b4ee8 100644
--- a/Source/CPack/bills-comments.txt
+++ b/Source/CPack/bills-comments.txt
@@ -1,18 +1,18 @@
cpack.cxx
-
-cmCPackGenerators -- creates cmCPackGenericGenerator's via NewGenerator
+
+cmCPackGenerators -- creates cmCPackGenericGenerator's via NewGenerator
- a cmCPackGenericGenerator factory
cmCPackGenericGenerator::Initialize
this->InitializeInternal
- CPACK_INCLUDE_TOPLEVEL_DIRECTORY = 0 turns off
+ CPACK_INCLUDE_TOPLEVEL_DIRECTORY = 0 turns off
// binary package run
cmCPackGenericGenerator::ProcessGenerator // DoPackage
cmCPackGenericGenerator::PrepareNames -- sets a bunch of CPACK_vars
- cmCPackGenericGenerator::InstallProject
+ cmCPackGenericGenerator::InstallProject
run preinstall (make preinstall/fast)
call ReadListFile(cmake_install.cmake)
glob recurse in install directory to get list of files
@@ -22,9 +22,9 @@ cmCPackGenericGenerator::ProcessGenerator // DoPackage
// source package run
cmCPackGenericGenerator::ProcessGenerator // DoPackage
cmCPackGenericGenerator::PrepareNames -- sets a bunch of CPACK_vars
- cmCPackGenericGenerator::InstallProject -->
+ cmCPackGenericGenerator::InstallProject -->
if set CPACK_INSTALLED_DIRECTORIES
- glob the files in that directory
+ glob the files in that directory
copy those files to the tmp install directory _CPack something
glob recurse in install directory to get list of files
this->CompressFiles with the list of files
@@ -35,12 +35,12 @@ packages. It is controled based on values set in CPACK_ variables.
InstallProject
- 1. CPACK_INSTALL_COMMANDS - a list of commands used to install the package
+ 1. CPACK_INSTALL_COMMANDS - a list of commands used to install the package
2. CPACK_INSTALLED_DIRECTORIES - copy this directory to CPACK_TEMPORARY_DIRECTORY
3. CPACK_INSTALL_CMAKE_PROJECTS - a cmake install script
- - run make preinstall
+ - run make preinstall
- run cmake_install.cmake
- set CMAKE_INSTALL_PREFIX to the temp directory
- CPACK_BUILD_CONFIG check this and set the BUILD_TYPE to it
@@ -59,10 +59,10 @@ rename cmCPackGenericGenerator::ProcessGenerator -> cmCPackGenerator::DoPackage
break up cmCPackGenerator::InstallProject so it calls the following:
// run user provided install commands
- cmCPackGenerator::RunInstallCommands();
+ cmCPackGenerator::RunInstallCommands();
// copy entire directories that need no processing like source trees
- cmCPackGenerator::CopyPreInstalledDirectories();
+ cmCPackGenerator::CopyPreInstalledDirectories();
// run the cmake install scripts if provided
- cmCPackGenerator::RunCMakeInstallScripts()
+ cmCPackGenerator::RunCMakeInstallScripts()
-
diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h
index b1bbb83..6411b1e 100644
--- a/Source/CPack/cmCPackArchiveGenerator.h
+++ b/Source/CPack/cmCPackArchiveGenerator.h
@@ -33,7 +33,7 @@ public:
*/
cmCPackArchiveGenerator(cmArchiveWrite::Compress, cmArchiveWrite::Type);
virtual ~cmCPackArchiveGenerator();
- // Used to add a header to the archive
+ // Used to add a header to the archive
virtual int GenerateHeader(std::ostream* os);
// component support
virtual bool SupportsComponentInstallation() const;
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index af78e78..6c994f1 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -91,8 +91,8 @@ int cmCPackBundleGenerator::PackageFiles()
}
// Get optional arguments ...
- const std::string cpack_bundle_startup_command =
- this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND")
+ const std::string cpack_bundle_startup_command =
+ this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND")
? this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND") : "";
// The staging directory contains everything that will end-up inside the
diff --git a/Source/CPack/cmCPackComponentGroup.cxx b/Source/CPack/cmCPackComponentGroup.cxx
index 1d21fb1..f93eca8 100644
--- a/Source/CPack/cmCPackComponentGroup.cxx
+++ b/Source/CPack/cmCPackComponentGroup.cxx
@@ -36,7 +36,7 @@ unsigned long cmCPackComponent::GetInstalledSize(const char* installDir) const
}
//----------------------------------------------------------------------
-unsigned long
+unsigned long
cmCPackComponent::GetInstalledSizeInKbytes(const char* installDir) const
{
unsigned long result = (GetInstalledSize(installDir) + 512) / 1024;
diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h
index cebdd6d..48d935c 100644
--- a/Source/CPack/cmCPackComponentGroup.h
+++ b/Source/CPack/cmCPackComponentGroup.h
@@ -18,7 +18,7 @@
class cmCPackComponentGroup;
/** \class cmCPackInstallationType
- * \brief A certain type of installation, which encompasses a
+ * \brief A certain type of installation, which encompasses a
* set of components.
*/
class cmCPackInstallationType
@@ -90,7 +90,7 @@ public:
std::vector<std::string> Directories;
/// Get the total installed size of all of the files in this
- /// component, in bytes. installDir is the directory into which the
+ /// component, in bytes. installDir is the directory into which the
/// component was installed.
unsigned long GetInstalledSize(const char* installDir) const;
diff --git a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
index 6c8fc54..6605f16 100644
--- a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
+++ b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
@@ -50,7 +50,7 @@ int cmCPackCygwinBinaryGenerator::PackageFiles()
std::string manifest = "/usr/share/doc/";
manifest += packageName;
manifest += "/MANIFEST";
- std::string manifestFile
+ std::string manifestFile
= this->GetOption("CPACK_TEMPORARY_DIRECTORY");
// Create a MANIFEST file that contains all of the files in
// the tar file
@@ -70,8 +70,8 @@ int cmCPackCygwinBinaryGenerator::PackageFiles()
}
// add the manifest file to the list of all files
files.push_back(manifestFile);
-
- // create the bzip2 tar file
+
+ // create the bzip2 tar file
return this->Superclass::PackageFiles();
}
@@ -81,8 +81,8 @@ const char* cmCPackCygwinBinaryGenerator::GetOutputExtension()
const char* patchNumber =this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if(!patchNumber)
{
- patchNumber = "1";
- cmCPackLogger(cmCPackLog::LOG_WARNING,
+ patchNumber = "1";
+ cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_CYGWIN_PATCH_NUMBER not specified using 1"
<< std::endl);
}
diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
index 5979729..f1e8539 100644
--- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx
+++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
@@ -68,18 +68,18 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
// and the CPACK_CYGWIN_PATCH_FILE and CPACK_TOPLEVEL_DIRECTORY
// files
std::string compressOutFile = packageDirFileName;
- // at this point compressOutFile is the full path to
+ // at this point compressOutFile is the full path to
// _CPack_Package/.../package-2.5.0.tar.bz2
// we want to create a tar _CPack_Package/.../package-2.5.0-1-src.tar.bz2
- // with these
- // _CPack_Package/.../package-2.5.0-1.patch
+ // with these
+ // _CPack_Package/.../package-2.5.0-1.patch
// _CPack_Package/.../package-2.5.0-1.sh
// _CPack_Package/.../package-2.5.0.tar.bz2
// the -1 is CPACK_CYGWIN_PATCH_NUMBER
-
+
// first copy the patch file and the .sh file
// to the toplevel cpack temp dir
-
+
// copy the patch file into place
if(!this->GetOption("CPACK_CYGWIN_PATCH_FILE"))
{
@@ -98,7 +98,7 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
}
if(!this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT"))
{
- cmCPackLogger(cmCPackLog::LOG_ERROR,
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
"No build script specified for cygwin sources.");
return 0;
}
@@ -168,7 +168,7 @@ const char* cmCPackCygwinSourceGenerator::GetPackagingInstallPrefix()
const char* cmCPackCygwinSourceGenerator::GetOutputExtension()
{
this->OutputExtension = "-";
- const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
+ const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if(!patch)
{
cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER"
@@ -179,4 +179,4 @@ const char* cmCPackCygwinSourceGenerator::GetOutputExtension()
this->OutputExtension += "-src.tar.bz2";
return this->OutputExtension.c_str();
}
-
+
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index fa456de..4bd5d5c 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -293,15 +293,15 @@ int cmCPackDebGenerator::createDeb()
// debian policy enforce lower case for package name
// mandatory entries:
- std::string debian_pkg_name = cmsys::SystemTools::LowerCase(
+ std::string debian_pkg_name = cmsys::SystemTools::LowerCase(
this->GetOption("CPACK_DEBIAN_PACKAGE_NAME") );
- const char* debian_pkg_version =
+ const char* debian_pkg_version =
this->GetOption("CPACK_DEBIAN_PACKAGE_VERSION");
- const char* debian_pkg_section =
+ const char* debian_pkg_section =
this->GetOption("CPACK_DEBIAN_PACKAGE_SECTION");
- const char* debian_pkg_priority =
+ const char* debian_pkg_priority =
this->GetOption("CPACK_DEBIAN_PACKAGE_PRIORITY");
- const char* debian_pkg_arch =
+ const char* debian_pkg_arch =
this->GetOption("CPACK_DEBIAN_PACKAGE_ARCHITECTURE");
const char* maintainer = this->GetOption("CPACK_DEBIAN_PACKAGE_MAINTAINER");
const char* desc = this->GetOption("CPACK_DEBIAN_PACKAGE_DESCRIPTION");
@@ -719,8 +719,8 @@ static int copy_ar(CF *cfp, off_t size)
FILE* from = cfp->rFile;
FILE* to = cfp->wFile;
- while (sz &&
- (nr = fread(buf, 1, sz < static_cast<off_t>(sizeof(buf))
+ while (sz &&
+ (nr = fread(buf, 1, sz < static_cast<off_t>(sizeof(buf))
? static_cast<size_t>(sz) : sizeof(buf), from ))
> 0) {
sz -= nr;
@@ -731,7 +731,7 @@ static int copy_ar(CF *cfp, off_t size)
if (sz)
return -2;
- if (cfp->flags & WPAD && (size + ar_already_written) & 1
+ if (cfp->flags & WPAD && (size + ar_already_written) & 1
&& fwrite(&pad, 1, 1, to) != 1)
return -4;
@@ -767,8 +767,8 @@ static int put_arobj(CF *cfp, struct stat *sb)
(long long)sb->st_size + lname, ARFMAG);
else {
lname = 0;
- (void)sprintf(ar_hb, HDR2, name,
- (long int)sb->st_mtime, uid, gid, sb->st_mode,
+ (void)sprintf(ar_hb, HDR2, name,
+ (long int)sb->st_mtime, uid, gid, sb->st_mode,
(long long)sb->st_size, ARFMAG);
}
off_t size = sb->st_size;
@@ -790,7 +790,7 @@ static int put_arobj(CF *cfp, struct stat *sb)
/* append --
* Append files to the archive - modifies original archive or creates
- * a new archive if named archive does not exist.
+ * a new archive if named archive does not exist.
*/
static int ar_append(const char* archive,const std::vector<std::string>& files)
{
diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx
index edbef45..6a841fa 100644
--- a/Source/CPack/cmCPackDocumentVariables.cxx
+++ b/Source/CPack/cmCPackDocumentVariables.cxx
@@ -31,31 +31,42 @@ void cmCPackDocumentVariables::DefineVariables(cmake* cm)
"Each CPack generator as a built-in default value for this"
" variable. E.g. Archive generators (ZIP, TGZ, ...) includes"
" the top level whereas RPM or DEB don't. The user may override"
- " the default value byt setting this variable.\n"
+ " the default value by setting this variable.\n"
"There is a similar variable "
- "CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"
+ "CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY "
"which may be used to override the behavior for the component"
- "packaging case which may have different default value for"
- "historical (now backward compatibility) reason.", false,
+ " packaging case which may have different default value for"
+ " historical (now backward compatibility) reason.", false,
"Variables common to all CPack generators");
cm->DefineProperty
+ ("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY", cmProperty::VARIABLE,
+ "Boolean toggle to include/exclude top level directory "
+ "(component case).",
+ "Similar usage as CPACK_INCLUDE_TOPLEVEL_DIRECTORY"
+ " but for the component case. "
+ "See CPACK_INCLUDE_TOPLEVEL_DIRECTORY documentation for"
+ " the detail.", false,
+ "Variables common to all CPack generators");
+
+ cm->DefineProperty
("CPACK_SET_DESTDIR", cmProperty::VARIABLE,
"Boolean toggle to make CPack use DESTDIR mechanism when"
" packaging.", "DESTDIR means DESTination DIRectory."
" It is commonly used by makefile "
"users in order to install software at non-default location. It "
- "is a basic relocation mechanism. "
+ "is a basic relocation mechanism that should not be used on"
+ " Windows (see CMAKE_INSTALL_PREFIX documentation). "
"It is usually invoked like this:\n"
" make DESTDIR=/home/john install\n"
"which will install the concerned software using the"
- " installation prefix, e.g. \"/usr/local\" prepended with "
+ " installation prefix, e.g. \"/usr/local\" pre-pended with "
"the DESTDIR value which finally gives \"/home/john/usr/local\"."
" When preparing a package, CPack first installs the items to be "
"packaged in a local (to the build tree) directory by using the "
"same DESTDIR mechanism. Nevertheless, if "
"CPACK_SET_DESTDIR is set then CPack will set DESTDIR before"
- " doing the local install. The most noticeable difference is"
+ " doing the local install. The most noticeable difference is"
" that without CPACK_SET_DESTDIR, CPack uses "
"CPACK_PACKAGING_INSTALL_PREFIX as a prefix whereas with "
"CPACK_SET_DESTDIR set, CPack will use CMAKE_INSTALL_PREFIX as"
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 6aee401..78cb1b6 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -17,7 +17,7 @@
#include <cmsys/RegularExpression.hxx>
-static const char* SLAHeader =
+static const char* SLAHeader =
"data 'LPic' (5000) {\n"
" $\"0002 0011 0003 0001 0000 0000 0002 0000\"\n"
" $\"0008 0003 0000 0001 0004 0000 0004 0005\"\n"
@@ -29,7 +29,7 @@ static const char* SLAHeader =
"};\n"
"\n";
-static const char* SLASTREnglish =
+static const char* SLASTREnglish =
"resource 'STR#' (5002, \"English\") {\n"
" {\n"
" \"English\",\n"
@@ -90,7 +90,7 @@ int cmCPackDragNDropGenerator::InitializeInternal()
return 0;
}
this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path.c_str());
-
+
const std::string rez_path = cmSystemTools::FindProgram("Rez",
paths, false);
if(rez_path.empty())
@@ -222,7 +222,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// Get optional arguments ...
const std::string cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON")
? this->GetOption("CPACK_PACKAGE_ICON") : "";
-
+
const std::string cpack_dmg_volume_name =
this->GetOption("CPACK_DMG_VOLUME_NAME")
? this->GetOption("CPACK_DMG_VOLUME_NAME")
@@ -233,8 +233,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
? this->GetOption("CPACK_DMG_FORMAT") : "UDZO";
// Get optional arguments ...
- std::string cpack_license_file =
- this->GetOption("CPACK_RESOURCE_FILE_LICENSE") ?
+ std::string cpack_license_file =
+ this->GetOption("CPACK_RESOURCE_FILE_LICENSE") ?
this->GetOption("CPACK_RESOURCE_FILE_LICENSE") : "";
const std::string cpack_dmg_background_image =
@@ -405,7 +405,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
cmOStringStream detach_command;
detach_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
detach_command << " detach";
- detach_command << " \"" << temp_mount.str() << "\"";
+ detach_command << " \"" << temp_mount.str() << "\"";
if(!this->RunCommand(detach_command))
{
@@ -416,7 +416,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
return 0;
}
}
-
+
if(!cpack_license_file.empty())
{
std::string sla_r = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
@@ -460,7 +460,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
udco_image_command << " convert \"" << temp_image << "\"";
udco_image_command << " -format UDCO";
udco_image_command << " -o \"" << temp_udco << "\"";
-
+
std::string error;
if(!this->RunCommand(udco_image_command, &error))
{
@@ -476,17 +476,17 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
unflatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
unflatten_command << " unflatten ";
unflatten_command << "\"" << temp_udco << "\"";
-
+
if(!this->RunCommand(unflatten_command, &error))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error unflattening dmg for adding SLA." << std::endl
- << error
+ << error
<< std::endl);
return 0;
}
-
- // Rez the SLA
+
+ // Rez the SLA
cmOStringStream embed_sla_command;
embed_sla_command << this->GetOption("CPACK_COMMAND_REZ");
embed_sla_command << " \"" << sla_r << "\"";
@@ -496,8 +496,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
if(!this->RunCommand(embed_sla_command, &error))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error adding SLA." << std::endl
- << error
+ "Error adding SLA." << std::endl
+ << error
<< std::endl);
return 0;
}
@@ -507,7 +507,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
flatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
flatten_command << " flatten ";
flatten_command << "\"" << temp_udco << "\"";
-
+
if(!this->RunCommand(flatten_command, &error))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -530,7 +530,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
final_image_command << " -imagekey";
final_image_command << " zlib-level=9";
final_image_command << " -o \"" << output_file << "\"";
-
+
if(!this->RunCommand(final_image_command))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 0177653..e964696 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -105,7 +105,7 @@ int cmCPackGenerator::PrepareNames()
"CPACK_PACKAGE_FILE_NAME not specified" << std::endl);
return 0;
}
- std::string outName = pfname;
+ std::string outName = pfname;
tempDirectory += "/" + outName;
if(!this->GetOutputExtension())
{
@@ -149,7 +149,7 @@ int cmCPackGenerator::PrepareNames()
if ( !cmSystemTools::FileExists(descFileName) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Cannot find description file name: ["
+ "Cannot find description file name: ["
<< descFileName << "]" << std::endl);
return 0;
}
@@ -207,7 +207,7 @@ int cmCPackGenerator::InstallProject()
if ( !cmsys::SystemTools::MakeDirectory(bareTempInstallDirectory.c_str()))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating temporary directory: "
+ "Problem creating temporary directory: "
<< (tempInstallDirectory ? tempInstallDirectory : "(NULL}")
<< std::endl);
return 0;
@@ -584,7 +584,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
!(this->IsSet("CPACK_MONOLITHIC_INSTALL")))
{
// Determine the installation types for this project (if provided).
- std::string installTypesVar = "CPACK_"
+ std::string installTypesVar = "CPACK_"
+ cmSystemTools::UpperCase(installComponent) + "_INSTALL_TYPES";
const char *installTypes = this->GetOption(installTypesVar.c_str());
if (installTypes && *installTypes)
@@ -596,16 +596,16 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
installTypeIt != installTypesVector.end();
++installTypeIt)
{
- this->GetInstallationType(installProjectName.c_str(),
+ this->GetInstallationType(installProjectName.c_str(),
installTypeIt->c_str());
}
}
// Determine the set of components that will be used in this project
- std::string componentsVar
+ std::string componentsVar
= "CPACK_COMPONENTS_" + cmSystemTools::UpperCase(installComponent);
const char *components = this->GetOption(componentsVar.c_str());
- if (components && *components)
+ if (components && *components)
{
cmSystemTools::ExpandListArgument(components, componentsVector);
std::vector<std::string>::iterator compIt;
@@ -688,10 +688,10 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
if (componentInstall)
{
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
- "- Install component: " << installComponent
+ "- Install component: " << installComponent
<< std::endl);
}
-
+
cmake cm;
cm.AddCMakePaths();
cm.SetProgressCallback(cmCPackGeneratorProgress, this);
@@ -758,7 +758,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
"- Using DESTDIR + CPACK_INSTALL_PREFIX... (mf->AddDefinition)"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
- "- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'"
+ "- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'"
<< std::endl);
// Make sure that DESTDIR + CPACK_INSTALL_PREFIX directory
@@ -792,7 +792,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
if ( !cmsys::SystemTools::MakeDirectory(dir.c_str()))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating temporary directory: "
+ "Problem creating temporary directory: "
<< dir << std::endl);
return 0;
}
@@ -806,7 +806,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
tempInstallDirectory.c_str()))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating temporary directory: "
+ "Problem creating temporary directory: "
<< tempInstallDirectory << std::endl);
return 0;
}
@@ -832,7 +832,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
installComponent.c_str());
}
- // strip on TRUE, ON, 1, one or several file names, but not on
+ // strip on TRUE, ON, 1, one or several file names, but not on
// FALSE, OFF, 0 and an empty string
if (!cmSystemTools::IsOff(this->GetOption("CPACK_STRIP_FILES")))
{
@@ -855,7 +855,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// If CPack was asked to warn on ABSOLUTE INSTALL DESTINATION
// then forward request to cmake_install.cmake script
- if (this->GetOption("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION"))
+ if (this->IsOn("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION"))
{
mf->AddDefinition("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION",
"1");
@@ -865,7 +865,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// then ask cmake_install.cmake script to error out
// as soon as it occurs (before installing file)
if (!SupportsAbsoluteDestination() ||
- this->GetOption("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION"))
+ this->IsOn("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION"))
{
mf->AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION",
"1");
@@ -905,7 +905,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
localFileName =
cmSystemTools::RelativePath(InstallPrefix, fit->c_str());
localFileName =
- localFileName.substr(localFileName.find('/')+1,
+ localFileName.substr(localFileName.find_first_not_of('/'),
std::string::npos);
Components[installComponent].Files.push_back(localFileName);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file <"
@@ -1024,7 +1024,7 @@ int cmCPackGenerator::DoPackage()
= this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
if ( cmSystemTools::FileExists(toplevelDirectory) )
{
- cmCPackLogger(cmCPackLog::LOG_VERBOSE,
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Remove toplevel directory: "
<< toplevelDirectory << std::endl);
if ( !cmSystemTools::RepeatedRemoveDirectory(toplevelDirectory) )
@@ -1153,10 +1153,10 @@ int cmCPackGenerator::Initialize(const char* name, cmMakefile* mf)
// set the running generator name
this->SetOption("CPACK_GENERATOR", this->Name.c_str());
// Load the project specific config file
- const char* config =
+ const char* config =
this->GetOption("CPACK_PROJECT_CONFIG_FILE");
if(config)
- {
+ {
mf->ReadListFile(config);
}
int result = this->InitializeInternal();
@@ -1193,13 +1193,13 @@ bool cmCPackGenerator::IsOn(const char* name) const
//----------------------------------------------------------------------
const char* cmCPackGenerator::GetOption(const char* op) const
-{
+{
const char* ret = this->MakefileMap->GetDefinition(op);
if(!ret)
- {
- cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ {
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Warning, GetOption return NULL for: "
- << op
+ << op
<< std::endl);
}
return ret;
@@ -1222,7 +1222,7 @@ int cmCPackGenerator::SetCMakeRoot()
return 1;
}
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Could not find CMAKE_ROOT !!!"
+ "Could not find CMAKE_ROOT !!!"
<< std::endl
<< "CMake has most likely not been installed correctly."
<< std::endl
@@ -1516,14 +1516,14 @@ cmCPackGenerator::GetInstallationType(const char *projectName,
(void) projectName;
bool hasInstallationType = this->InstallationTypes.count(name) != 0;
cmCPackInstallationType *installType = &this->InstallationTypes[name];
- if (!hasInstallationType)
+ if (!hasInstallationType)
{
// Define the installation type
- std::string macroPrefix = "CPACK_INSTALL_TYPE_"
+ std::string macroPrefix = "CPACK_INSTALL_TYPE_"
+ cmsys::SystemTools::UpperCase(name);
installType->Name = name;
- const char* displayName
+ const char* displayName
= this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str());
if (displayName && *displayName)
{
@@ -1546,13 +1546,13 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
{
bool hasComponent = this->Components.count(name) != 0;
cmCPackComponent *component = &this->Components[name];
- if (!hasComponent)
+ if (!hasComponent)
{
// Define the component
- std::string macroPrefix = "CPACK_COMPONENT_"
+ std::string macroPrefix = "CPACK_COMPONENT_"
+ cmsys::SystemTools::UpperCase(name);
component->Name = name;
- const char* displayName
+ const char* displayName
= this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str());
if (displayName && *displayName)
{
@@ -1562,7 +1562,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
{
component->DisplayName = component->Name;
}
- component->IsHidden
+ component->IsHidden
= this->IsSet((macroPrefix + "_HIDDEN").c_str());
component->IsRequired
= this->IsSet((macroPrefix + "_REQUIRED").c_str());
@@ -1572,7 +1572,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
= this->IsSet((macroPrefix + "_DOWNLOADED").c_str())
|| cmSystemTools::IsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
- const char* archiveFile = this->GetOption((macroPrefix +
+ const char* archiveFile = this->GetOption((macroPrefix +
"_ARCHIVE_FILE").c_str());
if (archiveFile && *archiveFile)
{
@@ -1580,7 +1580,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
}
const char* groupName = this->GetOption((macroPrefix + "_GROUP").c_str());
- if (groupName && *groupName)
+ if (groupName && *groupName)
{
component->Group = GetComponentGroup(projectName, groupName);
component->Group->Components.push_back(component);
@@ -1598,15 +1598,15 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
}
// Determine the installation types.
- const char *installTypes
+ const char *installTypes
= this->GetOption((macroPrefix + "_INSTALL_TYPES").c_str());
- if (installTypes && *installTypes)
+ if (installTypes && *installTypes)
{
std::vector<std::string> installTypesVector;
cmSystemTools::ExpandListArgument(installTypes, installTypesVector);
std::vector<std::string>::iterator installTypesIt;
- for (installTypesIt = installTypesVector.begin();
- installTypesIt != installTypesVector.end();
+ for (installTypesIt = installTypesVector.begin();
+ installTypesIt != installTypesVector.end();
++installTypesIt)
{
component->InstallationTypes.push_back(
@@ -1616,16 +1616,16 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
// Determine the component dependencies.
const char *depends = this->GetOption((macroPrefix + "_DEPENDS").c_str());
- if (depends && *depends)
+ if (depends && *depends)
{
std::vector<std::string> dependsVector;
cmSystemTools::ExpandListArgument(depends, dependsVector);
std::vector<std::string>::iterator dependIt;
- for (dependIt = dependsVector.begin();
- dependIt != dependsVector.end();
+ for (dependIt = dependsVector.begin();
+ dependIt != dependsVector.end();
++dependIt)
{
- cmCPackComponent *child = GetComponent(projectName,
+ cmCPackComponent *child = GetComponent(projectName,
dependIt->c_str());
component->Dependencies.push_back(child);
child->ReverseDependencies.push_back(component);
@@ -1640,15 +1640,15 @@ cmCPackComponentGroup*
cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name)
{
(void) projectName;
- std::string macroPrefix = "CPACK_COMPONENT_GROUP_"
+ std::string macroPrefix = "CPACK_COMPONENT_GROUP_"
+ cmsys::SystemTools::UpperCase(name);
bool hasGroup = this->ComponentGroups.count(name) != 0;
cmCPackComponentGroup *group = &this->ComponentGroups[name];
- if (!hasGroup)
+ if (!hasGroup)
{
// Define the group
group->Name = name;
- const char* displayName
+ const char* displayName
= this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str());
if (displayName && *displayName)
{
@@ -1669,7 +1669,7 @@ cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name)
= this->IsSet((macroPrefix + "_BOLD_TITLE").c_str());
group->IsExpandedByDefault
= this->IsSet((macroPrefix + "_EXPANDED").c_str());
- const char* parentGroupName
+ const char* parentGroupName
= this->GetOption((macroPrefix + "_PARENT_GROUP").c_str());
if (parentGroupName && *parentGroupName)
{
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index 6748512..8fafef9 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -113,7 +113,7 @@ public:
//! Display verbose information via logger
void DisplayVerboseOutput(const char* msg, float progress);
-
+
bool ReadListFile(const char* moduleName);
protected:
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 7b52511..b2e57a2 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -102,7 +102,7 @@ int cmCPackNSISGenerator::PackageFiles()
}
if (!Components.empty())
{
- // If this is a component installation, strip off the component
+ // If this is a component installation, strip off the component
// part of the path.
std::string::size_type slash = fileN.find('/');
if (slash != std::string::npos)
@@ -124,12 +124,12 @@ int cmCPackNSISGenerator::PackageFiles()
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Dirs: "
<< dstr.str().c_str() << std::endl);
- this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES",
+ this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES",
dstr.str().c_str());
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << nsisInFileName
<< " to " << nsisFileName << std::endl);
- if(this->IsSet("CPACK_NSIS_MUI_ICON")
+ if(this->IsSet("CPACK_NSIS_MUI_ICON")
|| this->IsSet("CPACK_NSIS_MUI_UNIICON"))
{
std::string installerIconCode;
@@ -174,7 +174,7 @@ int cmCPackNSISGenerator::PackageFiles()
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", "");
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", "");
this->SetOptionIfNotSet("CPACK_NSIS_PAGE_COMPONENTS", "");
- this->SetOptionIfNotSet("CPACK_NSIS_FULL_INSTALL",
+ this->SetOptionIfNotSet("CPACK_NSIS_FULL_INSTALL",
"File /r \"${INST_DIR}\\*.*\"");
this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTIONS", "");
this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTION_LIST", "");
@@ -194,7 +194,7 @@ int cmCPackNSISGenerator::PackageFiles()
// Create installation types. The order is significant, so we first fill
// in a vector based on the indices, and print them in that order.
- std::vector<cmCPackInstallationType *>
+ std::vector<cmCPackInstallationType *>
installTypes(this->InstallationTypes.size());
std::map<std::string, cmCPackInstallationType>::iterator installTypeIt;
for (installTypeIt = this->InstallationTypes.begin();
@@ -221,15 +221,15 @@ int cmCPackNSISGenerator::PackageFiles()
{
if (groupIt->second.ParentGroup == 0)
{
- componentCode +=
+ componentCode +=
this->CreateComponentGroupDescription(&groupIt->second, macrosOut);
}
// Add the group description, if any.
if (!groupIt->second.Description.empty())
{
- groupDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${"
- + groupIt->first + "} \""
+ groupDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${"
+ + groupIt->first + "} \""
+ this->TranslateNewlines(groupIt->second.Description) + "\"\n";
}
}
@@ -251,7 +251,7 @@ int cmCPackNSISGenerator::PackageFiles()
if (!compIt->second.Group)
{
- componentCode
+ componentCode
+= this->CreateComponentDescription(&compIt->second, macrosOut);
}
@@ -265,8 +265,8 @@ int cmCPackNSISGenerator::PackageFiles()
// Add the component description, if any.
if (!compIt->second.Description.empty())
{
- componentDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${"
- + compIt->first + "} \""
+ componentDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${"
+ + compIt->first + "} \""
+ this->TranslateNewlines(compIt->second.Description) + "\"\n";
}
}
@@ -276,17 +276,17 @@ int cmCPackNSISGenerator::PackageFiles()
if (componentDescriptions.empty() && groupDescriptions.empty())
{
// Turn off the "Description" box
- this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC",
+ this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC",
"!define MUI_COMPONENTSPAGE_NODESC");
}
else
{
- componentDescriptions =
+ componentDescriptions =
"!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n"
+ componentDescriptions
+ groupDescriptions
+ "!insertmacro MUI_FUNCTION_DESCRIPTION_END\n";
- this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC",
+ this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC",
componentDescriptions.c_str());
}
@@ -308,12 +308,12 @@ int cmCPackNSISGenerator::PackageFiles()
componentCode.c_str());
this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTION_LIST",
sectionList.c_str());
- this->SetOptionIfNotSet("CPACK_NSIS_SECTION_SELECTED_VARS",
+ this->SetOptionIfNotSet("CPACK_NSIS_SECTION_SELECTED_VARS",
selectedVarsList.c_str());
this->SetOption("CPACK_NSIS_DEFINES", defines.c_str());
}
- this->ConfigureFile(nsisInInstallOptions.c_str(),
+ this->ConfigureFile(nsisInInstallOptions.c_str(),
nsisInstallOptions.c_str());
this->ConfigureFile(nsisInFileName.c_str(), nsisFileName.c_str());
std::string nsisCmd = "\"";
@@ -445,11 +445,11 @@ int cmCPackNSISGenerator::InitializeInternal()
{
cmCPackLogger(cmCPackLog::LOG_DEBUG, "CPACK_CREATE_DESKTOP_LINKS: "
<< cpackPackageDeskTopLinks << std::endl);
-
+
cmSystemTools::
ExpandListArgument(cpackPackageDeskTopLinks,
cpackPackageDesktopLinksVector);
- for(std::vector<std::string>::iterator i =
+ for(std::vector<std::string>::iterator i =
cpackPackageDesktopLinksVector.begin(); i !=
cpackPackageDesktopLinksVector.end(); ++i)
{
@@ -499,7 +499,7 @@ int cmCPackNSISGenerator::InitializeInternal()
if(cpackPackageDesktopLinksVector.size() &&
std::find(cpackPackageDesktopLinksVector.begin(),
cpackPackageDesktopLinksVector.end(),
- execName)
+ execName)
!= cpackPackageDesktopLinksVector.end())
{
str << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
@@ -579,7 +579,7 @@ void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str,
else
{
str << " WriteINIStr \"$SMPROGRAMS\\$STARTMENU_FOLDER\\"
- << linkName << ".url\" \"InternetShortcut\" \"URL\" \""
+ << linkName << ".url\" \"InternetShortcut\" \"URL\" \""
<< sourceName << "\""
<< std::endl;
deleteStr << " Delete \"$SMPROGRAMS\\$MUI_TEMP\\" << linkName
@@ -651,9 +651,9 @@ bool cmCPackNSISGenerator::SupportsComponentInstallation() const
}
//----------------------------------------------------------------------
-std::string
+std::string
cmCPackNSISGenerator::
-CreateComponentDescription(cmCPackComponent *component,
+CreateComponentDescription(cmCPackComponent *component,
cmOStringStream& macrosOut)
{
// Basic description of the component
@@ -668,7 +668,7 @@ CreateComponentDescription(cmCPackComponent *component,
componentCode += "-";
}
componentCode += component->DisplayName + "\" " + component->Name + "\n";
- if (component->IsRequired)
+ if (component->IsRequired)
{
componentCode += " SectionIn RO\n";
}
@@ -701,7 +701,7 @@ CreateComponentDescription(cmCPackComponent *component,
}
// Create the directory for the upload area
- const char* userUploadDirectory =
+ const char* userUploadDirectory =
this->GetOption("CPACK_UPLOAD_DIRECTORY");
std::string uploadDirectory;
if (userUploadDirectory && *userUploadDirectory)
@@ -727,7 +727,7 @@ CreateComponentDescription(cmCPackComponent *component,
// Remove the old archive, if one exists
std::string archiveFile = uploadDirectory + '/' + component->ArchiveFile;
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
- "- Building downloaded component archive: "
+ "- Building downloaded component archive: "
<< archiveFile << std::endl);
if (cmSystemTools::FileExists(archiveFile.c_str(), true))
{
@@ -760,18 +760,18 @@ CreateComponentDescription(cmCPackComponent *component,
dirName += component->Name;
dirName += '/';
- // Build the list of files to go into this archive, and determine the
+ // Build the list of files to go into this archive, and determine the
// size of the installed component.
std::string zipListFileName = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
zipListFileName += "/winZip.filelist";
- bool needQuotesInFile
+ bool needQuotesInFile
= cmSystemTools::IsOn(this->GetOption("CPACK_ZIP_NEED_QUOTES"));
unsigned long totalSize = 0;
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(zipListFileName.c_str());
std::vector<std::string>::iterator fileIt;
- for (fileIt = component->Files.begin();
- fileIt != component->Files.end();
+ for (fileIt = component->Files.begin();
+ fileIt != component->Files.end();
++fileIt)
{
if ( needQuotesInFile )
@@ -792,11 +792,11 @@ CreateComponentDescription(cmCPackComponent *component,
// Build the archive in the upload area
std::string cmd = this->GetOption("CPACK_ZIP_COMMAND");
cmsys::SystemTools::ReplaceString(cmd, "<ARCHIVE>", archiveFile.c_str());
- cmsys::SystemTools::ReplaceString(cmd, "<FILELIST>",
+ cmsys::SystemTools::ReplaceString(cmd, "<FILELIST>",
zipListFileName.c_str());
std::string output;
int retVal = -1;
- int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &retVal,
+ int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &retVal,
dirName.c_str(),
cmSystemTools::OUTPUT_NONE, 0);
if ( !res || retVal )
@@ -812,7 +812,7 @@ CreateComponentDescription(cmCPackComponent *component,
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl);
return "";
}
-
+
// Create the NSIS code to download this file on-the-fly.
unsigned long totalSizeInKbytes = (totalSize + 512) / 1024;
if (totalSizeInKbytes == 0)
@@ -823,7 +823,7 @@ CreateComponentDescription(cmCPackComponent *component,
out << " AddSize " << totalSizeInKbytes << "\n"
<< " Push \"" << component->ArchiveFile << "\"\n"
<< " Call DownloadFile\n"
- << " ZipDLL::extractall \"$INSTDIR\\"
+ << " ZipDLL::extractall \"$INSTDIR\\"
<< component->ArchiveFile << "\" \"$INSTDIR\"\n"
<< " Pop $2 ; error message\n"
" StrCmp $2 \"success\" +2 0\n"
@@ -889,7 +889,7 @@ std::string cmCPackNSISGenerator::CreateSelectionDependenciesDescription
std::set<cmCPackComponent *>& visited)
{
// Don't visit a component twice
- if (visited.count(component))
+ if (visited.count(component))
{
return std::string();
}
@@ -921,7 +921,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription
std::set<cmCPackComponent *>& visited)
{
// Don't visit a component twice
- if (visited.count(component))
+ if (visited.count(component))
{
return std::string();
}
@@ -939,7 +939,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription
out << " IntOp $0 $0 & $1\n";
out << " SectionSetFlags ${" << (*dependIt)->Name << "} $0\n";
out << " IntOp $" << (*dependIt)->Name << "_selected 0 + 0\n";
-
+
// Recurse
out <<
CreateDeselectionDependenciesDescription(*dependIt, visited).c_str();
@@ -949,9 +949,9 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription
}
//----------------------------------------------------------------------
-std::string
+std::string
cmCPackNSISGenerator::
-CreateComponentGroupDescription(cmCPackComponentGroup *group,
+CreateComponentGroupDescription(cmCPackComponentGroup *group,
cmOStringStream& macrosOut)
{
if (group->Components.empty() && group->Subgroups.empty())
@@ -982,8 +982,8 @@ CreateComponentGroupDescription(cmCPackComponentGroup *group,
}
std::vector<cmCPackComponent*>::iterator comp;
- for (comp = group->Components.begin();
- comp != group->Components.end();
+ for (comp = group->Components.begin();
+ comp != group->Components.end();
++comp)
{
if ((*comp)->Files.empty())
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 363ccea..76e15fb 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -64,7 +64,7 @@ int cmCPackOSXX11Generator::PackageFiles()
{
std::string cpackExecutableName = *it;
++ it;
- this->SetOptionIfNotSet("CPACK_EXECUTABLE_NAME",
+ this->SetOptionIfNotSet("CPACK_EXECUTABLE_NAME",
cpackExecutableName.c_str());
}
}
@@ -113,7 +113,7 @@ int cmCPackOSXX11Generator::PackageFiles()
cmSystemTools::CreateSymlink("/Applications", applicationsLinkName.c_str());
if (
- !this->CopyResourcePlistFile("VolumeIcon.icns",
+ !this->CopyResourcePlistFile("VolumeIcon.icns",
diskImageDirectory.c_str(),
".VolumeIcon.icns", true ) ||
!this->CopyResourcePlistFile("DS_Store", diskImageDirectory.c_str(),
@@ -125,9 +125,9 @@ int cmCPackOSXX11Generator::PackageFiles()
"Info.plist" ) ||
!this->CopyResourcePlistFile("OSXX11.main.scpt", scrDir,
"main.scpt", true ) ||
- !this->CopyResourcePlistFile("OSXScriptLauncher.rsrc", dir,
+ !this->CopyResourcePlistFile("OSXScriptLauncher.rsrc", dir,
rsrcFile, true) ||
- !this->CopyResourcePlistFile("OSXScriptLauncher", appdir,
+ !this->CopyResourcePlistFile("OSXScriptLauncher", appdir,
this->GetOption("CPACK_PACKAGE_FILE_NAME"), true)
)
{
@@ -167,11 +167,11 @@ int cmCPackOSXX11Generator::PackageFiles()
tmpFile += "/hdiutilOutput.log";
cmOStringStream dmgCmd;
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE")
- << "\" create -ov -format UDZO -srcfolder \""
- << diskImageDirectory.c_str()
+ << "\" create -ov -format UDZO -srcfolder \""
+ << diskImageDirectory.c_str()
<< "\" \"" << packageFileNames[0] << "\"";
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
- "Compress disk image using command: "
+ "Compress disk image using command: "
<< dmgCmd.str().c_str() << std::endl);
// since we get random dashboard failures with this one
// try running it more than once
@@ -181,7 +181,7 @@ int cmCPackOSXX11Generator::PackageFiles()
while(numTries > 0)
{
res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
- &retVal, 0,
+ &retVal, 0,
this->GeneratorVerbose, 0);
if ( res && !retVal )
{
@@ -219,7 +219,7 @@ int cmCPackOSXX11Generator::InitializeInternal()
<< std::endl);
return 0;
}
- this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE",
+ this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE",
pkgPath.c_str());
return this->Superclass::InitializeInternal();
@@ -235,7 +235,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name)
if ( !inFileName )
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str()
- << " not specified. It should point to "
+ << " not specified. It should point to "
<< (name ? name : "(NULL)")
<< ".rtf, " << name
<< ".html, or " << name << ".txt file" << std::endl);
@@ -243,7 +243,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name)
}
if ( !cmSystemTools::FileExists(inFileName) )
{
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
<< (name ? name : "(NULL)")
<< " resource file: " << inFileName << std::endl);
return false;
@@ -262,7 +262,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name)
destFileName += name + ext;
- cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
<< (inFileName ? inFileName : "(NULL)")
<< " to " << destFileName.c_str() << std::endl);
this->ConfigureFile(inFileName, destFileName.c_str());
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 3a0e89b..edbe838 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -52,7 +52,7 @@ int cmCPackPackageMakerGenerator::CopyInstallScript(const char* resdir,
cmSystemTools::CopyFileAlways(script, dst.c_str());
cmSystemTools::SetPermissions(dst.c_str(),0777);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
- "copy script : " << script << "\ninto " << dst.c_str() <<
+ "copy script : " << script << "\ninto " << dst.c_str() <<
std::endl);
return 1;
@@ -79,7 +79,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if ( !cmsys::SystemTools::MakeDirectory(packageDirFileName.c_str()))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "unable to create package directory "
+ "unable to create package directory "
<< packageDirFileName << std::endl);
return 0;
}
@@ -89,7 +89,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if ( !cmsys::SystemTools::MakeDirectory(resDir.c_str()))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "unable to create package subdirectory " << resDir
+ "unable to create package subdirectory " << resDir
<< std::endl);
return 0;
}
@@ -98,7 +98,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if ( !cmsys::SystemTools::MakeDirectory(resDir.c_str()))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "unable to create package subdirectory " << resDir
+ "unable to create package subdirectory " << resDir
<< std::endl);
return 0;
}
@@ -135,7 +135,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
return 0;
}
}
- // if preflight, postflight, or postupgrade are set
+ // if preflight, postflight, or postupgrade are set
// then copy them into the resource directory and make
// them executable
if(preflight)
@@ -206,7 +206,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if (!cmSystemTools::MakeDirectory(uploadDirectory.c_str()))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Unable to create package upload directory "
+ "Unable to create package upload directory "
<< uploadDirectory << std::endl);
return 0;
}
@@ -254,7 +254,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
std::string packageDir = toplevel;
packageDir += '/';
packageDir += compIt->first;
- if (!this->GenerateComponentPackage(packageFile.c_str(),
+ if (!this->GenerateComponentPackage(packageFile.c_str(),
packageDir.c_str(),
compIt->second))
{
@@ -293,7 +293,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
}
pkgCmd << "\" -r \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
<< "/Resources\" -i \""
- << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
+ << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
<< "/Info.plist\" -d \""
<< this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
<< "/Description.plist\"";
@@ -324,7 +324,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
while(numTries > 0)
{
res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
- &retVal, 0, this->GeneratorVerbose,
+ &retVal, 0, this->GeneratorVerbose,
0);
if ( res && !retVal )
{
@@ -474,7 +474,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
const char *packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION");
if (packageCompat && *packageCompat)
{
- this->PackageCompatibilityVersion = atof(packageCompat);
+ this->PackageCompatibilityVersion = atof(packageCompat);
}
else if (this->GetOption("CPACK_DOWNLOAD_SITE"))
{
@@ -500,7 +500,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
<< std::endl);
return 0;
}
- this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE",
+ this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE",
pkgPath.c_str());
return this->Superclass::InitializeInternal();
@@ -516,7 +516,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
if ( !inFileName )
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str()
- << " not specified. It should point to "
+ << " not specified. It should point to "
<< (name ? name : "(NULL)")
<< ".rtf, " << name
<< ".html, or " << name << ".txt file" << std::endl);
@@ -524,7 +524,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
}
if ( !cmSystemTools::FileExists(inFileName) )
{
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
<< (name ? name : "(NULL)")
<< " resource file: " << inFileName << std::endl);
return false;
@@ -547,7 +547,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
this->SetOption(("CPACK_RESOURCE_FILE_" + uname + "_NOPATH").c_str(),
(name + ext).c_str());
- cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
<< (inFileName ? inFileName : "(NULL)")
<< " to " << destFileName.c_str() << std::endl);
this->ConfigureFile(inFileName, destFileName.c_str());
@@ -593,7 +593,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char *command,
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << command << std::endl);
std::string output;
int retVal = 1;
- bool res = cmSystemTools::RunSingleCommand(command, &output, &retVal, 0,
+ bool res = cmSystemTools::RunSingleCommand(command, &output, &retVal, 0,
this->GeneratorVerbose, 0);
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running package maker"
<< std::endl);
@@ -612,7 +612,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char *command,
// sometimes the command finishes but the directory is not yet
// created, so try 10 times to see if it shows up
int tries = 10;
- while(tries > 0 &&
+ while(tries > 0 &&
!cmSystemTools::FileExists(packageFile))
{
cmSystemTools::Delay(500);
@@ -632,7 +632,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char *command,
}
//----------------------------------------------------------------------
-std::string
+std::string
cmCPackPackageMakerGenerator::GetPackageName(const cmCPackComponent& component)
{
if (component.ArchiveFile.empty())
@@ -664,7 +664,7 @@ GenerateComponentPackage(const char *packageFile,
// The command that will be used to run PackageMaker
cmOStringStream pkgCmd;
- if (this->PackageCompatibilityVersion < 10.5 ||
+ if (this->PackageCompatibilityVersion < 10.5 ||
this->PackageMakerVersion < 3.0)
{
// Create Description.plist and Info.plist files for normal Mac OS
@@ -680,10 +680,10 @@ GenerateComponentPackage(const char *packageFile,
<< " <key>IFPkgDescriptionTitle</key>" << std::endl
<< " <string>" << component.DisplayName << "</string>" << std::endl
<< " <key>IFPkgDescriptionVersion</key>" << std::endl
- << " <string>" << this->GetOption("CPACK_PACKAGE_VERSION")
+ << " <string>" << this->GetOption("CPACK_PACKAGE_VERSION")
<< "</string>" << std::endl
<< " <key>IFPkgDescriptionDescription</key>" << std::endl
- << " <string>" + this->EscapeForXML(component.Description)
+ << " <string>" + this->EscapeForXML(component.Description)
<< "</string>" << std::endl
<< "</dict>" << std::endl
<< "</plist>" << std::endl;
@@ -692,7 +692,7 @@ GenerateComponentPackage(const char *packageFile,
// Create the Info.plist file for this component
std::string moduleVersionSuffix = ".";
moduleVersionSuffix += component.Name;
- this->SetOption("CPACK_MODULE_VERSION_SUFFIX",
+ this->SetOption("CPACK_MODULE_VERSION_SUFFIX",
moduleVersionSuffix.c_str());
std::string infoFileName = component.Name;
infoFileName += "-Info.plist";
@@ -704,9 +704,9 @@ GenerateComponentPackage(const char *packageFile,
pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
<< "\" -build -p \"" << packageFile << "\""
<< " -f \"" << packageDir << "\""
- << " -i \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
+ << " -i \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
<< "/" << infoFileName << "\""
- << " -d \"" << descriptionFile << "\"";
+ << " -d \"" << descriptionFile << "\"";
}
else
{
@@ -729,16 +729,16 @@ GenerateComponentPackage(const char *packageFile,
<< " --out \"" << packageFile << "\"";
}
- // Run PackageMaker
+ // Run PackageMaker
return RunPackageMaker(pkgCmd.str().c_str(), packageFile);
}
//----------------------------------------------------------------------
-void
+void
cmCPackPackageMakerGenerator::
WriteDistributionFile(const char* metapackageFile)
{
- std::string distributionTemplate
+ std::string distributionTemplate
= this->FindTemplate("CPack.distribution.dist.in");
if ( distributionTemplate.empty() )
{
@@ -757,8 +757,8 @@ WriteDistributionFile(const char* metapackageFile)
// Emit the outline for the groups
std::map<std::string, cmCPackComponentGroup>::iterator groupIt;
- for (groupIt = this->ComponentGroups.begin();
- groupIt != this->ComponentGroups.end();
+ for (groupIt = this->ComponentGroups.begin();
+ groupIt != this->ComponentGroups.end();
++groupIt)
{
if (groupIt->second.ParentGroup == 0)
@@ -781,8 +781,8 @@ WriteDistributionFile(const char* metapackageFile)
choiceOut << "</choices-outline>" << std::endl;
// Create the actual choices
- for (groupIt = this->ComponentGroups.begin();
- groupIt != this->ComponentGroups.end();
+ for (groupIt = this->ComponentGroups.begin();
+ groupIt != this->ComponentGroups.end();
++groupIt)
{
CreateChoice(groupIt->second, choiceOut);
@@ -796,7 +796,7 @@ WriteDistributionFile(const char* metapackageFile)
// Create the distribution.dist file in the metapackage to turn it
// into a distribution package.
- this->ConfigureFile(distributionTemplate.c_str(),
+ this->ConfigureFile(distributionTemplate.c_str(),
distributionFile.c_str());
}
@@ -824,13 +824,13 @@ CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out)
}
//----------------------------------------------------------------------
-void
+void
cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group,
cmOStringStream& out)
{
- out << "<choice id=\"" << group.Name << "Choice\" "
+ out << "<choice id=\"" << group.Name << "Choice\" "
<< "title=\"" << group.DisplayName << "\" "
- << "start_selected=\"true\" "
+ << "start_selected=\"true\" "
<< "start_enabled=\"true\" "
<< "start_visible=\"true\" ";
if (!group.Description.empty())
@@ -842,21 +842,21 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group,
}
//----------------------------------------------------------------------
-void
+void
cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component,
cmOStringStream& out)
{
std::string packageId = "com.";
packageId += this->GetOption("CPACK_PACKAGE_VENDOR");
- packageId += '.';
+ packageId += '.';
packageId += this->GetOption("CPACK_PACKAGE_NAME");
packageId += '.';
packageId += component.Name;
- out << "<choice id=\"" << component.Name << "Choice\" "
+ out << "<choice id=\"" << component.Name << "Choice\" "
<< "title=\"" << component.DisplayName << "\" "
- << "start_selected=\""
- << (component.IsDisabledByDefault &&
+ << "start_selected=\""
+ << (component.IsDisabledByDefault &&
!component.IsRequired? "false" : "true")
<< "\" "
<< "start_enabled=\""
@@ -905,7 +905,7 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component,
std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
dirName += '/';
dirName += component.Name;
- unsigned long installedSize
+ unsigned long installedSize
= component.GetInstalledSizeInKbytes(dirName.c_str());
out << "<pkg-ref id=\"" << packageId << "\" "
@@ -914,7 +914,7 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component,
<< "auth=\"Admin\" onConclusion=\"None\">";
if (component.IsDownloaded)
{
- out << this->GetOption("CPACK_DOWNLOAD_SITE")
+ out << this->GetOption("CPACK_DOWNLOAD_SITE")
<< this->GetPackageName(component);
}
else
@@ -925,9 +925,9 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component,
}
//----------------------------------------------------------------------
-void
+void
cmCPackPackageMakerGenerator::
-AddDependencyAttributes(const cmCPackComponent& component,
+AddDependencyAttributes(const cmCPackComponent& component,
std::set<const cmCPackComponent *>& visited,
cmOStringStream& out)
{
@@ -942,16 +942,16 @@ AddDependencyAttributes(const cmCPackComponent& component,
dependIt != component.Dependencies.end();
++dependIt)
{
- out << " &amp;&amp; choices['" <<
+ out << " &amp;&amp; choices['" <<
(*dependIt)->Name << "Choice'].selected";
AddDependencyAttributes(**dependIt, visited, out);
}
}
//----------------------------------------------------------------------
-void
+void
cmCPackPackageMakerGenerator::
-AddReverseDependencyAttributes(const cmCPackComponent& component,
+AddReverseDependencyAttributes(const cmCPackComponent& component,
std::set<const cmCPackComponent *>& visited,
cmOStringStream& out)
{
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h
index 2bab947..101813f 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.h
+++ b/Source/CPack/cmCPackPackageMakerGenerator.h
@@ -67,8 +67,8 @@ protected:
// Generate a package in the file packageFile for the given
// component. All of the files within this component are stored in
// the directory packageDir. Returns true if successful, false
- // otherwise.
- bool GenerateComponentPackage(const char *packageFile,
+ // otherwise.
+ bool GenerateComponentPackage(const char *packageFile,
const char *packageDir,
const cmCPackComponent& component);
@@ -87,14 +87,14 @@ protected:
// Subroutine of WriteDistributionFile that writes out the
// reverse dependency attributes for inter-component dependencies.
- void
+ void
AddReverseDependencyAttributes(const cmCPackComponent& component,
std::set<const cmCPackComponent *>& visited,
cmOStringStream& out);
// Generates XML that encodes the hierarchy of component groups and
// their components in a form that can be used by distribution
- // metapackages.
+ // metapackages.
void CreateChoiceOutline(const cmCPackComponentGroup& group,
cmOStringStream& out);
@@ -111,7 +111,7 @@ protected:
// Escape the given string to make it usable as an XML attribute
// value.
std::string EscapeForXML(std::string str);
-
+
double PackageMakerVersion;
double PackageCompatibilityVersion;
};
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 413572e..13aa6d8 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -230,7 +230,7 @@ int cmCPackRPMGenerator::PackageFiles()
}
}
- if (!this->IsSet("RPMBUILD_EXECUTABLE"))
+ if (!this->IsSet("RPMBUILD_EXECUTABLE"))
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find rpmbuild" << std::endl);
retval = 0;
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index 966a231..9b6cf14 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -97,7 +97,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
{
licenseText += line + "\n";
}
- this->SetOptionIfNotSet("CPACK_RESOURCE_FILE_LICENSE_CONTENT",
+ this->SetOptionIfNotSet("CPACK_RESOURCE_FILE_LICENSE_CONTENT",
licenseText.c_str());
const char headerLengthTag[] = "###CPACK_HEADER_LENGTH###";
@@ -126,7 +126,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
++ptr;
}
counter ++;
- cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Number of lines: " << counter << std::endl);
char buffer[1024];
sprintf(buffer, "%d", counter);
diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx
index 971d166..ae73c37 100644
--- a/Source/CPack/cmCPackTarBZip2Generator.cxx
+++ b/Source/CPack/cmCPackTarBZip2Generator.cxx
@@ -12,7 +12,7 @@
#include "cmCPackTarBZip2Generator.h"
//----------------------------------------------------------------------
-cmCPackTarBZip2Generator::cmCPackTarBZip2Generator()
+cmCPackTarBZip2Generator::cmCPackTarBZip2Generator()
:cmCPackArchiveGenerator(cmArchiveWrite::CompressBZip2,
cmArchiveWrite::TypeTAR)
{
diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx
index 7a8f697..df29408 100644
--- a/Source/CPack/cmCPackTarCompressGenerator.cxx
+++ b/Source/CPack/cmCPackTarCompressGenerator.cxx
@@ -13,7 +13,7 @@
#include "cmCPackTarCompressGenerator.h"
//----------------------------------------------------------------------
-cmCPackTarCompressGenerator::cmCPackTarCompressGenerator()
+cmCPackTarCompressGenerator::cmCPackTarCompressGenerator()
:cmCPackArchiveGenerator(cmArchiveWrite::CompressCompress,
cmArchiveWrite::TypeTAR)
{
diff --git a/Source/CPack/cygwin.readme b/Source/CPack/cygwin.readme
index 88922d3..c0cd4b9 100644
--- a/Source/CPack/cygwin.readme
+++ b/Source/CPack/cygwin.readme
@@ -16,11 +16,11 @@ Source-
- write diff into toplevel
- create tar file call super class
-cmake-2.2.3-1
+cmake-2.2.3-1
+
-
1. a source release
-cmake-2.2.3-2-src.tar.bz2
+cmake-2.2.3-2-src.tar.bz2
cmake-2.2.3-2.patch has cmake-2.2.3/CYGWIN-PATCHES/cmake.README cmake-2.2.3/CYGWIN-PATCHES/setup.hint
cmake-2.2.3-2.sh -> script to create cygwin release
diff --git a/Source/CTest/cmCTestBatchTestHandler.cxx b/Source/CTest/cmCTestBatchTestHandler.cxx
index 00bb6fa..a22c7be 100644
--- a/Source/CTest/cmCTestBatchTestHandler.cxx
+++ b/Source/CTest/cmCTestBatchTestHandler.cxx
@@ -56,7 +56,7 @@ void cmCTestBatchTestHandler::WriteSrunArgs(int test, std::fstream& fout)
fout << "srun ";
//fout << "--jobid=" << test << " ";
fout << "-J=" << properties->Name << " ";
-
+
//Write dependency information
/*if(this->Tests[test].size() > 0)
{
diff --git a/Source/CTest/cmCTestBatchTestHandler.h b/Source/CTest/cmCTestBatchTestHandler.h
index fdfd1be..ab0d081 100644
--- a/Source/CTest/cmCTestBatchTestHandler.h
+++ b/Source/CTest/cmCTestBatchTestHandler.h
@@ -21,7 +21,7 @@
/** \class cmCTestBatchTestHandler
* \brief run parallel ctest
*
- * cmCTestBatchTestHandler
+ * cmCTestBatchTestHandler
*/
class cmCTestBatchTestHandler : public cmCTestMultiProcessHandler
{
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 8a2d65a..554efb5 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -67,7 +67,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
generator += this->BuildGenerator;
args.push_back(generator);
}
-
+
const char* config = 0;
if ( this->CTest->GetConfigType().size() > 0 )
{
@@ -79,7 +79,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
config = CMAKE_INTDIR;
}
#endif
-
+
if ( config )
{
std::string btype
@@ -198,8 +198,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
std::string resultingConfig;
std::vector<std::string> extraPaths;
std::vector<std::string> failed;
- fullPath =
- cmCTestTestHandler::FindExecutable(this->CTest,
+ fullPath =
+ cmCTestTestHandler::FindExecutable(this->CTest,
this->ConfigSample.c_str(),
resultingConfig,
extraPaths,
@@ -211,7 +211,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
out << "Using config sample with results: "
<< fullPath << " and " << resultingConfig << std::endl;
}
-
+
// we need to honor the timeout specified, the timeout include cmake, build
// and test time
double clock_start = cmSystemTools::GetTime();
@@ -228,7 +228,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
// should we cmake?
cmake cm;
- cm.SetProgressCallback(CMakeProgressCallback, &cmakeOutString);
+ cm.SetProgressCallback(CMakeProgressCallback, &cmakeOutString);
cm.SetGlobalGenerator(cm.CreateGlobalGenerator(
this->BuildGenerator.c_str()));
@@ -247,7 +247,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
{
this->BuildTargets.push_back("");
}
- for ( tarIt = this->BuildTargets.begin();
+ for ( tarIt = this->BuildTargets.begin();
tarIt != this->BuildTargets.end(); ++ tarIt )
{
double remainingTime = 0;
@@ -284,7 +284,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
this->BuildProject.c_str(), tarIt->c_str(),
&output, this->BuildMakeProgram.c_str(),
config,
- !this->BuildNoClean,
+ !this->BuildNoClean,
false, remainingTime);
out << output;
// if the build failed then return
@@ -322,13 +322,13 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
extraPaths.push_back(tempPath);
}
std::vector<std::string> failed;
- fullPath =
- cmCTestTestHandler::FindExecutable(this->CTest,
+ fullPath =
+ cmCTestTestHandler::FindExecutable(this->CTest,
this->TestCommand.c_str(),
resultingConfig,
extraPaths,
failed);
-
+
if(!cmSystemTools::FileExists(fullPath.c_str()))
{
out << "Could not find path to executable, perhaps it was not built: "
@@ -388,8 +388,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
return 1;
}
}
-
- int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, 0,
+
+ int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, 0,
remainingTime, 0);
if(runTestRes != cmsysProcess_State_Exited || retval != 0)
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h
index 6e5f7a6..9029600 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.h
+++ b/Source/CTest/cmCTestBuildAndTestHandler.h
@@ -42,7 +42,7 @@ public:
* Get the output variable
*/
const char* GetOutput();
-
+
cmCTestBuildAndTestHandler();
virtual void Initialize();
@@ -50,10 +50,10 @@ public:
protected:
///! Run CMake and build a test and then run it as a single test.
int RunCMakeAndTest(std::string* output);
- int RunCMake(std::string* outstring, cmOStringStream &out,
+ int RunCMake(std::string* outstring, cmOStringStream &out,
std::string &cmakeOutString,
std::string &cwd, cmake *cm);
-
+
cmStdString Output;
std::string BuildGenerator;
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index b984e85..f4d38ce 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -175,7 +175,7 @@ bool cmCTestBuildCommand::InitialPass(std::vector<std::string> const& args,
{
bool ret = cmCTestHandlerCommand::InitialPass(args, status);
if ( this->Values[ctb_NUMBER_ERRORS] && *this->Values[ctb_NUMBER_ERRORS])
- {
+ {
cmOStringStream str;
str << this->Handler->GetTotalErrors();
this->Makefile->AddDefinition(
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 27bb06c..39eeb70 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -168,7 +168,7 @@ static cmCTestBuildCompileErrorWarningRex
cmCTestWarningErrorFileLine[] = {
{ "^Warning W[0-9]+ ([a-zA-Z.\\:/0-9_+ ~-]+) ([0-9]+):", 1, 2 },
{ "^([a-zA-Z./0-9_+ ~-]+):([0-9]+):", 1, 2 },
- { "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
+ { "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
{ "^[0-9]+>([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
{ "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
{ "\"([a-zA-Z./0-9_+ ~-]+)\", line ([0-9]+)", 1, 2 },
@@ -289,7 +289,7 @@ std::string cmCTestBuildHandler::GetMakeCommand()
std::string makeCommand
= this->CTest->GetCTestConfiguration("MakeCommand");
cmCTestLog(this->CTest,
- HANDLER_VERBOSE_OUTPUT, "MakeCommand:" << makeCommand <<
+ HANDLER_VERBOSE_OUTPUT, "MakeCommand:" << makeCommand <<
"\n");
std::string configType = this->CTest->GetConfigType();
@@ -392,7 +392,7 @@ int cmCTestBuildHandler::ProcessHandler()
{
this->CustomWarningMatches.push_back(cmCTestWarningMatches[cc]);
}
-
+
for ( cc = 0; cmCTestWarningExceptions[cc]; cc ++ )
{
this->CustomWarningExceptions.push_back(cmCTestWarningExceptions[cc]);
@@ -557,7 +557,7 @@ void cmCTestBuildHandler::GenerateXMLHeader(std::ostream& os)
this->CTest->StartXML(os, this->AppendXML);
os << "<Build>\n"
<< "\t<StartDateTime>" << this->StartBuild << "</StartDateTime>\n"
- << "\t<StartBuildTime>" <<
+ << "\t<StartBuildTime>" <<
static_cast<unsigned int>(this->StartBuildTime)
<< "</StartBuildTime>\n"
<< "<BuildCommand>"
@@ -998,7 +998,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
// dashboard.
cmCTestBuildErrorWarning errorwarning;
errorwarning.LogLine = 1;
- errorwarning.Text
+ errorwarning.Text
= "*** WARNING non-zero return value in ctest from: ";
errorwarning.Text += argv[0];
errorwarning.PreContext = "";
@@ -1150,7 +1150,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
{
// This is not an error or warning.
// So, figure out if this is a post-context line
- if ( this->ErrorsAndWarnings.size() &&
+ if ( this->ErrorsAndWarnings.size() &&
this->LastErrorOrWarning != this->ErrorsAndWarnings.end() &&
this->PostContextCount < this->MaxPostContext )
{
diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx
index 3329756..7c41298 100644
--- a/Source/CTest/cmCTestConfigureHandler.cxx
+++ b/Source/CTest/cmCTestConfigureHandler.cxx
@@ -106,7 +106,7 @@ int cmCTestConfigureHandler::ProcessHandler()
std::string end_time = this->CTest->CurrentTime();
os << "\t<ConfigureStatus>" << retVal << "</ConfigureStatus>\n"
<< "\t<EndDateTime>" << end_time << "</EndDateTime>\n"
- << "\t<EndConfigureTime>" <<
+ << "\t<EndConfigureTime>" <<
static_cast<unsigned int>(cmSystemTools::GetTime())
<< "</EndConfigureTime>\n"
<< "<ElapsedMinutes>"
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 81d3669..4d1e249 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -80,15 +80,15 @@ public:
{
args.push_back(i->c_str());
}
- args.push_back(0); // null terminate
+ args.push_back(0); // null terminate
cmsysProcess_SetCommand(this->Process, &*args.begin());
if(this->WorkingDirectory.size())
{
cmsysProcess_SetWorkingDirectory(this->Process,
this->WorkingDirectory.c_str());
}
-
- cmsysProcess_SetOption(this->Process,
+
+ cmsysProcess_SetOption(this->Process,
cmsysProcess_Option_HideWindow, 1);
if(this->TimeOut != -1)
{
@@ -112,7 +112,7 @@ public:
{
cmsysProcess_SetPipeFile(this->Process, cmsysProcess_Pipe_STDERR, fname);
}
- int WaitForExit(double* timeout =0)
+ int WaitForExit(double* timeout =0)
{
this->PipeState = cmsysProcess_WaitForExit(this->Process,
timeout);
@@ -183,7 +183,7 @@ bool cmCTestCoverageHandler::StartCoverageLogFile(
this->CTest->StartXML(covLogFile, this->AppendXML);
covLogFile << "<CoverageLog>" << std::endl
<< "\t<StartDateTime>" << local_start_time << "</StartDateTime>"
- << "\t<StartTime>"
+ << "\t<StartTime>"
<< static_cast<unsigned int>(cmSystemTools::GetTime())
<< "</StartTime>"
<< std::endl;
@@ -196,7 +196,7 @@ void cmCTestCoverageHandler::EndCoverageLogFile(cmGeneratedFileStream& ostr,
{
std::string local_end_time = this->CTest->CurrentTime();
ostr << "\t<EndDateTime>" << local_end_time << "</EndDateTime>" << std::endl
- << "\t<EndTime>" <<
+ << "\t<EndTime>" <<
static_cast<unsigned int>(cmSystemTools::GetTime())
<< "</EndTime>" << std::endl
<< "</CoverageLog>" << std::endl;
@@ -325,7 +325,7 @@ int cmCTestCoverageHandler::ProcessHandler()
{
return error;
}
-
+
std::string coverage_start_time = this->CTest->CurrentTime();
unsigned int coverage_start_time_time = static_cast<unsigned int>(
cmSystemTools::GetTime());
@@ -659,7 +659,7 @@ int cmCTestCoverageHandler::ProcessHandler()
covSumFile.precision(2);
covSumFile << (percent_coverage)<< "</PercentCoverage>\n"
<< "\t<EndDateTime>" << end_time << "</EndDateTime>\n"
- << "\t<EndTime>" <<
+ << "\t<EndTime>" <<
static_cast<unsigned int>(cmSystemTools::GetTime())
<< "</EndTime>\n";
covSumFile << "<ElapsedMinutes>" <<
@@ -871,7 +871,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Cannot find any GCov coverage files."
<< std::endl);
- // No coverage files is a valid thing, so the exit code is 0
+ // No coverage files is a valid thing, so the exit code is 0
return 0;
}
@@ -1294,7 +1294,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Cannot find any Python Trace.py coverage files."
<< std::endl);
- // No coverage files is a valid thing, so the exit code is 0
+ // No coverage files is a valid thing, so the exit code is 0
return 0;
}
@@ -1436,7 +1436,7 @@ std::string cmCTestCoverageHandler::FindFile(
// This is a header put on each marked up source file
namespace
{
- const char* bullseyeHelp[] =
+ const char* bullseyeHelp[] =
{" Coverage produced by bullseye covbr tool: ",
" www.bullseye.com/help/ref_covbr.html",
" * An arrow --> indicates incomplete coverage.",
@@ -1451,7 +1451,7 @@ namespace
" * The slash / means this probe is excluded from summary results. ",
0};
}
-
+
//----------------------------------------------------------------------
int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
cmCTestCoverageHandlerContainer* cont,
@@ -1461,7 +1461,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
{
if(files.size() != filesFullPath.size())
{
- cmCTestLog(this->CTest, ERROR_MESSAGE,
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
"Files and full path files not the same size?:\n");
return 0;
}
@@ -1498,13 +1498,13 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
}
std::map<cmStdString, cmStdString> fileMap;
std::vector<std::string>::iterator fp = filesFullPath.begin();
- for(std::vector<std::string>::iterator f = files.begin();
+ for(std::vector<std::string>::iterator f = files.begin();
f != files.end(); ++f, ++fp)
{
fileMap[*f] = *fp;
}
- int count =0; // keep count of the number of files
+ int count =0; // keep count of the number of files
// Now parse each line from the bullseye cov log file
std::string lineIn;
bool valid = false; // are we in a valid output file
@@ -1542,9 +1542,9 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
{
return -1;
}
- count++; // move on one
+ count++; // move on one
}
- std::map<cmStdString, cmStdString>::iterator
+ std::map<cmStdString, cmStdString>::iterator
i = fileMap.find(file);
// if the file should be covered write out the header for that file
if(i != fileMap.end())
@@ -1659,10 +1659,10 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covsrc:\n");
return 0;
}
-
+
std::ostream& tmpLog = *cont->OFS;
// copen the Coverage.xml file in the Testing directory
- cmGeneratedFileStream covSumFile;
+ cmGeneratedFileStream covSumFile;
if(!this->StartResultingXML(cmCTest::PartCoverage, "Coverage", covSumFile))
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
@@ -1673,10 +1673,10 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
double elapsed_time_start = cmSystemTools::GetTime();
std::string coverage_start_time = this->CTest->CurrentTime();
covSumFile << "<Coverage>" << std::endl
- << "\t<StartDateTime>"
+ << "\t<StartDateTime>"
<< coverage_start_time << "</StartDateTime>"
<< std::endl
- << "\t<StartTime>"
+ << "\t<StartTime>"
<< static_cast<unsigned int>(cmSystemTools::GetTime())
<< "</StartTime>"
<< std::endl;
@@ -1717,7 +1717,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
{
// parse the comma separated output
this->ParseBullsEyeCovsrcLine(stdline,
- sourceFile,
+ sourceFile,
functionsCalled,
totalFunctions,
percentFunction,
@@ -1741,7 +1741,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
file = cmSystemTools::CollapseFullPath(file.c_str());
bool shouldIDoCoverage
= this->ShouldIDoCoverage(file.c_str(),
- cont->SourceDir.c_str(),
+ cont->SourceDir.c_str(),
cont->BinaryDir.c_str());
if ( !shouldIDoCoverage )
{
@@ -1797,20 +1797,20 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
<< "\t\t<BranchesTested>"
<< branchCovered
<< "</BranchesTested>\n"
- << "\t\t<BranchesUnTested>"
+ << "\t\t<BranchesUnTested>"
<< totalBranches - branchCovered
<< "</BranchesUnTested>\n"
<< "\t\t<FunctionsTested>"
<< functionsCalled
<< "</FunctionsTested>\n"
- << "\t\t<FunctionsUnTested>"
+ << "\t\t<FunctionsUnTested>"
<< totalFunctions - functionsCalled
<< "</FunctionsUnTested>\n"
// Hack for conversion of function to loc assume a function
// has 100 lines of code
<< "\t\t<LOCTested>" << functionsCalled *100
<< "</LOCTested>\n"
- << "\t\t<LOCUnTested>"
+ << "\t\t<LOCUnTested>"
<< (totalFunctions - functionsCalled)*100
<< "</LOCUnTested>\n"
<< "\t\t<PercentCoverage>";
@@ -1832,12 +1832,12 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
<< "\t<PercentCoverage>";
covSumFile.setf(std::ios::fixed, std::ios::floatfield);
covSumFile.precision(2);
- covSumFile
+ covSumFile
<< SAFEDIV(percent_coverage,number_files)<< "</PercentCoverage>\n"
<< "\t<EndDateTime>" << end_time << "</EndDateTime>\n"
<< "\t<EndTime>" << static_cast<unsigned int>(cmSystemTools::GetTime())
<< "</EndTime>\n";
- covSumFile
+ covSumFile
<< "<ElapsedMinutes>" <<
static_cast<int>((cmSystemTools::GetTime() - elapsed_time_start)/6)/10.0
<< "</ElapsedMinutes>"
@@ -1858,22 +1858,22 @@ int cmCTestCoverageHandler::HandleBullseyeCoverage(
const char* covfile = cmSystemTools::GetEnv("COVFILE");
if(!covfile || strlen(covfile) == 0)
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " COVFILE environment variable not found, not running "
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ " COVFILE environment variable not found, not running "
" bullseye\n");
return 0;
}
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " run covsrc with COVFILE=["
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ " run covsrc with COVFILE=["
<< covfile
<< "]" << std::endl);
if(!this->RunBullseyeSourceSummary(cont))
- {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
"Error running bullseye summary.\n");
return 0;
}
- cmCTestLog(this->CTest, DEBUG, "HandleBullseyeCoverage return 1 "
+ cmCTestLog(this->CTest, DEBUG, "HandleBullseyeCoverage return 1 "
<< std::endl);
return 1;
}
@@ -1881,7 +1881,7 @@ int cmCTestCoverageHandler::HandleBullseyeCoverage(
bool cmCTestCoverageHandler::GetNextInt(std::string const& inputLine,
std::string::size_type& pos,
int& value)
-{
+{
std::string::size_type start = pos;
pos = inputLine.find(',', start);
value = atoi(inputLine.substr(start, pos).c_str());
@@ -1892,7 +1892,7 @@ bool cmCTestCoverageHandler::GetNextInt(std::string const& inputLine,
pos++;
return true;
}
-
+
bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
std::string const& inputLine,
std::string& sourceFile,
@@ -1906,7 +1906,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
// find the first comma
std::string::size_type pos = inputLine.find(',');
if(pos == inputLine.npos)
- {
+ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing string : "
<< inputLine.c_str() << "\n");
return false;
@@ -1942,7 +1942,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
if(pos != inputLine.npos)
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing input : "
- << inputLine.c_str() << " last pos not npos = " << pos <<
+ << inputLine.c_str() << " last pos not npos = " << pos <<
"\n");
}
return true;
diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
index 56312c0..abc33de 100644
--- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
+++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
@@ -28,8 +28,8 @@ bool cmCTestEmptyBinaryDirectoryCommand
ostr << "problem removing the binary directory: " << args[0].c_str();
this->SetError(ostr.str().c_str());
return false;
- }
-
+ }
+
return true;
}
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index fd75e45..5338f30 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -51,7 +51,7 @@ void cmCTestGenericHandler::SetOption(const char* op, const char* value)
}
//----------------------------------------------------------------------
-void cmCTestGenericHandler::SetPersistentOption(const char* op,
+void cmCTestGenericHandler::SetPersistentOption(const char* op,
const char* value)
{
this->SetOption(op, value);
@@ -79,7 +79,7 @@ void cmCTestGenericHandler::Initialize()
this->AppendXML = false;
this->Options.clear();
t_StringToString::iterator it;
- for ( it = this->PersistentOptions.begin();
+ for ( it = this->PersistentOptions.begin();
it != this->PersistentOptions.end();
++ it )
{
@@ -117,7 +117,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part,
{
ostr << "_" << this->SubmitIndex;
}
- ostr << ".xml";
+ ostr << ".xml";
if(this->CTest->GetCurrentTag().empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h
index 18189ec..ba8febb 100644
--- a/Source/CTest/cmCTestGenericHandler.h
+++ b/Source/CTest/cmCTestGenericHandler.h
@@ -73,7 +73,7 @@ public:
typedef std::map<cmStdString,cmStdString> t_StringToString;
-
+
void SetPersistentOption(const char* op, const char* value);
void SetOption(const char* op, const char* value);
const char* GetOption(const char* op);
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index 1957e04..0da8aae 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -91,7 +91,7 @@ bool cmCTestHandlerCommand
}
else
{
- const char* bdir =
+ const char* bdir =
this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY");
if(bdir)
{
diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h
index 399fe8b..6db47ae 100644
--- a/Source/CTest/cmCTestMemCheckCommand.h
+++ b/Source/CTest/cmCTestMemCheckCommand.h
@@ -60,7 +60,7 @@ public:
" ctest_memcheck([BUILD build_dir] [RETURN_VALUE res] [APPEND]\n"
" [START start number] [END end number]\n"
" [STRIDE stride number] [EXCLUDE exclude regex ]\n"
- " [INCLUDE include regex] \n"
+ " [INCLUDE include regex] \n"
" [EXCLUDE_LABEL exclude regex] \n"
" [INCLUDE_LABEL label regex] \n"
" [PARALLEL_LEVEL level] )\n"
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 3e4ecdd..80218ad 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -84,7 +84,7 @@ public:
}
const char* GetAttribute(const char* name, const char** atts)
- {
+ {
int i = 0;
for(; atts[i] != 0; ++i)
{
@@ -117,9 +117,9 @@ public:
}
if(ptr->ErrorCategory)
{
- this->Errors.push_back(cmCTestMemCheckHandler::ABW); // do not know
+ this->Errors.push_back(cmCTestMemCheckHandler::ABW); // do not know
cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Found unknown Bounds Checker error "
+ "Found unknown Bounds Checker error "
<< ptr->ErrorCategory << std::endl);
}
}
@@ -247,7 +247,8 @@ void cmCTestMemCheckHandler::GenerateTestCommand(
{
std::vector<cmStdString>::size_type pp;
std::string memcheckcommand = "";
- memcheckcommand = this->MemoryTester;
+ memcheckcommand
+ = cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str());
for ( pp = 0; pp < this->MemoryTesterOptions.size(); pp ++ )
{
args.push_back(this->MemoryTesterOptions[pp]);
@@ -410,29 +411,46 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
"MemoryCheckCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "MemoryCheckCommand").c_str());
+ = this->CTest->GetCTestConfiguration("MemoryCheckCommand").c_str();
+
+ // determine the checker type
+ if ( this->MemoryTester.find("valgrind") != std::string::npos )
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
+ }
+ else if ( this->MemoryTester.find("purify") != std::string::npos )
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY;
+ }
+ else if ( this->MemoryTester.find("BC") != std::string::npos )
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
+ }
+ else
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::UNKNOWN;
+ }
}
else if ( cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
"PurifyCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "PurifyCommand").c_str());
+ = this->CTest->GetCTestConfiguration("PurifyCommand").c_str();
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY;
}
else if ( cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
"ValgrindCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "ValgrindCommand").c_str());
+ = this->CTest->GetCTestConfiguration("ValgrindCommand").c_str();
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
}
else if ( cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
"BoundsCheckerCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "BoundsCheckerCommand").c_str());
+ = this->CTest->GetCTestConfiguration("BoundsCheckerCommand").c_str();
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
}
else
{
@@ -470,82 +488,81 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->MemoryTesterOutputFile
= this->CTest->GetBinaryDir() + "/Testing/Temporary/MemoryChecker.log";
- if ( this->MemoryTester.find("valgrind") != std::string::npos )
+ switch ( this->MemoryTesterStyle )
{
- this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
- if ( this->MemoryTesterOptions.empty() )
- {
- this->MemoryTesterOptions.push_back("-q");
- this->MemoryTesterOptions.push_back("--tool=memcheck");
- this->MemoryTesterOptions.push_back("--leak-check=yes");
- this->MemoryTesterOptions.push_back("--show-reachable=yes");
- this->MemoryTesterOptions.push_back("--workaround-gcc296-bugs=yes");
- this->MemoryTesterOptions.push_back("--num-callers=50");
- }
- if ( this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").size() )
- {
- if ( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str()) )
+ case cmCTestMemCheckHandler::VALGRIND:
+ if ( this->MemoryTesterOptions.empty() )
{
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Cannot find memory checker suppression file: "
- << this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str() << std::endl);
- return false;
- }
- std::string suppressions = "--suppressions="
- + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
- this->MemoryTesterOptions.push_back(suppressions);
- }
- }
- else if ( this->MemoryTester.find("purify") != std::string::npos )
- {
- this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY;
- std::string outputFile;
-#ifdef _WIN32
- if( this->CTest->GetCTestConfiguration(
+ this->MemoryTesterOptions.push_back("-q");
+ this->MemoryTesterOptions.push_back("--tool=memcheck");
+ this->MemoryTesterOptions.push_back("--leak-check=yes");
+ this->MemoryTesterOptions.push_back("--show-reachable=yes");
+ this->MemoryTesterOptions.push_back("--workaround-gcc296-bugs=yes");
+ this->MemoryTesterOptions.push_back("--num-callers=50");
+ }
+ if ( this->CTest->GetCTestConfiguration(
"MemoryCheckSuppressionFile").size() )
+ {
+ if ( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str()) )
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Cannot find memory checker suppression file: "
+ << this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str() << std::endl);
+ return false;
+ }
+ std::string suppressions = "--suppressions="
+ + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
+ this->MemoryTesterOptions.push_back(suppressions);
+ }
+ break;
+ case cmCTestMemCheckHandler::PURIFY:
{
- if( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str()) )
+ std::string outputFile;
+#ifdef _WIN32
+ if( this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").size() )
{
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Cannot find memory checker suppression file: "
- << this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str() << std::endl);
- return false;
- }
- std::string filterFiles = "/FilterFiles="
- + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
- this->MemoryTesterOptions.push_back(filterFiles);
- }
- outputFile = "/SAVETEXTDATA=";
+ if( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str()) )
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Cannot find memory checker suppression file: "
+ << this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str() << std::endl);
+ return false;
+ }
+ std::string filterFiles = "/FilterFiles="
+ + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
+ this->MemoryTesterOptions.push_back(filterFiles);
+ }
+ outputFile = "/SAVETEXTDATA=";
#else
- outputFile = "-log-file=";
+ outputFile = "-log-file=";
#endif
- outputFile += this->MemoryTesterOutputFile;
- this->MemoryTesterOptions.push_back(outputFile);
- }
- else if ( this->MemoryTester.find("BC") != std::string::npos )
- {
- this->BoundsCheckerXMLFile = this->MemoryTesterOutputFile;
- std::string dpbdFile = this->CTest->GetBinaryDir()
- + "/Testing/Temporary/MemoryChecker.DPbd";
- this->BoundsCheckerDPBDFile = dpbdFile;
- this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
- this->MemoryTesterOptions.push_back("/B");
- this->MemoryTesterOptions.push_back(dpbdFile);
- this->MemoryTesterOptions.push_back("/X");
- this->MemoryTesterOptions.push_back(this->MemoryTesterOutputFile);
- this->MemoryTesterOptions.push_back("/M");
- }
- else
- {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Do not understand memory checker: " << this->MemoryTester.c_str()
- << std::endl);
- return false;
+ outputFile += this->MemoryTesterOutputFile;
+ this->MemoryTesterOptions.push_back(outputFile);
+ break;
+ }
+ case cmCTestMemCheckHandler::BOUNDS_CHECKER:
+ {
+ this->BoundsCheckerXMLFile = this->MemoryTesterOutputFile;
+ std::string dpbdFile = this->CTest->GetBinaryDir()
+ + "/Testing/Temporary/MemoryChecker.DPbd";
+ this->BoundsCheckerDPBDFile = dpbdFile;
+ this->MemoryTesterOptions.push_back("/B");
+ this->MemoryTesterOptions.push_back(dpbdFile);
+ this->MemoryTesterOptions.push_back("/X");
+ this->MemoryTesterOptions.push_back(this->MemoryTesterOutputFile);
+ this->MemoryTesterOptions.push_back("/M");
+ break;
+ }
+ default:
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Do not understand memory checker: " << this->MemoryTester.c_str()
+ << std::endl);
+ return false;
}
std::vector<cmStdString>::size_type cc;
@@ -594,9 +611,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckOutput(const std::string& str,
bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
const std::string& str, std::string& log,
int* results)
-{
+{
std::vector<cmStdString> lines;
- cmSystemTools::Split(str.c_str(), lines);
+ cmSystemTools::Split(str.c_str(), lines);
cmOStringStream ostr;
log = "";
@@ -604,7 +621,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
int defects = 0;
- for( std::vector<cmStdString>::iterator i = lines.begin();
+ for( std::vector<cmStdString>::iterator i = lines.begin();
i != lines.end(); ++i)
{
int failure = cmCTestMemCheckHandler::NO_MEMORY_FAULT;
@@ -657,7 +674,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
{
unlimitedOutput = true;
}
-
+
std::string::size_type cc;
cmOStringStream ostr;
@@ -782,7 +799,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
}
totalOutputSize += lines[cc].size();
ostr << cmXMLSafe(lines[cc]) << std::endl;
- }
+ }
else
{
nonValGrindOutput.push_back(cc);
@@ -791,7 +808,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
// Now put all all the non valgrind output into the test output
if(!outputFull)
{
- for(std::vector<std::string::size_type>::iterator i =
+ for(std::vector<std::string::size_type>::iterator i =
nonValGrindOutput.begin(); i != nonValGrindOutput.end(); ++i)
{
totalOutputSize += lines[*i].size();
@@ -801,7 +818,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
<< cmXMLSafe(lines[*i]) << std::endl);
ostr << cmXMLSafe(lines[*i]) << std::endl;
- if(!unlimitedOutput && totalOutputSize >
+ if(!unlimitedOutput && totalOutputSize >
static_cast<size_t>(this->CustomMaximumFailedTestOutputSize))
{
outputFull = true;
@@ -833,7 +850,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
log = "";
double sttime = cmSystemTools::GetTime();
std::vector<cmStdString> lines;
- cmSystemTools::Split(str.c_str(), lines);
+ cmSystemTools::Split(str.c_str(), lines);
cmCTestLog(this->CTest, DEBUG, "Start test: " << lines.size() << std::endl);
std::vector<cmStdString>::size_type cc;
for ( cc = 0; cc < lines.size(); cc ++ )
@@ -886,8 +903,8 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
// for the test
void
cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res)
-{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+{
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"PostProcessBoundsCheckerTest for : "
<< res.Name.c_str() << std::endl);
if ( !cmSystemTools::FileExists(this->MemoryTesterOutputFile.c_str()) )
@@ -902,22 +919,22 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res)
std::ifstream ifs(this->MemoryTesterOutputFile.c_str());
if ( !ifs )
{
- std::string log = "Cannot read memory tester output file: "
+ std::string log = "Cannot read memory tester output file: "
+ this->MemoryTesterOutputFile;
cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
return;
- }
+ }
res.Output += BOUNDS_CHECKER_MARKER;
res.Output += "\n";
std::string line;
while ( cmSystemTools::GetLineFromStream(ifs, line) )
{
- res.Output += line;
+ res.Output += line;
res.Output += "\n";
}
}
cmSystemTools::Delay(1000);
- cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str());
+ cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "
<< this->BoundsCheckerDPBDFile.c_str() << std::endl);
cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile.c_str());
@@ -928,7 +945,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res)
void
cmCTestMemCheckHandler::PostProcessPurifyTest(cmCTestTestResult& res)
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"PostProcessPurifyTest for : "
<< res.Name.c_str() << std::endl);
if ( !cmSystemTools::FileExists(this->MemoryTesterOutputFile.c_str()) )
@@ -945,7 +962,7 @@ cmCTestMemCheckHandler::PostProcessPurifyTest(cmCTestTestResult& res)
+ this->MemoryTesterOutputFile;
cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
return;
- }
+ }
std::string line;
while ( cmSystemTools::GetLineFromStream(ifs, line) )
{
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h
index 427d471..1e81c89 100644
--- a/Source/CTest/cmCTestMemCheckHandler.h
+++ b/Source/CTest/cmCTestMemCheckHandler.h
@@ -30,7 +30,7 @@ public:
cmTypeMacro(cmCTestMemCheckHandler, cmCTestTestHandler);
void PopulateCustomVectors(cmMakefile *mf);
-
+
cmCTestMemCheckHandler();
void Initialize();
@@ -108,13 +108,13 @@ private:
//! Parse Valgrind/Purify/Bounds Checker result out of the output
//string. After running, log holds the output and results hold the
//different memmory errors.
- bool ProcessMemCheckOutput(const std::string& str,
+ bool ProcessMemCheckOutput(const std::string& str,
std::string& log, int* results);
- bool ProcessMemCheckValgrindOutput(const std::string& str,
+ bool ProcessMemCheckValgrindOutput(const std::string& str,
std::string& log, int* results);
- bool ProcessMemCheckPurifyOutput(const std::string& str,
+ bool ProcessMemCheckPurifyOutput(const std::string& str,
std::string& log, int* results);
- bool ProcessMemCheckBoundsCheckerOutput(const std::string& str,
+ bool ProcessMemCheckBoundsCheckerOutput(const std::string& str,
std::string& log, int* results);
void PostProcessPurifyTest(cmCTestTestResult& res);
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 2cae802..ebef1ed 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -48,7 +48,7 @@ cmCTestMultiProcessHandler::~cmCTestMultiProcessHandler()
}
// Set the tests
-void
+void
cmCTestMultiProcessHandler::SetTests(TestMap& tests,
PropertiesMap& properties)
{
@@ -178,7 +178,7 @@ void cmCTestMultiProcessHandler::EraseTest(int test)
//---------------------------------------------------------
inline size_t cmCTestMultiProcessHandler::GetProcessorsUsed(int test)
{
- size_t processors =
+ size_t processors =
static_cast<int>(this->Properties[test]->Processors);
//If this is set to run serially, it must run alone.
//Also, if processors setting is set higher than the -j
@@ -205,7 +205,7 @@ bool cmCTestMultiProcessHandler::StartTest(int test)
}
}
- // copy the depend tests locally because when
+ // copy the depend tests locally because when
// a test is finished it will be removed from the depend list
// and we don't want to be iterating a list while removing from it
TestSet depends = this->Tests[test];
@@ -240,7 +240,7 @@ bool cmCTestMultiProcessHandler::StartTest(int test)
this->StartTestProcess(test);
return true;
}
- // This test was not able to start because it is waiting
+ // This test was not able to start because it is waiting
// on depends to run
return false;
}
@@ -351,7 +351,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
while(std::getline(fin, line))
{
if(line == "---") break;
- std::vector<cmsys::String> parts =
+ std::vector<cmsys::String> parts =
cmSystemTools::SplitString(line.c_str(), ' ');
//Format: <name> <previous_runs> <avg_cost>
if(parts.size() < 3) break;
@@ -552,7 +552,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
}
cmOStringStream indexStr;
indexStr << " #" << p.Index << ":";
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex()))
<< indexStr.str().c_str());
cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
@@ -603,7 +603,7 @@ void cmCTestMultiProcessHandler::CheckResume()
<< std::endl
<< "----------------------------------------------------------"
<< std::endl;
-
+
std::ifstream fin;
fin.open(fname.c_str());
std::string line;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 1483440..cd21d91 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -19,16 +19,16 @@
/** \class cmCTestMultiProcessHandler
* \brief run parallel ctest
*
- * cmCTestMultiProcessHandler
+ * cmCTestMultiProcessHandler
*/
-class cmCTestMultiProcessHandler
+class cmCTestMultiProcessHandler
{
friend class TestComparator;
public:
struct TestSet : public std::set<int> {};
struct TestMap : public std::map<int, TestSet> {};
struct TestList : public std::vector<int> {};
- struct PropertiesMap : public
+ struct PropertiesMap : public
std::map<int, cmCTestTestHandler::cmCTestTestProperties*> {};
cmCTestMultiProcessHandler();
diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h
index f382b0f..b984c84 100644
--- a/Source/CTest/cmCTestReadCustomFilesCommand.h
+++ b/Source/CTest/cmCTestReadCustomFilesCommand.h
@@ -25,11 +25,11 @@ class cmCTestReadCustomFilesCommand : public cmCTestCommand
public:
cmCTestReadCustomFilesCommand() {}
-
+
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
cmCTestReadCustomFilesCommand* ni = new cmCTestReadCustomFilesCommand;
ni->CTest = this->CTest;
@@ -55,7 +55,7 @@ public:
{
return "read CTestCustom files.";
}
-
+
/**
* More documentation.
*/
diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h
index 6df69af..05e7899 100644
--- a/Source/CTest/cmCTestRunScriptCommand.h
+++ b/Source/CTest/cmCTestRunScriptCommand.h
@@ -25,11 +25,11 @@ class cmCTestRunScriptCommand : public cmCTestCommand
public:
cmCTestRunScriptCommand() {}
-
+
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
cmCTestRunScriptCommand* ni = new cmCTestRunScriptCommand;
ni->CTest = this->CTest;
@@ -56,7 +56,7 @@ public:
{
return "runs a ctest -S script";
}
-
+
/**
* More documentation.
*/
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index c3de5dc..5eabf3f 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -59,7 +59,7 @@ bool cmCTestRunTest::CheckOutput()
{
// Store this line of output.
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- this->GetIndex() << ": " << line << std::endl);
+ this->GetIndex() << ": " << line << std::endl);
this->ProcessOutput += line;
this->ProcessOutput += "\n";
}
@@ -79,7 +79,7 @@ void cmCTestRunTest::CompressOutput()
int ret;
z_stream strm;
- unsigned char* in =
+ unsigned char* in =
reinterpret_cast<unsigned char*>(
const_cast<char*>(this->ProcessOutput.c_str()));
//zlib makes the guarantee that this is the maximum output size
@@ -112,7 +112,7 @@ void cmCTestRunTest::CompressOutput()
}
(void)deflateEnd(&strm);
-
+
unsigned char *encoded_buffer
= new unsigned char[static_cast<int>(outSize * 1.5)];
@@ -169,11 +169,11 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
}
}
if ( !found )
- {
+ {
reason = "Required regular expression not found.";
forceFail = true;
}
- reason += "Regex=[";
+ reason += "Regex=[";
for ( passIt = this->TestProperties->RequiredRegularExpressions.begin();
passIt != this->TestProperties->RequiredRegularExpressions.end();
++ passIt )
@@ -201,10 +201,10 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
}
if (res == cmsysProcess_State_Exited)
{
- bool success =
- !forceFail && (retVal == 0 ||
+ bool success =
+ !forceFail && (retVal == 0 ||
this->TestProperties->RequiredRegularExpressions.size());
- if((success && !this->TestProperties->WillFail)
+ if((success && !this->TestProperties->WillFail)
|| (!success && this->TestProperties->WillFail))
{
this->TestResult.Status = cmCTestTestHandler::COMPLETED;
@@ -312,10 +312,10 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
<< std::endl;
if(this->TestResult.Reason.size())
{
- *this->TestHandler->LogFile << reasonType << ":\n"
+ *this->TestHandler->LogFile << reasonType << ":\n"
<< this->TestResult.Reason << "\n";
}
- else
+ else
{
if(pass)
{
@@ -333,14 +333,14 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
<< "----------------------------------------------------------"
<< std::endl << std::endl;
}
- // if the test actually started and ran
- // record the results in TestResult
+ // if the test actually started and ran
+ // record the results in TestResult
if(started)
{
bool compress = !this->TestHandler->MemCheck &&
this->CompressionRatio < 1 &&
this->CTest->ShouldCompressTestOutput();
- this->TestResult.Output = compress ? this->CompressedOutput
+ this->TestResult.Output = compress ? this->CompressedOutput
: this->ProcessOutput;
this->TestResult.CompressOutput = compress;
this->TestResult.ReturnValue = this->TestProcess->GetExitValue();
@@ -378,7 +378,7 @@ void cmCTestRunTest::MemCheckPostProcess()
{
return;
}
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index
<< ": process test output now: "
<< this->TestProperties->Name.c_str() << " "
<< this->TestResult.Name.c_str() << std::endl);
@@ -390,7 +390,7 @@ void cmCTestRunTest::MemCheckPostProcess()
}
else if(handler->MemoryTesterStyle == cmCTestMemCheckHandler::PURIFY)
{
- handler->PostProcessPurifyTest(this->TestResult);
+ handler->PostProcessPurifyTest(this->TestResult);
}
}
@@ -411,7 +411,7 @@ bool cmCTestRunTest::StartTest(size_t total)
this->TestResult.ReturnValue = -1;
this->TestResult.CompletionStatus = "Failed to start";
this->TestResult.Status = cmCTestTestHandler::BAD_COMMAND;
- this->TestResult.TestCount = this->TestProperties->Index;
+ this->TestResult.TestCount = this->TestProperties->Index;
this->TestResult.Name = this->TestProperties->Name;
this->TestResult.Path = this->TestProperties->Directory.c_str();
@@ -438,7 +438,7 @@ bool cmCTestRunTest::StartTest(size_t total)
this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
return false;
}
-
+
// Check if all required files exist
for(std::vector<std::string>::iterator i =
this->TestProperties->RequiredFiles.begin();
@@ -465,9 +465,9 @@ bool cmCTestRunTest::StartTest(size_t total)
if (this->ActualCommand == "")
{
// if the command was not found create a TestResult object
- // that has that information
+ // that has that information
this->TestProcess = new cmProcess;
- *this->TestHandler->LogFile << "Unable to find executable: "
+ *this->TestHandler->LogFile << "Unable to find executable: "
<< args[1].c_str() << std::endl;
cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to find executable: "
<< args[1].c_str() << std::endl);
@@ -536,7 +536,7 @@ void cmCTestRunTest::ComputeArguments()
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
<< this->Index << ": "
- << (this->TestHandler->MemCheck?"MemCheck":"Test")
+ << (this->TestHandler->MemCheck?"MemCheck":"Test")
<< " command: " << testCommand
<< std::endl);
}
@@ -544,7 +544,7 @@ void cmCTestRunTest::ComputeArguments()
//----------------------------------------------------------------------
void cmCTestRunTest::DartProcessing()
{
- if (!this->ProcessOutput.empty() &&
+ if (!this->ProcessOutput.empty() &&
this->ProcessOutput.find("<DartMeasurement") != this->ProcessOutput.npos)
{
if (this->TestHandler->DartStuff.find(this->ProcessOutput.c_str()))
@@ -695,7 +695,7 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
cmOStringStream indexStr;
indexStr << " #" << this->Index << ":";
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex()))
<< indexStr.str().c_str());
cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
@@ -704,17 +704,17 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
outname.resize(maxTestNameWidth + 4, '.');
*this->TestHandler->LogFile << this->TestProperties->Index << "/"
- << this->TestHandler->TotalNumberOfTests << " Testing: "
+ << this->TestHandler->TotalNumberOfTests << " Testing: "
<< this->TestProperties->Name << std::endl;
*this->TestHandler->LogFile << this->TestProperties->Index << "/"
<< this->TestHandler->TotalNumberOfTests
<< " Test: " << this->TestProperties->Name.c_str() << std::endl;
*this->TestHandler->LogFile << "Command: \"" << this->ActualCommand << "\"";
-
+
for (std::vector<std::string>::iterator i = this->Arguments.begin();
i != this->Arguments.end(); ++i)
{
- *this->TestHandler->LogFile
+ *this->TestHandler->LogFile
<< " \"" << i->c_str() << "\"";
}
*this->TestHandler->LogFile << std::endl
@@ -730,6 +730,6 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
<< this->ProcessOutput.c_str() << "<end of output>" << std::endl;
cmCTestLog(this->CTest, HANDLER_OUTPUT, outname.c_str());
- cmCTestLog(this->CTest, DEBUG, "Testing "
+ cmCTestLog(this->CTest, DEBUG, "Testing "
<< this->TestProperties->Name.c_str() << " ... ");
}
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index 89456d5..476f3e1 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -74,7 +74,7 @@ private:
cmCTestTestHandler * TestHandler;
cmCTest * CTest;
cmProcess * TestProcess;
- //If the executable to run is ctest, don't create a new process;
+ //If the executable to run is ctest, don't create a new process;
//just instantiate a new cmTest. (Can be disabled for a single test
//if this option is set to false.)
//bool OptimizeForCTest;
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index fab9a8c..2668c8e 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -18,6 +18,11 @@
#include <cmsys/RegularExpression.hxx>
+struct cmCTestSVN::Revision: public cmCTestVC::Revision
+{
+ cmCTestSVN::SVNInfo* SVNInfo;
+};
+
//----------------------------------------------------------------------------
cmCTestSVN::cmCTestSVN(cmCTest* ct, std::ostream& log):
cmCTestGlobalVC(ct, log)
@@ -33,19 +38,22 @@ cmCTestSVN::~cmCTestSVN()
//----------------------------------------------------------------------------
void cmCTestSVN::CleanupImpl()
{
- const char* svn = this->CommandLineTool.c_str();
- const char* svn_cleanup[] = {svn, "cleanup", 0};
+ std::vector<const char*> svn_cleanup;
+ svn_cleanup.push_back("cleanup");
OutputLogger out(this->Log, "cleanup-out> ");
OutputLogger err(this->Log, "cleanup-err> ");
- this->RunChild(svn_cleanup, &out, &err);
+ this->RunSVNCommand(svn_cleanup, &out, &err);
}
//----------------------------------------------------------------------------
class cmCTestSVN::InfoParser: public cmCTestVC::LineParser
{
public:
- InfoParser(cmCTestSVN* svn, const char* prefix, std::string& rev):
- SVN(svn), Rev(rev)
+ InfoParser(cmCTestSVN* svn,
+ const char* prefix,
+ std::string& rev,
+ SVNInfo& svninfo):
+ Rev(rev), SVNRepo(svninfo)
{
this->SetLog(&svn->Log, prefix);
this->RegexRev.compile("^Revision: ([0-9]+)");
@@ -53,8 +61,8 @@ public:
this->RegexRoot.compile("^Repository Root: +([^ ]+) *$");
}
private:
- cmCTestSVN* SVN;
std::string& Rev;
+ cmCTestSVN::SVNInfo& SVNRepo;
cmsys::RegularExpression RegexRev;
cmsys::RegularExpression RegexURL;
cmsys::RegularExpression RegexRoot;
@@ -66,11 +74,11 @@ private:
}
else if(this->RegexURL.find(this->Line))
{
- this->SVN->URL = this->RegexURL.match(1);
+ this->SVNRepo.URL = this->RegexURL.match(1);
}
else if(this->RegexRoot.find(this->Line))
{
- this->SVN->Root = this->RegexRoot.match(1);
+ this->SVNRepo.Root = this->RegexRoot.match(1);
}
return true;
}
@@ -95,70 +103,110 @@ static bool cmCTestSVNPathStarts(std::string const& p1, std::string const& p2)
}
//----------------------------------------------------------------------------
-std::string cmCTestSVN::LoadInfo()
+std::string cmCTestSVN::LoadInfo(SVNInfo& svninfo)
{
// Run "svn info" to get the repository info from the work tree.
- const char* svn = this->CommandLineTool.c_str();
- const char* svn_info[] = {svn, "info", 0};
+ std::vector<const char*> svn_info;
+ svn_info.push_back("info");
+ svn_info.push_back(svninfo.LocalPath.c_str());
std::string rev;
- InfoParser out(this, "info-out> ", rev);
+ InfoParser out(this, "info-out> ", rev, svninfo);
OutputLogger err(this->Log, "info-err> ");
- this->RunChild(svn_info, &out, &err);
+ this->RunSVNCommand(svn_info, &out, &err);
return rev;
}
//----------------------------------------------------------------------------
void cmCTestSVN::NoteOldRevision()
{
- this->OldRevision = this->LoadInfo();
- this->Log << "Revision before update: " << this->OldRevision << "\n";
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " Old revision of repository is: "
- << this->OldRevision << "\n");
+ // Info for root repository
+ this->Repositories.push_back( SVNInfo("") );
+ this->RootInfo = &(this->Repositories.back());
+ // Info for the external repositories
+ this->LoadExternals();
+
+ // Get info for all the repositories
+ std::list<SVNInfo>::iterator itbeg = this->Repositories.begin();
+ std::list<SVNInfo>::iterator itend = this->Repositories.end();
+ for( ; itbeg != itend ; itbeg++)
+ {
+ SVNInfo& svninfo = *itbeg;
+ svninfo.OldRevision = this->LoadInfo(svninfo);
+ this->Log << "Revision for repository '" << svninfo.LocalPath
+ << "' before update: " << svninfo.OldRevision << "\n";
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ " Old revision of external repository '"
+ << svninfo.LocalPath << "' is: "
+ << svninfo.OldRevision << "\n");
+ }
+
+ // Set the global old revision to the one of the root
+ this->OldRevision = this->RootInfo->OldRevision;
this->PriorRev.Rev = this->OldRevision;
}
//----------------------------------------------------------------------------
void cmCTestSVN::NoteNewRevision()
{
- this->NewRevision = this->LoadInfo();
- this->Log << "Revision after update: " << this->NewRevision << "\n";
- cmCTestLog(this->CTest, HANDLER_OUTPUT, " New revision of repository is: "
- << this->NewRevision << "\n");
+ // Get info for the external repositories
+ std::list<SVNInfo>::iterator itbeg = this->Repositories.begin();
+ std::list<SVNInfo>::iterator itend = this->Repositories.end();
+ for( ; itbeg != itend ; itbeg++)
+ {
+ SVNInfo& svninfo = *itbeg;
+ svninfo.NewRevision = this->LoadInfo(svninfo);
+ this->Log << "Revision for repository '" << svninfo.LocalPath
+ << "' after update: " << svninfo.NewRevision << "\n";
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ " New revision of external repository '"
+ << svninfo.LocalPath << "' is: "
+ << svninfo.NewRevision << "\n");
+
+ // svninfo.Root = ""; // uncomment to test GuessBase
+ this->Log << "Repository '" << svninfo.LocalPath
+ << "' URL = " << svninfo.URL << "\n";
+ this->Log << "Repository '" << svninfo.LocalPath
+ << "' Root = " << svninfo.Root << "\n";
+
+ // Compute the base path the working tree has checked out under
+ // the repository root.
+ if(!svninfo.Root.empty()
+ && cmCTestSVNPathStarts(svninfo.URL, svninfo.Root))
+ {
+ svninfo.Base = cmCTest::DecodeURL(
+ svninfo.URL.substr(svninfo.Root.size()));
+ svninfo.Base += "/";
+ }
+ this->Log << "Repository '" << svninfo.LocalPath
+ << "' Base = " << svninfo.Base << "\n";
- // this->Root = ""; // uncomment to test GuessBase
- this->Log << "URL = " << this->URL << "\n";
- this->Log << "Root = " << this->Root << "\n";
+ }
- // Compute the base path the working tree has checked out under
- // the repository root.
- if(!this->Root.empty() && cmCTestSVNPathStarts(this->URL, this->Root))
- {
- this->Base = cmCTest::DecodeURL(this->URL.substr(this->Root.size()));
- this->Base += "/";
- }
- this->Log << "Base = " << this->Base << "\n";
+ // Set the global new revision to the one of the root
+ this->NewRevision = this->RootInfo->NewRevision;
}
//----------------------------------------------------------------------------
-void cmCTestSVN::GuessBase(std::vector<Change> const& changes)
+void cmCTestSVN::GuessBase(SVNInfo& svninfo,
+ std::vector<Change> const& changes)
{
// Subversion did not give us a good repository root so we need to
// guess the base path from the URL and the paths in a revision with
// changes under it.
// Consider each possible URL suffix from longest to shortest.
- for(std::string::size_type slash = this->URL.find('/');
- this->Base.empty() && slash != std::string::npos;
- slash = this->URL.find('/', slash+1))
+ for(std::string::size_type slash = svninfo.URL.find('/');
+ svninfo.Base.empty() && slash != std::string::npos;
+ slash = svninfo.URL.find('/', slash+1))
{
// If the URL suffix is a prefix of at least one path then it is the base.
- std::string base = cmCTest::DecodeURL(this->URL.substr(slash));
+ std::string base = cmCTest::DecodeURL(svninfo.URL.substr(slash));
for(std::vector<Change>::const_iterator ci = changes.begin();
- this->Base.empty() && ci != changes.end(); ++ci)
+ svninfo.Base.empty() && ci != changes.end(); ++ci)
{
if(cmCTestSVNPathStarts(ci->Path, base))
{
- this->Base = base;
+ svninfo.Base = base;
}
}
}
@@ -167,25 +215,9 @@ void cmCTestSVN::GuessBase(std::vector<Change> const& changes)
// base lie under its path. If no base was found then the working
// tree must be a checkout of the entire repo and this will match
// the leading slash in all paths.
- this->Base += "/";
-
- this->Log << "Guessed Base = " << this->Base << "\n";
-}
+ svninfo.Base += "/";
-//----------------------------------------------------------------------------
-const char* cmCTestSVN::LocalPath(std::string const& path)
-{
- if(path.size() > this->Base.size() &&
- strncmp(path.c_str(), this->Base.c_str(), this->Base.size()) == 0)
- {
- // This path lies under the base, so return a relative path.
- return path.c_str() + this->Base.size();
- }
- else
- {
- // This path does not lie under the base, so ignore it.
- return 0;
- }
+ this->Log << "Guessed Base = " << svninfo.Base << "\n";
}
//----------------------------------------------------------------------------
@@ -254,19 +286,52 @@ bool cmCTestSVN::UpdateImpl()
}
std::vector<char const*> svn_update;
- svn_update.push_back(this->CommandLineTool.c_str());
svn_update.push_back("update");
- svn_update.push_back("--non-interactive");
for(std::vector<cmStdString>::const_iterator ai = args.begin();
ai != args.end(); ++ai)
{
svn_update.push_back(ai->c_str());
}
- svn_update.push_back(0);
UpdateParser out(this, "up-out> ");
OutputLogger err(this->Log, "up-err> ");
- return this->RunUpdateCommand(&svn_update[0], &out, &err);
+ return this->RunSVNCommand(svn_update, &out, &err);
+}
+
+//----------------------------------------------------------------------------
+bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
+ OutputParser* out, OutputParser* err)
+{
+ if(parameters.empty()) return false;
+
+ std::vector<char const*> args;
+ args.push_back(this->CommandLineTool.c_str());
+
+ args.insert(args.end(), parameters.begin(), parameters.end());
+
+ args.push_back("--non-interactive");
+
+ std::string userOptions =
+ this->CTest->GetCTestConfiguration("SVNOptions");
+
+ std::vector<cmStdString> parsedUserOptions =
+ cmSystemTools::ParseArguments(userOptions.c_str());
+ for(std::vector<cmStdString>::iterator i = parsedUserOptions.begin();
+ i != parsedUserOptions.end(); ++i)
+ {
+ args.push_back(i->c_str());
+ }
+
+ args.push_back(0);
+
+ if(strcmp(parameters[0], "update") == 0)
+ {
+ return RunUpdateCommand(&args[0], out, err);
+ }
+ else
+ {
+ return RunChild(&args[0], out, err);
+ }
}
//----------------------------------------------------------------------------
@@ -274,11 +339,13 @@ class cmCTestSVN::LogParser: public cmCTestVC::OutputLogger,
private cmXMLParser
{
public:
- LogParser(cmCTestSVN* svn, const char* prefix):
- OutputLogger(svn->Log, prefix), SVN(svn) { this->InitializeParser(); }
+ LogParser(cmCTestSVN* svn, const char* prefix, SVNInfo& svninfo):
+ OutputLogger(svn->Log, prefix), SVN(svn), SVNRepo(svninfo)
+ { this->InitializeParser(); }
~LogParser() { this->CleanupParser(); }
private:
cmCTestSVN* SVN;
+ cmCTestSVN::SVNInfo& SVNRepo;
typedef cmCTestSVN::Revision Revision;
typedef cmCTestSVN::Change Change;
@@ -300,6 +367,7 @@ private:
if(strcmp(name, "logentry") == 0)
{
this->Rev = Revision();
+ this->Rev.SVNInfo = &SVNRepo;
if(const char* rev = this->FindAttribute(atts, "revision"))
{
this->Rev.Rev = rev;
@@ -325,11 +393,13 @@ private:
{
if(strcmp(name, "logentry") == 0)
{
- this->SVN->DoRevision(this->Rev, this->Changes);
+ this->SVN->DoRevisionSVN(this->Rev, this->Changes);
}
else if(strcmp(name, "path") == 0 && !this->CData.empty())
{
- this->CurChange.Path.assign(&this->CData[0], this->CData.size());
+ std::string orig_path(&this->CData[0], this->CData.size());
+ std::string new_path = SVNRepo.BuildLocalPath( orig_path );
+ this->CurChange.Path.assign(new_path);
this->Changes.push_back(this->CurChange);
}
else if(strcmp(name, "author") == 0 && !this->CData.empty())
@@ -356,36 +426,59 @@ private:
//----------------------------------------------------------------------------
void cmCTestSVN::LoadRevisions()
{
+ // Get revisions for all the external repositories
+ std::list<SVNInfo>::iterator itbeg = this->Repositories.begin();
+ std::list<SVNInfo>::iterator itend = this->Repositories.end();
+ for( ; itbeg != itend ; itbeg++)
+ {
+ SVNInfo& svninfo = *itbeg;
+ LoadRevisions(svninfo);
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmCTestSVN::LoadRevisions(SVNInfo &svninfo)
+{
// We are interested in every revision included in the update.
std::string revs;
- if(atoi(this->OldRevision.c_str()) < atoi(this->NewRevision.c_str()))
+ if(atoi(svninfo.OldRevision.c_str()) < atoi(svninfo.NewRevision.c_str()))
{
- revs = "-r" + this->OldRevision + ":" + this->NewRevision;
+ revs = "-r" + svninfo.OldRevision + ":" + svninfo.NewRevision;
}
else
{
- revs = "-r" + this->NewRevision;
+ revs = "-r" + svninfo.NewRevision;
}
// Run "svn log" to get all global revisions of interest.
- const char* svn = this->CommandLineTool.c_str();
- const char* svn_log[] = {svn, "log", "--xml", "-v", revs.c_str(), 0};
- {
- LogParser out(this, "log-out> ");
+ std::vector<const char*> svn_log;
+ svn_log.push_back("log");
+ svn_log.push_back("--xml");
+ svn_log.push_back("-v");
+ svn_log.push_back(revs.c_str());
+ svn_log.push_back(svninfo.LocalPath.c_str());
+ LogParser out(this, "log-out> ", svninfo);
OutputLogger err(this->Log, "log-err> ");
- this->RunChild(svn_log, &out, &err);
- }
+ this->RunSVNCommand(svn_log, &out, &err);
}
//----------------------------------------------------------------------------
-void cmCTestSVN::DoRevision(Revision const& revision,
- std::vector<Change> const& changes)
+void cmCTestSVN::DoRevisionSVN(Revision const& revision,
+ std::vector<Change> const& changes)
{
// Guess the base checkout path from the changes if necessary.
- if(this->Base.empty() && !changes.empty())
+ if(this->RootInfo->Base.empty() && !changes.empty())
+ {
+ this->GuessBase(*this->RootInfo, changes);
+ }
+
+ // Ignore changes in the old revision for external repositories
+ if(revision.Rev == revision.SVNInfo->OldRevision
+ && revision.SVNInfo->LocalPath != "")
{
- this->GuessBase(changes);
+ return;
}
+
this->cmCTestGlobalVC::DoRevision(revision, changes);
}
@@ -434,11 +527,11 @@ private:
void cmCTestSVN::LoadModifications()
{
// Run "svn status" which reports local modifications.
- const char* svn = this->CommandLineTool.c_str();
- const char* svn_status[] = {svn, "status", "--non-interactive", 0};
+ std::vector<const char*> svn_status;
+ svn_status.push_back("status");
StatusParser out(this, "status-out> ");
OutputLogger err(this->Log, "status-err> ");
- this->RunChild(svn_status, &out, &err);
+ this->RunSVNCommand(svn_status, &out, &err);
}
//----------------------------------------------------------------------------
@@ -446,5 +539,81 @@ void cmCTestSVN::WriteXMLGlobal(std::ostream& xml)
{
this->cmCTestGlobalVC::WriteXMLGlobal(xml);
- xml << "\t<SVNPath>" << this->Base << "</SVNPath>\n";
+ xml << "\t<SVNPath>" << this->RootInfo->Base << "</SVNPath>\n";
+}
+
+//----------------------------------------------------------------------------
+class cmCTestSVN::ExternalParser: public cmCTestVC::LineParser
+{
+public:
+ ExternalParser(cmCTestSVN* svn, const char* prefix): SVN(svn)
+ {
+ this->SetLog(&svn->Log, prefix);
+ this->RegexExternal.compile("^X..... +(.+)$");
+ }
+private:
+ cmCTestSVN* SVN;
+ cmsys::RegularExpression RegexExternal;
+ bool ProcessLine()
+ {
+ if(this->RegexExternal.find(this->Line))
+ {
+ this->DoPath(this->RegexExternal.match(1));
+ }
+ return true;
+ }
+
+ void DoPath(std::string const& path)
+ {
+ // Get local path relative to the source directory
+ std::string local_path;
+ if(path.size() > this->SVN->SourceDirectory.size() &&
+ strncmp(path.c_str(), this->SVN->SourceDirectory.c_str(),
+ this->SVN->SourceDirectory.size()) == 0)
+ {
+ local_path = path.c_str() + this->SVN->SourceDirectory.size() + 1;
+ }
+ else
+ {
+ local_path = path;
+ }
+ this->SVN->Repositories.push_back( SVNInfo(local_path.c_str()) );
+ }
+};
+
+//----------------------------------------------------------------------------
+void cmCTestSVN::LoadExternals()
+{
+ // Run "svn status" to get the list of external repositories
+ std::vector<const char*> svn_status;
+ svn_status.push_back("status");
+ ExternalParser out(this, "external-out> ");
+ OutputLogger err(this->Log, "external-err> ");
+ this->RunSVNCommand(svn_status, &out, &err);
+}
+
+//----------------------------------------------------------------------------
+std::string cmCTestSVN::SVNInfo::BuildLocalPath(std::string const& path) const
+{
+ std::string local_path;
+
+ // Add local path prefix if not empty
+ if (!this->LocalPath.empty())
+ {
+ local_path += this->LocalPath;
+ local_path += "/";
+ }
+
+ // Add path with base prefix removed
+ if(path.size() > this->Base.size() &&
+ strncmp(path.c_str(), this->Base.c_str(), this->Base.size()) == 0)
+ {
+ local_path += (path.c_str() + this->Base.size());
+ }
+ else
+ {
+ local_path += path;
+ }
+
+ return local_path;
}
diff --git a/Source/CTest/cmCTestSVN.h b/Source/CTest/cmCTestSVN.h
index f72c58f..c6548e3 100644
--- a/Source/CTest/cmCTestSVN.h
+++ b/Source/CTest/cmCTestSVN.h
@@ -33,24 +33,54 @@ private:
virtual void NoteNewRevision();
virtual bool UpdateImpl();
- // URL of repository directory checked out in the working tree.
- std::string URL;
+ bool RunSVNCommand(std::vector<char const*> const& parameters,
+ OutputParser* out, OutputParser* err);
- // URL of repository root directory.
- std::string Root;
+ // Information about an SVN repository (root repository or external)
+ struct SVNInfo {
- // Directory under repository root checked out in working tree.
- std::string Base;
+ SVNInfo(const char* path) : LocalPath(path) {}
+ // Remove base from the filename
+ std::string BuildLocalPath(std::string const& path) const;
- std::string LoadInfo();
+ // LocalPath relative to the main source directory.
+ std::string LocalPath;
+
+ // URL of repository directory checked out in the working tree.
+ std::string URL;
+
+ // URL of repository root directory.
+ std::string Root;
+
+ // Directory under repository root checked out in working tree.
+ std::string Base;
+
+ // Old and new repository revisions.
+ std::string OldRevision;
+ std::string NewRevision;
+
+ };
+
+ // Extended revision structure to include info about external it refers to.
+ struct Revision;
+ friend struct Revision;
+
+ // Info of all the repositories (root, externals and nested ones).
+ std::list<SVNInfo> Repositories;
+
+ // Pointer to the infos of the root repository.
+ SVNInfo* RootInfo;
+
+ std::string LoadInfo(SVNInfo& svninfo);
+ void LoadExternals();
void LoadModifications();
void LoadRevisions();
+ void LoadRevisions(SVNInfo& svninfo);
- void GuessBase(std::vector<Change> const& changes);
- const char* LocalPath(std::string const& path);
+ void GuessBase(SVNInfo &svninfo, std::vector<Change> const& changes);
- void DoRevision(Revision const& revision,
- std::vector<Change> const& changes);
+ void DoRevisionSVN(Revision const& revision,
+ std::vector<Change> const& changes);
void WriteXMLGlobal(std::ostream& xml);
@@ -59,10 +89,12 @@ private:
class LogParser;
class StatusParser;
class UpdateParser;
+ class ExternalParser;
friend class InfoParser;
friend class LogParser;
friend class StatusParser;
friend class UpdateParser;
+ friend class ExternalParser;
};
#endif
diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h
index a7cf6ba..9d852ca 100644
--- a/Source/CTest/cmCTestScriptHandler.h
+++ b/Source/CTest/cmCTestScriptHandler.h
@@ -97,7 +97,7 @@ public:
static void SleepInSeconds(unsigned int secondsToWait);
void UpdateElapsedTime();
- /**
+ /**
* Return the time remaianing that the script is allowed to run in
* seconds if the user has set the variable CTEST_TIME_LIMIT. If that has
* not been set it returns 1e7 seconds
diff --git a/Source/CTest/cmCTestSleepCommand.cxx b/Source/CTest/cmCTestSleepCommand.cxx
index 5b06972..7e87550 100644
--- a/Source/CTest/cmCTestSleepCommand.cxx
+++ b/Source/CTest/cmCTestSleepCommand.cxx
@@ -47,7 +47,7 @@ bool cmCTestSleepCommand
}
return true;
}
-
+
this->SetError("called with incorrect number of arguments");
return false;
}
diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h
index 80fd6af..0f51ddf 100644
--- a/Source/CTest/cmCTestSleepCommand.h
+++ b/Source/CTest/cmCTestSleepCommand.h
@@ -25,11 +25,11 @@ class cmCTestSleepCommand : public cmCTestCommand
public:
cmCTestSleepCommand() {}
-
+
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
cmCTestSleepCommand* ni = new cmCTestSleepCommand;
ni->CTest = this->CTest;
@@ -56,7 +56,7 @@ public:
{
return "sleeps for some amount of time";
}
-
+
/**
* More documentation.
*/
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index 5aee035..231f035 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -32,7 +32,7 @@ cmCTestTestCommand::cmCTestTestCommand()
cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
{
- const char* ctestTimeout =
+ const char* ctestTimeout =
this->Makefile->GetDefinition("CTEST_TEST_TIMEOUT");
double timeout = this->CTest->GetTimeOut();
@@ -86,7 +86,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
}
if(this->Values[ctt_INCLUDE_LABEL])
{
- handler->SetOption("LabelRegularExpression",
+ handler->SetOption("LabelRegularExpression",
this->Values[ctt_INCLUDE_LABEL]);
}
if(this->Values[ctt_PARALLEL_LEVEL])
diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h
index d184ff2..130cb69 100644
--- a/Source/CTest/cmCTestTestCommand.h
+++ b/Source/CTest/cmCTestTestCommand.h
@@ -58,7 +58,7 @@ public:
" ctest_test([BUILD build_dir] [APPEND]\n"
" [START start number] [END end number]\n"
" [STRIDE stride number] [EXCLUDE exclude regex ]\n"
- " [INCLUDE include regex] [RETURN_VALUE res] \n"
+ " [INCLUDE include regex] [RETURN_VALUE res] \n"
" [EXCLUDE_LABEL exclude regex] \n"
" [INCLUDE_LABEL label regex] \n"
" [PARALLEL_LEVEL level] \n"
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index ead449e..b796b83 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1304,9 +1304,10 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec)
for ( it = vec.begin(); it != vec.end(); ++it )
{
int retVal = 0;
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << *it
+ std::string cmd = cmSystemTools::ConvertToOutputPath(it->c_str());
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << cmd
<< std::endl);
- if ( !cmSystemTools::RunSingleCommand(it->c_str(), 0, &retVal, 0,
+ if ( !cmSystemTools::RunSingleCommand(cmd.c_str(), 0, &retVal, 0,
cmSystemTools::OUTPUT_MERGE
/*this->Verbose*/) || retVal != 0 )
{
diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx
index 8414349..2ca9f6c 100644
--- a/Source/CTest/cmCTestUpdateCommand.cxx
+++ b/Source/CTest/cmCTestUpdateCommand.cxx
@@ -44,6 +44,8 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"SVNUpdateOptions", "CTEST_SVN_UPDATE_OPTIONS");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
+ "SVNOptions", "CTEST_SVN_OPTIONS");
+ this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"BZRCommand", "CTEST_BZR_COMMAND");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"BZRUpdateOptions", "CTEST_BZR_UPDATE_OPTIONS");
diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h
index 44e1dac..9dd0651 100644
--- a/Source/CTest/cmCTestVC.h
+++ b/Source/CTest/cmCTestVC.h
@@ -67,6 +67,9 @@ protected:
virtual void NoteNewRevision();
virtual bool WriteXMLUpdates(std::ostream& xml);
+#if defined(__SUNPRO_CC) && __SUNPRO_CC <= 0x510
+public: // Sun CC 5.1 needs help to allow cmCTestSVN::Revision to see this
+#endif
/** Basic information about one revision of a tree or file. */
struct Revision
{
@@ -80,6 +83,7 @@ protected:
std::string Log;
};
+protected:
struct File;
friend struct File;
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 0ee631f..000bc85 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -196,12 +196,12 @@ int cmProcess::ReportStatus()
{
case cmsysProcess_State_Starting:
{
- std::cerr << "cmProcess: Never started "
+ std::cerr << "cmProcess: Never started "
<< this->Command << " process.\n";
} break;
case cmsysProcess_State_Error:
{
- std::cerr << "cmProcess: Error executing " << this->Command
+ std::cerr << "cmProcess: Error executing " << this->Command
<< " process: "
<< cmsysProcess_GetErrorString(this->Process)
<< "\n";
@@ -241,19 +241,19 @@ int cmProcess::ReportStatus()
} break;
case cmsysProcess_State_Executing:
{
- std::cerr << "cmProcess: Never terminated " <<
+ std::cerr << "cmProcess: Never terminated " <<
this->Command << " process.\n";
} break;
case cmsysProcess_State_Exited:
{
result = cmsysProcess_GetExitValue(this->Process);
- std::cerr << "cmProcess: " << this->Command
+ std::cerr << "cmProcess: " << this->Command
<< " process exited with code "
<< result << "\n";
} break;
case cmsysProcess_State_Expired:
{
- std::cerr << "cmProcess: killed " << this->Command
+ std::cerr << "cmProcess: killed " << this->Command
<< " process due to timeout.\n";
} break;
case cmsysProcess_State_Killed:
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index ff99ca2..1479df0 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -22,7 +22,7 @@
*
* cmProcess wraps the kwsys process stuff in a c++ class.
*/
-class cmProcess
+class cmProcess
{
public:
cmProcess();
@@ -37,7 +37,7 @@ public:
// return the process status
int GetProcessStatus();
- // Report the status of the program
+ // Report the status of the program
int ReportStatus();
int GetId() { return this->Id; }
void SetId(int id) { this->Id = id;}
diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt
index 3349ebe..96e28b4 100644
--- a/Source/CursesDialog/CMakeLists.txt
+++ b/Source/CursesDialog/CMakeLists.txt
@@ -10,7 +10,7 @@
# See the License for more information.
#=============================================================================
-SET( CURSES_SRCS
+set( CURSES_SRCS
CursesDialog/cmCursesBoolWidget
CursesDialog/cmCursesCacheEntryComposite
CursesDialog/cmCursesDummyWidget
@@ -25,13 +25,13 @@ SET( CURSES_SRCS
CursesDialog/ccmake
)
-INCLUDE_DIRECTORIES(${CMake_SOURCE_DIR}/Source/CursesDialog/form
+include_directories(${CMake_SOURCE_DIR}/Source/CursesDialog/form
${CMake_BINARY_DIR}/Source/CursesDialog/form)
-INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH})
+include_directories(${CURSES_INCLUDE_PATH})
-ADD_EXECUTABLE(ccmake ${CURSES_SRCS} )
-TARGET_LINK_LIBRARIES(ccmake CMakeLib)
-TARGET_LINK_LIBRARIES(ccmake cmForm)
+add_executable(ccmake ${CURSES_SRCS} )
+target_link_libraries(ccmake CMakeLib)
+target_link_libraries(ccmake cmForm)
-INSTALL_TARGETS(/bin ccmake)
+install_targets(/bin ccmake)
diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx
index 9c4c5a5..fd15b99 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.cxx
+++ b/Source/CursesDialog/cmCursesBoolWidget.cxx
@@ -12,7 +12,7 @@
#include "cmCursesBoolWidget.h"
#include "cmCursesMainForm.h"
-cmCursesBoolWidget::cmCursesBoolWidget(int width, int height,
+cmCursesBoolWidget::cmCursesBoolWidget(int width, int height,
int left, int top) :
cmCursesWidget(width, height, left, top)
{
@@ -38,15 +38,15 @@ bool cmCursesBoolWidget::HandleInput(int& key, cmCursesMainForm*, WINDOW* w)
this->SetValueAsBool(true);
}
- touchwin(w);
- wrefresh(w);
+ touchwin(w);
+ wrefresh(w);
return true;
}
else
{
return false;
}
-
+
}
void cmCursesBoolWidget::SetValueAsBool(bool value)
@@ -56,7 +56,7 @@ void cmCursesBoolWidget::SetValueAsBool(bool value)
this->SetValue("ON");
}
else
- {
+ {
this->SetValue("OFF");
}
}
@@ -68,7 +68,7 @@ bool cmCursesBoolWidget::GetValueAsBool()
return true;
}
else
- {
+ {
return false;
}
}
diff --git a/Source/CursesDialog/cmCursesBoolWidget.h b/Source/CursesDialog/cmCursesBoolWidget.h
index 0d1d6a6..d2a25ca 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.h
+++ b/Source/CursesDialog/cmCursesBoolWidget.h
@@ -19,7 +19,7 @@ class cmCursesBoolWidget : public cmCursesWidget
{
public:
cmCursesBoolWidget(int width, int height, int left, int top);
-
+
// Description:
// Handle user input. Called by the container of this widget
// when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index 828384d..c58d037 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -19,19 +19,19 @@
#include "../cmSystemTools.h"
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(const char* key,
- int labelwidth,
+ int labelwidth,
int entrywidth) :
Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
{
this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " ");
- this->Entry = 0;
+ this->Entry = 0;
this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1);
}
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
- const char* key, const cmCacheManager::CacheIterator& it, bool isNew,
- int labelwidth, int entrywidth)
+ const char* key, const cmCacheManager::CacheIterator& it, bool isNew,
+ int labelwidth, int entrywidth)
: Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
{
this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
@@ -74,7 +74,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
it.GetValue());
break;
case cmCacheManager::UNINITIALIZED:
- cmSystemTools::Error("Found an undefined variable: ", it.GetName());
+ cmSystemTools::Error("Found an undefined variable: ", it.GetName());
break;
default:
// TODO : put warning message here
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h
index a40ea28..1357a02 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.h
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h
@@ -20,7 +20,7 @@ class cmCursesCacheEntryComposite
public:
cmCursesCacheEntryComposite(const char* key, int labelwidth, int entrywidth);
cmCursesCacheEntryComposite(const char* key,
- const cmCacheManager::CacheIterator& it,
+ const cmCacheManager::CacheIterator& it,
bool isNew, int labelwidth, int entrywidth);
~cmCursesCacheEntryComposite();
const char* GetValue();
diff --git a/Source/CursesDialog/cmCursesDummyWidget.cxx b/Source/CursesDialog/cmCursesDummyWidget.cxx
index 1d8a45d..60086a5 100644
--- a/Source/CursesDialog/cmCursesDummyWidget.cxx
+++ b/Source/CursesDialog/cmCursesDummyWidget.cxx
@@ -11,7 +11,7 @@
============================================================================*/
#include "cmCursesDummyWidget.h"
-cmCursesDummyWidget::cmCursesDummyWidget(int width, int height,
+cmCursesDummyWidget::cmCursesDummyWidget(int width, int height,
int left, int top) :
cmCursesWidget(width, height, left, top)
{
diff --git a/Source/CursesDialog/cmCursesDummyWidget.h b/Source/CursesDialog/cmCursesDummyWidget.h
index cc4cc74..9ac1365 100644
--- a/Source/CursesDialog/cmCursesDummyWidget.h
+++ b/Source/CursesDialog/cmCursesDummyWidget.h
@@ -20,7 +20,7 @@ class cmCursesDummyWidget : public cmCursesWidget
{
public:
cmCursesDummyWidget(int width, int height, int left, int top);
-
+
// Description:
// Handle user input. Called by the container of this widget
// when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesFilePathWidget.cxx b/Source/CursesDialog/cmCursesFilePathWidget.cxx
index 13bbcc9..01db014 100644
--- a/Source/CursesDialog/cmCursesFilePathWidget.cxx
+++ b/Source/CursesDialog/cmCursesFilePathWidget.cxx
@@ -11,7 +11,7 @@
============================================================================*/
#include "cmCursesFilePathWidget.h"
-cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height,
+cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height,
int left, int top) :
cmCursesPathWidget(width, height, left, top)
{
diff --git a/Source/CursesDialog/cmCursesForm.h b/Source/CursesDialog/cmCursesForm.h
index 7556d74..3cba856 100644
--- a/Source/CursesDialog/cmCursesForm.h
+++ b/Source/CursesDialog/cmCursesForm.h
@@ -20,7 +20,7 @@ class cmCursesForm
public:
cmCursesForm();
virtual ~cmCursesForm();
-
+
// Description:
// Handle user input.
virtual void HandleInput() = 0;
@@ -59,7 +59,7 @@ public:
}
static cmCursesForm* CurrentForm;
-
+
protected:
diff --git a/Source/CursesDialog/cmCursesLabelWidget.cxx b/Source/CursesDialog/cmCursesLabelWidget.cxx
index 2ad4813..b5ed312 100644
--- a/Source/CursesDialog/cmCursesLabelWidget.cxx
+++ b/Source/CursesDialog/cmCursesLabelWidget.cxx
@@ -11,7 +11,7 @@
============================================================================*/
#include "cmCursesLabelWidget.h"
-cmCursesLabelWidget::cmCursesLabelWidget(int width, int height,
+cmCursesLabelWidget::cmCursesLabelWidget(int width, int height,
int left, int top,
const std::string& name) :
cmCursesWidget(width, height, left, top)
diff --git a/Source/CursesDialog/cmCursesLabelWidget.h b/Source/CursesDialog/cmCursesLabelWidget.h
index bbcc586..cc32d11 100644
--- a/Source/CursesDialog/cmCursesLabelWidget.h
+++ b/Source/CursesDialog/cmCursesLabelWidget.h
@@ -23,7 +23,7 @@ public:
cmCursesLabelWidget(int width, int height, int left, int top,
const std::string& name);
virtual ~cmCursesLabelWidget();
-
+
// Description:
// Handle user input. Called by the container of this widget
// when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index 0e2cd22..057f8f3 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -19,10 +19,10 @@
inline int ctrl(int z)
{
return (z&037);
-}
+}
-cmCursesLongMessageForm::cmCursesLongMessageForm(std::vector<std::string>
- const& messages, const char*
+cmCursesLongMessageForm::cmCursesLongMessageForm(std::vector<std::string>
+ const& messages, const char*
title)
{
// Append all messages into on big string
@@ -84,7 +84,7 @@ void cmCursesLongMessageForm::UpdateStatusBar()
curses_move(y-4,0);
attron(A_STANDOUT);
printw(bar);
- attroff(A_STANDOUT);
+ attroff(A_STANDOUT);
curses_move(y-3,0);
printw(version);
pos_form_cursor(this->Form);
@@ -94,7 +94,7 @@ void cmCursesLongMessageForm::PrintKeys()
{
int x,y;
getmaxyx(stdscr, y, x);
- if ( x < cmCursesMainForm::MIN_WIDTH ||
+ if ( x < cmCursesMainForm::MIN_WIDTH ||
y < cmCursesMainForm::MIN_HEIGHT )
{
return;
@@ -105,7 +105,7 @@ void cmCursesLongMessageForm::PrintKeys()
curses_move(y-2,0);
printw(firstLine);
pos_form_cursor(this->Form);
-
+
}
void cmCursesLongMessageForm::Render(int, int, int, int)
@@ -155,7 +155,7 @@ void cmCursesLongMessageForm::Render(int, int, int, int)
this->UpdateStatusBar();
this->PrintKeys();
- touchwin(stdscr);
+ touchwin(stdscr);
refresh();
}
@@ -200,8 +200,8 @@ void cmCursesLongMessageForm::HandleInput()
this->UpdateStatusBar();
this->PrintKeys();
- touchwin(stdscr);
- wrefresh(stdscr);
+ touchwin(stdscr);
+ wrefresh(stdscr);
}
}
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h
index 341f9c6..1e86974 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.h
+++ b/Source/CursesDialog/cmCursesLongMessageForm.h
@@ -21,10 +21,10 @@ class cmCursesCacheEntryComposite;
class cmCursesLongMessageForm : public cmCursesForm
{
public:
- cmCursesLongMessageForm(std::vector<std::string> const& messages,
+ cmCursesLongMessageForm(std::vector<std::string> const& messages,
const char* title);
virtual ~cmCursesLongMessageForm();
-
+
// Description:
// Handle user input.
virtual void HandleInput();
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 3e191b4..883a2b3 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -30,12 +30,12 @@ class cmCursesMainForm : public cmCursesForm
public:
cmCursesMainForm(std::vector<std::string> const& args, int initwidth);
virtual ~cmCursesMainForm();
-
+
/**
* Set the widgets which represent the cache entries.
*/
void InitializeUI();
-
+
/**
* Handle user input.
*/
@@ -65,7 +65,7 @@ public:
* exception is during a resize. The optional argument specifies the
* string to be displayed in the status bar.
*/
- virtual void UpdateStatusBar() { this->UpdateStatusBar(0); }
+ virtual void UpdateStatusBar() { this->UpdateStatusBar(0); }
virtual void UpdateStatusBar(const char* message);
/**
@@ -90,7 +90,7 @@ public:
int Configure(int noconfigure=0);
/**
- * Used to generate
+ * Used to generate
*/
int Generate();
@@ -98,7 +98,7 @@ public:
* Used by main program
*/
int LoadCache(const char *dir);
-
+
/**
* Progress callback
*/
diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx
index b113c2e..14c325b 100644
--- a/Source/CursesDialog/cmCursesPathWidget.cxx
+++ b/Source/CursesDialog/cmCursesPathWidget.cxx
@@ -14,7 +14,7 @@
#include "cmCursesMainForm.h"
#include "cmSystemTools.h"
-cmCursesPathWidget::cmCursesPathWidget(int width, int height,
+cmCursesPathWidget::cmCursesPathWidget(int width, int height,
int left, int top) :
cmCursesStringWidget(width, height, left, top)
{
@@ -75,8 +75,8 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
}
this->SetString(cstr.c_str());
- touchwin(w);
- wrefresh(w);
+ touchwin(w);
+ wrefresh(w);
form_driver(form, REQ_END_FIELD);
this->LastGlob = glob;
this->LastString = cstr;
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index d363f00..5c7414f 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -15,9 +15,9 @@
inline int ctrl(int z)
{
return (z&037);
-}
+}
-cmCursesStringWidget::cmCursesStringWidget(int width, int height,
+cmCursesStringWidget::cmCursesStringWidget(int width, int height,
int left, int top) :
cmCursesWidget(width, height, left, top)
{
@@ -63,7 +63,7 @@ void cmCursesStringWidget::OnType(int& key, cmCursesMainForm* fm, WINDOW*)
form_driver(fm->GetForm(), key);
}
-bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
+bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
WINDOW* w)
{
int x,y;
@@ -90,7 +90,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
getmaxyx(stdscr, y, x);
// If window too small, handle 'q' only
- if ( x < cmCursesMainForm::MIN_WIDTH ||
+ if ( x < cmCursesMainForm::MIN_WIDTH ||
y < cmCursesMainForm::MIN_HEIGHT )
{
// quit
@@ -100,7 +100,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
}
else
{
- key=getch();
+ key=getch();
continue;
}
}
@@ -111,7 +111,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
return false;
}
// 10 == enter
- if (key == 10 || key == KEY_ENTER)
+ if (key == 10 || key == KEY_ENTER)
{
this->OnReturn(fm, w);
}
@@ -121,7 +121,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
key == KEY_PPAGE || key == ctrl('u'))
{
this->InEdit = false;
- delete[] this->OriginalString;
+ delete[] this->OriginalString;
// trick to force forms to update the field buffer
form_driver(form, REQ_NEXT_FIELD);
form_driver(form, REQ_PREV_FIELD);
@@ -136,8 +136,8 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
fm->PrintKeys();
this->SetString(this->OriginalString);
delete[] this->OriginalString;
- touchwin(w);
- wrefresh(w);
+ touchwin(w);
+ wrefresh(w);
return true;
}
}
@@ -165,7 +165,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
{
form_driver(form, REQ_END_FIELD);
}
- else if ( key == 127 ||
+ else if ( key == 127 ||
key == KEY_BACKSPACE )
{
if ( form->curcol > 0 )
@@ -186,10 +186,10 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
}
if ( !this->Done )
{
- touchwin(w);
- wrefresh(w);
-
- key=getch();
+ touchwin(w);
+ wrefresh(w);
+
+ key=getch();
}
}
return true;
@@ -214,7 +214,7 @@ bool cmCursesStringWidget::PrintKeys()
{
int x,y;
getmaxyx(stdscr, y, x);
- if ( x < cmCursesMainForm::MIN_WIDTH ||
+ if ( x < cmCursesMainForm::MIN_WIDTH ||
y < cmCursesMainForm::MIN_HEIGHT )
{
return false;
diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h
index cd54f24..e939049 100644
--- a/Source/CursesDialog/cmCursesStringWidget.h
+++ b/Source/CursesDialog/cmCursesStringWidget.h
@@ -26,7 +26,7 @@ class cmCursesStringWidget : public cmCursesWidget
{
public:
cmCursesStringWidget(int width, int height, int left, int top);
-
+
/**
* Handle user input. Called by the container of this widget
* when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h
index ee36af6..952c67a 100644
--- a/Source/CursesDialog/cmCursesWidget.h
+++ b/Source/CursesDialog/cmCursesWidget.h
@@ -22,7 +22,7 @@ class cmCursesWidget
public:
cmCursesWidget(int width, int height, int left, int top);
virtual ~cmCursesWidget();
-
+
/**
* Handle user input. Called by the container of this widget
* when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/form/CMakeLists.txt b/Source/CursesDialog/form/CMakeLists.txt
index 2435f39..4e07fa0 100644
--- a/Source/CursesDialog/form/CMakeLists.txt
+++ b/Source/CursesDialog/form/CMakeLists.txt
@@ -9,14 +9,14 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-PROJECT(CMAKE_FORM)
+project(CMAKE_FORM)
-INCLUDE_REGULAR_EXPRESSION("^.*$")
-INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH} "${CMAKE_CURRENT_BINARY_DIR}")
+include_regular_expression("^.*$")
+include_directories(${CURSES_INCLUDE_PATH} "${CMAKE_CURRENT_BINARY_DIR}")
-CONFIGURE_FILE(cmFormConfigure.h.in "${CMAKE_CURRENT_BINARY_DIR}/cmFormConfigure.h")
+configure_file(cmFormConfigure.h.in "${CMAKE_CURRENT_BINARY_DIR}/cmFormConfigure.h")
-SET( FORM_SRCS
+set( FORM_SRCS
fld_arg.c
fld_attr.c
fld_current.c
@@ -58,9 +58,9 @@ SET( FORM_SRCS
fty_regex.c
)
-INCLUDE_DIRECTORIES(${CMAKE_FORM_SOURCE_DIR})
-ADD_LIBRARY(cmForm ${FORM_SRCS} )
-TARGET_LINK_LIBRARIES(cmForm ${CURSES_LIBRARY})
-IF(CURSES_EXTRA_LIBRARY)
- TARGET_LINK_LIBRARIES(cmForm ${CURSES_EXTRA_LIBRARY})
-ENDIF(CURSES_EXTRA_LIBRARY)
+include_directories(${CMAKE_FORM_SOURCE_DIR})
+add_library(cmForm ${FORM_SRCS} )
+target_link_libraries(cmForm ${CURSES_LIBRARY})
+if(CURSES_EXTRA_LIBRARY)
+ target_link_libraries(cmForm ${CURSES_EXTRA_LIBRARY})
+endif()
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 07ec106..29daffd 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -9,115 +9,131 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-PROJECT(QtDialog)
-SET(QT_MIN_VERSION "4.4.0")
-FIND_PACKAGE(Qt4 REQUIRED)
-IF(NOT QT4_FOUND)
- MESSAGE(SEND_ERROR "Failed to find Qt 4.4 or greater.")
-ELSE(NOT QT4_FOUND)
+project(QtDialog)
+find_package(Qt5Widgets QUIET)
+if (Qt5Widgets_FOUND)
+ include_directories(${Qt5Widgets_INCLUDE_DIRS})
+ add_definitions(${Qt5Widgets_DEFINITONS})
+ macro(qt4_wrap_ui)
+ qt5_wrap_ui(${ARGN})
+ endmacro()
+ macro(qt4_wrap_cpp)
+ qt5_wrap_cpp(${ARGN})
+ endmacro()
+ macro(qt4_add_resources)
+ qt5_add_resources(${ARGN})
+ endmacro()
+ set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ # Remove this when the minimum version of Qt is 4.6.
+ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
+else()
+ set(QT_MIN_VERSION "4.4.0")
+ find_package(Qt4 REQUIRED)
+ if(NOT QT4_FOUND)
+ message(SEND_ERROR "Failed to find Qt 4.4 or greater.")
+ return()
+ endif()
- INCLUDE(${QT_USE_FILE})
- SET(CMAKE_PACKAGE_QTGUI TRUE)
- SET(SRCS
- AddCacheEntry.cxx
- AddCacheEntry.h
- CMakeSetup.cxx
- CMakeSetupDialog.cxx
- CMakeSetupDialog.h
- FirstConfigure.cxx
- FirstConfigure.h
- QCMake.cxx
- QCMake.h
- QCMakeCacheView.cxx
- QCMakeCacheView.h
- QCMakeWidgets.cxx
- QCMakeWidgets.h
- QMacInstallDialog.cxx
- QMacInstallDialog.h
- )
- QT4_WRAP_UI(UI_SRCS
- CMakeSetupDialog.ui
- Compilers.ui
- CrossCompiler.ui
- AddCacheEntry.ui
- MacInstallDialog.ui
- )
- QT4_WRAP_CPP(MOC_SRCS
- AddCacheEntry.h
- Compilers.h
- CMakeSetupDialog.h
- FirstConfigure.h
- QCMake.h
- QCMakeCacheView.h
- QCMakeWidgets.h
- QMacInstallDialog.h
- )
- QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc)
+ include(${QT_USE_FILE})
+endif()
- SET(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS})
- IF(Q_WS_WIN)
- SET(SRCS ${SRCS} CMakeSetup.rc)
- ENDIF(Q_WS_WIN)
- IF(Q_WS_MAC)
- SET(SRCS ${SRCS} CMakeSetup.icns)
- SET(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns)
- SET_SOURCE_FILES_PROPERTIES(CMakeSetup.icns PROPERTIES
- MACOSX_PACKAGE_LOCATION Resources)
- ENDIF(Q_WS_MAC)
+set(SRCS
+ AddCacheEntry.cxx
+ AddCacheEntry.h
+ CMakeSetup.cxx
+ CMakeSetupDialog.cxx
+ CMakeSetupDialog.h
+ FirstConfigure.cxx
+ FirstConfigure.h
+ QCMake.cxx
+ QCMake.h
+ QCMakeCacheView.cxx
+ QCMakeCacheView.h
+ QCMakeWidgets.cxx
+ QCMakeWidgets.h
+ QMacInstallDialog.cxx
+ QMacInstallDialog.h
+ )
+QT4_WRAP_UI(UI_SRCS
+ CMakeSetupDialog.ui
+ Compilers.ui
+ CrossCompiler.ui
+ AddCacheEntry.ui
+ MacInstallDialog.ui
+ )
+QT4_WRAP_CPP(MOC_SRCS
+ AddCacheEntry.h
+ Compilers.h
+ CMakeSetupDialog.h
+ FirstConfigure.h
+ QCMake.h
+ QCMakeCacheView.h
+ QCMakeWidgets.h
+ QMacInstallDialog.h
+ )
+QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc)
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+set(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS})
+if(WIN32)
+ set(SRCS ${SRCS} CMakeSetup.rc)
+endif()
+if(APPLE)
+ set(SRCS ${SRCS} CMakeSetup.icns)
+ set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns)
+ set_source_files_properties(CMakeSetup.icns PROPERTIES
+ MACOSX_PACKAGE_LOCATION Resources)
+endif()
- ADD_EXECUTABLE(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS})
- TARGET_LINK_LIBRARIES(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES})
- IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
- IF(APPLE)
- SET_TARGET_PROPERTIES(cmake-gui PROPERTIES
- OUTPUT_NAME ${CMAKE_BUNDLE_NAME})
- ENDIF(APPLE)
- SET(CMAKE_INSTALL_DESTINATION_ARGS
- BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}")
- ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
- INSTALL(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS})
+add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS})
+target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES})
- IF(UNIX)
- # install a desktop file so CMake appears in the application start menu
- # with an icon
- INSTALL(FILES CMake.desktop DESTINATION share/applications )
- INSTALL(FILES CMakeSetup32.png DESTINATION share/pixmaps )
- INSTALL(FILES cmakecache.xml DESTINATION share/mime/packages )
- ENDIF(UNIX)
+if(APPLE)
+ set_target_properties(cmake-gui PROPERTIES
+ OUTPUT_NAME ${CMAKE_BUNDLE_NAME})
+endif()
+set(CMAKE_INSTALL_DESTINATION_ARGS
+ BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}")
- IF(APPLE)
- SET(CMAKE_POSTFLIGHT_SCRIPT
- "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
- SET(CMAKE_POSTUPGRADE_SCRIPT
- "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
- configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postflight.sh.in"
- "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
- configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in"
- "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
- INSTALL(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui
- WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
- ENDIF(APPLE)
+install(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS})
- if(APPLE OR WIN32)
- # install rules for including 3rd party libs such as Qt
- # if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation
- set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}")
- if(APPLE)
- set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
- endif(APPLE)
- install(CODE "
- include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\")
- set(BU_CHMOD_BUNDLE_ITEMS ON)
- fixup_bundle(\"${fixup_exe}\" \"\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR}\")
- ")
- endif(APPLE OR WIN32)
+if(UNIX)
+ # install a desktop file so CMake appears in the application start menu
+ # with an icon
+ install(FILES CMake.desktop DESTINATION share/applications )
+ install(FILES CMakeSetup32.png DESTINATION share/pixmaps )
+ install(FILES cmakecache.xml DESTINATION share/mime/packages )
+endif()
- CONFIGURE_FILE("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in"
- "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY)
-ENDIF(NOT QT4_FOUND)
+if(APPLE)
+ set(CMAKE_POSTFLIGHT_SCRIPT
+ "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
+ set(CMAKE_POSTUPGRADE_SCRIPT
+ "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
+ configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postflight.sh.in"
+ "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
+ configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in"
+ "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
+ install(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui
+ WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
+endif()
+if(APPLE OR WIN32)
+ # install rules for including 3rd party libs such as Qt
+ # if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation
+ set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}")
+ if(APPLE)
+ set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
+ endif()
+ install(CODE "
+ include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\")
+ set(BU_CHMOD_BUNDLE_ITEMS ON)
+ fixup_bundle(\"${fixup_exe}\" \"\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR}\")
+ ")
+endif()
+
+set(CMAKE_PACKAGE_QTGUI TRUE)
+configure_file("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in"
+ "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY)
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index c942bc4..01893f5 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -99,15 +99,15 @@ int main(int argc, char** argv)
}
QApplication app(argc, argv);
-
+
// clean out standard Qt paths for plugins, which we don't use anyway
// when creating Mac bundles, it potentially causes problems
foreach(QString p, QApplication::libraryPaths())
{
QApplication::removeLibraryPath(p);
}
-
- // if arg for install
+
+ // if arg for install
for(int i =0; i < argc; i++)
{
if(strcmp(argv[i], "--mac-install") == 0)
@@ -117,7 +117,7 @@ int main(int argc, char** argv)
return 0;
}
}
- // tell the cmake library where cmake is
+ // tell the cmake library where cmake is
QDir cmExecDir(QApplication::applicationDirPath());
#if defined(Q_OS_MAC)
cmExecDir.cd("../../../");
@@ -131,7 +131,7 @@ int main(int argc, char** argv)
QString transfile = QString("cmake_%1").arg(QLocale::system().name());
translator.load(transfile, translationsDir.path());
app.installTranslator(&translator);
-
+
// app setup
app.setApplicationName("CMakeSetup");
app.setOrganizationName("Kitware");
@@ -139,16 +139,16 @@ int main(int argc, char** argv)
appIcon.addFile(":/Icons/CMakeSetup32.png");
appIcon.addFile(":/Icons/CMakeSetup128.png");
app.setWindowIcon(appIcon);
-
+
CMakeSetupDialog dialog;
dialog.show();
-
+
cmsys::CommandLineArguments arg;
arg.Initialize(argc, argv);
std::string binaryDirectory;
std::string sourceDirectory;
typedef cmsys::CommandLineArguments argT;
- arg.AddArgument("-B", argT::CONCAT_ARGUMENT,
+ arg.AddArgument("-B", argT::CONCAT_ARGUMENT,
&binaryDirectory, "Binary Directory");
arg.AddArgument("-H", argT::CONCAT_ARGUMENT,
&sourceDirectory, "Source Directory");
@@ -199,7 +199,7 @@ int main(int argc, char** argv)
}
}
}
-
+
return app.exec();
}
diff --git a/Source/QtDialog/Compilers.h b/Source/QtDialog/Compilers.h
index e9c90a5..3f7b834 100644
--- a/Source/QtDialog/Compilers.h
+++ b/Source/QtDialog/Compilers.h
@@ -10,7 +10,7 @@ class Compilers : public QWidget, public Ui::Compilers
{
Q_OBJECT
public:
- Compilers(QWidget* p=NULL) :
+ Compilers(QWidget* p=NULL) :
QWidget(p)
{
this->setupUi(this);
diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx
index 2a79877..6de9f00 100644
--- a/Source/QtDialog/FirstConfigure.cxx
+++ b/Source/QtDialog/FirstConfigure.cxx
@@ -25,7 +25,7 @@ StartCompilerSetup::StartCompilerSetup(QWidget* p)
l->addWidget(this->CompilerSetupOptions[1]);
l->addWidget(this->CompilerSetupOptions[2]);
l->addWidget(this->CompilerSetupOptions[3]);
-
+
this->CompilerSetupOptions[0]->setChecked(true);
QObject::connect(this->CompilerSetupOptions[0], SIGNAL(toggled(bool)),
@@ -47,7 +47,7 @@ void StartCompilerSetup::setGenerators(const QStringList& gens)
this->GeneratorOptions->clear();
this->GeneratorOptions->addItems(gens);
};
-
+
void StartCompilerSetup::setCurrentGenerator(const QString& gen)
{
int idx = this->GeneratorOptions->findText(gen);
@@ -237,7 +237,7 @@ void CrossCompilerSetup::setProcessor(const QString& t)
{
this->systemProcessor->setText(t);
}
-
+
QString CrossCompilerSetup::getFindRoot() const
{
return this->crossFindRoot->text();
@@ -313,10 +313,10 @@ FirstConfigure::FirstConfigure()
this->mNativeCompilerSetupPage = new NativeCompilerSetup(this);
this->setPage(NativeSetup, this->mNativeCompilerSetupPage);
-
+
this->mCrossCompilerSetupPage = new CrossCompilerSetup(this);
this->setPage(CrossSetup, this->mCrossCompilerSetupPage);
-
+
this->mToolchainCompilerSetupPage = new ToolchainCompilerSetup(this);
this->setPage(ToolchainSetup, this->mToolchainCompilerSetupPage);
}
@@ -370,14 +370,14 @@ void FirstConfigure::loadFromSettings()
void FirstConfigure::saveToSettings()
{
QSettings settings;
-
+
// save generator
settings.beginGroup("Settings/StartPath");
QString lastGen = this->mStartCompilerSetupPage->getGenerator();
settings.setValue("LastGenerator", lastGen);
settings.endGroup();
- // save compiler setup
+ // save compiler setup
settings.beginGroup("Settings/Compiler");
settings.setValue("CCompiler", this->mNativeCompilerSetupPage->getCCompiler());
settings.setValue("CXXCompiler", this->mNativeCompilerSetupPage->getCXXCompiler());
@@ -419,7 +419,7 @@ bool FirstConfigure::crossCompilerToolChainFile() const
{
return this->mStartCompilerSetupPage->crossCompilerToolChainFile();
}
-
+
QString FirstConfigure::getCrossCompilerToolChainFile() const
{
return this->mToolchainCompilerSetupPage->toolchainFile();
diff --git a/Source/QtDialog/FirstConfigure.h b/Source/QtDialog/FirstConfigure.h
index f4e368b..be390b0 100644
--- a/Source/QtDialog/FirstConfigure.h
+++ b/Source/QtDialog/FirstConfigure.h
@@ -30,14 +30,14 @@ class StartCompilerSetup : public QWizardPage
void setGenerators(const QStringList& gens);
void setCurrentGenerator(const QString& gen);
QString getGenerator() const;
-
+
bool defaultSetup() const;
bool compilerSetup() const;
bool crossCompilerSetup() const;
bool crossCompilerToolChainFile() const;
int nextId() const;
-
+
signals:
void selectionChanged();
@@ -56,7 +56,7 @@ class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers
public:
NativeCompilerSetup(QWidget* p);
~NativeCompilerSetup();
-
+
QString getCCompiler() const;
void setCCompiler(const QString&);
@@ -65,7 +65,7 @@ class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers
QString getFortranCompiler() const;
void setFortranCompiler(const QString&);
-
+
int nextId() const { return -1; }
};
@@ -76,13 +76,13 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
public:
CrossCompilerSetup(QWidget* p);
~CrossCompilerSetup();
-
+
QString getSystem() const;
void setSystem(const QString&);
-
+
QString getVersion() const;
void setVersion(const QString&);
-
+
QString getProcessor() const;
void setProcessor(const QString&);
@@ -94,7 +94,7 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
QString getFortranCompiler() const;
void setFortranCompiler(const QString&);
-
+
QString getFindRoot() const;
void setFindRoot(const QString&);
@@ -104,14 +104,14 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
ONLY,
NEVER
};
-
+
int getProgramMode() const;
void setProgramMode(int);
int getLibraryMode() const;
void setLibraryMode(int);
int getIncludeMode() const;
void setIncludeMode(int);
-
+
int nextId() const { return -1; }
};
@@ -127,7 +127,7 @@ class ToolchainCompilerSetup : public QWizardPage
void setToolchainFile(const QString&);
int nextId() const { return -1; }
-
+
protected:
QCMakeFilePathEditor* ToolchainFile;
};
@@ -151,7 +151,7 @@ public:
QString getCCompiler() const;
QString getCXXCompiler() const;
QString getFortranCompiler() const;
-
+
QString getSystemName() const;
QString getSystemVersion() const;
QString getSystemProcessor() const;
@@ -159,7 +159,7 @@ public:
QString getCrossProgramMode() const;
QString getCrossLibraryMode() const;
QString getCrossIncludeMode() const;
-
+
QString getCrossCompilerToolChainFile() const;
void loadFromSettings();
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 8554ff8..0d01181 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -32,9 +32,9 @@ QCMake::QCMake(QObject* p)
this->WarnUnusedMode = false;
qRegisterMetaType<QCMakeProperty>();
qRegisterMetaType<QCMakePropertyList>();
-
+
QDir execDir(QCoreApplication::applicationDirPath());
-
+
#if defined(Q_OS_MAC)
if(execDir.exists("../bin/cmake"))
{
@@ -45,7 +45,7 @@ QCMake::QCMake(QObject* p)
execDir.cd("../../../"); // path to cmake in build directory (need to fix for deployment)
}
#endif
-
+
QString cmakeCommand = QString("cmake")+QString::fromLocal8Bit(cmSystemTools::GetExecutableExtension());
cmakeCommand = execDir.filePath(cmakeCommand);
@@ -58,7 +58,7 @@ QCMake::QCMake(QObject* p)
this->CMakeInstance->SetCMakeCommand(cmakeCommand.toLocal8Bit().data());
#if defined(Q_OS_MAC)
this->CMakeInstance->SetCMakeEditCommand("cmake-gui.app/Contents/MacOS/cmake-gui");
-#else
+#else
this->CMakeInstance->SetCMakeEditCommand("cmake-gui");
#endif
this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
@@ -96,7 +96,7 @@ void QCMake::loadCache(const QString& dir)
void QCMake::setSourceDirectory(const QString& _dir)
{
- QString dir =
+ QString dir =
QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str());
if(this->SourceDirectory != dir)
{
@@ -107,7 +107,7 @@ void QCMake::setSourceDirectory(const QString& _dir)
void QCMake::setBinaryDirectory(const QString& _dir)
{
- QString dir =
+ QString dir =
QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str());
if(this->BinaryDirectory != dir)
{
@@ -126,7 +126,7 @@ void QCMake::setBinaryDirectory(const QString& _dir)
"Please check the permissions of the directory you are trying to run CMake on.");
}
}
-
+
QCMakePropertyList props = this->properties();
emit this->propertiesChanged(props);
cmCacheManager::CacheIterator itm = cachem->NewIterator();
@@ -202,7 +202,7 @@ void QCMake::generate()
emit this->generateDone(err);
}
-
+
void QCMake::setProperties(const QCMakePropertyList& newProps)
{
QCMakePropertyList props = newProps;
@@ -251,7 +251,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
cachem->RemoveCacheEntry(s.toLocal8Bit().data());
}
-
+
// add some new properites
foreach(QCMakeProperty s, props)
{
@@ -286,7 +286,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
cmCacheManager::FILEPATH);
}
}
-
+
cachem->SaveCache(this->BinaryDirectory.toLocal8Bit().data());
}
@@ -339,7 +339,7 @@ QCMakePropertyList QCMake::properties() const
return ret;
}
-
+
void QCMake::interrupt()
{
this->InterruptFlag.ref();
@@ -348,7 +348,11 @@ void QCMake::interrupt()
bool QCMake::interruptCallback(void* cd)
{
QCMake* self = reinterpret_cast<QCMake*>(cd);
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
return self->InterruptFlag;
+#else
+ return self->InterruptFlag.load();
+#endif
}
void QCMake::progressCallback(const char* msg, float percent, void* cd)
@@ -416,7 +420,7 @@ void QCMake::reloadCache()
props = this->properties();
emit this->propertiesChanged(props);
}
-
+
void QCMake::setDebugOutput(bool flag)
{
if(flag != this->CMakeInstance->GetDebugOutput())
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index 0d68586..93ac8ab 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -38,12 +38,12 @@ struct QCMakeProperty
QString Help;
PropertyType Type;
bool Advanced;
- bool operator==(const QCMakeProperty& other) const
- {
+ bool operator==(const QCMakeProperty& other) const
+ {
return this->Key == other.Key;
}
- bool operator<(const QCMakeProperty& other) const
- {
+ bool operator<(const QCMakeProperty& other) const
+ {
return this->Key < other.Key;
}
};
@@ -56,7 +56,7 @@ Q_DECLARE_METATYPE(QCMakeProperty)
Q_DECLARE_METATYPE(QCMakePropertyList)
/// Qt API for CMake library.
-/// Wrapper like class allows for easier integration with
+/// Wrapper like class allows for easier integration with
/// Qt features such as, signal/slot connections, multi-threading, etc..
class QCMake : public QObject
{
@@ -136,7 +136,7 @@ protected:
static bool interruptCallback(void*);
static void progressCallback(const char* msg, float percent, void* cd);
- static void errorCallback(const char* msg, const char* title,
+ static void errorCallback(const char* msg, const char* title,
bool&, void* cd);
bool SuppressDevWarnings;
bool WarnUninitializedMode;
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 72e9b24..1d21d42 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -64,7 +64,7 @@ protected:
return true;
}
}
-
+
return false;
}
};
@@ -73,11 +73,11 @@ protected:
class QCMakeAdvancedFilter : public QSortFilterProxyModel
{
public:
- QCMakeAdvancedFilter(QObject* o)
+ QCMakeAdvancedFilter(QObject* o)
: QSortFilterProxyModel(o), ShowAdvanced(false) {}
- void setShowAdvanced(bool f)
- {
+ void setShowAdvanced(bool f)
+ {
this->ShowAdvanced = f;
this->invalidate();
}
@@ -102,7 +102,7 @@ protected:
}
return false;
}
-
+
// check children
int num = m->rowCount(idx);
for(int i=0; i<num; i++)
@@ -134,9 +134,9 @@ QCMakeCacheView::QCMakeCacheView(QWidget* p)
// our delegate for creating our editors
QCMakeCacheModelDelegate* delegate = new QCMakeCacheModelDelegate(this);
this->setItemDelegate(delegate);
-
+
this->setUniformRowHeights(true);
-
+
this->setEditTriggers(QAbstractItemView::AllEditTriggers);
// tab, backtab doesn't step through items
@@ -153,13 +153,13 @@ bool QCMakeCacheView::event(QEvent* e)
}
return QTreeView::event(e);
}
-
+
QCMakeCacheModel* QCMakeCacheView::cacheModel() const
{
return this->CacheModel;
}
-
-QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
+
+QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
Qt::KeyboardModifiers mod)
{
// want home/end to go to begin/end of rows, not columns
@@ -173,7 +173,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
}
return QTreeView::moveCursor(act, mod);
}
-
+
void QCMakeCacheView::setShowAdvanced(bool s)
{
#if QT_VERSION >= 040300
@@ -224,7 +224,7 @@ void QCMakeCacheModel::clear()
{
this->QStandardItemModel::clear();
this->NewPropertyCount = 0;
-
+
QStringList labels;
labels << tr("Name") << tr("Value");
this->setHorizontalHeaderLabels(labels);
@@ -281,7 +281,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
this->breakProperties(newProps2, newPropsTree2);
QStandardItem* root = this->invisibleRootItem();
-
+
foreach(QString key, newPropsTree.keys())
{
QCMakePropertyList props2 = newPropsTree[key];
@@ -308,12 +308,12 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
this->setPropertyData(this->indexFromItem(items[0]), prop, true);
}
}
-
+
foreach(QString key, newPropsTree2.keys())
{
QCMakePropertyList props2 = newPropsTree2[key];
- QStandardItem* parentItem =
+ QStandardItem* parentItem =
new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key);
root->appendRow(parentItem);
parentItem->setData(1, GroupRole);
@@ -330,7 +330,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
}
}
}
-
+
this->blockSignals(b);
this->reset();
}
@@ -361,7 +361,7 @@ void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t)
this->reset();
}
-void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
+void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
const QCMakeProperty& prop, bool isNew)
{
QModelIndex idx2 = idx1.sibling(idx1.row(), 1);
@@ -370,7 +370,7 @@ void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
this->setData(idx1, prop.Help, QCMakeCacheModel::HelpRole);
this->setData(idx1, prop.Type, QCMakeCacheModel::TypeRole);
this->setData(idx1, prop.Advanced, QCMakeCacheModel::AdvancedRole);
-
+
if(prop.Type == QCMakeProperty::BOOL)
{
int check = prop.Value.toBool() ? Qt::Checked : Qt::Unchecked;
@@ -394,7 +394,7 @@ void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
}
}
-void QCMakeCacheModel::getPropertyData(const QModelIndex& idx1,
+void QCMakeCacheModel::getPropertyData(const QModelIndex& idx1,
QCMakeProperty& prop) const
{
QModelIndex idx2 = idx1.sibling(idx1.row(), 1);
@@ -457,7 +457,7 @@ void QCMakeCacheModel::breakProperties(const QSet<QCMakeProperty>& props,
}
result = tmp;
}
-
+
QCMakePropertyList QCMakeCacheModel::properties() const
{
QCMakePropertyList props;
@@ -488,7 +488,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const
this->getPropertyData(idx, prop);
props.append(prop);
}
-
+
// go to the next in the tree
while(!idxs.isEmpty() && !idxs.last().sibling(idxs.last().row()+1, 0).isValid())
{
@@ -503,7 +503,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const
return props;
}
-
+
bool QCMakeCacheModel::insertProperty(QCMakeProperty::PropertyType t,
const QString& name, const QString& description,
const QVariant& value, bool advanced)
@@ -554,7 +554,7 @@ Qt::ItemFlags QCMakeCacheModel::flags (const QModelIndex& idx) const
QModelIndex QCMakeCacheModel::buddy(const QModelIndex& idx) const
{
- if(!this->hasChildren(idx) &&
+ if(!this->hasChildren(idx) &&
this->data(idx, TypeRole).toInt() != QCMakeProperty::BOOL)
{
return this->index(idx.row(), 1, idx.parent());
@@ -572,7 +572,7 @@ void QCMakeCacheModelDelegate::setFileDialogFlag(bool f)
this->FileDialogFlag = f;
}
-QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
+QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
const QStyleOptionViewItem&, const QModelIndex& idx) const
{
QModelIndex var = idx.sibling(idx.row(), 0);
@@ -584,7 +584,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
else if(type == QCMakeProperty::PATH)
{
QCMakePathEditor* editor =
- new QCMakePathEditor(p,
+ new QCMakePathEditor(p,
var.data(Qt::DisplayRole).toString());
QObject::connect(editor, SIGNAL(fileDialogExists(bool)), this,
SLOT(setFileDialogFlag(bool)));
@@ -593,7 +593,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
else if(type == QCMakeProperty::FILEPATH)
{
QCMakeFilePathEditor* editor =
- new QCMakeFilePathEditor(p,
+ new QCMakeFilePathEditor(p,
var.data(Qt::DisplayRole).toString());
QObject::connect(editor, SIGNAL(fileDialogExists(bool)), this,
SLOT(setFileDialogFlag(bool)));
@@ -602,7 +602,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
else if(type == QCMakeProperty::STRING &&
var.data(QCMakeCacheModel::StringsRole).isValid())
{
- QCMakeComboBox* editor =
+ QCMakeComboBox* editor =
new QCMakeComboBox(p, var.data(QCMakeCacheModel::StringsRole).toStringList());
editor->setFrame(false);
return editor;
@@ -613,7 +613,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
return editor;
}
-bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
+bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
const QStyleOptionViewItem& option, const QModelIndex& index)
{
Qt::ItemFlags flags = model->flags(index);
@@ -637,7 +637,7 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
{
return true;
}
- }
+ }
else if (e->type() == QEvent::KeyPress)
{
if(static_cast<QKeyEvent*>(e)->key() != Qt::Key_Space &&
@@ -645,8 +645,8 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
{
return false;
}
- }
- else
+ }
+ else
{
return false;
}
@@ -660,7 +660,7 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
}
return success;
}
-
+
// Issue 205903 fixed in Qt 4.5.0.
// Can remove this function and FileDialogFlag when minimum Qt version is 4.5
bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* evt)
@@ -682,7 +682,7 @@ void QCMakeCacheModelDelegate::setModelData(QWidget* editor,
QItemDelegate::setModelData(editor, model, index);
const_cast<QCMakeCacheModelDelegate*>(this)->recordChange(model, index);
}
-
+
QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
{
QSize sz = QItemDelegate::sizeHint(option, index);
@@ -695,7 +695,7 @@ QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option, con
return sz;
}
-
+
QSet<QCMakeProperty> QCMakeCacheModelDelegate::changes() const
{
return mChanges;
@@ -721,7 +721,7 @@ void QCMakeCacheModelDelegate::recordChange(QAbstractItemModel* model, const QMo
QCMakeProperty prop;
idx = idx.sibling(idx.row(), 0);
cache_model->getPropertyData(idx, prop);
-
+
// clean out an old one
QSet<QCMakeProperty>::iterator iter = mChanges.find(prop);
if(iter != mChanges.end())
diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h
index 0a628b9..41f0bd8 100644
--- a/Source/QtDialog/QCMakeCacheView.h
+++ b/Source/QtDialog/QCMakeCacheView.h
@@ -33,7 +33,7 @@ public:
// retrieve the QCMakeCacheModel storing all the pointers
// this isn't necessarily the model one would get from model()
QCMakeCacheModel* cacheModel() const;
-
+
// get whether to show advanced entries
bool showAdvanced() const;
@@ -65,7 +65,7 @@ public:
// roles used to retrieve extra data such has help strings, types of
// properties, and the advanced flag
enum { HelpRole = Qt::ToolTipRole,
- TypeRole = Qt::UserRole,
+ TypeRole = Qt::UserRole,
AdvancedRole,
StringsRole,
GroupRole
@@ -102,7 +102,7 @@ public slots:
public:
// get the properties
QCMakePropertyList properties() const;
-
+
// editing enabled
bool editEnabled() const;
@@ -112,7 +112,7 @@ public:
// return flags (overloaded to modify flag based on EditEnabled flag)
Qt::ItemFlags flags (const QModelIndex& index) const;
QModelIndex buddy(const QModelIndex& idx) const;
-
+
// get the data in the model for this property
void getPropertyData(const QModelIndex& idx1,
QCMakeProperty& prop) const;
@@ -124,20 +124,20 @@ protected:
ViewType View;
// set the data in the model for this property
- void setPropertyData(const QModelIndex& idx1,
+ void setPropertyData(const QModelIndex& idx1,
const QCMakeProperty& p, bool isNew);
// breaks up he property list into groups
// where each group has the same prefix up to the first underscore
static void breakProperties(const QSet<QCMakeProperty>& props,
QMap<QString, QCMakePropertyList>& result);
-
+
// gets the prefix of a string up to the first _
static QString prefix(const QString& s);
};
-/// Qt delegate class for interaction (or other customization)
+/// Qt delegate class for interaction (or other customization)
/// with cache properties
class QCMakeCacheModelDelegate : public QItemDelegate
{
@@ -145,9 +145,9 @@ class QCMakeCacheModelDelegate : public QItemDelegate
public:
QCMakeCacheModelDelegate(QObject* p);
/// create our own editors for cache properties
- QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option,
+ QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option,
const QModelIndex& index ) const;
- bool editorEvent (QEvent* event, QAbstractItemModel* model,
+ bool editorEvent (QEvent* event, QAbstractItemModel* model,
const QStyleOptionViewItem& option, const QModelIndex& index);
bool eventFilter(QObject* object, QEvent* event);
void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index ) const;
diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx
index 144e1f3..a0c5e17 100644
--- a/Source/QtDialog/QCMakeWidgets.cxx
+++ b/Source/QtDialog/QCMakeWidgets.cxx
@@ -69,7 +69,7 @@ void QCMakeFilePathEditor::chooseFile()
this->fileDialogExists(true);
path = QFileDialog::getOpenFileName(this, title, info.absolutePath());
this->fileDialogExists(false);
-
+
if(!path.isEmpty())
{
this->setText(QDir::fromNativeSeparators(path));
diff --git a/Source/QtDialog/QMacInstallDialog.cxx b/Source/QtDialog/QMacInstallDialog.cxx
index 6eb053b..8b8c531 100644
--- a/Source/QtDialog/QMacInstallDialog.cxx
+++ b/Source/QtDialog/QMacInstallDialog.cxx
@@ -15,11 +15,11 @@ QMacInstallDialog::QMacInstallDialog(QWidget*w)
{
this->Internals = new QMacInstallDialogInternals;
this->Internals->setupUi(this);
- QObject::connect(this->Internals->choosePathButton, SIGNAL(pressed()),
+ QObject::connect(this->Internals->choosePathButton, SIGNAL(pressed()),
this, SLOT(ShowBrowser()));
- QObject::connect(this->Internals->skipInstallButton, SIGNAL(pressed()),
+ QObject::connect(this->Internals->skipInstallButton, SIGNAL(pressed()),
this, SLOT(SkipInstall()));
- QObject::connect(this->Internals->doInstallButton, SIGNAL(pressed()),
+ QObject::connect(this->Internals->doInstallButton, SIGNAL(pressed()),
this, SLOT(DoInstall()));
this->Internals->InstallPrefix->setText("/usr/bin/");
@@ -31,7 +31,7 @@ QMacInstallDialog::~QMacInstallDialog()
}
void QMacInstallDialog::DoInstall()
-{
+{
QDir installDir(this->Internals->InstallPrefix->text());
QString installTo = installDir.path();
if(!cmSystemTools::FileExists(installTo.toLocal8Bit().data()))
@@ -42,7 +42,7 @@ void QMacInstallDialog::DoInstall()
message += installDir.path();
QString title = tr("Create Directory");
QMessageBox::StandardButton btn;
- btn = QMessageBox::information(this, title, message,
+ btn = QMessageBox::information(this, title, message,
QMessageBox::Yes | QMessageBox::No);
if(btn == QMessageBox::Yes)
{
@@ -52,7 +52,7 @@ void QMacInstallDialog::DoInstall()
QDir cmExecDir(QApplication::applicationDirPath());
cmExecDir.cd("../bin");
QFileInfoList list = cmExecDir.entryInfoList();
- for (int i = 0; i < list.size(); ++i)
+ for (int i = 0; i < list.size(); ++i)
{
QFileInfo fileInfo = list.at(i);
QString filename = fileInfo.fileName();
@@ -75,7 +75,7 @@ void QMacInstallDialog::DoInstall()
message += newName;
QString title = tr("Error Removing file");
QMessageBox::StandardButton btn =
- QMessageBox::critical(this, title, message,
+ QMessageBox::critical(this, title, message,
QMessageBox::Ok|QMessageBox::Abort);
if(btn == QMessageBox::Abort)
{
@@ -93,7 +93,7 @@ void QMacInstallDialog::DoInstall()
message += newName;
QString title = tr("Error Creating Symlink");
QMessageBox::StandardButton btn =
- QMessageBox::critical(this, title, message,
+ QMessageBox::critical(this, title, message,
QMessageBox::Ok|QMessageBox::Abort);
if(btn == QMessageBox::Abort)
{
@@ -112,7 +112,7 @@ void QMacInstallDialog::SkipInstall()
void QMacInstallDialog::ShowBrowser()
{
- QString dir = QFileDialog::getExistingDirectory(this,
+ QString dir = QFileDialog::getExistingDirectory(this,
tr("Enter Install Prefix"), this->Internals->InstallPrefix->text());
if(!dir.isEmpty())
{
diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in
index 701991b..3196471 100644
--- a/Source/QtDialog/QtDialogCPack.cmake.in
+++ b/Source/QtDialog/QtDialogCPack.cmake.in
@@ -1,18 +1,18 @@
-SET(IS_APPLE @APPLE@)
-SET(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@)
+set(IS_APPLE @APPLE@)
+set(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@)
-IF(CMAKE_PACKAGE_QTGUI)
- SET(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES})
- SET(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS})
- IF(IS_APPLE)
+if(CMAKE_PACKAGE_QTGUI)
+ set(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES})
+ set(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS})
+ if(IS_APPLE)
# for apple install we set the install prefix to
# / and then install
# cmake into the bundle for cmake-gui and must use DESTDIR
- SET(CPACK_SET_DESTDIR TRUE)
+ set(CPACK_SET_DESTDIR TRUE)
# we also want to run post install stuff to setup command line
- SET(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@")
- SET(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@")
- ENDIF(IS_APPLE)
-ENDIF(CMAKE_PACKAGE_QTGUI)
+ set(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@")
+ set(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@")
+ endif()
+endif()
diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h
index 1f770ed..c5252b7 100644
--- a/Source/cmAddCustomCommandCommand.h
+++ b/Source/cmAddCustomCommandCommand.h
@@ -16,7 +16,7 @@
#include "cmDocumentGeneratorExpressions.h"
/** \class cmAddCustomCommandCommand
- * \brief
+ * \brief
*
* cmAddCustomCommandCommand defines a new command (rule) that can
* be executed within the build process
@@ -29,7 +29,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmAddCustomCommandCommand;
}
@@ -45,7 +45,7 @@ public:
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() const {return "add_custom_command";}
-
+
/**
* Succinct documentation.
*/
@@ -53,7 +53,7 @@ public:
{
return "Add a custom build rule to the generated build system.";
}
-
+
/**
* More documentation.
*/
@@ -177,7 +177,7 @@ public:
"is recompiled.\n"
;
}
-
+
cmTypeMacro(cmAddCustomCommandCommand, cmCommand);
protected:
bool CheckOutputs(const std::vector<std::string>& outputs);
diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h
index 50bffef..d4ed450 100644
--- a/Source/cmAddCustomTargetCommand.h
+++ b/Source/cmAddCustomTargetCommand.h
@@ -27,7 +27,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmAddCustomTargetCommand;
}
@@ -38,13 +38,13 @@ public:
*/
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
-
+
/**
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() const
{return "add_custom_target";}
-
+
/**
* Succinct documentation.
*/
@@ -52,7 +52,7 @@ public:
{
return "Add a target with no output so it will always be built.";
}
-
+
/**
* More documentation.
*/
@@ -101,7 +101,7 @@ public:
"convenience in editing even if they have not build rules."
;
}
-
+
cmTypeMacro(cmAddCustomTargetCommand, cmCommand);
};
diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h
index 14a7741..ed80067 100644
--- a/Source/cmAddDependenciesCommand.h
+++ b/Source/cmAddDependenciesCommand.h
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmAddDependenciesCommand;
}
@@ -49,7 +49,7 @@ public:
{
return "Add a dependency between top-level targets.";
}
-
+
/**
* More documentation.
*/
@@ -70,7 +70,7 @@ public:
"SET_SOURCE_FILES_PROPERTIES to add file-level dependencies to object "
"files.";
}
-
+
cmTypeMacro(cmAddDependenciesCommand, cmCommand);
};
diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h
index b1ae202..c144565 100644
--- a/Source/cmAddLibraryCommand.h
+++ b/Source/cmAddLibraryCommand.h
@@ -26,7 +26,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmAddLibraryCommand;
}
@@ -50,7 +50,7 @@ public:
{
return "Add a library to the project using the specified source files.";
}
-
+
/**
* More documentation.
*/
@@ -78,7 +78,9 @@ public:
"functionality. "
"If no type is given explicitly the type is STATIC or SHARED based "
"on whether the current value of the variable BUILD_SHARED_LIBS is "
- "true."
+ "true. "
+ "For SHARED and MODULE libraries the POSITION_INDEPENDENT_CODE "
+ "target property is set to TRUE automatically."
"\n"
"By default the library file will be created in the build tree "
"directory corresponding to the source tree directory in which "
@@ -134,7 +136,7 @@ public:
"Object libraries cannot be imported, exported, installed, or linked."
;
}
-
+
cmTypeMacro(cmAddLibraryCommand, cmCommand);
};
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx
index 5fca527..9efeda4 100644
--- a/Source/cmAddSubDirectoryCommand.cxx
+++ b/Source/cmAddSubDirectoryCommand.cxx
@@ -20,11 +20,11 @@ bool cmAddSubDirectoryCommand::InitialPass
this->SetError("called with incorrect number of arguments");
return false;
}
-
+
// store the binpath
std::string srcArg = args[0];
std::string binArg;
-
+
bool excludeFromAll = false;
// process the rest of the arguments looking for optional args
diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h
index 3d6f51e..fa322b0 100644
--- a/Source/cmAddSubDirectoryCommand.h
+++ b/Source/cmAddSubDirectoryCommand.h
@@ -27,7 +27,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmAddSubDirectoryCommand;
}
@@ -51,7 +51,7 @@ public:
{
return "Add a subdirectory to the build.";
}
-
+
/**
* More documentation.
*/
@@ -90,7 +90,7 @@ public:
"project build system to satisfy the dependency."
;
}
-
+
cmTypeMacro(cmAddSubDirectoryCommand, cmCommand);
};
diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h
index 59f10f6..6a0cd9d 100644
--- a/Source/cmAddTestCommand.h
+++ b/Source/cmAddTestCommand.h
@@ -26,7 +26,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmAddTestCommand;
}
@@ -50,7 +50,7 @@ public:
{
return "Add a test to the project with the specified arguments.";
}
-
+
/**
* More documentation.
*/
@@ -81,7 +81,7 @@ public:
"\n"
"Arguments after COMMAND may use \"generator expressions\" with the "
"syntax \"$<...>\". "
- CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
+ CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS
"Example usage:\n"
" add_test(NAME mytest\n"
" COMMAND testDriver --config $<CONFIGURATION>\n"
@@ -91,7 +91,7 @@ public:
"executable file produced by target \"myexe\"."
;
}
-
+
cmTypeMacro(cmAddTestCommand, cmCommand);
private:
bool HandleNameMode(std::vector<std::string> const& args);
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index f88be3d..01f64b7 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -23,7 +23,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass
this->SetError("called with incorrect number of arguments");
return false;
}
-
+
std::string sourceListValue;
std::string templateDirectory = args[0];
this->Makefile->AddExtraDirectory(templateDirectory.c_str());
@@ -40,12 +40,12 @@ bool cmAuxSourceDirectoryCommand::InitialPass
}
// was the list already populated
- const char *def = this->Makefile->GetDefinition(args[1].c_str());
+ const char *def = this->Makefile->GetDefinition(args[1].c_str());
if (def)
{
sourceListValue = def;
}
-
+
// Load all the files in the directory
cmsys::Directory dir;
if(dir.Load(tdir.c_str()))
@@ -69,7 +69,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass
std::string fullname = templateDirectory;
fullname += "/";
fullname += file;
- // add the file as a class file so
+ // add the file as a class file so
// depends can be done
cmSourceFile* sf =
this->Makefile->GetOrCreateSource(fullname.c_str());
@@ -83,7 +83,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass
}
}
}
- this->Makefile->AddDefinition(args[1].c_str(), sourceListValue.c_str());
+ this->Makefile->AddDefinition(args[1].c_str(), sourceListValue.c_str());
return true;
}
diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h
index f059e44..8a70f19 100644
--- a/Source/cmAuxSourceDirectoryCommand.h
+++ b/Source/cmAuxSourceDirectoryCommand.h
@@ -29,7 +29,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmAuxSourceDirectoryCommand;
}
@@ -45,7 +45,7 @@ public:
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() const { return "aux_source_directory";}
-
+
/**
* Succinct documentation.
*/
@@ -53,7 +53,7 @@ public:
{
return "Find all source files in a directory.";
}
-
+
/**
* More documentation.
*/
@@ -77,7 +77,7 @@ public:
"one would have to manually rerun CMake to generate a build system "
"incorporating the new file.";
}
-
+
cmTypeMacro(cmAuxSourceDirectoryCommand, cmCommand);
};
diff --git a/Source/cmBreakCommand.h b/Source/cmBreakCommand.h
index 67ef37e..17f57cf 100644
--- a/Source/cmBreakCommand.h
+++ b/Source/cmBreakCommand.h
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmBreakCommand;
}
@@ -46,7 +46,7 @@ public:
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() const {return "break";}
-
+
/**
* Succinct documentation.
*/
@@ -54,7 +54,7 @@ public:
{
return "Break from an enclosing foreach or while loop.";
}
-
+
/**
* More documentation.
*/
@@ -64,7 +64,7 @@ public:
" break()\n"
"Breaks from an enclosing foreach loop or while loop";
}
-
+
cmTypeMacro(cmBreakCommand, cmCommand);
};
diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h
index a333c5d..1bab453 100644
--- a/Source/cmBuildCommand.h
+++ b/Source/cmBuildCommand.h
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmBuildCommand;
}
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
index fa69830..f95a79e 100644
--- a/Source/cmBuildNameCommand.cxx
+++ b/Source/cmBuildNameCommand.cxx
@@ -25,7 +25,7 @@ bool cmBuildNameCommand
const char* cacheValue = this->Makefile->GetDefinition(args[0].c_str());
if(cacheValue)
{
- // do we need to correct the value?
+ // do we need to correct the value?
cmsys::RegularExpression reg("[()/]");
if (reg.find(cacheValue))
{
@@ -41,7 +41,7 @@ bool cmBuildNameCommand
return true;
}
-
+
std::string buildname = "WinNT";
if(this->Makefile->GetDefinition("UNIX"))
{
@@ -67,7 +67,7 @@ bool cmBuildNameCommand
"(", "_");
cmSystemTools::ReplaceString(buildname,
")", "_");
-
+
this->Makefile->AddCacheDefinition(args[0].c_str(),
buildname.c_str(),
"Name of build.",
diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx
index 126934c..49c585f 100644
--- a/Source/cmCMakeMinimumRequired.cxx
+++ b/Source/cmCMakeMinimumRequired.cxx
@@ -120,7 +120,7 @@ bool cmCMakeMinimumRequired
{
this->Makefile->SetPolicyVersion(version_string.c_str());
}
-
+
return true;
}
diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h
index d23ce79..acf2829 100644
--- a/Source/cmCMakeMinimumRequired.h
+++ b/Source/cmCMakeMinimumRequired.h
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmCMakeMinimumRequired;
}
@@ -46,7 +46,7 @@ public:
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() const {return "cmake_minimum_required";}
-
+
/**
* Succinct documentation.
*/
@@ -54,7 +54,7 @@ public:
{
return "Set the minimum required version of cmake for a project.";
}
-
+
/**
* More documentation.
*/
@@ -77,7 +77,7 @@ public:
"It should be specified so CMake versions 2.4 and lower fail with an "
"error instead of just a warning.";
}
-
+
cmTypeMacro(cmCMakeMinimumRequired, cmCommand);
private:
diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h
index 4f1ed36..4f9faa1 100644
--- a/Source/cmCMakePolicyCommand.h
+++ b/Source/cmCMakePolicyCommand.h
@@ -17,8 +17,8 @@
/** \class cmCMakePolicyCommand
* \brief Set how CMake should handle policies
*
- * cmCMakePolicyCommand sets how CMake should deal with backwards
- * compatibility policies.
+ * cmCMakePolicyCommand sets how CMake should deal with backwards
+ * compatibility policies.
*/
class cmCMakePolicyCommand : public cmCommand
{
@@ -26,7 +26,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmCMakePolicyCommand;
}
@@ -47,7 +47,7 @@ public:
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() const {return "cmake_policy";}
-
+
/**
* Succinct documentation.
*/
@@ -55,7 +55,7 @@ public:
{
return "Manage CMake Policy settings.";
}
-
+
/**
* More documentation.
*/
@@ -129,7 +129,7 @@ public:
"closest nested policy stack entry."
;
}
-
+
cmTypeMacro(cmCMakePolicyCommand, cmCommand);
private:
bool HandleSetMode(std::vector<std::string> const& args);
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index e237913..48ae50e 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -389,7 +389,7 @@ void CCONV cmAddLibrary(void *arg, const char *libname, int shared,
{
srcs2.push_back(srcs[i]);
}
- mf->AddLibrary(libname,
+ mf->AddLibrary(libname,
(shared? cmTarget::SHARED_LIBRARY : cmTarget::STATIC_LIBRARY),
srcs2);
}
@@ -859,13 +859,13 @@ void CCONV cmFree(void *data)
}
void CCONV DefineSourceFileProperty (void *arg, const char *name,
- const char *briefDocs,
+ const char *briefDocs,
const char *longDocs,
int chained)
{
cmMakefile *mf = static_cast<cmMakefile *>(arg);
mf->GetCMakeInstance()->DefineProperty(name,cmProperty::SOURCE_FILE,
- briefDocs, longDocs,
+ briefDocs, longDocs,
chained != 0);
}
diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h
index fd5a4f8..5c832c3 100644
--- a/Source/cmCPluginAPI.h
+++ b/Source/cmCPluginAPI.h
@@ -168,10 +168,10 @@ typedef struct
/* new functions added after 2.4 */
void *(CCONV *CreateNewSourceFile) (void *mf);
void (CCONV *DefineSourceFileProperty) (void *mf, const char *name,
- const char *briefDocs,
+ const char *briefDocs,
const char *longDocs,
int chained);
-
+
/* this is the end of the C function stub API structure */
} cmCAPI;
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index b5687e3..a6d04b7 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -75,8 +75,8 @@ struct tm* cmCTest::GetNightlyTime(std::string str,
char buf[1024];
// add todays year day and month to the time in str because
// curl_getdate no longer assumes the day is today
- sprintf(buf, "%d%02d%02d %s",
- lctime->tm_year+1900,
+ sprintf(buf, "%d%02d%02d %s",
+ lctime->tm_year+1900,
lctime->tm_mon +1,
lctime->tm_mday,
str.c_str());
@@ -223,7 +223,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method,
default:
break;
}
-
+
::curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
::curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout);
::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
@@ -237,7 +237,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method,
::curl_easy_cleanup(curl);
::curl_global_cleanup();
-
+
return static_cast<int>(res);
}
#endif
@@ -300,7 +300,7 @@ cmCTest::cmCTest()
this->ForceNewCTestProcess = false;
this->TomorrowTag = false;
this->Verbose = false;
-
+
this->Debug = false;
this->ShowLineNumbers = false;
this->Quiet = false;
@@ -760,7 +760,7 @@ bool cmCTest::UpdateCTestConfiguration()
}
else
{
- cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:"
+ cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:"
<< fileName.c_str() << "\n");
// parse the dart test file
std::ifstream fin(fileName.c_str());
@@ -944,7 +944,7 @@ bool cmCTest::AddIfExists(Part part, const char* file)
//----------------------------------------------------------------------
bool cmCTest::CTestFileExists(const std::string& filename)
{
- std::string testingDir = this->BinaryDir + "/Testing/" +
+ std::string testingDir = this->BinaryDir + "/Testing/" +
this->CurrentTag + "/" + filename;
return cmSystemTools::FileExists(testingDir.c_str());
}
@@ -952,7 +952,7 @@ bool cmCTest::CTestFileExists(const std::string& filename)
//----------------------------------------------------------------------
cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler)
{
- cmCTest::t_TestingHandlers::iterator it =
+ cmCTest::t_TestingHandlers::iterator it =
this->TestingHandlers.find(handler);
if ( it == this->TestingHandlers.end() )
{
@@ -965,7 +965,7 @@ cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler)
//----------------------------------------------------------------------
cmCTestGenericHandler* cmCTest::GetHandler(const char* handler)
{
- cmCTest::t_TestingHandlers::iterator it =
+ cmCTest::t_TestingHandlers::iterator it =
this->TestingHandlers.find(handler);
if ( it == this->TestingHandlers.end() )
{
@@ -1314,8 +1314,8 @@ int cmCTest::RunTest(std::vector<const char*> argv,
{
if(argv[i])
{
- // make sure we pass the timeout in for any build and test
- // invocations. Since --build-generator is required this is a
+ // make sure we pass the timeout in for any build and test
+ // invocations. Since --build-generator is required this is a
// good place to check for it, and to add the arguments in
if (strcmp(argv[i],"--build-generator") == 0 && timeout > 0)
{
@@ -1524,18 +1524,18 @@ void cmCTest::StartXML(std::ostream& ostr, bool append)
<< "\tNumberOfPhysicalCPU=\""<< info.GetNumberOfPhysicalCPU() << "\"\n"
<< "\tTotalVirtualMemory=\"" << info.GetTotalVirtualMemory() << "\"\n"
<< "\tTotalPhysicalMemory=\""<< info.GetTotalPhysicalMemory() << "\"\n"
- << "\tLogicalProcessorsPerPhysical=\""
+ << "\tLogicalProcessorsPerPhysical=\""
<< info.GetLogicalProcessorsPerPhysical() << "\"\n"
- << "\tProcessorClockFrequency=\""
- << info.GetProcessorClockFrequency() << "\"\n"
+ << "\tProcessorClockFrequency=\""
+ << info.GetProcessorClockFrequency() << "\"\n"
<< ">" << std::endl;
- this->AddSiteProperties(ostr);
+ this->AddSiteProperties(ostr);
}
//----------------------------------------------------------------------
void cmCTest::AddSiteProperties(std::ostream& ostr)
{
- cmCTestScriptHandler* ch =
+ cmCTestScriptHandler* ch =
static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
cmake* cm = ch->GetCMake();
// if no CMake then this is the old style script and props like
@@ -1547,9 +1547,9 @@ void cmCTest::AddSiteProperties(std::ostream& ostr)
// This code should go when cdash is changed to use labels only
const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL);
if(subproject)
- {
+ {
ostr << "<Subproject name=\"" << subproject << "\">\n";
- const char* labels =
+ const char* labels =
ch->GetCMake()->GetProperty("SubProjectLabels", cmProperty::GLOBAL);
if(labels)
{
@@ -1566,11 +1566,11 @@ void cmCTest::AddSiteProperties(std::ostream& ostr)
}
ostr << "</Subproject>\n";
}
-
+
// This code should stay when cdash only does label based sub-projects
const char* label = cm->GetProperty("Label", cmProperty::GLOBAL);
if(label)
- {
+ {
ostr << "<Labels>\n";
ostr << " <Label>" << label << "</Label>\n";
ostr << "</Labels>\n";
@@ -1762,7 +1762,7 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles)
//-------------------------------------------------------
-// for a -D argument convert the next argument into
+// for a -D argument convert the next argument into
// the proper list of dashboard steps via SetTest
bool cmCTest::AddTestsForDashboardType(std::string &targ)
{
@@ -1980,9 +1980,9 @@ bool cmCTest::CheckArgument(const std::string& arg, const char* varg1,
//----------------------------------------------------------------------
-// Processes one command line argument (and its arguments if any)
+// Processes one command line argument (and its arguments if any)
// for many simple options and then returns
-void cmCTest::HandleCommandLineArguments(size_t &i,
+void cmCTest::HandleCommandLineArguments(size_t &i,
std::vector<std::string> &args)
{
std::string arg = args[i];
@@ -2031,14 +2031,14 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
i++;
this->SetStopTime(args[i]);
}
-
+
if(this->CheckArgument(arg, "-C", "--build-config") &&
i < args.size() - 1)
{
i++;
this->SetConfigType(args[i].c_str());
}
-
+
if(this->CheckArgument(arg, "--debug"))
{
this->Debug = true;
@@ -2078,7 +2078,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
{
this->OutputTestOutputOnTestFailure = true;
}
-
+
if(this->CheckArgument(arg, "-N", "--show-only"))
{
this->ShowOnly = true;
@@ -2118,7 +2118,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
this->SubmitIndex = 0;
}
}
-
+
if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1)
{
i++;
@@ -2171,7 +2171,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
this->GetHandler("memcheck")->
SetPersistentOption("ExcludeLabelRegularExpression", args[i].c_str());
}
-
+
if(this->CheckArgument(arg, "-E", "--exclude-regex") &&
i < args.size() - 1)
{
@@ -2180,17 +2180,17 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
SetPersistentOption("ExcludeRegularExpression", args[i].c_str());
this->GetHandler("memcheck")->
SetPersistentOption("ExcludeRegularExpression", args[i].c_str());
- }
+ }
}
//----------------------------------------------------------------------
// handle the -S -SR and -SP arguments
-void cmCTest::HandleScriptArguments(size_t &i,
+void cmCTest::HandleScriptArguments(size_t &i,
std::vector<std::string> &args,
bool &SRArgumentSpecified)
{
std::string arg = args[i];
- if(this->CheckArgument(arg, "-SP", "--script-new-process") &&
+ if(this->CheckArgument(arg, "-SP", "--script-new-process") &&
i < args.size() - 1 )
{
this->RunConfigurationScript = true;
@@ -2203,8 +2203,8 @@ void cmCTest::HandleScriptArguments(size_t &i,
ch->AddConfigurationScript(args[i].c_str(),false);
}
}
-
- if(this->CheckArgument(arg, "-SR", "--script-run") &&
+
+ if(this->CheckArgument(arg, "-SR", "--script-run") &&
i < args.size() - 1 )
{
SRArgumentSpecified = true;
@@ -2214,7 +2214,7 @@ void cmCTest::HandleScriptArguments(size_t &i,
= static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
ch->AddConfigurationScript(args[i].c_str(),true);
}
-
+
if(this->CheckArgument(arg, "-S", "--script") && i < args.size() - 1 )
{
this->RunConfigurationScript = true;
@@ -2396,7 +2396,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
} // the close of the for argument loop
- // now what sould cmake do? if --build-and-test was specified then
+ // now what sould cmake do? if --build-and-test was specified then
// we run the build and test handler and return
if(cmakeAndTest)
{
@@ -2410,7 +2410,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
#endif
if(retv != 0)
{
- cmCTestLog(this, DEBUG, "build and test failing returing: " << retv
+ cmCTestLog(this, DEBUG, "build and test failing returing: " << retv
<< std::endl);
}
return retv;
@@ -2438,14 +2438,14 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
res = this->GetHandler("script")->ProcessHandler();
if(res != 0)
{
- cmCTestLog(this, DEBUG, "running script failing returning: " << res
+ cmCTestLog(this, DEBUG, "running script failing returning: " << res
<< std::endl);
}
}
else
{
- // What is this? -V seems to be the same as -VV,
+ // What is this? -V seems to be the same as -VV,
// and Verbose is always on in this case
this->ExtraVerbose = this->Verbose;
this->Verbose = true;
@@ -2472,7 +2472,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
}
if(res != 0)
{
- cmCTestLog(this, DEBUG, "Running a test(s) failed returning : " << res
+ cmCTestLog(this, DEBUG, "Running a test(s) failed returning : " << res
<< std::endl);
}
return res;
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index beffe9e..f2638fe 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -93,7 +93,7 @@ public:
*/
static int HTTPRequest(std::string url, HTTPMethod method,
std::string& response,
- std::string fields = "",
+ std::string fields = "",
std::string putFile = "", int timeout = 0);
#endif
@@ -198,13 +198,13 @@ public:
//! base64 encode a file
std::string Base64EncodeFile(std::string file);
- /**
+ /**
* Return the time remaining that the script is allowed to run in
* seconds if the user has set the variable CTEST_TIME_LIMIT. If that has
* not been set it returns 1e7 seconds
*/
double GetRemainingTimeAllowed();
-
+
///! Open file in the output directory and set the stream
bool OpenOutputFile(const std::string& path,
const std::string& name,
@@ -529,11 +529,11 @@ private:
bool AddVariableDefinition(const std::string &arg);
//! parse and process most common command line arguments
- void HandleCommandLineArguments(size_t &i,
+ void HandleCommandLineArguments(size_t &i,
std::vector<std::string> &args);
//! hande the -S -SP and -SR arguments
- void HandleScriptArguments(size_t &i,
+ void HandleScriptArguments(size_t &i,
std::vector<std::string> &args,
bool &SRArgumentSpecified);
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 47a0e85..4231243 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -267,7 +267,7 @@ bool cmCacheManager::LoadCache(const char* path,
// If the entry is not internal to the cache being loaded
// or if it is in the list of internal entries to be
// imported, load it.
- if ( internal || (e.Type != INTERNAL) ||
+ if ( internal || (e.Type != INTERNAL) ||
(includes.find(entryKey) != includes.end()) )
{
// If we are loading the cache from another project,
@@ -478,7 +478,7 @@ bool cmCacheManager::SaveCache(const char* path)
= this->GetCacheEntry("CMAKE_COMMAND");
if ( cmakeCacheEntry )
{
- fout << "# It was generated by CMake: " <<
+ fout << "# It was generated by CMake: " <<
cmakeCacheEntry->Value << std::endl;
}
@@ -500,10 +500,10 @@ bool cmCacheManager::SaveCache(const char* path)
fout << "########################\n";
fout << "\n";
- for( std::map<cmStdString, CacheEntry>::const_iterator i =
+ for( std::map<cmStdString, CacheEntry>::const_iterator i =
this->Cache.begin(); i != this->Cache.end(); ++i)
{
- const CacheEntry& ce = (*i).second;
+ const CacheEntry& ce = (*i).second;
CacheEntryType t = ce.Type;
if(!ce.Initialized)
{
@@ -641,7 +641,7 @@ void cmCacheManager::OutputHelpString(std::ostream& fout,
std::string::size_type pos = 0;
for (std::string::size_type i=0; i<=end; i++)
{
- if ((i==end)
+ if ((i==end)
|| (helpString[i]=='\n')
|| ((i-pos >= 60) && (helpString[i]==' ')))
{
@@ -700,12 +700,12 @@ void cmCacheManager::PrintCache(std::ostream& out) const
{
out << "=================================================" << std::endl;
out << "CMakeCache Contents:" << std::endl;
- for(std::map<cmStdString, CacheEntry>::const_iterator i =
+ for(std::map<cmStdString, CacheEntry>::const_iterator i =
this->Cache.begin(); i != this->Cache.end(); ++i)
{
if((*i).second.Type != INTERNAL)
{
- out << (*i).first.c_str() << " = " << (*i).second.Value.c_str()
+ out << (*i).first.c_str() << " = " << (*i).second.Value.c_str()
<< std::endl;
}
}
@@ -768,7 +768,7 @@ bool cmCacheManager::CacheIterator::IsAtEnd() const
void cmCacheManager::CacheIterator::Begin()
{
- this->Position = this->Container.Cache.begin();
+ this->Position = this->Container.Cache.begin();
}
bool cmCacheManager::CacheIterator::Find(const char* key)
@@ -781,7 +781,7 @@ void cmCacheManager::CacheIterator::Next()
{
if (!this->IsAtEnd())
{
- ++this->Position;
+ ++this->Position;
}
}
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 9c94d21..4a5ee45 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -22,7 +22,7 @@ class cmake;
* \brief Control class for cmake's cache
*
* Load and Save CMake cache files.
- *
+ *
*/
class cmCacheManager
{
@@ -30,7 +30,7 @@ public:
cmCacheManager(cmake* cm);
class CacheIterator;
friend class cmCacheManager::CacheIterator;
- enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC,
+ enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC,
UNINITIALIZED };
private:
@@ -57,7 +57,7 @@ public:
bool IsAtEnd() const;
void Next();
const char *GetName() const {
- return this->Position->first.c_str(); }
+ return this->Position->first.c_str(); }
const char* GetProperty(const char*) const ;
bool GetPropertyAsBool(const char*) const ;
bool PropertyExists(const char*) const;
@@ -76,7 +76,7 @@ public:
CacheIterator(cmCacheManager &cm) : Container(cm) {
this->Begin();
}
- CacheIterator(cmCacheManager &cm, const char* key) : Container(cm)
+ CacheIterator(cmCacheManager &cm, const char* key) : Container(cm)
{
if ( key )
{
@@ -87,30 +87,30 @@ public:
CacheEntry const& GetEntry() const { return this->Position->second; }
CacheEntry& GetEntry() { return this->Position->second; }
};
-
+
///! return an iterator to iterate through the cache map
- cmCacheManager::CacheIterator NewIterator()
+ cmCacheManager::CacheIterator NewIterator()
{
return CacheIterator(*this);
- }
-
+ }
+
/**
* Types for the cache entries. These are useful as
* hints for a cache editor program. Path should bring
- * up a file chooser, BOOL a check box, and STRING a
+ * up a file chooser, BOOL a check box, and STRING a
* text entry box, FILEPATH is a full path to a file which
* can be different than just a path input
*/
static CacheEntryType StringToType(const char*);
static const char* TypeToString(CacheEntryType);
static bool IsType(const char*);
-
+
///! Load a cache for given makefile. Loads from ouput home.
- bool LoadCache(cmMakefile*);
+ bool LoadCache(cmMakefile*);
///! Load a cache for given makefile. Loads from path/CMakeCache.txt.
bool LoadCache(const char* path);
bool LoadCache(const char* path, bool internal);
- bool LoadCache(const char* path, bool internal,
+ bool LoadCache(const char* path, bool internal,
std::set<cmStdString>& excludes,
std::set<cmStdString>& includes);
@@ -124,19 +124,19 @@ public:
///! Print the cache to a stream
void PrintCache(std::ostream&) const;
-
+
///! Get the iterator for an entry with a given key.
cmCacheManager::CacheIterator GetCacheIterator(const char *key=0);
-
+
///! Remove an entry from the cache
void RemoveCacheEntry(const char* key);
-
+
///! Get the number of entries in the cache
int GetSize() {
return static_cast<int>(this->Cache.size()); }
-
+
///! Break up a line like VAR:type="value" into var, type and value
- static bool ParseEntry(const char* entry,
+ static bool ParseEntry(const char* entry,
std::string& var,
std::string& value,
CacheEntryType& type);
@@ -154,7 +154,7 @@ public:
protected:
///! Add an entry into the cache
- void AddCacheEntry(const char* key, const char* value,
+ void AddCacheEntry(const char* key, const char* value,
const char* helpString, CacheEntryType type);
///! Get a cache entry object for a key
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 4faaee3..49f451b 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -23,8 +23,8 @@
* cmCommand is the base class for all commands in CMake. A command
* manifests as an entry in CMakeLists.txt and produces one or
* more makefile rules. Commands are associated with a particular
- * makefile. This base class cmCommand defines the API for commands
- * to support such features as enable/disable, inheritance,
+ * makefile. This base class cmCommand defines the API for commands
+ * to support such features as enable/disable, inheritance,
* documentation, and construction.
*/
class cmCommand : public cmObject
@@ -35,18 +35,18 @@ public:
/**
* Construct the command. By default it is enabled with no makefile.
*/
- cmCommand()
+ cmCommand()
{this->Makefile = 0; this->Enabled = true;}
/**
* Need virtual destructor to destroy real command type.
*/
virtual ~cmCommand() {}
-
+
/**
* Specify the makefile.
*/
- void SetMakefile(cmMakefile*m)
+ void SetMakefile(cmMakefile*m)
{this->Makefile = m; }
cmMakefile* GetMakefile() { return this->Makefile; }
@@ -87,12 +87,12 @@ public:
* Does this command have a final pass? Query after InitialPass.
*/
virtual bool HasFinalPass() const { return false; }
-
+
/**
* This is a virtual constructor for the command.
*/
virtual cmCommand* Clone() = 0;
-
+
/**
* This determines if the command is invoked when in script mode.
*/
@@ -139,13 +139,13 @@ public:
/**
* Enable the command.
*/
- void EnabledOn()
+ void EnabledOn()
{this->Enabled = true;}
/**
* Disable the command.
*/
- void EnabledOff()
+ void EnabledOff()
{this->Enabled = false;}
/**
@@ -157,13 +157,13 @@ public:
/**
* Disable or enable the command.
*/
- void SetEnabled(bool enabled)
+ void SetEnabled(bool enabled)
{this->Enabled = enabled;}
/**
* Return the last error string.
*/
- const char* GetError()
+ const char* GetError()
{
if(this->Error.length() == 0)
{
diff --git a/Source/cmCommandArgumentLexer.h b/Source/cmCommandArgumentLexer.h
index 828122b..2ea3fa2 100644
--- a/Source/cmCommandArgumentLexer.h
+++ b/Source/cmCommandArgumentLexer.h
@@ -45,7 +45,7 @@
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@@ -62,7 +62,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
@@ -192,7 +192,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
diff --git a/Source/cmCommandArgumentLexer.in.l b/Source/cmCommandArgumentLexer.in.l
index d10e50d..fdca61b 100644
--- a/Source/cmCommandArgumentLexer.in.l
+++ b/Source/cmCommandArgumentLexer.in.l
@@ -66,43 +66,43 @@ Modify cmCommandArgumentLexer.h:
return cal_ENVCURLY;
}
-\$[A-Za-z0-9/_.+-]+\{ {
+\$[A-Za-z0-9/_.+-]+\{ {
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
- return cal_NCURLY;
-}
+ yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
+ return cal_NCURLY;
+}
-@[A-Za-z0-9/_.+-]+@ {
+@[A-Za-z0-9/_.+-]+@ {
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
- return cal_ATNAME;
-}
+ yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
+ return cal_ATNAME;
+}
"${" {
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->DCURLYVariable;
return cal_DCURLY;
}
"}" {
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->RCURLYVariable;
return cal_RCURLY;
}
"@" {
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->ATVariable;
return cal_AT;
}
-[A-Za-z0-9/_.+-]+ {
+[A-Za-z0-9/_.+-]+ {
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
- return cal_NAME;
+ yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ return cal_NAME;
}
<ESCAPES>\\. {
@@ -110,31 +110,31 @@ Modify cmCommandArgumentLexer.h:
{
return cal_ERROR;
}
- return cal_SYMBOL;
+ return cal_SYMBOL;
}
-[^\${}\\@]+ {
+[^\${}\\@]+ {
//std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
- yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
- return cal_SYMBOL;
+ yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ return cal_SYMBOL;
}
"$" {
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->DOLLARVariable;
- return cal_DOLLAR;
+ return cal_DOLLAR;
}
"{" {
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->LCURLYVariable;
- return cal_LCURLY;
+ return cal_LCURLY;
}
<ESCAPES>"\\" {
- //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
yylvalp->str = yyextra->BSLASHVariable;
- return cal_BSLASH;
+ return cal_BSLASH;
}
<NOESCAPES>"\\" {
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index a781767..2f26b0c 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -61,7 +61,7 @@ char* cmCommandArgumentParserHelper::AddString(const char* str)
return stVal;
}
-char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
+char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
const char* var)
{
if ( !key )
@@ -163,7 +163,7 @@ char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
// try to expand the variable
char* ret = this->ExpandVariable(var);
// if the return was 0 and we want to replace empty strings
- // then return an empty string
+ // then return an empty string
if(!ret && this->RemoveEmpty)
{
return this->AddString(ret);
@@ -175,7 +175,7 @@ char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
}
}
// at this point we want to put it back because of one of these cases:
- // - this->ReplaceAtSyntax is false
+ // - this->ReplaceAtSyntax is false
// - this->ReplaceAtSyntax is true, but this->RemoveEmpty is false,
// and the variable was not defined
std::string ref = "@";
@@ -274,7 +274,7 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb)
this->InputBuffer = str;
this->InputBufferPos = 0;
this->CurrentLine = 0;
-
+
this->Result = "";
yyscan_t yyscanner;
@@ -292,7 +292,7 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb)
if ( Verbose )
{
- std::cerr << "Expanding [" << str << "] produced: ["
+ std::cerr << "Expanding [" << str << "] produced: ["
<< this->Result.c_str() << "]" << std::endl;
}
return 1;
diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h
index cdb832b..f8c672f 100644
--- a/Source/cmCommandArgumentParserHelper.h
+++ b/Source/cmCommandArgumentParserHelper.h
@@ -66,8 +66,8 @@ public:
void SetNoEscapeMode(bool b) { this->NoEscapeMode = b; }
void SetReplaceAtSyntax(bool b) { this->ReplaceAtSyntax = b; }
void SetRemoveEmpty(bool b) { this->RemoveEmpty = b; }
-
- const char* GetError() { return this->ErrorString.c_str(); }
+
+ const char* GetError() { return this->ErrorString.c_str(); }
char EmptyVariable[1];
char DCURLYVariable[3];
char RCURLYVariable[3];
@@ -102,7 +102,7 @@ private:
std::string ErrorString;
bool NoEscapeMode;
bool ReplaceAtSyntax;
- bool RemoveEmpty;
+ bool RemoveEmpty;
};
#endif
diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx
index d920137..1d5fc07 100644
--- a/Source/cmCommandArgumentsHelper.cxx
+++ b/Source/cmCommandArgumentsHelper.cxx
@@ -12,20 +12,20 @@
#include "cmCommandArgumentsHelper.h"
-cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args,
- const char* key,
+cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args,
+ const char* key,
cmCommandArgumentGroup* group)
:Key(key)
,Group(group)
,WasActive(false)
,ArgumentsBeforeEmpty(true)
-,CurrentIndex(0)
+,CurrentIndex(0)
{
if (args!=0)
{
args->AddArgument(this);
}
-
+
if (this->Group!=0)
{
this->Group->ContainedArguments.push_back(this);
@@ -50,7 +50,7 @@ void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group)
if (group!=0)
{
this->ArgumentsBeforeEmpty = false;
- for(std::vector<cmCommandArgument*>::const_iterator
+ for(std::vector<cmCommandArgument*>::const_iterator
argIt= group->ContainedArguments.begin();
argIt != group->ContainedArguments.end();
++argIt)
@@ -67,7 +67,7 @@ bool cmCommandArgument::MayFollow(const cmCommandArgument* current) const
return true;
}
- std::set<const cmCommandArgument*>::const_iterator argIt
+ std::set<const cmCommandArgument*>::const_iterator argIt
= this->ArgumentsBefore.find(current);
if (argIt != this->ArgumentsBefore.end())
{
@@ -90,7 +90,7 @@ void cmCommandArgument::ApplyOwnGroup()
{
if (this->Group!=0)
{
- for (std::vector<cmCommandArgument*>::const_iterator
+ for (std::vector<cmCommandArgument*>::const_iterator
it = this->Group->ContainedArguments.begin();
it != this->Group->ContainedArguments.end();
++it)
@@ -105,7 +105,7 @@ void cmCommandArgument::ApplyOwnGroup()
void cmCommandArgument::Activate()
{
- this->WasActive = true;
+ this->WasActive = true;
this->CurrentIndex = 0;
}
@@ -117,8 +117,8 @@ bool cmCommandArgument::Consume(const std::string& arg)
}
-cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args,
- const char* key,
+cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args,
+ const char* key,
cmCommandArgumentGroup* group)
:cmCommandArgument(args, key, group)
,Ignore(0)
@@ -151,8 +151,8 @@ void cmCAStringVector::DoReset()
this->Vector.clear();
}
-cmCAString::cmCAString(cmCommandArgumentsHelper* args,
- const char* key,
+cmCAString::cmCAString(cmCommandArgumentsHelper* args,
+ const char* key,
cmCommandArgumentGroup* group)
:cmCommandArgument(args, key, group)
{
@@ -181,11 +181,11 @@ void cmCAString::DoReset()
this->String = "";
}
-cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args,
- const char* key,
+cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args,
+ const char* key,
cmCommandArgumentGroup* group)
:cmCommandArgument(args, key, group)
-,Enabled(false)
+,Enabled(false)
{}
bool cmCAEnabler::DoConsume(const std::string&, unsigned int index)
@@ -202,11 +202,11 @@ void cmCAEnabler::DoReset()
this->Enabled = false;
}
-cmCADisabler::cmCADisabler(cmCommandArgumentsHelper* args,
- const char* key,
+cmCADisabler::cmCADisabler(cmCommandArgumentsHelper* args,
+ const char* key,
cmCommandArgumentGroup* group)
:cmCommandArgument(args, key, group)
-,Enabled(true)
+,Enabled(true)
{}
bool cmCADisabler::DoConsume(const std::string&, unsigned int index)
@@ -225,7 +225,7 @@ void cmCADisabler::DoReset()
void cmCommandArgumentGroup::Follows(const cmCommandArgument* arg)
{
- for(std::vector<cmCommandArgument*>::iterator
+ for(std::vector<cmCommandArgument*>::iterator
it = this->ContainedArguments.begin();
it != this->ContainedArguments.end();
++it)
@@ -236,7 +236,7 @@ void cmCommandArgumentGroup::Follows(const cmCommandArgument* arg)
void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group)
{
- for(std::vector<cmCommandArgument*>::iterator
+ for(std::vector<cmCommandArgument*>::iterator
it = this->ContainedArguments.begin();
it != this->ContainedArguments.end();
++it)
@@ -245,7 +245,7 @@ void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group)
}
}
-void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
+void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
std::vector<std::string>* unconsumedArgs)
{
if(args==0)
@@ -253,7 +253,7 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
return;
}
- for(std::vector<cmCommandArgument*>::iterator
+ for(std::vector<cmCommandArgument*>::iterator
argIt = this->Arguments.begin();
argIt != this->Arguments.end();
++argIt)
@@ -268,7 +268,7 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
it != args->end();
++it)
{
- for(std::vector<cmCommandArgument*>::iterator
+ for(std::vector<cmCommandArgument*>::iterator
argIt = this->Arguments.begin();
argIt != this->Arguments.end();
++argIt)
diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h
index 3b0b058..f732f8f 100644
--- a/Source/cmCommandArgumentsHelper.h
+++ b/Source/cmCommandArgumentsHelper.h
@@ -18,7 +18,7 @@ class cmCommandArgumentsHelper;
class cmCommandArgumentGroup;
/* cmCommandArgumentsHelper, cmCommandArgumentGroup and cmCommandArgument (i.e.
-its derived classes cmCAXXX can be used to simplify the processing of
+its derived classes cmCAXXX can be used to simplify the processing of
arguments to cmake commands. Maybe they can also be used to generate
documentation.
@@ -26,11 +26,11 @@ For every argument supported by a command one cmCommandArgument is created
and added to cmCommandArgumentsHelper. cmCommand has a cmCommandArgumentsHelper
as member variable so this should be used.
-The order of the arguments is defined using the Follows(arg) method. It says
+The order of the arguments is defined using the Follows(arg) method. It says
that this argument follows immediateley the given argument. It can be used
with multiple arguments if the argument can follow after different arguments.
-Arguments can be arranged in groups using cmCommandArgumentGroup. Every
+Arguments can be arranged in groups using cmCommandArgumentGroup. Every
member of a group can follow any other member of the group. These groups
can also be used to define the order.
@@ -42,8 +42,8 @@ For an example see cmExportCommand.cxx.
class cmCommandArgument
{
public:
- cmCommandArgument(cmCommandArgumentsHelper* args,
- const char* key,
+ cmCommandArgument(cmCommandArgumentsHelper* args,
+ const char* key,
cmCommandArgumentGroup* group=0);
virtual ~cmCommandArgument() {}
@@ -56,8 +56,8 @@ class cmCommandArgument
/// Returns true if the argument was found in the argument list
bool WasFound() const {return this->WasActive;}
- // The following methods are only called from
- // cmCommandArgumentsHelper::Parse(), but making this a friend would
+ // The following methods are only called from
+ // cmCommandArgumentsHelper::Parse(), but making this a friend would
// give it access to everything
/// Make the current argument the currently active argument
@@ -89,19 +89,19 @@ class cmCommandArgument
virtual void DoReset() = 0;
};
-/** cmCAStringVector is to be used for arguments which can consist of more
+/** cmCAStringVector is to be used for arguments which can consist of more
than one string, e.g. the FILES argument in INSTALL(FILES f1 f2 f3 ...). */
class cmCAStringVector : public cmCommandArgument
{
public:
- cmCAStringVector(cmCommandArgumentsHelper* args,
- const char* key,
+ cmCAStringVector(cmCommandArgumentsHelper* args,
+ const char* key,
cmCommandArgumentGroup* group=0);
/// Return the vector of strings
const std::vector<std::string>& GetVector() const {return this->Vector;}
- /** Is there a keyword which should be skipped in
+ /** Is there a keyword which should be skipped in
the arguments (e.g. ARGS for ADD_CUSTOM_COMMAND) ? */
void SetIgnore(const char* ignore) {this->Ignore=ignore;}
private:
@@ -118,8 +118,8 @@ e.g. the executable name in ADD_EXECUTABLE(). */
class cmCAString : public cmCommandArgument
{
public:
- cmCAString(cmCommandArgumentsHelper* args,
- const char* key,
+ cmCAString(cmCommandArgumentsHelper* args,
+ const char* key,
cmCommandArgumentGroup* group=0);
/// Return the string
@@ -138,8 +138,8 @@ enabled using a special argument, e.g. EXCLUDE_FROM_ALL in ADD_EXECUTABLE(). */
class cmCAEnabler : public cmCommandArgument
{
public:
- cmCAEnabler(cmCommandArgumentsHelper* args,
- const char* key,
+ cmCAEnabler(cmCommandArgumentsHelper* args,
+ const char* key,
cmCommandArgumentGroup* group=0);
/// Has it been enabled ?
@@ -156,8 +156,8 @@ disabled using a special argument.*/
class cmCADisabler : public cmCommandArgument
{
public:
- cmCADisabler(cmCommandArgumentsHelper* args,
- const char* key,
+ cmCADisabler(cmCommandArgumentsHelper* args,
+ const char* key,
cmCommandArgumentGroup* group=0);
/// Is it still enabled ?
@@ -170,7 +170,7 @@ class cmCADisabler : public cmCommandArgument
};
-/** Group of arguments, needed for ordering. E.g. WIN32, EXCLUDE_FROM_ALL and
+/** Group of arguments, needed for ordering. E.g. WIN32, EXCLUDE_FROM_ALL and
MACSOX_BUNDLE from ADD_EXECUTABLE() are a group.
*/
class cmCommandArgumentGroup
@@ -192,7 +192,7 @@ class cmCommandArgumentsHelper
{
public:
/// Parse the argument list
- void Parse(const std::vector<std::string>* args,
+ void Parse(const std::vector<std::string>* args,
std::vector<std::string>* unconsumedArgs);
/// Add an argument.
void AddArgument(cmCommandArgument* arg);
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index df78bf8..cd3ef59 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1214,7 +1214,7 @@ void cmComputeLinkInformation::AddUserItem(std::string const& item,
{
// if this is a -l option then we might need to warn about
// CMP0003 so put it in OldUserFlagItems, if it is not a -l
- // or -Wl,-l (-framework -pthread), then allow it without a
+ // or -Wl,-l (-framework -pthread), then allow it without a
// CMP0003 as -L will not affect those other linker flags
if(item.find("-l") == 0 || item.find("-Wl,-l") == 0)
{
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx
index ea98326..e52ddef 100644
--- a/Source/cmConfigureFileCommand.cxx
+++ b/Source/cmConfigureFileCommand.cxx
@@ -104,7 +104,7 @@ bool cmConfigureFileCommand
this->Immediate = true;
}
}
-
+
// If we were told to copy the file immediately, then do it on the
// first pass (now).
if(this->Immediate)
@@ -115,7 +115,7 @@ bool cmConfigureFileCommand
return false;
}
}
-
+
return true;
}
diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h
index de497a9..347174a 100644
--- a/Source/cmConfigureFileCommand.h
+++ b/Source/cmConfigureFileCommand.h
@@ -19,7 +19,7 @@ class cmConfigureFileCommand : public cmCommand
public:
cmTypeMacro(cmConfigureFileCommand, cmCommand);
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmConfigureFileCommand;
}
@@ -48,7 +48,7 @@ public:
{
return "Copy a file to another location and modify its contents.";
}
-
+
/**
* Longer documentation.
*/
@@ -93,7 +93,7 @@ public:
private:
int ConfigureFile();
-
+
cmNewLineStyle NewLineStyle;
std::string InputFile;
diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h
index 806e5a9..3aa0a79 100644
--- a/Source/cmCreateTestSourceList.h
+++ b/Source/cmCreateTestSourceList.h
@@ -15,7 +15,7 @@
#include "cmCommand.h"
/** \class cmCreateTestSourceList
- * \brief
+ * \brief
*
*/
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmCreateTestSourceList;
}
@@ -41,7 +41,7 @@ public:
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() const {return "create_test_sourcelist";}
-
+
/**
* Succinct documentation.
*/
@@ -49,7 +49,7 @@ public:
{
return "Create a test driver and source list for building test programs.";
}
-
+
/**
* More documentation.
*/
@@ -81,7 +81,7 @@ public:
"CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be "
"placed directly after the call to the test main function.";
}
-
+
cmTypeMacro(cmCreateTestSourceList, cmCommand);
};
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index a650129..07df7d5 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -21,7 +21,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(
cmCustomCommand const& cc, const char* config, cmMakefile* mf):
CC(cc), Config(config), Makefile(mf), LG(mf->GetLocalGenerator()),
OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()),
- GE(new cmGeneratorExpression(mf, config, cc.GetBacktrace()))
+ GE(new cmGeneratorExpression(cc.GetBacktrace()))
{
}
@@ -47,7 +47,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
{
return target->GetLocation(this->Config);
}
- return this->GE->Process(argv0);
+ return this->GE->Parse(argv0).Evaluate(this->Makefile, this->Config);
}
//----------------------------------------------------------------------------
@@ -58,7 +58,8 @@ cmCustomCommandGenerator
cmCustomCommandLine const& commandLine = this->CC.GetCommandLines()[c];
for(unsigned int j=1;j < commandLine.size(); ++j)
{
- std::string arg = this->GE->Process(commandLine[j]);
+ std::string arg = this->GE->Parse(commandLine[j]).Evaluate(this->Makefile,
+ this->Config);
cmd += " ";
if(this->OldStyle)
{
diff --git a/Source/cmDefinePropertyCommand.h b/Source/cmDefinePropertyCommand.h
index 55ef521..b5175d5 100644
--- a/Source/cmDefinePropertyCommand.h
+++ b/Source/cmDefinePropertyCommand.h
@@ -17,7 +17,7 @@
class cmDefinePropertyCommand : public cmCommand
{
public:
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmDefinePropertyCommand;
}
@@ -41,7 +41,7 @@ public:
{
return "Define and document custom properties.";
}
-
+
/**
* Longer documentation.
*/
@@ -80,7 +80,7 @@ public:
"Corresponding options to the get_property command will retrieve the "
"documentation.";
}
-
+
cmTypeMacro(cmDefinePropertyCommand, cmCommand);
private:
std::string PropertyName;
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 9296d4c..166a584 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -98,7 +98,7 @@ bool cmDepends::Check(const char *makeFile, const char *internalFile,
// Check whether dependencies must be regenerated.
bool okay = true;
std::ifstream fin(internalFile);
- if(!(fin && this->CheckDependencies(fin, validDeps)))
+ if(!(fin && this->CheckDependencies(fin, internalFile, validDeps)))
{
// Clear all dependencies so they will be regenerated.
this->Clear(makeFile);
@@ -143,6 +143,7 @@ bool cmDepends::WriteDependencies(const char*, const char*,
//----------------------------------------------------------------------------
bool cmDepends::CheckDependencies(std::istream& internalDepends,
+ const char* internalDependsFileName,
std::map<std::string, DependencyVector>& validDeps)
{
// Parse dependencies from the stream. If any dependee is missing
@@ -154,7 +155,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
while(internalDepends.getline(this->Dependee, this->MaxPath))
{
- if ( this->Dependee[0] == 0 || this->Dependee[0] == '#' ||
+ if ( this->Dependee[0] == 0 || this->Dependee[0] == '#' ||
this->Dependee[0] == '\r' )
{
continue;
@@ -186,8 +187,11 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
}
*/
- // Dependencies must be regenerated if the dependee does not exist
- // or if the depender exists and is older than the dependee.
+ // Dependencies must be regenerated
+ // * if the dependee does not exist
+ // * if the depender exists and is older than the dependee.
+ // * if the depender does not exist, but the dependee is newer than the
+ // depends file
bool regenerate = false;
const char* dependee = this->Dependee+1;
const char* depender = this->Depender;
@@ -211,24 +215,49 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
cmSystemTools::Stdout(msg.str().c_str());
}
}
- else if(dependerExists)
+ else
{
- // The dependee and depender both exist. Compare file times.
- int result = 0;
- if((!this->FileComparison->FileTimeCompare(depender, dependee,
- &result) || result < 0))
+ if(dependerExists)
{
- // The depender is older than the dependee.
- regenerate = true;
+ // The dependee and depender both exist. Compare file times.
+ int result = 0;
+ if((!this->FileComparison->FileTimeCompare(depender, dependee,
+ &result) || result < 0))
+ {
+ // The depender is older than the dependee.
+ regenerate = true;
- // Print verbose output.
- if(this->Verbose)
+ // Print verbose output.
+ if(this->Verbose)
+ {
+ cmOStringStream msg;
+ msg << "Dependee \"" << dependee
+ << "\" is newer than depender \""
+ << depender << "\"." << std::endl;
+ cmSystemTools::Stdout(msg.str().c_str());
+ }
+ }
+ }
+ else
+ {
+ // The dependee exists, but the depender doesn't. Regenerate if the
+ // internalDepends file is older than the dependee.
+ int result = 0;
+ if((!this->FileComparison->FileTimeCompare(internalDependsFileName,
+ dependee, &result) || result < 0))
{
- cmOStringStream msg;
- msg << "Dependee \"" << dependee
- << "\" is newer than depender \""
- << depender << "\"." << std::endl;
- cmSystemTools::Stdout(msg.str().c_str());
+ // The depends-file is older than the dependee.
+ regenerate = true;
+
+ // Print verbose output.
+ if(this->Verbose)
+ {
+ cmOStringStream msg;
+ msg << "Dependee \"" << dependee
+ << "\" is newer than depends file \""
+ << internalDependsFileName << "\"." << std::endl;
+ cmSystemTools::Stdout(msg.str().c_str());
+ }
}
}
}
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index 087da64..f7dc881 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -30,7 +30,7 @@ public:
/** Instances need to know the build directory name and the relative
path from the build directory to the target file. */
cmDepends(cmLocalGenerator* lg=0, const char* targetDir="");
-
+
/** at what level will the compile be done from */
void SetCompileDirectory(const char *dir) {this->CompileDirectory = dir;};
@@ -48,7 +48,7 @@ public:
/** should this be verbose in its output */
void SetVerbose(bool verb) { this->Verbose = verb; }
-
+
/** Virtual destructor to cleanup subclasses properly. */
virtual ~cmDepends();
@@ -69,7 +69,7 @@ public:
void Clear(const char *file);
/** Set the file comparison object */
- void SetFileComparison(cmFileTimeComparison* fc) {
+ void SetFileComparison(cmFileTimeComparison* fc) {
this->FileComparison = fc; }
protected:
@@ -83,6 +83,7 @@ protected:
// Return false if dependencies must be regenerated and true
// otherwise.
virtual bool CheckDependencies(std::istream& internalDepends,
+ const char* internalDependsFileName,
std::map<std::string, DependencyVector>& validDeps);
// Finalize the dependency information for the target.
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index c1b6090..3e66058 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -889,7 +889,7 @@ bool cmDependsFortran::FindIncludeFile(const char* dir,
}
// Search the include path for the file.
- for(std::vector<std::string>::const_iterator i =
+ for(std::vector<std::string>::const_iterator i =
this->IncludePath.begin(); i != this->IncludePath.end(); ++i)
{
fullName = *i;
diff --git a/Source/cmDependsJava.cxx b/Source/cmDependsJava.cxx
index 1d84914..ba0e8fb 100644
--- a/Source/cmDependsJava.cxx
+++ b/Source/cmDependsJava.cxx
@@ -38,7 +38,7 @@ bool cmDependsJava::WriteDependencies(const char *src, const char *,
return true;
}
-bool cmDependsJava::CheckDependencies(std::istream&,
+bool cmDependsJava::CheckDependencies(std::istream&, const char*,
std::map<std::string, DependencyVector >&)
{
return true;
diff --git a/Source/cmDependsJava.h b/Source/cmDependsJava.h
index fe6fef5..bf7e234 100644
--- a/Source/cmDependsJava.h
+++ b/Source/cmDependsJava.h
@@ -32,7 +32,8 @@ protected:
virtual bool WriteDependencies(const char *src, const char *file,
std::ostream& makeDepends, std::ostream& internalDepends);
virtual bool CheckDependencies(std::istream& internalDepends,
- std::map<std::string, DependencyVector >& validDeps);
+ const char* internalDependsFileName,
+ std::map<std::string, DependencyVector>& validDeps);
private:
cmDependsJava(cmDependsJava const&); // Purposely not implemented.
diff --git a/Source/cmDependsJavaLexer.h b/Source/cmDependsJavaLexer.h
index 09c19bf..61aa66d 100644
--- a/Source/cmDependsJavaLexer.h
+++ b/Source/cmDependsJavaLexer.h
@@ -58,7 +58,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@@ -188,7 +188,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
diff --git a/Source/cmDependsJavaLexer.in.l b/Source/cmDependsJavaLexer.in.l
index aae7ec6..9796ad5 100644
--- a/Source/cmDependsJavaLexer.in.l
+++ b/Source/cmDependsJavaLexer.in.l
@@ -171,18 +171,18 @@ null { PRIMITIVE; return jp_NULLLITERAL; }
"\*" { SYMBOL; return jp_TIMES; }
"\*=" { SYMBOL; return jp_TIMESEQUALS; }
-[a-z_A-Z][a-z_0-9A-Z]* {
- yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
- return jp_NAME;
+[a-z_A-Z][a-z_0-9A-Z]* {
+ yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+ return jp_NAME;
}
\/\/.*\n { }
[ \f\t\n\r] { }
-. {
- std::cerr << "Unknown character: " << yytext[0]
- << " (" << (int)yytext[0] << ")" << std::endl;
- yyextra->Error("Unknown character");
- return jp_ERROR;
+. {
+ std::cerr << "Unknown character: " << yytext[0]
+ << " (" << (int)yytext[0] << ")" << std::endl;
+ yyextra->Error("Unknown character");
+ return jp_ERROR;
}
%%
diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx
index 7b595cc..6136baa 100644
--- a/Source/cmDependsJavaParserHelper.cxx
+++ b/Source/cmDependsJavaParserHelper.cxx
@@ -35,7 +35,7 @@ cmDependsJavaParserHelper::~cmDependsJavaParserHelper()
}
void cmDependsJavaParserHelper::CurrentClass
-::AddFileNamesForPrinting(std::vector<cmStdString> *files,
+::AddFileNamesForPrinting(std::vector<cmStdString> *files,
const char* prefix, const char* sep)
{
cmStdString rname = "";
@@ -103,7 +103,7 @@ void cmDependsJavaParserHelper::AddPackagesImport(const char* sclass)
this->PackagesImport.push_back(sclass);
}
-void cmDependsJavaParserHelper::SafePrintMissing(const char* str,
+void cmDependsJavaParserHelper::SafePrintMissing(const char* str,
int line, int cnt)
{
if ( str )
@@ -134,7 +134,7 @@ void cmDependsJavaParserHelper::Print(const char* place, const char* str)
}
}
-void cmDependsJavaParserHelper::CombineUnions(char** out,
+void cmDependsJavaParserHelper::CombineUnions(char** out,
const char* in1, char** in2,
const char* sep)
{
@@ -193,7 +193,7 @@ void cmDependsJavaParserHelper
}
void cmDependsJavaParserHelper
-::AllocateParserType(cmDependsJavaParserHelper::ParserType* pt,
+::AllocateParserType(cmDependsJavaParserHelper::ParserType* pt,
const char* str, int len)
{
pt->str = 0;
@@ -270,7 +270,7 @@ std::vector<cmStdString> cmDependsJavaParserHelper::GetFilesProduced()
std::vector<cmStdString> files;
CurrentClass* toplevel = &(*(this->ClassStack.begin()));
std::vector<CurrentClass>::iterator it;
- for ( it = toplevel->NestedClasses->begin();
+ for ( it = toplevel->NestedClasses->begin();
it != toplevel->NestedClasses->end();
++ it )
{
@@ -289,7 +289,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
this->InputBuffer = str;
this->InputBufferPos = 0;
this->CurrentLine = 0;
-
+
yyscan_t yyscanner;
cmDependsJava_yylex_init(&yyscanner);
@@ -306,7 +306,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
{
if ( this->CurrentPackage.size() > 0 )
{
- std::cout << "Current package is: " <<
+ std::cout << "Current package is: " <<
this->CurrentPackage.c_str() << std::endl;
}
std::cout << "Imports packages:";
@@ -337,7 +337,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
this->PrintClasses();
if ( this->UnionsAvailable != 0 )
{
- std::cout << "There are still " <<
+ std::cout << "There are still " <<
this->UnionsAvailable << " unions available" << std::endl;
}
}
@@ -348,13 +348,13 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
void cmDependsJavaParserHelper::CleanupParser()
{
std::vector<char*>::iterator it;
- for ( it = this->Allocates.begin();
+ for ( it = this->Allocates.begin();
it != this->Allocates.end();
++ it )
{
delete [] *it;
}
- this->Allocates.erase(this->Allocates.begin(),
+ this->Allocates.erase(this->Allocates.begin(),
this->Allocates.end());
}
@@ -382,11 +382,11 @@ int cmDependsJavaParserHelper::LexInput(char* buf, int maxlen)
void cmDependsJavaParserHelper::Error(const char* str)
{
unsigned long pos = static_cast<unsigned long>(this->InputBufferPos);
- fprintf(stderr, "JPError: %s (%lu / Line: %d)\n",
+ fprintf(stderr, "JPError: %s (%lu / Line: %d)\n",
str, pos, this->CurrentLine);
int cc;
std::cerr << "String: [";
- for ( cc = 0;
+ for ( cc = 0;
cc < 30 && *(this->InputBuffer.c_str() + this->InputBufferPos + cc);
cc ++ )
{
@@ -395,7 +395,7 @@ void cmDependsJavaParserHelper::Error(const char* str)
std::cerr << "]" << std::endl;
}
-void cmDependsJavaParserHelper::UpdateCombine(const char* str1,
+void cmDependsJavaParserHelper::UpdateCombine(const char* str1,
const char* str2)
{
if ( this->CurrentCombine == "" && str1 != 0)
diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h
index baecab3..9807a04 100644
--- a/Source/cmDependsJavaParserHelper.h
+++ b/Source/cmDependsJavaParserHelper.h
@@ -9,7 +9,7 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
-#ifndef cmDependsJavaParserHelper_h
+#ifndef cmDependsJavaParserHelper_h
#define cmDependsJavaParserHelper_h
#include "cmStandardIncludes.h"
@@ -39,7 +39,7 @@ public:
int ParseFile(const char* file);
// For the lexer:
- void AllocateParserType(cmDependsJavaParserHelper::ParserType* pt,
+ void AllocateParserType(cmDependsJavaParserHelper::ParserType* pt,
const char* str, int len = 0);
int LexInput(char* buf, int maxlen);
@@ -69,7 +69,7 @@ private:
public:
cmStdString Name;
std::vector<CurrentClass>* NestedClasses;
- CurrentClass()
+ CurrentClass()
{
this->NestedClasses = new std::vector<CurrentClass>;
}
@@ -77,7 +77,7 @@ private:
{
delete this->NestedClasses;
}
- CurrentClass& operator=(CurrentClass const& c)
+ CurrentClass& operator=(CurrentClass const& c)
{
this->NestedClasses->clear();
this->Name = c.Name;
@@ -93,7 +93,7 @@ private:
{
(*this) = c;
}
- void AddFileNamesForPrinting(std::vector<cmStdString> *files,
+ void AddFileNamesForPrinting(std::vector<cmStdString> *files,
const char* prefix, const char* sep);
};
cmStdString CurrentPackage;
@@ -117,7 +117,7 @@ private:
void PrintClasses();
void Print(const char* place, const char* str);
- void CombineUnions(char** out, const char* in1, char** in2,
+ void CombineUnions(char** out, const char* in1, char** in2,
const char* sep);
void SafePrintMissing(const char* str, int line, int cnt);
diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
index 5359013..445fd0e 100644
--- a/Source/cmDocumentGeneratorExpressions.h
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -12,11 +12,20 @@
#ifndef cmDocumentGeneratorExpressions_h
#define cmDocumentGeneratorExpressions_h
-#define CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS \
+#define CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS \
"Generator expressions are evaluted during build system generation " \
"to produce information specific to each build configuration. " \
"Valid expressions are:\n" \
+ " $<0:...> = empty string (ignores \"...\")\n" \
+ " $<1:...> = content of \"...\"\n" \
+ " $<CONFIG:cfg> = '1' if config is \"cfg\", else '0'\n" \
" $<CONFIGURATION> = configuration name\n" \
+ " $<BOOL:...> = '1' if the '...' is true, else '0'\n" \
+ " $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'\n" \
+ " $<ANGLE-R> = A literal '>'. Used to compare " \
+ "strings which contain a '>' for example.\n" \
+ " $<COMMA> = A literal ','. Used to compare " \
+ "strings which contain a ',' for example.\n" \
" $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n" \
" $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n" \
" $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)\n" \
@@ -25,6 +34,23 @@
"versions can produce the directory and file name components:\n" \
" $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>\n" \
" $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>\n" \
- " $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>\n"
+ " $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>\n" \
+ "\n" \
+ " $<TARGET_PROPERTY:tgt,prop> = The value of the property prop\n" \
+ "on the target tgt. Note that tgt is not added as a dependency of\n" \
+ "the target this expression is evaluated on.\n" \
+ "Boolean expressions:\n" \
+ " $<AND:?[,?]...> = '1' if all '?' are '1', else '0'\n" \
+ " $<OR:?[,?]...> = '0' if all '?' are '0', else '1'\n" \
+ " $<NOT:?> = '0' if '?' is '1', else '1'\n" \
+ "where '?' is always either '0' or '1'.\n" \
+ ""
+
+#define CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS \
+ CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS \
+ "Expressions with an implicit 'this' target:\n" \
+ " $<TARGET_PROPERTY:prop> = The value of the property prop on\n" \
+ "the target on which the generator expression is evaluated.\n" \
+ ""
#endif
diff --git a/Source/cmDocumentLocationUndefined.h b/Source/cmDocumentLocationUndefined.h
index d1be77a..9aecf21 100644
--- a/Source/cmDocumentLocationUndefined.h
+++ b/Source/cmDocumentLocationUndefined.h
@@ -16,8 +16,8 @@
"\n" \
"Do not set properties that affect the location of a target after " \
action ". These include properties whose names match " \
- "\"(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?\" " \
- "or \"(IMPLIB_)?(PREFIX|SUFFIX)\". " \
+ "\"(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?\", " \
+ "\"(IMPLIB_)?(PREFIX|SUFFIX)\", or \"LINKER_LANGUAGE\". " \
"Failure to follow this rule is not diagnosed and leaves the location " \
"of the target undefined."
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 77aaffc..8db0e8f 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1,6 +1,8 @@
#include "cmDocumentVariables.h"
#include "cmake.h"
+#include <cmsys/ios/sstream>
+
void cmDocumentVariables::DefineVariables(cmake* cm)
{
// Subsection: variables defined by cmake, that give
@@ -283,6 +285,16 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"see CMAKE_BUILD_TOOL.",false,
"Variables that Provide Information");
cm->DefineProperty
+ ("CMAKE_VS_PLATFORM_TOOLSET", cmProperty::VARIABLE,
+ "Visual Studio Platform Toolset name.",
+ "VS 10 and above use MSBuild under the hood and support multiple "
+ "compiler toolchains. "
+ "CMake may specify a toolset explicitly, such as \"v110\" for "
+ "VS 11 or \"Windows7.1SDK\" for 64-bit support in VS 10 Express. "
+ "CMake provides the name of the chosen toolset in this variable."
+ ,false,
+ "Variables that Provide Information");
+ cm->DefineProperty
("CMAKE_MINOR_VERSION", cmProperty::VARIABLE,
"The Minor version of cmake (i.e. the 4 in X.4.X).",
"This specifies the minor version of the CMake"
@@ -373,12 +385,6 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"into all executables and libraries.",false,
"Variables that Provide Information");
cm->DefineProperty
- ("CMAKE_USING_VC_FREE_TOOLS", cmProperty::VARIABLE,
- "True if free visual studio tools being used.",
- "This is set to true if the compiler is Visual "
- "Studio free tools.",false,
- "Variables that Provide Information");
- cm->DefineProperty
("CMAKE_VERBOSE_MAKEFILE", cmProperty::VARIABLE,
"Create verbose makefiles if on.",
"This variable defaults to false. You can set "
@@ -595,7 +601,21 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"If \"make install\" is invoked or INSTALL is built"
", this directory is pre-pended onto all install "
"directories. This variable defaults to /usr/local"
- " on UNIX and c:/Program Files on Windows.",false,
+ " on UNIX and c:/Program Files on Windows.\n"
+ "On UNIX one can use the DESTDIR mechanism in order"
+ " to relocate the whole installation. "
+ "DESTDIR means DESTination DIRectory. It is "
+ "commonly used by makefile users "
+ "in order to install software at non-default location. "
+ "It is usually invoked like this:\n"
+ " make DESTDIR=/home/john install\n"
+ "which will install the concerned software using the"
+ " installation prefix, e.g. \"/usr/local\" pre-pended with "
+ "the DESTDIR value which finally gives \"/home/john/usr/local\".\n"
+ "WARNING: DESTDIR may not be used on Windows because installation"
+ " prefix usually contains a drive letter like in \"C:/Program Files\""
+ " which cannot be pre-pended with some other prefix."
+ ,false,
"Variables That Change Behavior");
cm->DefineProperty
@@ -681,7 +701,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_SYSTEM_IGNORE_PATH", cmProperty::VARIABLE,
"Path to be ignored by FIND_XXX() commands.",
- "Specifies directories to be ignored by searches in FIND_XXX() commands "
+ "Specifies directories to be ignored by searches in FIND_XXX() "
+ "commands. "
"This is useful in cross-compiled environments where some system "
"directories contain incompatible but possibly linkable libraries. For "
"example, on cross-compiled cluster environments, this allows a user to "
@@ -696,7 +717,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_IGNORE_PATH", cmProperty::VARIABLE,
"Path to be ignored by FIND_XXX() commands.",
- "Specifies directories to be ignored by searches in FIND_XXX() commands "
+ "Specifies directories to be ignored by searches in FIND_XXX() "
+ "commands. "
"This is useful in cross-compiled environments where some system "
"directories contain incompatible but possibly linkable libraries. For "
"example, on cross-compiled cluster environments, this allows a user to "
@@ -827,13 +849,13 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Tell cmake to use MFC for an executable or dll.",
"This can be set in a CMakeLists.txt file and will "
"enable MFC in the application. It should be set "
- "to 1 for static the static MFC library, and 2 for "
- "the shared MFC library. This is used in visual "
- "studio 6 and 7 project files. The CMakeSetup "
+ "to 1 for the static MFC library, and 2 for "
+ "the shared MFC library. This is used in Visual "
+ "Studio 6 and 7 project files. The CMakeSetup "
"dialog used MFC and the CMakeLists.txt looks like this:\n"
- "add_definitions(-D_AFXDLL)\n"
- "set(CMAKE_MFC_FLAG 2)\n"
- "add_executable(CMakeSetup WIN32 ${SRCS})\n",false,
+ " add_definitions(-D_AFXDLL)\n"
+ " set(CMAKE_MFC_FLAG 2)\n"
+ " add_executable(CMakeSetup WIN32 ${SRCS})\n",false,
"Variables That Change Behavior");
cm->DefineProperty
@@ -974,12 +996,33 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
false,
"Variables That Describe the System");
- cm->DefineProperty
- ("MSVC80", cmProperty::VARIABLE,
- "True when using Microsoft Visual C 8.0",
- "Set to true when the compiler is version 8.0 of Microsoft Visual C.",
- false,
- "Variables That Describe the System");
+ int msvc_versions[] = { 60, 70, 71, 80, 90, 100, 110, 0 };
+ for (int i = 0; msvc_versions[i] != 0; i ++)
+ {
+ const char minor = (char)('0' + (msvc_versions[i] % 10));
+ cmStdString varName = "MSVC";
+ cmsys_ios::ostringstream majorStr;
+
+ majorStr << (msvc_versions[i] / 10);
+ varName += majorStr.str();
+ if (msvc_versions[i] < 100)
+ {
+ varName += minor;
+ }
+
+ cmStdString verString = majorStr.str() + "." + minor;
+
+ cmStdString shortStr = "True when using Microsoft Visual C " + verString;
+ cmStdString fullStr = "Set to true when the compiler is version " +
+ verString +
+ " of Microsoft Visual C.";
+ cm->DefineProperty
+ (varName.c_str(), cmProperty::VARIABLE,
+ shortStr.c_str(),
+ fullStr.c_str(),
+ false,
+ "Variables That Describe the System");
+ }
cm->DefineProperty
("MSVC_IDE", cmProperty::VARIABLE,
@@ -999,6 +1042,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
" 1400 = VS 8.0\n"
" 1500 = VS 9.0\n"
" 1600 = VS 10.0\n"
+ " 1700 = VS 11.0\n"
"",
false,
"Variables That Describe the System");
@@ -1169,6 +1213,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Variables that Control the Build");
cm->DefineProperty
+ ("CMAKE_PDB_OUTPUT_DIRECTORY", cmProperty::VARIABLE,
+ "Where to put all the MS debug symbol files.",
+ "This variable is used to initialize the "
+ "PDB_OUTPUT_DIRECTORY property on all the targets. "
+ "See that target property for additional information.",
+ false,
+ "Variables that Control the Build");
+
+ cm->DefineProperty
("CMAKE_AUTOMOC", cmProperty::VARIABLE,
"Whether to handle moc automatically for Qt targets.",
"This variable is used to initialize the "
@@ -1351,7 +1404,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
false,
"Variables that Control the Build");
cm->DefineProperty
- ("CMAKE_POSITION_INDEPENDENT_FLAGS", cmProperty::VARIABLE,
+ ("CMAKE_POSITION_INDEPENDENT_CODE", cmProperty::VARIABLE,
"Default value for POSITION_INDEPENDENT_CODE of targets.",
"This variable is used to initialize the "
"POSITION_INDEPENDENT_CODE property on all the targets. "
@@ -1381,8 +1434,30 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_<LANG>_COMPILER_ID", cmProperty::VARIABLE,
- "An internal variable subject to change.",
- "This is used in determining the compiler and is subject to change.",
+ "Compiler identification string.",
+ "A short string unique to the compiler vendor. "
+ "Possible values include:\n"
+ " Absoft = Absoft Fortran (absoft.com)\n"
+ " ADSP = Analog VisualDSP++ (analog.com)\n"
+ " Clang = LLVM Clang (clang.llvm.org)\n"
+ " Cray = Cray Compiler (cray.com)\n"
+ " Embarcadero, Borland = Embarcadero (embarcadero.com)\n"
+ " G95 = G95 Fortran (g95.org)\n"
+ " GNU = GNU Compiler Collection (gcc.gnu.org)\n"
+ " HP = Hewlett-Packard Compiler (hp.com)\n"
+ " Intel = Intel Compiler (intel.com)\n"
+ " MIPSpro = SGI MIPSpro (sgi.com)\n"
+ " MSVC = Microsoft Visual Studio (microsoft.com)\n"
+ " PGI = The Portland Group (pgroup.com)\n"
+ " PathScale = PathScale (pathscale.com)\n"
+ " SDCC = Small Device C Compiler (sdcc.sourceforge.net)\n"
+ " SunPro = Oracle Solaris Studio (oracle.com)\n"
+ " TI_DSP = Texas Instruments (ti.com)\n"
+ " TinyCC = Tiny C Compiler (tinycc.org)\n"
+ " Watcom = Open Watcom (openwatcom.org)\n"
+ " XL, VisualAge, zOS = IBM XL (ibm.com)\n"
+ "This variable is not guaranteed to be defined for all "
+ "compilers or languages.",
false,
"Variables for Languages");
@@ -1402,10 +1477,10 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_<LANG>_COMPILER_VERSION", cmProperty::VARIABLE,
- "An internal variable subject to change.",
+ "Compiler version string.",
"Compiler version in major[.minor[.patch[.tweak]]] format. "
- "This variable is reserved for internal use by CMake and is not "
- "guaranteed to be set.",
+ "This variable is not guaranteed to be defined for all "
+ "compilers or languages.",
false,
"Variables for Languages");
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 1b042ae..debde3b 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -148,13 +148,6 @@ static const char *cmDocumentationStandardSeeAlso[][3] =
"The list is member-post-only but one may sign up on the CMake web page. "
"Please first read the full documentation at "
"http://www.cmake.org before posting questions to the list."},
- {0,
- "Summary of helpful links:\n"
- " Home: http://www.cmake.org\n"
- " Docs: http://www.cmake.org/HTML/Documentation.html\n"
- " Mail: http://www.cmake.org/HTML/MailingLists.html\n"
- " FAQ: http://www.cmake.org/Wiki/CMake_FAQ\n"
- , 0},
{0,0,0}
};
@@ -162,7 +155,7 @@ static const char *cmDocumentationStandardSeeAlso[][3] =
static const char *cmDocumentationCopyright[][3] =
{
{0,
- "Copyright 2000-2009 Kitware, Inc., Insight Software Consortium. "
+ "Copyright 2000-2012 Kitware, Inc., Insight Software Consortium. "
"All rights reserved.", 0},
{0,
"Redistribution and use in source and binary forms, with or without "
diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx
index 6762d66..9f01949 100644
--- a/Source/cmDocumentationFormatter.cxx
+++ b/Source/cmDocumentationFormatter.cxx
@@ -19,7 +19,7 @@ cmDocumentationFormatter::~cmDocumentationFormatter()
{
}
-void cmDocumentationFormatter::PrintFormatted(std::ostream& os,
+void cmDocumentationFormatter::PrintFormatted(std::ostream& os,
const char* text)
{
if(!text)
diff --git a/Source/cmDocumentationFormatterDocbook.cxx b/Source/cmDocumentationFormatterDocbook.cxx
index 3087330..706ce0a 100644
--- a/Source/cmDocumentationFormatterDocbook.cxx
+++ b/Source/cmDocumentationFormatterDocbook.cxx
@@ -11,6 +11,14 @@
============================================================================*/
#include "cmDocumentationFormatterDocbook.h"
#include "cmDocumentationSection.h"
+#include <algorithm>
+#include <ctype.h> // for isalnum
+
+static int cmIsAlnum(int c)
+{
+ return isalnum(c);
+}
+
//----------------------------------------------------------------------------
// this function is a copy of the one in the HTML formatter
@@ -34,7 +42,7 @@ static void cmDocumentationPrintDocbookChar(std::ostream& os, char c)
case '<':
os << "&lt;";
break;
- case '>':
+ case '>':
os << "&gt;";
break;
case '&':
@@ -94,151 +102,116 @@ void cmDocumentationPrintDocbookEscapes(std::ostream& os, const char* text)
}
}
-
+//----------------------------------------------------------------------------
cmDocumentationFormatterDocbook::cmDocumentationFormatterDocbook()
:cmDocumentationFormatter()
{
}
+//----------------------------------------------------------------------------
void cmDocumentationFormatterDocbook
::PrintSection(std::ostream& os,
const cmDocumentationSection &section,
const char* name)
{
- if(name)
- {
- std::string id = "section_";
- id += name;
- if (this->EmittedLinkIds.find(id) == this->EmittedLinkIds.end())
- {
- this->EmittedLinkIds.insert(id);
- os << "<sect1 id=\"section_" << name << "\">\n"
- "<title>\n" << name << "</title>\n";
- }
- else
- {
- static unsigned int i=0;
- i++;
- os << "<sect1 id=\"section_" << name << i << "\">\n"
- "<title>\n" << name << "</title>\n";
- }
- }
+ os << "<sect1 id=\"";
+ this->PrintId(os, 0, name);
+ os << "\">\n<title>" << name << "</title>\n";
std::string prefix = this->ComputeSectionLinkPrefix(name);
+ const std::vector<cmDocumentationEntry> &entries = section.GetEntries();
- const std::vector<cmDocumentationEntry> &entries =
- section.GetEntries();
-
- if (!entries.empty())
+ bool hasSubSections = false;
+ for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
+ op != entries.end(); ++op)
{
- os << "<itemizedlist>\n";
- for(std::vector<cmDocumentationEntry>::const_iterator op
- = entries.begin(); op != entries.end(); ++ op )
+ if(op->Name.size())
{
- if(op->Name.size())
- {
- os << " <listitem><link linkend=\"" << prefix << "_";
- cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
- os << "\"><emphasis><literal>";
- cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
- os << "</literal></emphasis></link></listitem>\n";
- }
+ hasSubSections = true;
+ break;
}
- os << "</itemizedlist>\n" ;
}
- for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
- op != entries.end();)
+ bool inAbstract = false;
+ for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
+ op != entries.end(); ++op)
{
if(op->Name.size())
{
- for(;op != entries.end() && op->Name.size(); ++op)
+ if(inAbstract)
{
- if(op->Name.size())
- {
- os << " <para id=\"" << prefix << "_";
- cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
-
- // make sure that each id exists only once. Since it seems
- // not easily possible to determine which link refers to which id,
- // we have at least to make sure that the duplicated id's get a
- // different name (by appending an increasing number), Alex
- std::string id = prefix;
- id += "_";
- id += op->Name;
- if (this->EmittedLinkIds.find(id) == this->EmittedLinkIds.end())
- {
- this->EmittedLinkIds.insert(id);
- }
- else
- {
- static unsigned int i=0;
- i++;
- os << i;
- }
- // continue as normal...
-
- os << "\"><sect2><title>";
- cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
- os << "</title></sect2> ";
- }
+ os << "</abstract>\n";
+ inAbstract = false;
+ }
+ os << "<sect2 id=\"";
+ this->PrintId(os, prefix.c_str(), op->Name);
+ os << "\">\n<title>";
+ cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
+ os << "</title>\n";
+ if(op->Full.size())
+ {
+ os << "<abstract>\n<para>";
cmDocumentationPrintDocbookEscapes(os, op->Brief.c_str());
- if(op->Name.size())
- {
- os << "</para>\n";
- }
-
- if(op->Full.size())
- {
- // a line break seems to be simply a line break with docbook
- os << "\n ";
- this->PrintFormatted(os, op->Full.c_str());
- }
- os << "\n";
+ os << "</para>\n</abstract>\n";
+ this->PrintFormatted(os, op->Full.c_str());
}
+ else
+ {
+ this->PrintFormatted(os, op->Brief.c_str());
+ }
+ os << "</sect2>\n";
}
else
{
+ if(hasSubSections && op == entries.begin())
+ {
+ os << "<abstract>\n";
+ inAbstract = true;
+ }
this->PrintFormatted(os, op->Brief.c_str());
- os << "\n";
- ++op;
}
}
- if(name)
+
+ // empty sections are not allowed in docbook.
+ if(entries.empty())
{
- os << "</sect1>\n";
+ os << "<para/>\n";
}
+
+ os << "</sect1>\n";
}
-void cmDocumentationFormatterDocbook::PrintPreformatted(std::ostream& os,
- const char* text)
+//----------------------------------------------------------------------------
+void cmDocumentationFormatterDocbook
+::PrintPreformatted(std::ostream& os, const char* text)
{
- os << "<literallayout>";
+ os << "<para>\n<programlisting>";
cmDocumentationPrintDocbookEscapes(os, text);
- os << "</literallayout>\n ";
+ os << "</programlisting>\n</para>\n";
}
-void cmDocumentationFormatterDocbook::PrintParagraph(std::ostream& os,
- const char* text)
+void cmDocumentationFormatterDocbook
+::PrintParagraph(std::ostream& os, const char* text)
{
os << "<para>";
cmDocumentationPrintDocbookEscapes(os, text);
- os << "</para>";
+ os << "</para>\n";
}
//----------------------------------------------------------------------------
-void cmDocumentationFormatterDocbook::PrintHeader(const char* docname,
- const char* appname,
- std::ostream& os)
+void cmDocumentationFormatterDocbook
+::PrintHeader(const char* docname, const char* appname, std::ostream& os)
{
+ this->Docname = docname;
+
// this one is used to ensure that we don't create multiple link targets
- // with the same name. We can clear it here since we are at the
+ // with the same name. We can clear it here since we are at the
// start of a document here.
this->EmittedLinkIds.clear();
os << "<?xml version=\"1.0\" ?>\n"
- "<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook V4.2//EN\" "
- "\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\" [\n"
+ "<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook V4.5//EN\" "
+ "\"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\" [\n"
"<!ENTITY % addindex \"IGNORE\">\n"
"<!ENTITY % English \"INCLUDE\"> ]>\n"
"<article>\n"
@@ -253,3 +226,29 @@ void cmDocumentationFormatterDocbook::PrintFooter(std::ostream& os)
os << "</article>\n";
}
+//----------------------------------------------------------------------------
+void cmDocumentationFormatterDocbook
+::PrintId(std::ostream& os, const char* prefix, std::string id)
+{
+ std::replace_if(id.begin(), id.end(),
+ std::not1(std::ptr_fun(cmIsAlnum)), '_');
+ if(prefix)
+ {
+ id = std::string(prefix) + "." + id;
+ }
+ os << this->Docname << '.' << id;
+
+ // make sure that each id exists only once. Since it seems
+ // not easily possible to determine which link refers to which id,
+ // we have at least to make sure that the duplicated id's get a
+ // different name (by appending an increasing number), Alex
+ if (this->EmittedLinkIds.find(id) == this->EmittedLinkIds.end())
+ {
+ this->EmittedLinkIds.insert(id);
+ }
+ else
+ {
+ static unsigned int i=0;
+ os << i++;
+ }
+}
diff --git a/Source/cmDocumentationFormatterDocbook.h b/Source/cmDocumentationFormatterDocbook.h
index 213948d..0352d34 100644
--- a/Source/cmDocumentationFormatterDocbook.h
+++ b/Source/cmDocumentationFormatterDocbook.h
@@ -35,7 +35,9 @@ public:
virtual void PrintPreformatted(std::ostream& os, const char* text);
virtual void PrintParagraph(std::ostream& os, const char* text);
private:
+ void PrintId(std::ostream& os, const char* prefix, std::string id);
std::set<std::string> EmittedLinkIds;
+ std::string Docname;
};
#endif
diff --git a/Source/cmDocumentationFormatterHTML.cxx b/Source/cmDocumentationFormatterHTML.cxx
index cd0077e..7213b43 100644
--- a/Source/cmDocumentationFormatterHTML.cxx
+++ b/Source/cmDocumentationFormatterHTML.cxx
@@ -29,7 +29,7 @@ static void cmDocumentationPrintHTMLChar(std::ostream& os, char c)
// Use an escape sequence if necessary.
switch (c)
{
- case '<':
+ case '<':
os << "&lt;";
break;
case '>':
@@ -114,7 +114,7 @@ void cmDocumentationFormatterHTML
{
std::string prefix = this->ComputeSectionLinkPrefix(name);
- const std::vector<cmDocumentationEntry> &entries =
+ const std::vector<cmDocumentationEntry> &entries =
section.GetEntries();
// skip the index if the help for only a single item (--help-command,
@@ -131,7 +131,7 @@ void cmDocumentationFormatterHTML
}
// Is a list needed?
- for(std::vector<cmDocumentationEntry>::const_iterator op
+ for(std::vector<cmDocumentationEntry>::const_iterator op
= entries.begin(); op != entries.end(); ++ op )
{
if (op->Name.size())
@@ -154,7 +154,7 @@ void cmDocumentationFormatterHTML
}
}
- for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
+ for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end();)
{
if(op->Name.size())
@@ -191,7 +191,7 @@ void cmDocumentationFormatterHTML
}
}
-void cmDocumentationFormatterHTML::PrintPreformatted(std::ostream& os,
+void cmDocumentationFormatterHTML::PrintPreformatted(std::ostream& os,
const char* text)
{
os << "<pre>";
@@ -199,7 +199,7 @@ void cmDocumentationFormatterHTML::PrintPreformatted(std::ostream& os,
os << "</pre>\n ";
}
-void cmDocumentationFormatterHTML::PrintParagraph(std::ostream& os,
+void cmDocumentationFormatterHTML::PrintParagraph(std::ostream& os,
const char* text)
{
os << "<p>";
@@ -229,7 +229,7 @@ void cmDocumentationFormatterHTML::PrintFooter(std::ostream& os)
}
//----------------------------------------------------------------------------
-void cmDocumentationFormatterHTML::PrintHTMLEscapes(std::ostream& os,
+void cmDocumentationFormatterHTML::PrintHTMLEscapes(std::ostream& os,
const char* text)
{
// Hyperlink prefixes.
@@ -262,7 +262,7 @@ void cmDocumentationFormatterHTML
std::vector<const cmDocumentationSection *>& sections)
{
// skip the index if only the help for a single item is printed
- if ((sections.size() == 1)
+ if ((sections.size() == 1)
&& (sections[0]->GetName(this->GetForm()) != 0 )
&& (std::string(sections[0]->GetName(this->GetForm())) == "SingleItem"))
{
diff --git a/Source/cmDocumentationFormatterHTML.h b/Source/cmDocumentationFormatterHTML.h
index 427e04b..44bf240 100644
--- a/Source/cmDocumentationFormatterHTML.h
+++ b/Source/cmDocumentationFormatterHTML.h
@@ -32,7 +32,7 @@ public:
const cmDocumentationSection& section,
const char* name);
virtual void PrintPreformatted(std::ostream& os, const char* text);
- virtual void PrintParagraph(std::ostream& os, const char* text);
+ virtual void PrintParagraph(std::ostream& os, const char* text);
virtual void PrintIndex(std::ostream& ,
std::vector<const cmDocumentationSection *>&);
private:
diff --git a/Source/cmDocumentationFormatterText.cxx b/Source/cmDocumentationFormatterText.cxx
index 0b04b73..5def194 100644
--- a/Source/cmDocumentationFormatterText.cxx
+++ b/Source/cmDocumentationFormatterText.cxx
@@ -33,9 +33,9 @@ void cmDocumentationFormatterText
os << name << "\n\n";
}
- const std::vector<cmDocumentationEntry> &entries =
+ const std::vector<cmDocumentationEntry> &entries =
section.GetEntries();
- for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
+ for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end(); ++op)
{
if(op->Name.size())
@@ -58,7 +58,7 @@ void cmDocumentationFormatterText
}
}
-void cmDocumentationFormatterText::PrintPreformatted(std::ostream& os,
+void cmDocumentationFormatterText::PrintPreformatted(std::ostream& os,
const char* text)
{
bool newline = true;
@@ -78,7 +78,7 @@ void cmDocumentationFormatterText::PrintPreformatted(std::ostream& os,
os << "\n";
}
-void cmDocumentationFormatterText::PrintParagraph(std::ostream& os,
+void cmDocumentationFormatterText::PrintParagraph(std::ostream& os,
const char* text)
{
os << this->TextIndent;
@@ -91,7 +91,7 @@ void cmDocumentationFormatterText::SetIndent(const char* indent)
this->TextIndent = indent;
}
-void cmDocumentationFormatterText::PrintColumn(std::ostream& os,
+void cmDocumentationFormatterText::PrintColumn(std::ostream& os,
const char* text)
{
// Print text arranged in an indented column of fixed witdh.
@@ -100,14 +100,14 @@ void cmDocumentationFormatterText::PrintColumn(std::ostream& os,
bool newSentence = false;
bool firstLine = true;
int width = this->TextWidth - static_cast<int>(strlen(this->TextIndent));
-
+
// Loop until the end of the text.
while(*l)
{
// Parse the next word.
const char* r = l;
while(*r && (*r != '\n') && (*r != ' ')) { ++r; }
-
+
// Does it fit on this line?
if(r-l < (width-column-(newSentence?1:0)))
{
@@ -135,12 +135,12 @@ void cmDocumentationFormatterText::PrintColumn(std::ostream& os,
// first line.
os << (firstLine?"":this->TextIndent);
}
-
+
// Print the word.
os.write(l, static_cast<long>(r-l));
newSentence = (*(r-1) == '.');
}
-
+
if(*r == '\n')
{
// Text provided a newline. Start a new line.
@@ -175,6 +175,6 @@ void cmDocumentationFormatterText::PrintColumn(std::ostream& os,
// Move to beginning of next word. Skip over whitespace.
l = r;
- while(*l && (*l == ' ')) { ++l; }
+ while(*l && (*l == ' ')) { ++l; }
}
}
diff --git a/Source/cmDocumentationFormatterUsage.cxx b/Source/cmDocumentationFormatterUsage.cxx
index 8a415cb..a068e56 100644
--- a/Source/cmDocumentationFormatterUsage.cxx
+++ b/Source/cmDocumentationFormatterUsage.cxx
@@ -28,9 +28,9 @@ void cmDocumentationFormatterUsage
os << name << "\n";
}
- const std::vector<cmDocumentationEntry> &entries =
+ const std::vector<cmDocumentationEntry> &entries =
section.GetEntries();
- for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
+ for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end(); ++op)
{
if(op->Name.size())
diff --git a/Source/cmDocumentationSection.h b/Source/cmDocumentationSection.h
index 0fab38f..4f8c10d 100644
--- a/Source/cmDocumentationSection.h
+++ b/Source/cmDocumentationSection.h
@@ -26,28 +26,28 @@ public:
/** Create a cmSection, with a special name for man-output mode. */
cmDocumentationSection(const char* name, const char* manName)
:Name(name), ManName(manName) {}
-
+
/** Has any content been added to this section or is it empty ? */
bool IsEmpty() const { return this->Entries.empty(); }
-
+
/** Clear contents. */
void Clear() { this->Entries.clear(); }
-
+
/** Return the name of this section for the given output form. */
const char* GetName(cmDocumentationEnums::Form form) const
{ return (form==cmDocumentationEnums::ManForm ?
this->ManName.c_str() : this->Name.c_str()); }
-
+
/** Return a pointer to the first entry of this section. */
const std::vector<cmDocumentationEntry> &GetEntries() const
{ return this->Entries; }
-
+
/** Append an entry to this section. */
void Append(const cmDocumentationEntry& entry)
{ this->Entries.push_back(entry); }
void Append(const std::vector<cmDocumentationEntry> &entries)
{ this->Entries.insert(this->Entries.end(),entries.begin(),entries.end()); }
-
+
/** Append an entry to this section using NULL terminated chars */
void Append(const char *[][3]);
void Append(const char *n, const char *b, const char *f);
@@ -58,7 +58,7 @@ public:
{ this->Entries.insert(this->Entries.begin(),
entries.begin(),entries.end()); }
-
+
private:
std::string Name;
std::string ManName;
diff --git a/Source/cmElseCommand.h b/Source/cmElseCommand.h
index 5e8b790..f259919 100644
--- a/Source/cmElseCommand.h
+++ b/Source/cmElseCommand.h
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmElseCommand;
}
@@ -54,7 +54,7 @@ public:
{
return "Starts the else portion of an if block.";
}
-
+
/**
* More documentation.
*/
@@ -64,7 +64,7 @@ public:
" else(expression)\n"
"See the if command.";
}
-
+
cmTypeMacro(cmElseCommand, cmCommand);
};
diff --git a/Source/cmElseIfCommand.h b/Source/cmElseIfCommand.h
index 20cd81a..46e2bd9 100644
--- a/Source/cmElseIfCommand.h
+++ b/Source/cmElseIfCommand.h
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmElseIfCommand;
}
@@ -54,7 +54,7 @@ public:
{
return "Starts the elseif portion of an if block.";
}
-
+
/**
* More documentation.
*/
@@ -64,7 +64,7 @@ public:
" elseif(expression)\n"
"See the if command.";
}
-
+
cmTypeMacro(cmElseIfCommand, cmCommand);
};
diff --git a/Source/cmEnableLanguageCommand.cxx b/Source/cmEnableLanguageCommand.cxx
index f8f36eb..dcabf6a 100644
--- a/Source/cmEnableLanguageCommand.cxx
+++ b/Source/cmEnableLanguageCommand.cxx
@@ -22,7 +22,7 @@ bool cmEnableLanguageCommand
this->SetError
("called with incorrect number of arguments");
return false;
- }
+ }
for (std::vector<std::string>::const_iterator it = args.begin();
it != args.end();
++it)
diff --git a/Source/cmEnableLanguageCommand.h b/Source/cmEnableLanguageCommand.h
index 5958e44..e4bb251 100644
--- a/Source/cmEnableLanguageCommand.h
+++ b/Source/cmEnableLanguageCommand.h
@@ -28,7 +28,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmEnableLanguageCommand;
}
@@ -39,7 +39,7 @@ public:
*/
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
-
+
/**
* The name of the command as specified in CMakeList.txt.
*/
@@ -52,7 +52,7 @@ public:
{
return "Enable a language (CXX/C/Fortran/etc)";
}
-
+
/**
* More documentation.
*/
@@ -67,7 +67,7 @@ public:
"If OPTIONAL is used, use the CMAKE_<languageName>_COMPILER_WORKS "
"variable to check whether the language has been enabled successfully.";
}
-
+
cmTypeMacro(cmEnableLanguageCommand, cmCommand);
};
diff --git a/Source/cmEnableTestingCommand.cxx b/Source/cmEnableTestingCommand.cxx
index 5abb873..aa41ef7 100644
--- a/Source/cmEnableTestingCommand.cxx
+++ b/Source/cmEnableTestingCommand.cxx
@@ -12,7 +12,7 @@
#include "cmEnableTestingCommand.h"
#include "cmLocalGenerator.h"
-// we do this in the final pass so that we now the subdirs have all
+// we do this in the final pass so that we now the subdirs have all
// been defined
bool cmEnableTestingCommand::InitialPass(std::vector<std::string> const&,
cmExecutionStatus &)
diff --git a/Source/cmEnableTestingCommand.h b/Source/cmEnableTestingCommand.h
index b607818..9b9e985 100644
--- a/Source/cmEnableTestingCommand.h
+++ b/Source/cmEnableTestingCommand.h
@@ -24,7 +24,7 @@
* within the valid control structures are replicated in Testfile
* (i.e. SUBDIRS() and ADD_TEST() commands within IF() commands that are
* not entered by CMake are not replicated in Testfile).
- * Note that CTest expects to find this file in the build directory root;
+ * Note that CTest expects to find this file in the build directory root;
* therefore, this command should be in the source directory root too.
*/
class cmEnableTestingCommand : public cmCommand
@@ -33,7 +33,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmEnableTestingCommand;
}
@@ -57,7 +57,7 @@ public:
{
return "Enable testing for current directory and below.";
}
-
+
/**
* More documentation.
*/
@@ -70,9 +70,9 @@ public:
"a test file in the build directory root. Therefore, this command "
"should be in the source directory root.";
}
-
+
cmTypeMacro(cmEnableTestingCommand, cmCommand);
-
+
};
diff --git a/Source/cmEndForEachCommand.cxx b/Source/cmEndForEachCommand.cxx
index 2eca4e2..7f11ae5 100644
--- a/Source/cmEndForEachCommand.cxx
+++ b/Source/cmEndForEachCommand.cxx
@@ -12,7 +12,7 @@
#include "cmEndForEachCommand.h"
bool cmEndForEachCommand
-::InvokeInitialPass(std::vector<cmListFileArgument> const&,
+::InvokeInitialPass(std::vector<cmListFileArgument> const&,
cmExecutionStatus &)
{
this->SetError("An ENDFOREACH command was found outside of a proper "
diff --git a/Source/cmEndForEachCommand.h b/Source/cmEndForEachCommand.h
index 37b2d2a..d5ee8a6 100644
--- a/Source/cmEndForEachCommand.h
+++ b/Source/cmEndForEachCommand.h
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmEndForEachCommand;
}
@@ -36,7 +36,7 @@ public:
*/
virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
cmExecutionStatus &);
-
+
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
@@ -61,7 +61,7 @@ public:
{
return "Ends a list of commands in a FOREACH block.";
}
-
+
/**
* More documentation.
*/
@@ -71,7 +71,7 @@ public:
" endforeach(expression)\n"
"See the FOREACH command.";
}
-
+
cmTypeMacro(cmEndForEachCommand, cmCommand);
};
diff --git a/Source/cmEndFunctionCommand.h b/Source/cmEndFunctionCommand.h
index 54ac068..d7b74e9 100644
--- a/Source/cmEndFunctionCommand.h
+++ b/Source/cmEndFunctionCommand.h
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmEndFunctionCommand;
}
@@ -36,7 +36,7 @@ public:
*/
virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
cmExecutionStatus &);
-
+
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
@@ -61,7 +61,7 @@ public:
{
return "Ends a list of commands in a function block.";
}
-
+
/**
* More documentation.
*/
@@ -71,7 +71,7 @@ public:
" endfunction(expression)\n"
"See the function command.";
}
-
+
cmTypeMacro(cmEndFunctionCommand, cmCommand);
};
diff --git a/Source/cmEndIfCommand.cxx b/Source/cmEndIfCommand.cxx
index e98d4d4..0ac09de 100644
--- a/Source/cmEndIfCommand.cxx
+++ b/Source/cmEndIfCommand.cxx
@@ -20,7 +20,7 @@ bool cmEndIfCommand::InitialPass(std::vector<std::string> const&,
{
return true;
}
-
+
this->SetError("An ENDIF command was found outside of a proper "
"IF ENDIF structure. Or its arguments did not match "
"the opening IF command.");
diff --git a/Source/cmEndIfCommand.h b/Source/cmEndIfCommand.h
index 81d1b5f..5c4b9e3 100644
--- a/Source/cmEndIfCommand.h
+++ b/Source/cmEndIfCommand.h
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmEndIfCommand;
}
@@ -54,7 +54,7 @@ public:
{
return "Ends a list of commands in an if block.";
}
-
+
/**
* More documentation.
*/
@@ -64,7 +64,7 @@ public:
" endif(expression)\n"
"See the if command.";
}
-
+
cmTypeMacro(cmEndIfCommand, cmCommand);
};
diff --git a/Source/cmEndMacroCommand.h b/Source/cmEndMacroCommand.h
index 25e86b7..9d0e70f 100644
--- a/Source/cmEndMacroCommand.h
+++ b/Source/cmEndMacroCommand.h
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmEndMacroCommand;
}
@@ -36,7 +36,7 @@ public:
*/
virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
cmExecutionStatus &);
-
+
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
@@ -61,7 +61,7 @@ public:
{
return "Ends a list of commands in a macro block.";
}
-
+
/**
* More documentation.
*/
@@ -71,7 +71,7 @@ public:
" endmacro(expression)\n"
"See the macro command.";
}
-
+
cmTypeMacro(cmEndMacroCommand, cmCommand);
};
diff --git a/Source/cmEndWhileCommand.h b/Source/cmEndWhileCommand.h
index 635ad5a..18ba5ea 100644
--- a/Source/cmEndWhileCommand.h
+++ b/Source/cmEndWhileCommand.h
@@ -25,7 +25,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmEndWhileCommand;
}
@@ -36,7 +36,7 @@ public:
*/
virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const& args,
cmExecutionStatus &status);
-
+
/**
* This is called when the command is first encountered in
* the CMakeLists.txt file.
@@ -61,7 +61,7 @@ public:
{
return "Ends a list of commands in a while block.";
}
-
+
/**
* More documentation.
*/
@@ -71,7 +71,7 @@ public:
" endwhile(expression)\n"
"See the while command.";
}
-
+
cmTypeMacro(cmEndWhileCommand, cmCommand);
};
diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx
index 61b27ea..9fdb1e8 100644
--- a/Source/cmExecProgramCommand.cxx
+++ b/Source/cmExecProgramCommand.cxx
@@ -36,7 +36,7 @@ bool cmExecProgramCommand
doingargs = false;
havereturn_variable = false;
haveoutput_variable = true;
- }
+ }
else if ( haveoutput_variable )
{
if ( output_variable.size() > 0 )
@@ -54,7 +54,7 @@ bool cmExecProgramCommand
doingargs = false;
haveoutput_variable = false;
havereturn_variable = true;
- }
+ }
else if ( havereturn_variable )
{
if ( return_variable.size() > 0 )
@@ -108,16 +108,16 @@ bool cmExecProgramCommand
}
else
{
- result = cmSystemTools::RunCommand(command.c_str(), output,
+ result = cmSystemTools::RunCommand(command.c_str(), output,
retVal, 0, verbose);
}
if(!result)
{
retVal = -1;
- }
+ }
if ( output_variable.size() > 0 )
- {
+ {
std::string::size_type first = output.find_first_not_of(" \n\t\r");
std::string::size_type last = output.find_last_not_of(" \n\t\r");
if(first == std::string::npos)
@@ -128,7 +128,7 @@ bool cmExecProgramCommand
{
last = output.size()-1;
}
-
+
std::string coutput = std::string(output, first, last-first+1);
this->Makefile->AddDefinition(output_variable.c_str(), coutput.c_str());
}
@@ -139,7 +139,7 @@ bool cmExecProgramCommand
sprintf(buffer, "%d", retVal);
this->Makefile->AddDefinition(return_variable.c_str(), buffer);
}
-
+
return true;
}
diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h
index 7233860..f752501 100644
--- a/Source/cmExecProgramCommand.h
+++ b/Source/cmExecProgramCommand.h
@@ -27,7 +27,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmExecProgramCommand;
}
@@ -38,13 +38,13 @@ public:
*/
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
-
+
/**
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() const
{return "exec_program";}
-
+
/**
* This determines if the command is invoked when in script mode.
*/
@@ -55,10 +55,10 @@ public:
*/
virtual const char* GetTerseDocumentation() const
{
- return
+ return
"Deprecated. Use the execute_process() command instead.";
}
-
+
/**
* More documentation.
*/
@@ -82,7 +82,7 @@ public:
"stdout/stderr of the console running cmake.\n"
;
}
-
+
/** This command is kept for compatibility with older CMake versions. */
virtual bool IsDiscouraged() const
{
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index a0d9c9c..994c170 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -266,12 +266,12 @@ bool cmExecuteProcessCommand
}
if(!output_file.empty())
{
- cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDOUT,
+ cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDOUT,
output_file.c_str());
}
if(!error_file.empty())
{
- cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDERR,
+ cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDERR,
error_file.c_str());
}
@@ -326,12 +326,12 @@ bool cmExecuteProcessCommand
// Store the output obtained.
if(!output_variable.empty() && tempOutput.size())
{
- this->Makefile->AddDefinition(output_variable.c_str(),
+ this->Makefile->AddDefinition(output_variable.c_str(),
&*tempOutput.begin());
}
if(!merge_output && !error_variable.empty() && tempError.size())
{
- this->Makefile->AddDefinition(error_variable.c_str(),
+ this->Makefile->AddDefinition(error_variable.c_str(),
&*tempError.begin());
}
diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h
index 9fbecac..1488924 100644
--- a/Source/cmExecutionStatus.h
+++ b/Source/cmExecutionStatus.h
@@ -23,19 +23,19 @@ class cmExecutionStatus : public cmObject
{
public:
cmTypeMacro(cmExecutionStatus, cmObject);
-
+
cmExecutionStatus() { this->Clear();};
-
- virtual void SetReturnInvoked(bool val)
+
+ virtual void SetReturnInvoked(bool val)
{ this->ReturnInvoked = val; }
virtual bool GetReturnInvoked()
{ return this->ReturnInvoked; }
-
- virtual void SetBreakInvoked(bool val)
+
+ virtual void SetBreakInvoked(bool val)
{ this->BreakInvoked = val; }
virtual bool GetBreakInvoked()
{ return this->BreakInvoked; }
-
+
virtual void Clear()
{
this->ReturnInvoked = false;
@@ -45,7 +45,7 @@ public:
virtual void SetNestedError(bool val) { this->NestedError = val; }
virtual bool GetNestedError() { return this->NestedError; }
-
+
protected:
bool ReturnInvoked;
bool BreakInvoked;
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 32595ee..fb3f39f 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -72,8 +72,9 @@ cmExportBuildFileGenerator
if(!properties.empty())
{
// Get the rest of the target details.
+ std::vector<std::string> missingTargets;
this->SetImportDetailProperties(config, suffix,
- target, properties);
+ target, properties, missingTargets);
// TOOD: PUBLIC_HEADER_LOCATION
// This should wait until the build feature propagation stuff
@@ -82,6 +83,7 @@ cmExportBuildFileGenerator
// properties);
// Generate code in the export file.
+ this->GenerateMissingTargetsCheckCode(os, missingTargets);
this->GenerateImportPropertyCode(os, config, target, properties);
}
}
@@ -133,6 +135,25 @@ cmExportBuildFileGenerator
//----------------------------------------------------------------------------
void
+cmExportBuildFileGenerator::HandleMissingTarget(
+ std::string& link_libs, std::vector<std::string>&,
+ cmMakefile*, cmTarget* depender, cmTarget* dependee)
+{
+ // The target is not in the export.
+ if(!this->AppendMode)
+ {
+ // We are not appending, so all exported targets should be
+ // known here. This is probably user-error.
+ this->ComplainAboutMissingTarget(depender, dependee);
+ }
+ // Assume the target will be exported by another command.
+ // Append it with the export namespace.
+ link_libs += this->Namespace;
+ link_libs += dependee->GetName();
+}
+
+//----------------------------------------------------------------------------
+void
cmExportBuildFileGenerator
::ComplainAboutMissingTarget(cmTarget* depender,
cmTarget* dependee)
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index 0f37626..726537b 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -45,8 +45,14 @@ protected:
virtual void GenerateImportTargetsConfig(std::ostream& os,
const char* config,
std::string const& suffix);
- virtual void ComplainAboutMissingTarget(cmTarget* depender,
- cmTarget* dependee);
+ virtual void HandleMissingTarget(std::string& link_libs,
+ std::vector<std::string>& missingTargets,
+ cmMakefile* mf,
+ cmTarget* depender,
+ cmTarget* dependee);
+
+ void ComplainAboutMissingTarget(cmTarget* depender,
+ cmTarget* dependee);
/** Fill in properties indicating built file locations. */
void SetImportLocationProperty(const char* config,
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index eb19df5..8dffae4 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -11,10 +11,15 @@
============================================================================*/
#include "cmExportFileGenerator.h"
+#include "cmExportSet.h"
#include "cmGeneratedFileStream.h"
+#include "cmGlobalGenerator.h"
+#include "cmInstallExportGenerator.h"
+#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
+#include "cmTargetExport.h"
#include "cmVersion.h"
#include <cmsys/auto_ptr.hxx>
@@ -123,7 +128,9 @@ void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
void
cmExportFileGenerator
::SetImportDetailProperties(const char* config, std::string const& suffix,
- cmTarget* target, ImportPropertyMap& properties)
+ cmTarget* target, ImportPropertyMap& properties,
+ std::vector<std::string>& missingTargets
+ )
{
// Get the makefile in which to lookup target information.
cmMakefile* mf = target->GetMakefile();
@@ -159,13 +166,13 @@ cmExportFileGenerator
{
this->SetImportLinkProperty(suffix, target,
"IMPORTED_LINK_INTERFACE_LANGUAGES",
- iface->Languages, properties);
+ iface->Languages, properties, missingTargets);
this->SetImportLinkProperty(suffix, target,
"IMPORTED_LINK_INTERFACE_LIBRARIES",
- iface->Libraries, properties);
+ iface->Libraries, properties, missingTargets);
this->SetImportLinkProperty(suffix, target,
"IMPORTED_LINK_DEPENDENT_LIBRARIES",
- iface->SharedDeps, properties);
+ iface->SharedDeps, properties, missingTargets);
if(iface->Multiplicity > 0)
{
std::string prop = "IMPORTED_LINK_INTERFACE_MULTIPLICITY";
@@ -184,7 +191,9 @@ cmExportFileGenerator
cmTarget* target,
const char* propName,
std::vector<std::string> const& libs,
- ImportPropertyMap& properties)
+ ImportPropertyMap& properties,
+ std::vector<std::string>& missingTargets
+ )
{
// Skip the property if there are no libraries.
if(libs.empty())
@@ -224,17 +233,7 @@ cmExportFileGenerator
}
else
{
- // The target is not in the export.
- if(!this->AppendMode)
- {
- // We are not appending, so all exported targets should be
- // known here. This is probably user-error.
- this->ComplainAboutMissingTarget(target, tgt);
- }
- // Assume the target will be exported by another command.
- // Append it with the export namespace.
- link_libs += this->Namespace;
- link_libs += *li;
+ this->HandleMissingTarget(link_libs, missingTargets, mf, target, tgt);
}
}
else
@@ -250,6 +249,7 @@ cmExportFileGenerator
properties[prop] = link_libs;
}
+
//----------------------------------------------------------------------------
void cmExportFileGenerator::GenerateImportHeaderCode(std::ostream& os,
const char* config)
@@ -381,6 +381,30 @@ cmExportFileGenerator
//----------------------------------------------------------------------------
+void cmExportFileGenerator::GenerateMissingTargetsCheckCode(std::ostream& os,
+ const std::vector<std::string>& missingTargets)
+{
+ os << "# Make sure the targets which have been exported in some other \n"
+ "# export set exist.\n";
+ for(unsigned int i=0; i<missingTargets.size(); ++i)
+ {
+ os << "IF(NOT TARGET \"" << missingTargets[i] << "\" )\n"
+ << " IF(CMAKE_FIND_PACKAGE_NAME)\n"
+ << " SET( ${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)\n"
+ << " SET( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "
+ << "\"Required imported target \\\"" << missingTargets[i]
+ << "\\\" not found ! \")\n"
+ << " ELSE()\n"
+ << " MESSAGE(FATAL_ERROR \"Required imported target \\\""
+ << missingTargets[i] << "\\\" not found ! \")\n"
+ << " ENDIF()\n"
+ << "ENDIF()\n";
+ }
+ os << "\n";
+}
+
+
+//----------------------------------------------------------------------------
void
cmExportFileGenerator::GenerateImportedFileCheckLoop(std::ostream& os)
{
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index f271e55..70bc65d 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -60,17 +60,21 @@ protected:
ImportPropertyMap const& properties,
const std::set<std::string>& importedLocations);
void GenerateImportedFileCheckLoop(std::ostream& os);
+ void GenerateMissingTargetsCheckCode(std::ostream& os,
+ const std::vector<std::string>& missingTargets);
// Collect properties with detailed information about targets beyond
// their location on disk.
void SetImportDetailProperties(const char* config,
std::string const& suffix, cmTarget* target,
- ImportPropertyMap& properties);
+ ImportPropertyMap& properties,
+ std::vector<std::string>& missingTargets);
void SetImportLinkProperty(std::string const& suffix,
cmTarget* target, const char* propName,
std::vector<std::string> const& libs,
- ImportPropertyMap& properties);
+ ImportPropertyMap& properties,
+ std::vector<std::string>& missingTargets);
/** Each subclass knows how to generate its kind of export file. */
virtual bool GenerateMainFile(std::ostream& os) = 0;
@@ -80,10 +84,13 @@ protected:
const char* config,
std::string const& suffix) = 0;
- /** Each subclass knows how to complain about a target that is
- missing from an export set. */
- virtual void ComplainAboutMissingTarget(cmTarget* depender,
- cmTarget* dependee) = 0;
+ /** Each subclass knows how to deal with a target that is missing from an
+ * export set. */
+ virtual void HandleMissingTarget(std::string& link_libs,
+ std::vector<std::string>& missingTargets,
+ cmMakefile* mf,
+ cmTarget* depender,
+ cmTarget* dependee) = 0;
// The namespace in which the exports are placed in the generated file.
std::string Namespace;
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index da14dd7..7841731 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -11,14 +11,19 @@
============================================================================*/
#include "cmExportInstallFileGenerator.h"
+#include "cmExportSet.h"
+#include "cmExportSetMap.h"
#include "cmGeneratedFileStream.h"
+#include "cmGlobalGenerator.h"
+#include "cmLocalGenerator.h"
#include "cmInstallExportGenerator.h"
#include "cmInstallTargetGenerator.h"
+#include "cmTargetExport.h"
//----------------------------------------------------------------------------
cmExportInstallFileGenerator
::cmExportInstallFileGenerator(cmInstallExportGenerator* iegen):
- InstallExportGenerator(iegen)
+ IEGen(iegen)
{
}
@@ -36,10 +41,10 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
{
// Create all the imported targets.
for(std::vector<cmTargetExport*>::const_iterator
- tei = this->ExportSet->begin();
- tei != this->ExportSet->end(); ++tei)
+ tei = this->IEGen->GetExportSet()->GetTargetExports()->begin();
+ tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
{
- cmTargetExport* te = *tei;
+ cmTargetExport const* te = *tei;
if(this->ExportedTargets.insert(te->Target).second)
{
this->GenerateImportTargetCode(os, te->Target);
@@ -47,8 +52,9 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
else
{
cmOStringStream e;
- e << "INSTALL(EXPORT \"" << this->Name << "\" ...) "
- << "includes target \"" << te->Target->GetName()
+ e << "INSTALL(EXPORT \""
+ << this->IEGen->GetExportSet()->GetName()
+ << "\" ...) " << "includes target \"" << te->Target->GetName()
<< "\" more than once in the export set.";
cmSystemTools::Error(e.str().c_str());
return false;
@@ -84,7 +90,7 @@ bool
cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config)
{
// Skip configurations not enabled for this export.
- if(!this->InstallExportGenerator->InstallsForConfig(config))
+ if(!this->IEGen->InstallsForConfig(config))
{
return true;
}
@@ -140,7 +146,7 @@ cmExportInstallFileGenerator
{
// Add code to compute the installation prefix relative to the
// import file location.
- const char* installDest = this->InstallExportGenerator->GetDestination();
+ const char* installDest = this->IEGen->GetDestination();
if(!cmSystemTools::FileIsFullPath(installDest))
{
std::string dest = installDest;
@@ -161,11 +167,11 @@ cmExportInstallFileGenerator
// Add each target in the set to the export.
for(std::vector<cmTargetExport*>::const_iterator
- tei = this->ExportSet->begin();
- tei != this->ExportSet->end(); ++tei)
+ tei = this->IEGen->GetExportSet()->GetTargetExports()->begin();
+ tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
{
// Collect import properties for this target.
- cmTargetExport* te = *tei;
+ cmTargetExport const* te = *tei;
ImportPropertyMap properties;
std::set<std::string> importedLocations;
this->SetImportLocationProperty(config, suffix, te->ArchiveGenerator,
@@ -185,8 +191,9 @@ cmExportInstallFileGenerator
if(!properties.empty())
{
// Get the rest of the target details.
+ std::vector<std::string> missingTargets;
this->SetImportDetailProperties(config, suffix,
- te->Target, properties);
+ te->Target, properties, missingTargets);
// TOOD: PUBLIC_HEADER_LOCATION
// This should wait until the build feature propagation stuff
@@ -195,6 +202,7 @@ cmExportInstallFileGenerator
// properties);
// Generate code in the export file.
+ this->GenerateMissingTargetsCheckCode(os, missingTargets);
this->GenerateImportPropertyCode(os, config, te->Target, properties);
this->GenerateImportedFileChecksCode(os, te->Target, properties,
importedLocations);
@@ -306,12 +314,80 @@ cmExportInstallFileGenerator
//----------------------------------------------------------------------------
void
+cmExportInstallFileGenerator::HandleMissingTarget(
+ std::string& link_libs, std::vector<std::string>& missingTargets,
+ cmMakefile* mf, cmTarget* depender, cmTarget* dependee)
+{
+ std::string name = dependee->GetName();
+ std::vector<std::string> namespaces = this->FindNamespaces(mf, name);
+ int targetOccurrences = (int)namespaces.size();
+ if (targetOccurrences == 1)
+ {
+ std::string missingTarget = namespaces[0];
+ missingTarget += name;
+ link_libs += missingTarget;
+ missingTargets.push_back(missingTarget);
+ }
+ else
+ {
+ // We are not appending, so all exported targets should be
+ // known here. This is probably user-error.
+ this->ComplainAboutMissingTarget(depender, dependee, targetOccurrences);
+ }
+}
+
+//----------------------------------------------------------------------------
+std::vector<std::string>
+cmExportInstallFileGenerator
+::FindNamespaces(cmMakefile* mf, const std::string& name)
+{
+ std::vector<std::string> namespaces;
+ cmGlobalGenerator* gg = mf->GetLocalGenerator()->GetGlobalGenerator();
+ const cmExportSetMap& exportSets = gg->GetExportSets();
+
+ for(cmExportSetMap::const_iterator expIt = exportSets.begin();
+ expIt != exportSets.end();
+ ++expIt)
+ {
+ const cmExportSet* exportSet = expIt->second;
+ std::vector<cmTargetExport*> const* targets =
+ exportSet->GetTargetExports();
+
+ bool containsTarget = false;
+ for(unsigned int i=0; i<targets->size(); i++)
+ {
+ if (name == (*targets)[i]->Target->GetName())
+ {
+ containsTarget = true;
+ break;
+ }
+ }
+
+ if (containsTarget)
+ {
+ std::vector<cmInstallExportGenerator const*> const* installs =
+ exportSet->GetInstallations();
+ for(unsigned int i=0; i<installs->size(); i++)
+ {
+ namespaces.push_back((*installs)[i]->GetNamespace());
+ }
+ }
+ }
+
+ return namespaces;
+}
+
+
+//----------------------------------------------------------------------------
+void
cmExportInstallFileGenerator
::ComplainAboutImportPrefix(cmInstallTargetGenerator* itgen)
{
- const char* installDest = this->InstallExportGenerator->GetDestination();
+ const char* installDest = this->IEGen->GetDestination();
cmOStringStream e;
- e << "INSTALL(EXPORT \"" << this->Name << "\") given absolute "
+ e << "INSTALL(EXPORT \""
+ << this->IEGen->GetExportSet()->GetName()
+ << "\") given absolute "
<< "DESTINATION \"" << installDest << "\" but the export "
<< "references an installation of target \""
<< itgen->GetTarget()->GetName() << "\" which has relative "
@@ -322,12 +398,24 @@ cmExportInstallFileGenerator
//----------------------------------------------------------------------------
void
cmExportInstallFileGenerator
-::ComplainAboutMissingTarget(cmTarget* depender, cmTarget* dependee)
+::ComplainAboutMissingTarget(cmTarget* depender,
+ cmTarget* dependee,
+ int occurrences)
{
cmOStringStream e;
- e << "INSTALL(EXPORT \"" << this->Name << "\" ...) "
+ e << "INSTALL(EXPORT \""
+ << this->IEGen->GetExportSet()->GetName()
+ << "\" ...) "
<< "includes target \"" << depender->GetName()
- << "\" which requires target \"" << dependee->GetName()
- << "\" that is not in the export set.";
+ << "\" which requires target \"" << dependee->GetName() << "\" ";
+ if (occurrences == 0)
+ {
+ e << "that is not in the export set.";
+ }
+ else
+ {
+ e << "that is not in this export set, but " << occurrences
+ << " times in others.";
+ }
cmSystemTools::Error(e.str().c_str());
}
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h
index fb678e8..e719ecc 100644
--- a/Source/cmExportInstallFileGenerator.h
+++ b/Source/cmExportInstallFileGenerator.h
@@ -18,6 +18,7 @@ class cmInstallExportGenerator;
class cmInstallFilesGenerator;
class cmInstallTargetGenerator;
class cmTargetExport;
+class cmExportSet;
/** \class cmExportInstallFileGenerator
* \brief Generate a file exporting targets from an install tree.
@@ -40,15 +41,6 @@ public:
files. */
cmExportInstallFileGenerator(cmInstallExportGenerator* iegen);
- /** Set the name of the export associated with the files. This is
- the name given to the install(EXPORT) command mode. */
- void SetName(const char* name) { this->Name = name; }
-
- /** Set the set of targets to be exported. These are the targets
- associated with the export name. */
- void SetExportSet(std::vector<cmTargetExport*> const* eSet)
- { this->ExportSet = eSet; }
-
/** Get the per-config file generated for each configuraiton. This
maps from the configuration name to the file temporary location
for installation. */
@@ -65,8 +57,19 @@ protected:
virtual void GenerateImportTargetsConfig(std::ostream& os,
const char* config,
std::string const& suffix);
- virtual void ComplainAboutMissingTarget(cmTarget* depender,
- cmTarget* dependee);
+ virtual void HandleMissingTarget(std::string& link_libs,
+ std::vector<std::string>& missingTargets,
+ cmMakefile* mf,
+ cmTarget* depender,
+ cmTarget* dependee);
+
+ void ComplainAboutMissingTarget(cmTarget* depender,
+ cmTarget* dependee,
+ int occurrences);
+
+ std::vector<std::string> FindNamespaces(cmMakefile* mf,
+ const std::string& name);
+
/** Generate a per-configuration file for the targets. */
bool GenerateImportFileConfig(const char* config);
@@ -81,9 +84,7 @@ protected:
void ComplainAboutImportPrefix(cmInstallTargetGenerator* itgen);
- cmInstallExportGenerator* InstallExportGenerator;
- std::string Name;
- std::vector<cmTargetExport*> const* ExportSet;
+ cmInstallExportGenerator* IEGen;
std::string ImportPrefix;
@@ -91,34 +92,4 @@ protected:
std::map<cmStdString, cmStdString> ConfigImportFiles;
};
-/*
- cmTargetExport is used in cmGlobalGenerator to collect the install
- generators for targets associated with an export.
-*/
-class cmTargetExport
-{
-public:
- cmTargetExport(cmTarget* tgt,
- cmInstallTargetGenerator* archive,
- cmInstallTargetGenerator* runtime,
- cmInstallTargetGenerator* library,
- cmInstallTargetGenerator* framework,
- cmInstallTargetGenerator* bundle,
- cmInstallFilesGenerator* headers
- ) : Target(tgt), ArchiveGenerator(archive),
- RuntimeGenerator(runtime), LibraryGenerator(library),
- FrameworkGenerator(framework), BundleGenerator(bundle),
- HeaderGenerator(headers) {}
-
- cmTarget* Target;
- cmInstallTargetGenerator* ArchiveGenerator;
- cmInstallTargetGenerator* RuntimeGenerator;
- cmInstallTargetGenerator* LibraryGenerator;
- cmInstallTargetGenerator* FrameworkGenerator;
- cmInstallTargetGenerator* BundleGenerator;
- cmInstallFilesGenerator* HeaderGenerator;
-private:
- cmTargetExport();
-};
-
#endif
diff --git a/Source/cmExportLibraryDependencies.cxx b/Source/cmExportLibraryDependencies.cxx
index 8fdb069..f07b783 100644
--- a/Source/cmExportLibraryDependencies.cxx
+++ b/Source/cmExportLibraryDependencies.cxx
@@ -26,7 +26,7 @@ bool cmExportLibraryDependenciesCommand
this->SetError("called with incorrect number of arguments");
return false;
}
-
+
// store the arguments for the final pass
this->Filename = args[0];
this->Append = false;
diff --git a/Source/cmExportLibraryDependencies.h b/Source/cmExportLibraryDependencies.h
index 2a2ff21..d8b65cc 100644
--- a/Source/cmExportLibraryDependencies.h
+++ b/Source/cmExportLibraryDependencies.h
@@ -18,7 +18,7 @@
* \brief Add a test to the lists of tests to run.
*
* cmExportLibraryDependenciesCommand adds a test to the list of tests to run
- *
+ *
*/
class cmExportLibraryDependenciesCommand : public cmCommand
{
@@ -26,7 +26,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmExportLibraryDependenciesCommand;
}
@@ -40,7 +40,7 @@ public:
/**
* This is called at the end after all the information
- * specified by the command is accumulated.
+ * specified by the command is accumulated.
*/
virtual void FinalPass();
virtual bool HasFinalPass() const { return true; }
@@ -57,7 +57,7 @@ public:
{
return "Deprecated. Use INSTALL(EXPORT) or EXPORT command.";
}
-
+
/**
* More documentation.
*/
@@ -87,7 +87,7 @@ public:
{
return true;
}
-
+
cmTypeMacro(cmExportLibraryDependenciesCommand, cmCommand);
private:
diff --git a/Source/cmExportSet.cxx b/Source/cmExportSet.cxx
new file mode 100644
index 0000000..33b0630
--- /dev/null
+++ b/Source/cmExportSet.cxx
@@ -0,0 +1,32 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#include "cmExportSet.h"
+#include "cmTargetExport.h"
+
+cmExportSet::~cmExportSet()
+{
+ for(unsigned int i = 0; i < this->TargetExports.size(); ++ i)
+ {
+ delete this->TargetExports[i];
+ }
+}
+
+void cmExportSet::AddTargetExport(cmTargetExport* te)
+{
+ this->TargetExports.push_back(te);
+}
+
+void cmExportSet::AddInstallation(cmInstallExportGenerator const* installation)
+{
+ this->Installations.push_back(installation);
+}
diff --git a/Source/cmExportSet.h b/Source/cmExportSet.h
new file mode 100644
index 0000000..a57aa12
--- /dev/null
+++ b/Source/cmExportSet.h
@@ -0,0 +1,46 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmExportSet_h
+#define cmExportSet_h
+
+#include "cmSystemTools.h"
+class cmTargetExport;
+class cmInstallExportGenerator;
+
+/// A set of targets that were installed with the same EXPORT parameter.
+class cmExportSet
+{
+public:
+ /// Construct an empty export set named \a name
+ cmExportSet(const std::string &name) : Name(name) {}
+ /// Destructor
+ ~cmExportSet();
+
+ void AddTargetExport(cmTargetExport* tgt);
+
+ void AddInstallation(cmInstallExportGenerator const* installation);
+
+ std::string const& GetName() const { return this->Name; }
+
+ std::vector<cmTargetExport*> const* GetTargetExports() const
+ { return &this->TargetExports; }
+
+ std::vector<cmInstallExportGenerator const*> const* GetInstallations() const
+ { return &this->Installations; }
+
+private:
+ std::vector<cmTargetExport*> TargetExports;
+ std::string Name;
+ std::vector<cmInstallExportGenerator const*> Installations;
+};
+
+#endif
diff --git a/Source/cmExportSetMap.cxx b/Source/cmExportSetMap.cxx
new file mode 100644
index 0000000..96fdb3e
--- /dev/null
+++ b/Source/cmExportSetMap.cxx
@@ -0,0 +1,34 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#include "cmExportSetMap.h"
+#include "cmExportSet.h"
+
+cmExportSet* cmExportSetMap::operator[](const std::string &name)
+{
+ std::map<std::string, cmExportSet*>::iterator it = this->find(name);
+ if (it == this->end()) // Export set not found
+ {
+ it = this->insert(std::make_pair(name, new cmExportSet(name))).first;
+ }
+ return it->second;
+}
+
+cmExportSetMap::~cmExportSetMap()
+{
+ for(std::map<std::string, cmExportSet*>::iterator it = this->begin();
+ it != this->end();
+ ++ it)
+ {
+ delete it->second;
+ }
+}
diff --git a/Source/cmExportSetMap.h b/Source/cmExportSetMap.h
new file mode 100644
index 0000000..4663c55
--- /dev/null
+++ b/Source/cmExportSetMap.h
@@ -0,0 +1,33 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmExportSetMap_h
+#define cmExportSetMap_h
+
+#include "cmSystemTools.h"
+class cmExportSet;
+
+/// A name -> cmExportSet map with overloaded operator[].
+class cmExportSetMap : public std::map<std::string, cmExportSet*>
+{
+public:
+ /** \brief Overloaded operator[].
+ *
+ * The operator is overloaded because cmExportSet has no default constructor:
+ * we do not want unnamed export sets.
+ */
+ cmExportSet* operator[](const std::string &name);
+
+ /// Overloaded destructor deletes all member export sets.
+ ~cmExportSetMap();
+};
+
+#endif
diff --git a/Source/cmExprLexer.h b/Source/cmExprLexer.h
index 4c10496..03b36ce 100644
--- a/Source/cmExprLexer.h
+++ b/Source/cmExprLexer.h
@@ -58,7 +58,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@@ -188,7 +188,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
diff --git a/Source/cmExprLexer.in.l b/Source/cmExprLexer.in.l
index db9018f..f344b40 100644
--- a/Source/cmExprLexer.in.l
+++ b/Source/cmExprLexer.in.l
@@ -54,19 +54,19 @@ Modify cmExprLexer.h:
%%
-[0-9][0-9]* { yylvalp->Number = atoi(yytext); return exp_NUMBER; }
+[0-9][0-9]* { yylvalp->Number = atoi(yytext); return exp_NUMBER; }
"+" { return exp_PLUS; }
-"-" { return exp_MINUS; }
-"*" { return exp_TIMES; }
-"/" { return exp_DIVIDE; }
-"%" { return exp_MOD; }
-"\|" { return exp_OR; }
-"&" { return exp_AND; }
-"^" { return exp_XOR; }
-"~" { return exp_NOT; }
-"<<" { return exp_SHIFTLEFT; }
-">>" { return exp_SHIFTRIGHT; }
+"-" { return exp_MINUS; }
+"*" { return exp_TIMES; }
+"/" { return exp_DIVIDE; }
+"%" { return exp_MOD; }
+"\|" { return exp_OR; }
+"&" { return exp_AND; }
+"^" { return exp_XOR; }
+"~" { return exp_NOT; }
+"<<" { return exp_SHIFTLEFT; }
+">>" { return exp_SHIFTRIGHT; }
"(" { return exp_OPENPARENT; }
")" { return exp_CLOSEPARENT; }
diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx
index 7728d74..9c1795e 100644
--- a/Source/cmExprParserHelper.cxx
+++ b/Source/cmExprParserHelper.cxx
@@ -42,7 +42,7 @@ int cmExprParserHelper::ParseString(const char* str, int verb)
this->InputBuffer = str;
this->InputBufferPos = 0;
this->CurrentLine = 0;
-
+
this->Result = 0;
yyscan_t yyscanner;
@@ -61,7 +61,7 @@ int cmExprParserHelper::ParseString(const char* str, int verb)
if ( Verbose )
{
- std::cerr << "Expanding [" << str << "] produced: ["
+ std::cerr << "Expanding [" << str << "] produced: ["
<< this->Result << "]" << std::endl;
}
return 1;
diff --git a/Source/cmExprParserHelper.h b/Source/cmExprParserHelper.h
index 690426d..4b76b33 100644
--- a/Source/cmExprParserHelper.h
+++ b/Source/cmExprParserHelper.h
@@ -9,7 +9,7 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
-#ifndef cmExprParserHelper_h
+#ifndef cmExprParserHelper_h
#define cmExprParserHelper_h
#include "cmStandardIncludes.h"
diff --git a/Source/cmExternalMakefileProjectGenerator.cxx b/Source/cmExternalMakefileProjectGenerator.cxx
index 6ed84bd..9c965cc 100644
--- a/Source/cmExternalMakefileProjectGenerator.cxx
+++ b/Source/cmExternalMakefileProjectGenerator.cxx
@@ -49,7 +49,7 @@ const char* cmExternalMakefileProjectGenerator::GetGlobalGeneratorName(
}
// otherwise search for the matching global generator
- for (std::vector<std::string>::const_iterator
+ for (std::vector<std::string>::const_iterator
it = this->SupportedGlobalGenerators.begin();
it != this->SupportedGlobalGenerators.end();
++it)
diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h
index 46f1d31..182c1a8 100644
--- a/Source/cmExternalMakefileProjectGenerator.h
+++ b/Source/cmExternalMakefileProjectGenerator.h
@@ -22,12 +22,12 @@ class cmGlobalGenerator;
* \brief Base class for generators for "External Makefile based IDE projects".
*
* cmExternalMakefileProjectGenerator is a base class for generators
- * for "external makefile based projects", i.e. IDE projects which work
+ * for "external makefile based projects", i.e. IDE projects which work
* an already existing makefiles.
* See cmGlobalKdevelopGenerator as an example.
- * After the makefiles have been generated by one of the Makefile
+ * After the makefiles have been generated by one of the Makefile
* generators, the Generate() method is called and this generator
- * can iterate over the local generators and/or projects to produce the
+ * can iterate over the local generators and/or projects to produce the
* project files for the IDE.
*/
class cmExternalMakefileProjectGenerator
@@ -39,7 +39,7 @@ public:
///! Get the name for this generator.
virtual const char* GetName() const = 0;
/** Get the documentation entry for this generator. */
- virtual void GetDocumentation(cmDocumentationEntry& entry,
+ virtual void GetDocumentation(cmDocumentationEntry& entry,
const char* fullName) const = 0;
///! set the global generator which will generate the makefiles
@@ -47,7 +47,7 @@ public:
{this->GlobalGenerator = generator;}
///! Return the list of global generators supported by this extra generator
- const std::vector<std::string>& GetSupportedGlobalGenerators() const
+ const std::vector<std::string>& GetSupportedGlobalGenerators() const
{return this->SupportedGlobalGenerators;}
///! Get the name of the global generator for the given full name
@@ -55,7 +55,7 @@ public:
/** Create a full name from the given global generator name and the
* extra generator name
*/
- static std::string CreateFullGeneratorName(const char* globalGenerator,
+ static std::string CreateFullGeneratorName(const char* globalGenerator,
const char* extraGenerator);
///! Generate the project files, the Makefiles have already been generated
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index ad4ab76..25b13e5 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -617,14 +617,17 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
" <Option compiler=\"" << compiler << "\" />\n"
" <Compiler>\n";
+ cmGeneratorTarget *gtgt = this->GlobalGenerator
+ ->GetGeneratorTarget(target);
+
// the compilerdefines for this target
- const char* cdefs = target->GetMakefile()->GetProperty(
- "COMPILE_DEFINITIONS");
- if(cdefs)
+ std::string cdefs = gtgt->GetCompileDefinitions();
+
+ if(!cdefs.empty())
{
// Expand the list.
std::vector<std::string> defs;
- cmSystemTools::ExpandListArgument(cdefs, defs);
+ cmSystemTools::ExpandListArgument(cdefs.c_str(), defs);
for(std::vector<std::string>::const_iterator di = defs.begin();
di != defs.end(); ++di)
{
@@ -633,57 +636,59 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
}
}
- // the include directories for this target
- std::set<std::string> uniqIncludeDirs;
+ // the include directories for this target
+ std::set<std::string> uniqIncludeDirs;
+
+ std::vector<std::string> includes;
+ const char *config = target->GetMakefile()
+ ->GetDefinition("CMAKE_BUILD_TYPE");
+ target->GetMakefile()->GetLocalGenerator()->
+ GetIncludeDirectories(includes, gtgt, "C", config);
+ for(std::vector<std::string>::const_iterator dirIt=includes.begin();
+ dirIt != includes.end();
+ ++dirIt)
+ {
+ uniqIncludeDirs.insert(*dirIt);
+ }
- std::vector<std::string> includes;
- target->GetMakefile()->GetLocalGenerator()->
- GetIncludeDirectories(includes, target);
- for(std::vector<std::string>::const_iterator dirIt=includes.begin();
- dirIt != includes.end();
+ std::string systemIncludeDirs = makefile->GetSafeDefinition(
+ "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
+ if (!systemIncludeDirs.empty())
+ {
+ std::vector<std::string> dirs;
+ cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
+ for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
+ dirIt != dirs.end();
++dirIt)
{
uniqIncludeDirs.insert(*dirIt);
}
+ }
- std::string systemIncludeDirs = makefile->GetSafeDefinition(
- "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
- if (!systemIncludeDirs.empty())
- {
- std::vector<std::string> dirs;
- cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
- for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
- dirIt != dirs.end();
- ++dirIt)
- {
- uniqIncludeDirs.insert(*dirIt);
- }
- }
-
- systemIncludeDirs = makefile->GetSafeDefinition(
- "CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
- if (!systemIncludeDirs.empty())
- {
- std::vector<std::string> dirs;
- cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
- for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
- dirIt != dirs.end();
- ++dirIt)
- {
- uniqIncludeDirs.insert(*dirIt);
- }
- }
-
- for(std::set<std::string>::const_iterator dirIt=uniqIncludeDirs.begin();
- dirIt != uniqIncludeDirs.end();
+ systemIncludeDirs = makefile->GetSafeDefinition(
+ "CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
+ if (!systemIncludeDirs.empty())
+ {
+ std::vector<std::string> dirs;
+ cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
+ for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
+ dirIt != dirs.end();
++dirIt)
{
- fout <<" <Add directory=\"" << dirIt->c_str() << "\" />\n";
+ uniqIncludeDirs.insert(*dirIt);
}
+ }
- fout<<" </Compiler>\n";
+ for(std::set<std::string>::const_iterator dirIt=uniqIncludeDirs.begin();
+ dirIt != uniqIncludeDirs.end();
+ ++dirIt)
+ {
+ fout <<" <Add directory=\"" << dirIt->c_str() << "\" />\n";
}
- else // e.g. all and the GLOBAL and UTILITY targets
+
+ fout<<" </Compiler>\n";
+ }
+ else // e.g. all and the GLOBAL and UTILITY targets
{
fout<<" <Option working_dir=\""
<< makefile->GetStartOutputDirectory() << "\" />\n"
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 78a8704..96b8a09 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -462,18 +462,6 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
this->CreateLinksForTargets(fout);
}
- // I'm not sure this makes too much sense. There can be different
- // output directories in different subdirs, so we would need more of them.
-
- // for EXECUTABLE_OUTPUT_PATH when not in binary dir
- this->AppendOutLinkedResource(fout,
- mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"),
- mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"));
- // for LIBRARY_OUTPUT_PATH when not in binary dir
- this->AppendOutLinkedResource(fout,
- mf->GetSafeDefinition("CMAKE_LIBRARY_OUTPUT_DIRECTORY"),
- mf->GetSafeDefinition("LIBRARY_OUTPUT_PATH"));
-
fout << "\t</linkedResources>\n";
fout << "</projectDescription>\n";
@@ -610,6 +598,16 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
if (!inc->empty())
{
std::string dir = cmSystemTools::CollapseFullPath(inc->c_str());
+
+ // handle framework include dirs on OSX, the remainder after the
+ // Frameworks/ part has to be stripped
+ // /System/Library/Frameworks/GLUT.framework/Headers
+ cmsys::RegularExpression frameworkRx("(.+/Frameworks)/.+\\.framework/");
+ if(frameworkRx.find(dir.c_str()))
+ {
+ dir = frameworkRx.match(1);
+ }
+
if(emittedDirs.find(dir) == emittedDirs.end())
{
emittedDirs.insert(dir);
@@ -761,18 +759,6 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
excludeFromOut += "**/CMakeFiles/";
fout << "<pathentry excluding=\"" << excludeFromOut
<< "\" kind=\"out\" path=\"\"/>\n";
- // add output entry for EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH
- // - if it is a subdir of homeOutputDirectory, there is no need to add it
- // - if it is not then create a linked resource and add the linked name
- // but check it doesn't conflict with other linked resources names
- for (std::vector<std::string>::const_iterator
- it = this->OutLinkedResources.begin();
- it != this->OutLinkedResources.end();
- ++it)
- {
- fout << "<pathentry kind=\"out\" path=\"" << this->EscapeForXML(*it)
- << "\"/>\n";
- }
// add pre-processor definitions to allow eclipse to gray out sections
emmited.clear();
@@ -898,11 +884,18 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
it != this->GlobalGenerator->GetLocalGenerators().end();
++it)
{
- cmTargets & targets = (*it)->GetMakefile()->GetTargets();
- for (cmTargets::iterator l = targets.begin(); l != targets.end(); ++l)
+ cmGeneratorTargetsType targets = (*it)->GetMakefile()
+ ->GetGeneratorTargets();
+ for (cmGeneratorTargetsType::iterator l = targets.begin();
+ l != targets.end(); ++l)
{
+ if (l->first->IsImported())
+ {
+ continue;
+ }
std::vector<std::string> includeDirs;
- (*it)->GetIncludeDirectories(includeDirs, &l->second);
+ const char *config = mf->GetDefinition("CMAKE_BUILD_TYPE");
+ (*it)->GetIncludeDirectories(includeDirs, l->second, "C", config);
this->AppendIncludeDirectories(fout, includeDirs, emmited);
}
}
@@ -1317,51 +1310,3 @@ void cmExtraEclipseCDT4Generator
"\t\t</link>\n"
;
}
-
-bool cmExtraEclipseCDT4Generator
-::AppendOutLinkedResource(cmGeneratedFileStream& fout,
- const std::string& defname,
- const std::string& altdefname)
-{
- if (defname.empty() && altdefname.empty())
- {
- return false;
- }
-
- std::string outputPath = (defname.empty() ? altdefname : defname);
-
- if (!cmSystemTools::FileIsFullPath(outputPath.c_str()))
- {
- outputPath = this->HomeOutputDirectory + "/" + outputPath;
- }
- if (cmSystemTools::IsSubDirectory(outputPath.c_str(),
- this->HomeOutputDirectory.c_str()))
- {
- return false;
- }
-
- std::string name = this->GetPathBasename(outputPath);
-
- // make sure linked resource name is unique
- while (this->GlobalGenerator->GetProjectMap().find(name)
- != this->GlobalGenerator->GetProjectMap().end())
- {
- name += "_";
- }
-
- if (std::find(this->OutLinkedResources.begin(),
- this->OutLinkedResources.end(),
- name)
- != this->OutLinkedResources.end())
- {
- return false;
- }
- else
- {
- this->AppendLinkedResource(fout, name,
- this->GetEclipsePath(outputPath), LinkToFolder);
- this->OutLinkedResources.push_back(name);
- return true;
- }
-}
-
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index ebd8c08..37ce65e 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -93,10 +93,6 @@ private:
const std::string& path,
LinkType linkType);
- bool AppendOutLinkedResource(cmGeneratedFileStream& fout,
- const std::string& defname,
- const std::string& altdefname);
-
static void AppendIncludeDirectories(cmGeneratedFileStream& fout,
const std::vector<std::string>& includeDirs,
std::set<std::string>& emittedDirs);
@@ -109,7 +105,6 @@ private:
void CreateLinksForTargets(cmGeneratedFileStream& fout);
std::vector<std::string> SrcLinkedResources;
- std::vector<std::string> OutLinkedResources;
std::string HomeDirectory;
std::string HomeOutputDirectory;
bool IsOutOfSourceBuild;
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index 93533e5..a4aa75a 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -33,19 +33,19 @@ bool cmFLTKWrapUICommand
std::vector<std::string> newArgs;
this->Makefile->ExpandSourceListArguments(args,newArgs, 1);
-
- // get the list of GUI files from which .cxx and .h will be generated
+
+ // get the list of GUI files from which .cxx and .h will be generated
std::string outputDirectory = this->Makefile->GetCurrentOutputDirectory();
- // Some of the generated files are *.h so the directory "GUI"
+ // Some of the generated files are *.h so the directory "GUI"
// where they are created have to be added to the include path
this->Makefile->AddIncludeDirectory( outputDirectory.c_str() );
- for(std::vector<std::string>::iterator i = (newArgs.begin() + 1);
+ for(std::vector<std::string>::iterator i = (newArgs.begin() + 1);
i != newArgs.end(); i++)
{
cmSourceFile *curr = this->Makefile->GetSource(i->c_str());
- // if we should use the source GUI
+ // if we should use the source GUI
// to generate .cxx and .h files
if (!curr || !curr->GetPropertyAsBool("WRAP_EXCLUDE"))
{
@@ -107,11 +107,11 @@ bool cmFLTKWrapUICommand
std::string varName = this->Target;
varName += "_FLTK_UI_SRCS";
this->Makefile->AddDefinition(varName.c_str(), sourceListValue.c_str());
-
+
return true;
}
-void cmFLTKWrapUICommand::FinalPass()
+void cmFLTKWrapUICommand::FinalPass()
{
// people should add the srcs to the target themselves, but the old command
// didn't support that, so check and see if they added the files in and if
@@ -119,7 +119,7 @@ void cmFLTKWrapUICommand::FinalPass()
cmTarget* target = this->Makefile->FindTarget(this->Target.c_str());
if(!target)
{
- std::string msg =
+ std::string msg =
"FLTK_WRAP_UI was called with a target that was never created: ";
msg += this->Target;
msg +=". The problem was found while processing the source directory: ";
@@ -128,12 +128,12 @@ void cmFLTKWrapUICommand::FinalPass()
cmSystemTools::Message(msg.c_str(),"Warning");
return;
}
- std::vector<cmSourceFile*> const& srcs =
+ std::vector<cmSourceFile*> const& srcs =
target->GetSourceFiles();
bool found = false;
for (unsigned int i = 0; i < srcs.size(); ++i)
{
- if (srcs[i]->GetFullPath() ==
+ if (srcs[i]->GetFullPath() ==
this->GeneratedSourcesClasses[0]->GetFullPath())
{
found = true;
@@ -142,7 +142,7 @@ void cmFLTKWrapUICommand::FinalPass()
}
if (!found)
{
- std::string msg =
+ std::string msg =
"In CMake 2.2 the FLTK_WRAP_UI command sets a variable to the list of "
"source files that should be added to your executable or library. It "
"appears that you have not added these source files to your target. "
@@ -153,13 +153,13 @@ void cmFLTKWrapUICommand::FinalPass()
"of sources to add to your target when you call ADD_LIBRARY or "
"ADD_EXECUTABLE. For now CMake will add the sources to your target "
"for you as was done in CMake 2.0 and earlier. In the future this may "
- "become an error.";
+ "become an error.";
msg +="The problem was found while processing the source directory: ";
msg += this->Makefile->GetStartDirectory();
cmSystemTools::Message(msg.c_str(),"Warning");
// first we add the rules for all the .fl to .h and .cxx files
size_t lastHeadersClass = this->GeneratedSourcesClasses.size();
-
+
// Generate code for all the .fl files
for(size_t classNum = 0; classNum < lastHeadersClass; classNum++)
{
diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h
index cb0f9d5..530de2c 100644
--- a/Source/cmFLTKWrapUICommand.h
+++ b/Source/cmFLTKWrapUICommand.h
@@ -28,7 +28,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmFLTKWrapUICommand;
}
@@ -39,7 +39,7 @@ public:
*/
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
-
+
/**
* This is called at the end after all the information
* specified by the command is accumulated. Most commands do
@@ -61,7 +61,7 @@ public:
{
return "Create FLTK user interfaces Wrappers.";
}
-
+
/**
* More documentation.
*/
@@ -75,7 +75,7 @@ public:
"resultingLibraryName_FLTK_UI_SRCS which should be added to your "
"library.";
}
-
+
private:
/**
* List of produced files.
@@ -83,7 +83,7 @@ private:
std::vector<cmSourceFile *> GeneratedSourcesClasses;
/**
- * List of Fluid files that provide the source
+ * List of Fluid files that provide the source
* generating .cxx and .h files
*/
std::string Target;
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 5da5a01..8de24b3 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -10,6 +10,7 @@
See the License for more information.
============================================================================*/
#include "cmFileCommand.h"
+#include "cmCryptoHash.h"
#include "cmake.h"
#include "cmHexFileConverter.h"
#include "cmInstallType.h"
@@ -271,7 +272,7 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args)
// Open the specified file.
#if defined(_WIN32) || defined(__CYGWIN__)
- std::ifstream file(fileName.c_str(), std::ios::in |
+ std::ifstream file(fileName.c_str(), std::ios::in |
(hexOutputArg.IsEnabled() ? std::ios::binary : std::ios::in));
#else
std::ifstream file(fileName.c_str(), std::ios::in);
@@ -2621,17 +2622,17 @@ namespace {
::curl_easy_cleanup(this->Easy);
}
}
-
- inline void release(void)
+
+ inline void release(void)
{
this->Easy = 0;
return;
}
-
+
private:
::CURL * Easy;
};
-
+
}
#endif
@@ -2666,7 +2667,11 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
long inactivity_timeout = 0;
std::string verboseLog;
std::string statusVar;
- std::string expectedMD5sum;
+ bool tls_verify = this->Makefile->IsOn("CMAKE_TLS_VERIFY");
+ const char* cainfo = this->Makefile->GetDefinition("CMAKE_TLS_CAINFO");
+ std::string expectedHash;
+ std::string hashMatchMSG;
+ cmsys::auto_ptr<cmCryptoHash> hash;
bool showProgress = false;
while(i != args.end())
@@ -2717,6 +2722,32 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
}
statusVar = *i;
}
+ else if(*i == "TLS_VERIFY")
+ {
+ ++i;
+ if(i != args.end())
+ {
+ tls_verify = cmSystemTools::IsOn(i->c_str());
+ }
+ else
+ {
+ this->SetError("TLS_VERIFY missing bool value.");
+ return false;
+ }
+ }
+ else if(*i == "TLS_CAINFO")
+ {
+ ++i;
+ if(i != args.end())
+ {
+ cainfo = i->c_str();
+ }
+ else
+ {
+ this->SetError("TLS_CAFILE missing file value.");
+ return false;
+ }
+ }
else if(*i == "EXPECTED_MD5")
{
++i;
@@ -2725,48 +2756,68 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
this->SetError("DOWNLOAD missing sum value for EXPECTED_MD5.");
return false;
}
- expectedMD5sum = cmSystemTools::LowerCase(*i);
+ hash = cmsys::auto_ptr<cmCryptoHash>(cmCryptoHash::New("MD5"));
+ hashMatchMSG = "MD5 sum";
+ expectedHash = cmSystemTools::LowerCase(*i);
}
else if(*i == "SHOW_PROGRESS")
{
showProgress = true;
}
+ else if(*i == "EXPECTED_HASH")
+ {
+ ++i;
+ if(i == args.end())
+ {
+ this->SetError("DOWNLOAD missing ALGO=value for EXPECTED_HASH.");
+ return false;
+ }
+ std::string::size_type pos = i->find("=");
+ if(pos == std::string::npos)
+ {
+ std::string err =
+ "DOWNLOAD EXPECTED_HASH expects ALGO=value but got: ";
+ err += *i;
+ this->SetError(err.c_str());
+ return false;
+ }
+ std::string algo = i->substr(0, pos);
+ expectedHash = cmSystemTools::LowerCase(i->substr(pos+1));
+ hash = cmsys::auto_ptr<cmCryptoHash>(cmCryptoHash::New(algo.c_str()));
+ if(!hash.get())
+ {
+ std::string err = "DOWNLOAD EXPECTED_HASH given unknown ALGO: ";
+ err += algo;
+ this->SetError(err.c_str());
+ return false;
+ }
+ hashMatchMSG = algo + " hash";
+ }
++i;
}
-
- // If file exists already, and caller specified an expected md5 sum,
- // and the existing file already has the expected md5 sum, then simply
+ // If file exists already, and caller specified an expected md5 or sha,
+ // and the existing file already has the expected hash, then simply
// return.
//
- if(cmSystemTools::FileExists(file.c_str()) &&
- !expectedMD5sum.empty())
+ if(cmSystemTools::FileExists(file.c_str()) && hash.get())
{
- char computedMD5[32];
-
- if (!cmSystemTools::ComputeFileMD5(file.c_str(), computedMD5))
- {
- this->SetError("DOWNLOAD cannot compute MD5 sum on pre-existing file");
- return false;
- }
-
- std::string actualMD5sum = cmSystemTools::LowerCase(
- std::string(computedMD5, 32));
-
- if (expectedMD5sum == actualMD5sum)
+ std::string msg;
+ std::string actualHash = hash->HashFile(file.c_str());
+ if(actualHash == expectedHash)
{
+ msg = "returning early; file already exists with expected ";
+ msg += hashMatchMSG;
+ msg += "\"";
if(statusVar.size())
{
cmOStringStream result;
- result << (int)0 << ";\""
- "returning early: file already exists with expected MD5 sum\"";
+ result << (int)0 << ";\"" << msg;
this->Makefile->AddDefinition(statusVar.c_str(),
result.str().c_str());
}
-
return true;
}
}
-
// Make sure parent directory exists so we can write to the file
// as we receive downloaded bits from curl...
//
@@ -2798,7 +2849,6 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
}
cURLEasyGuard g_curl(curl);
-
::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
check_curl_result(res, "DOWNLOAD cannot set url: ");
@@ -2806,6 +2856,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
check_curl_result(res, "DOWNLOAD cannot set http failure option: ");
+ res = ::curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/" LIBCURL_VERSION);
+ check_curl_result(res, "DOWNLOAD cannot set user agent option: ");
+
res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
cmWriteToFileCallback);
check_curl_result(res, "DOWNLOAD cannot set write function: ");
@@ -2814,6 +2867,25 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
cmFileCommandCurlDebugCallback);
check_curl_result(res, "DOWNLOAD cannot set debug function: ");
+ // check to see if TLS verification is requested
+ if(tls_verify)
+ {
+ res = ::curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1);
+ check_curl_result(res, "Unable to set TLS/SSL Verify on: ");
+ }
+ else
+ {
+ res = ::curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
+ check_curl_result(res, "Unable to set TLS/SSL Verify off: ");
+ }
+ // check to see if a CAINFO file has been specified
+ // command arg comes first
+ if(cainfo && *cainfo)
+ {
+ res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cainfo);
+ check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
+ }
+
cmFileCommandVectorOfChar chunkDebug;
res = ::curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&fout);
@@ -2888,26 +2960,22 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
// Verify MD5 sum if requested:
//
- if (!expectedMD5sum.empty())
+ if (hash.get())
{
- char computedMD5[32];
-
- if (!cmSystemTools::ComputeFileMD5(file.c_str(), computedMD5))
+ std::string actualHash = hash->HashFile(file.c_str());
+ if (actualHash.size() == 0)
{
- this->SetError("DOWNLOAD cannot compute MD5 sum on downloaded file");
+ this->SetError("DOWNLOAD cannot compute hash on downloaded file");
return false;
}
- std::string actualMD5sum = cmSystemTools::LowerCase(
- std::string(computedMD5, 32));
-
- if (expectedMD5sum != actualMD5sum)
+ if (expectedHash != actualHash)
{
cmOStringStream oss;
- oss << "DOWNLOAD MD5 mismatch" << std::endl
+ oss << "DOWNLOAD HASH mismatch" << std::endl
<< " for file: [" << file << "]" << std::endl
- << " expected MD5 sum: [" << expectedMD5sum << "]" << std::endl
- << " actual MD5 sum: [" << actualMD5sum << "]" << std::endl
+ << " expected hash: [" << expectedHash << "]" << std::endl
+ << " actual hash: [" << actualHash << "]" << std::endl
;
this->SetError(oss.str().c_str());
return false;
diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h
index ced26c4..b4aa903 100644
--- a/Source/cmFileCommand.h
+++ b/Source/cmFileCommand.h
@@ -83,7 +83,8 @@ public:
" file(TO_NATIVE_PATH path result)\n"
" file(DOWNLOAD url file [INACTIVITY_TIMEOUT timeout]\n"
" [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS]\n"
- " [EXPECTED_MD5 sum])\n"
+ " [EXPECTED_HASH ALGO=value] [EXPECTED_MD5 sum]\n"
+ " [TLS_VERIFY on|off] [TLS_CAINFO file])\n"
" file(UPLOAD filename url [INACTIVITY_TIMEOUT timeout]\n"
" [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS])\n"
"WRITE will write a message into a file called 'filename'. It "
@@ -168,11 +169,21 @@ public:
"timeout after time seconds, time should be specified as an integer. "
"The INACTIVITY_TIMEOUT specifies an integer number of seconds of "
"inactivity after which the operation should terminate. "
- "If EXPECTED_MD5 sum is specified, the operation will verify that the "
- "downloaded file's actual md5 sum matches the expected value. If it "
- "does not match, the operation fails with an error. "
+ "If EXPECTED_HASH ALGO=value is specified, the operation will verify "
+ "that the downloaded file's actual hash matches the expected value, "
+ "where ALGO is one of MD5, SHA1, SHA224, SHA256, SHA384, or SHA512. "
+ "If it does not match, the operation fails with an error. "
+ "(\"EXPECTED_MD5 sum\" is short-hand for \"EXPECTED_HASH MD5=sum\".) "
"If SHOW_PROGRESS is specified, progress information will be printed "
- "as status messages until the operation is complete."
+ "as status messages until the operation is complete. "
+ "For https URLs CMake must be built with OpenSSL. "
+ "TLS/SSL certificates are not checked by default. "
+ "Set TLS_VERIFY to ON to check certificates and/or use "
+ "EXPECTED_HASH to verify downloaded content. "
+ "Set TLS_CAINFO to specify a custom Certificate Authority file. "
+ "If either TLS option is not given CMake will check variables "
+ "CMAKE_TLS_VERIFY and CMAKE_TLS_CAINFO, "
+ "respectively."
"\n"
"UPLOAD will upload the given file to the given URL. "
"If LOG var is specified a log of the upload will be put in var. "
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index b1050d3..3167be4 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -116,7 +116,7 @@ cmFileTimeComparison::~cmFileTimeComparison()
}
//----------------------------------------------------------------------------
-bool cmFileTimeComparison::FileTimeCompare(const char* f1,
+bool cmFileTimeComparison::FileTimeCompare(const char* f1,
const char* f2, int* result)
{
return this->Internals->FileTimeCompare(f1, f2, result);
@@ -129,7 +129,7 @@ bool cmFileTimeComparison::FileTimesDiffer(const char* f1, const char* f2)
}
//----------------------------------------------------------------------------
-int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
+int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
cmFileTimeComparison_Type* s2)
{
#if !defined(_WIN32) || defined(__CYGWIN__)
diff --git a/Source/cmFileTimeComparison.h b/Source/cmFileTimeComparison.h
index f5de2f6..cc1ef63 100644
--- a/Source/cmFileTimeComparison.h
+++ b/Source/cmFileTimeComparison.h
@@ -31,7 +31,7 @@ public:
* Compare file modification times.
* Return true for successful comparison and false for error.
* When true is returned, result has -1, 0, +1 for
- * f1 older, same, or newer than f2.
+ * f1 older, same, or newer than f2.
*/
bool FileTimeCompare(const char* f1, const char* f2, int* result);
@@ -42,7 +42,7 @@ public:
bool FileTimesDiffer(const char* f1, const char* f2);
protected:
-
+
cmFileTimeComparisonInternal* Internals;
};
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index fb8bcf7..a54bf7c 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -10,7 +10,7 @@
See the License for more information.
============================================================================*/
#include "cmFindBase.h"
-
+
cmFindBase::cmFindBase()
{
this->AlreadyInCache = false;
@@ -132,7 +132,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
bool compatibility = this->Makefile->NeedBackwardsCompatibility(2,3);
// copy argsIn into args so it can be modified,
- // in the process extract the DOC "documentation"
+ // in the process extract the DOC "documentation"
size_t size = argsIn.size();
std::vector<std::string> args;
bool foundDoc = false;
@@ -178,7 +178,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
this->AlreadyInCache = true;
return true;
}
- this->AlreadyInCache = false;
+ this->AlreadyInCache = false;
// Find the current root path mode.
this->SelectDefaultRootPathMode();
@@ -264,17 +264,17 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
}
else if(this->Names.size() == 1)
{
- this->VariableDocumentation += "the "
+ this->VariableDocumentation += "the "
+ this->Names[0] + " library be found";
}
else
- {
+ {
this->VariableDocumentation += "one of the " + this->Names[0];
for (unsigned int j = 1; j < this->Names.size() - 1; ++j)
{
this->VariableDocumentation += ", " + this->Names[j];
}
- this->VariableDocumentation += " or "
+ this->VariableDocumentation += " or "
+ this->Names[this->Names.size() - 1] + " libraries be found";
}
}
@@ -504,7 +504,7 @@ void cmFindBase::AddPathSuffixes()
cmSystemTools::ConvertToUnixSlashes(*i);
// copy each finalPath combined with SearchPathSuffixes
// to the SearchPaths ivar
- for(std::vector<std::string>::iterator j =
+ for(std::vector<std::string>::iterator j =
this->SearchPathSuffixes.begin();
j != this->SearchPathSuffixes.end(); ++j)
{
@@ -517,7 +517,7 @@ void cmFindBase::AddPathSuffixes()
p += std::string("/");
}
p += *j;
- // add to all paths because the search path may be modified
+ // add to all paths because the search path may be modified
// later with lib being replaced for lib64 which may exist
paths.push_back(p);
}
@@ -535,13 +535,13 @@ void cmFindBase::PrintFindStuff()
std::cerr << "SearchAppBundleOnly: " << this->SearchAppBundleOnly << "\n";
std::cerr << "SearchAppBundleFirst: " << this->SearchAppBundleFirst << "\n";
std::cerr << "VariableName " << this->VariableName << "\n";
- std::cerr << "VariableDocumentation "
+ std::cerr << "VariableDocumentation "
<< this->VariableDocumentation << "\n";
std::cerr << "NoDefaultPath " << this->NoDefaultPath << "\n";
- std::cerr << "NoCMakeEnvironmentPath "
+ std::cerr << "NoCMakeEnvironmentPath "
<< this->NoCMakeEnvironmentPath << "\n";
std::cerr << "NoCMakePath " << this->NoCMakePath << "\n";
- std::cerr << "NoSystemEnvironmentPath "
+ std::cerr << "NoSystemEnvironmentPath "
<< this->NoSystemEnvironmentPath << "\n";
std::cerr << "NoCMakeSystemPath " << this->NoCMakeSystemPath << "\n";
std::cerr << "EnvironmentPath " << this->EnvironmentPath << "\n";
diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h
index 37ab2ec..eac1885 100644
--- a/Source/cmFindBase.h
+++ b/Source/cmFindBase.h
@@ -30,7 +30,7 @@ public:
*/
virtual bool ParseArguments(std::vector<std::string> const& args);
cmTypeMacro(cmFindBase, cmFindCommon);
-
+
virtual const char* GetFullDocumentation() const;
protected:
@@ -43,7 +43,7 @@ protected:
// also copy the documentation from the cache to VariableDocumentation
// if it has documentation in the cache
bool CheckForVariableInCache();
-
+
cmStdString GenericDocumentation;
// use by command during find
cmStdString VariableDocumentation;
diff --git a/Source/cmFindFileCommand.h b/Source/cmFindFileCommand.h
index 7d349d3..1bfdcbd 100644
--- a/Source/cmFindFileCommand.h
+++ b/Source/cmFindFileCommand.h
@@ -18,7 +18,7 @@
* \brief Define a command to search for an executable program.
*
* cmFindFileCommand is used to define a CMake variable
- * that specifies an executable program. The command searches
+ * that specifies an executable program. The command searches
* in the current path (e.g., PATH environment variable) for
* an executable that matches one of the supplied names.
*/
@@ -29,7 +29,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmFindFileCommand;
}
@@ -42,7 +42,7 @@ public:
{
return "Find the full path to a file.";
}
-
+
cmTypeMacro(cmFindFileCommand, cmFindPathCommand);
protected:
virtual void GenerateDocumentation();
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 6cdbbf2..0080e55 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -15,7 +15,7 @@
#include <cmsys/stl/algorithm>
cmFindLibraryCommand::cmFindLibraryCommand()
-{
+{
this->EnvironmentPath = "LIB";
}
@@ -105,7 +105,10 @@ bool cmFindLibraryCommand
->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS"))
{
// add special 64 bit paths if this is a 64 bit compile.
- this->AddLib64Paths();
+ if(this->Makefile->PlatformIs64Bit())
+ {
+ this->AddArchitecturePaths("64");
+ }
}
std::string library = this->FindLibrary();
@@ -129,90 +132,55 @@ bool cmFindLibraryCommand
//----------------------------------------------------------------------------
void cmFindLibraryCommand::AddArchitecturePaths(const char* suffix)
{
- std::vector<std::string> newPaths;
- bool found = false;
- std::string subpath = "lib";
- subpath += suffix;
- subpath += "/";
- for(std::vector<std::string>::iterator i = this->SearchPaths.begin();
- i != this->SearchPaths.end(); ++i)
+ std::vector<std::string> original;
+ original.swap(this->SearchPaths);
+ for(std::vector<std::string>::iterator i = original.begin();
+ i != original.end(); ++i)
{
- // Try replacing lib/ with lib<suffix>/
- std::string s = *i;
- cmSystemTools::ReplaceString(s, "lib/", subpath.c_str());
- if((s != *i) && cmSystemTools::FileIsDirectory(s.c_str()))
- {
- found = true;
- newPaths.push_back(s);
- }
+ this->AddArchitecturePath(*i, 0, suffix);
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmFindLibraryCommand::AddArchitecturePath(
+ std::string const& dir, std::string::size_type start_pos,
+ const char* suffix, bool fresh)
+{
+ std::string::size_type pos = dir.find("lib/", start_pos);
+ if(pos != std::string::npos)
+ {
+ std::string cur_dir = dir.substr(0,pos+3);
- // Now look for lib<suffix>
- s = *i;
- s += suffix;
- if(cmSystemTools::FileIsDirectory(s.c_str()))
+ // Follow "lib<suffix>".
+ std::string next_dir = cur_dir + suffix;
+ if(cmSystemTools::FileIsDirectory(next_dir.c_str()))
{
- found = true;
- newPaths.push_back(s);
+ next_dir += dir.substr(pos+3);
+ std::string::size_type next_pos = pos+3+strlen(suffix)+1;
+ this->AddArchitecturePath(next_dir, next_pos, suffix);
}
- // now add the original unchanged path
- if(cmSystemTools::FileIsDirectory(i->c_str()))
+
+ // Follow "lib".
+ if(cmSystemTools::FileIsDirectory(cur_dir.c_str()))
{
- newPaths.push_back(*i);
+ this->AddArchitecturePath(dir, pos+3+1, suffix, false);
}
}
-
- // If any new paths were found replace the original set.
- if(found)
- {
- this->SearchPaths = newPaths;
- }
-}
-
-void cmFindLibraryCommand::AddLib64Paths()
-{
- std::string voidsize =
- this->Makefile->GetSafeDefinition("CMAKE_SIZEOF_VOID_P");
- int size = atoi(voidsize.c_str());
- if(size != 8)
- {
- return;
- }
- std::vector<std::string> path64;
- bool found64 = false;
- for(std::vector<std::string>::iterator i = this->SearchPaths.begin();
- i != this->SearchPaths.end(); ++i)
+ if(fresh)
{
- std::string s = *i;
- std::string s2 = *i;
- cmSystemTools::ReplaceString(s, "lib/", "lib64/");
- // try to replace lib with lib64 and see if it is there,
- // then prepend it to the path
- // Note that all paths have trailing slashes.
- if((s != *i) && cmSystemTools::FileIsDirectory(s.c_str()))
- {
- path64.push_back(s);
- found64 = true;
- }
- // now just add a 64 to the path name and if it is there,
- // add it to the path
- s2 += "64/";
- if(cmSystemTools::FileIsDirectory(s2.c_str()))
+ // Check for <dir><suffix>/.
+ std::string cur_dir = dir + suffix + "/";
+ if(cmSystemTools::FileIsDirectory(cur_dir.c_str()))
{
- found64 = true;
- path64.push_back(s2);
- }
- // now add the original unchanged path
- if(cmSystemTools::FileIsDirectory(i->c_str()))
+ this->SearchPaths.push_back(cur_dir);
+ }
+
+ // Now add the original unchanged path
+ if(cmSystemTools::FileIsDirectory(dir.c_str()))
{
- path64.push_back(*i);
+ this->SearchPaths.push_back(dir);
}
}
- // now replace the SearchPaths with the 64 bit converted path
- // if any 64 bit paths were discovered
- if(found64)
- {
- this->SearchPaths = path64;
- }
}
//----------------------------------------------------------------------------
diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h
index b880be2..455348a 100644
--- a/Source/cmFindLibraryCommand.h
+++ b/Source/cmFindLibraryCommand.h
@@ -29,7 +29,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmFindLibraryCommand;
}
@@ -59,10 +59,13 @@ public:
return "Find a library.";
}
cmTypeMacro(cmFindLibraryCommand, cmFindBase);
-
+
protected:
void AddArchitecturePaths(const char* suffix);
- void AddLib64Paths();
+ void AddArchitecturePath(std::string const& dir,
+ std::string::size_type start_pos,
+ const char* suffix,
+ bool fresh = true);
std::string FindLibrary();
virtual void GenerateDocumentation();
private:
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index be47f95..470ceca 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -840,6 +840,8 @@ bool cmFindPackageCommand
//----------------------------------------------------------------------------
void cmFindPackageCommand::SetModuleVariables(const std::string& components)
{
+ this->AddFindDefinition("CMAKE_FIND_PACKAGE_NAME", this->Name.c_str());
+
// Store the list of components.
std::string components_var = this->Name + "_FIND_COMPONENTS";
this->AddFindDefinition(components_var.c_str(), components.c_str());
@@ -1016,6 +1018,9 @@ bool cmFindPackageCommand::HandlePackageMode()
std::string foundVar = this->Name;
foundVar += "_FOUND";
+ std::string notFoundMessageVar = this->Name;
+ notFoundMessageVar += "_NOT_FOUND_MESSAGE";
+ std::string notFoundMessage;
// If the directory for the config file was found, try to read the file.
bool result = true;
@@ -1033,6 +1038,7 @@ bool cmFindPackageCommand::HandlePackageMode()
// has set Foo_FOUND to FALSE itself:
this->Makefile->RemoveDefinition(foundVar.c_str());
}
+ this->Makefile->RemoveDefinition(notFoundMessageVar.c_str());
// Set the version variables before loading the config file.
// It may override them.
@@ -1051,6 +1057,8 @@ bool cmFindPackageCommand::HandlePackageMode()
// we get here if the Config file has set Foo_FOUND actively to FALSE
found = false;
configFileSetFOUNDFalse = true;
+ notFoundMessage = this->Makefile->GetSafeDefinition(
+ notFoundMessageVar.c_str());
}
}
else
@@ -1071,6 +1079,10 @@ bool cmFindPackageCommand::HandlePackageMode()
" " << this->FileFound << "\n"
"but it set " << foundVar << " to FALSE so package \"" <<
this->Name << "\" is considered to be NOT FOUND.";
+ if (!notFoundMessage.empty())
+ {
+ e << " Reason given by package: \n" << notFoundMessage << "\n";
+ }
}
// If there are files in ConsideredConfigs, it means that FooConfig.cmake
// have been found, but they didn't have appropriate versions.
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx
index 846d187..9524924 100644
--- a/Source/cmFindPathCommand.cxx
+++ b/Source/cmFindPathCommand.cxx
@@ -104,7 +104,7 @@ bool cmFindPathCommand
(this->VariableName.c_str(),
(this->VariableName + "-NOTFOUND").c_str(),
this->VariableDocumentation.c_str(),
- (this->IncludeFileInPath) ?
+ (this->IncludeFileInPath) ?
cmCacheManager::FILEPATH :cmCacheManager::PATH);
return true;
}
@@ -143,14 +143,14 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file,
// remove the name from the slash;
fileName = fileName.substr(pos+1);
frameWorkName = file;
- frameWorkName =
+ frameWorkName =
frameWorkName.substr(0, frameWorkName.size()-fileName.size()-1);
// if the framework has a path in it then just use the filename
if(frameWorkName.find("/") != frameWorkName.npos)
{
fileName = file;
frameWorkName = "";
- }
+ }
if(frameWorkName.size())
{
std::string fpath = dir;
@@ -160,7 +160,7 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file,
intPath += "/Headers/";
intPath += fileName;
if(cmSystemTools::FileExists(intPath.c_str()))
- {
+ {
if(this->IncludeFileInPath)
{
return intPath;
diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h
index a612990..759567d 100644
--- a/Source/cmFindPathCommand.h
+++ b/Source/cmFindPathCommand.h
@@ -29,7 +29,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmFindPathCommand;
}
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index 00f5419..909b333 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -81,7 +81,7 @@ bool cmFindProgramCommand
result.c_str(),
this->VariableDocumentation.c_str(),
cmCacheManager::FILEPATH);
-
+
return true;
}
this->Makefile->AddCacheDefinition(this->VariableName.c_str(),
@@ -117,21 +117,21 @@ std::string cmFindProgramCommand
for(std::vector<std::string>::const_iterator name = names.begin();
name != names.end() ; ++name)
{
-
+
std::string appName = *name + std::string(".app");
- std::string appPath = cmSystemTools::FindDirectory(appName.c_str(),
- this->SearchPaths,
+ std::string appPath = cmSystemTools::FindDirectory(appName.c_str(),
+ this->SearchPaths,
true);
if ( !appPath.empty() )
{
std::string executable = GetBundleExecutable(appPath);
- if (!executable.empty())
+ if (!executable.empty())
{
return cmSystemTools::CollapseFullPath(executable.c_str());
}
- }
- }
+ }
+ }
// Couldn't find app bundle
return "";
@@ -142,44 +142,44 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
std::string executable = "";
(void)bundlePath;
#if defined(__APPLE__)
- // Started with an example on developer.apple.com about finding bundles
+ // Started with an example on developer.apple.com about finding bundles
// and modified from that.
-
+
// Get a CFString of the app bundle path
// XXX - Is it safe to assume everything is in UTF8?
- CFStringRef bundlePathCFS =
- CFStringCreateWithCString(kCFAllocatorDefault ,
+ CFStringRef bundlePathCFS =
+ CFStringCreateWithCString(kCFAllocatorDefault ,
bundlePath.c_str(), kCFStringEncodingUTF8 );
-
+
// Make a CFURLRef from the CFString representation of the
// bundle’s path.
- CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
+ CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
bundlePathCFS,
kCFURLPOSIXPathStyle,
true );
-
+
// Make a bundle instance using the URLRef.
CFBundleRef appBundle = CFBundleCreate( kCFAllocatorDefault, bundleURL );
-
+
// returned executableURL is relative to <appbundle>/Contents/MacOS/
CFURLRef executableURL = CFBundleCopyExecutableURL(appBundle);
-
+
if (executableURL != NULL)
{
const int MAX_OSX_PATH_SIZE = 1024;
char buffer[MAX_OSX_PATH_SIZE];
-
+
// Convert the CFString to a C string
- CFStringGetCString( CFURLGetString(executableURL), buffer,
+ CFStringGetCString( CFURLGetString(executableURL), buffer,
MAX_OSX_PATH_SIZE, kCFStringEncodingUTF8 );
-
+
// And finally to a c++ string
executable = bundlePath + "/Contents/MacOS/" + std::string(buffer);
// Only release CFURLRef if it's not null
CFRelease( executableURL );
}
- // Any CF objects returned from functions with "create" or
+ // Any CF objects returned from functions with "create" or
// "copy" in their names must be released by us!
CFRelease( bundlePathCFS );
CFRelease( bundleURL );
diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h
index c1b14f9..8350c9b 100644
--- a/Source/cmFindProgramCommand.h
+++ b/Source/cmFindProgramCommand.h
@@ -18,7 +18,7 @@
* \brief Define a command to search for an executable program.
*
* cmFindProgramCommand is used to define a CMake variable
- * that specifies an executable program. The command searches
+ * that specifies an executable program. The command searches
* in the current path (e.g., PATH environment variable) for
* an executable that matches one of the supplied names.
*/
@@ -28,7 +28,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmFindProgramCommand;
}
@@ -57,7 +57,7 @@ public:
{
return "Find an executable program.";
}
-
+
cmTypeMacro(cmFindProgramCommand, cmFindBase);
protected:
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 74966c9..d697067 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -25,7 +25,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
else if (!cmSystemTools::Strucmp(lff.Name.c_str(),"endforeach"))
{
// if this is the endofreach for this statement
- if (!this->Depth)
+ if (!this->Depth)
{
// Remove the function blocker for this scope or bail.
cmsys::auto_ptr<cmFunctionBlocker>
@@ -45,7 +45,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
std::string tmps;
cmListFileArgument arg;
for( ; j != this->Args.end(); ++j)
- {
+ {
// set the variable to the loop value
mf.AddDefinition(this->Args[0].c_str(),j->c_str());
// Invoke all the functions that were collected in the block.
@@ -83,10 +83,10 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
this->Depth--;
}
}
-
+
// record the command
this->Functions.push_back(lff);
-
+
// always return true
return true;
}
@@ -121,7 +121,7 @@ bool cmForEachCommand
{
return this->HandleInMode(args);
}
-
+
// create a function blocker
cmForEachFunctionBlocker *f = new cmForEachFunctionBlocker();
if ( args.size() > 1 )
@@ -157,7 +157,7 @@ bool cmForEachCommand
step = 1;
}
}
- if (
+ if (
(start > stop && step > 0) ||
(start < stop && step < 0) ||
step == 0
@@ -198,7 +198,7 @@ bool cmForEachCommand
f->Args = args;
}
this->Makefile->AddFunctionBlocker(f);
-
+
return true;
}
diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h
index ae50005..dc47613 100644
--- a/Source/cmForEachCommand.h
+++ b/Source/cmForEachCommand.h
@@ -25,7 +25,7 @@ public:
cmMakefile &mf,
cmExecutionStatus &);
virtual bool ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf);
-
+
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
private:
@@ -39,7 +39,7 @@ public:
/**
* This is a virtual constructor for the command.
*/
- virtual cmCommand* Clone()
+ virtual cmCommand* Clone()
{
return new cmForEachCommand;
}
@@ -68,7 +68,7 @@ public:
{
return "Evaluate a group of commands for each value in a list.";
}
-
+
/**
* More documentation.
*/
@@ -106,7 +106,7 @@ public:
"following it in the iteration."
;
}
-
+
cmTypeMacro(cmForEachCommand, cmCommand);
private:
bool HandleInMode(std::vector<std::string> const& args);
diff --git a/Source/cmFunctionBlocker.h b/Source/cmFunctionBlocker.h
index 9ee0b5c..68bf762 100644
--- a/Source/cmFunctionBlocker.h
+++ b/Source/cmFunctionBlocker.h
@@ -29,7 +29,7 @@ public:
/**
* should this function blocker be removed, useful when one function adds a
- * blocker and another must remove it
+ * blocker and another must remove it
*/
virtual bool ShouldRemove(const cmListFileFunction&,
cmMakefile&) {return false;}
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index ce36145..10b47b9 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -65,7 +65,7 @@ public:
* The name of the command as specified in CMakeList.txt.
*/
virtual const char* GetName() const { return this->Args[0].c_str(); }
-
+
/**
* Succinct documentation.
*/
@@ -131,15 +131,15 @@ bool cmFunctionHelperCommand::InvokeInitialPass
{
cmOStringStream tmpStream;
tmpStream << "ARGV" << t;
- this->Makefile->AddDefinition(tmpStream.str().c_str(),
+ this->Makefile->AddDefinition(tmpStream.str().c_str(),
expandedArgs[t].c_str());
this->Makefile->MarkVariableAsUsed(tmpStream.str().c_str());
}
-
+
// define the formal arguments
for (unsigned int j = 1; j < this->Args.size(); ++j)
{
- this->Makefile->AddDefinition(this->Args[j].c_str(),
+ this->Makefile->AddDefinition(this->Args[j].c_str(),
expandedArgs[j-1].c_str());
}
@@ -208,7 +208,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
else if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endfunction"))
{
// if this is the endfunction for this function then execute
- if (!this->Depth)
+ if (!this->Depth)
{
std::string name = this->Args[0];
std::vector<std::string>::size_type cc;
@@ -224,20 +224,20 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
f->Args = this->Args;
f->Functions = this->Functions;
mf.RecordPolicies(f->Policies);
-
+
// Set the FilePath on the arguments to match the function since it is
// not stored and the original values may be freed
for (unsigned int i = 0; i < f->Functions.size(); ++i)
{
for (unsigned int j = 0; j < f->Functions[i].Arguments.size(); ++j)
{
- f->Functions[i].Arguments[j].FilePath =
+ f->Functions[i].Arguments[j].FilePath =
f->Functions[i].FilePath.c_str();
}
}
std::string newName = "_" + this->Args[0];
- mf.GetCMakeInstance()->RenameCommand(this->Args[0].c_str(),
+ mf.GetCMakeInstance()->RenameCommand(this->Args[0].c_str(),
newName.c_str());
mf.AddCommand(f);
@@ -265,7 +265,7 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf)
if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endfunction"))
{
std::vector<std::string> expandedArguments;
- mf.ExpandArguments(lff.Arguments, expandedArguments);
+ mf.ExpandArguments(lff.Arguments, expandedArguments);
// if the endfunction has arguments then make sure
// they match the ones in the openeing function command
if ((expandedArguments.empty() ||
@@ -291,7 +291,7 @@ bool cmFunctionCommand
cmFunctionFunctionBlocker *f = new cmFunctionFunctionBlocker();
for(std::vector<std::string>::const_iterator j = args.begin();
j != args.end(); ++j)
- {
+ {
f->Args.push_back(*j);
}
this->Makefile->AddFunctionBlocker(f);
diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h
index 43c8e29..730a7a7 100644
--- a/Source/cmFunctionCommand.h
+++ b/Source/cmFunctionCommand.h
@@ -20,11 +20,11 @@ class cmFunctionFunctionBlocker : public cmFunctionBlocker
public:
cmFunctionFunctionBlocker() {this->Depth=0;}
virtual ~cmFunctionFunctionBlocker() {}
- virtual bool IsFunctionBlocked(const cmListFileFunction&,
+ virtual bool IsFunctionBlocked(const cmListFileFunction&,
cmMakefile &mf,
cmExecutionStatus &);
virtual bool ShouldRemove(const cmListFileFunction&, cmMakefile &mf);
-
+
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
int Depth;
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index 1a391ed..0af0753 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -31,7 +31,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(const char* name, bool quiet):
// Check if the file opened.
if(!*this && !quiet)
{
- cmSystemTools::Error("Cannot open file for write: ",
+ cmSystemTools::Error("Cannot open file for write: ",
this->TempName.c_str());
cmSystemTools::ReportLastSystemError("");
}
@@ -58,7 +58,7 @@ cmGeneratedFileStream::Open(const char* name, bool quiet, bool binaryFlag)
// Open the temporary output file.
if ( binaryFlag )
{
- this->Stream::open(this->TempName.c_str(),
+ this->Stream::open(this->TempName.c_str(),
std::ios::out | std::ios::binary);
}
else
@@ -69,7 +69,7 @@ cmGeneratedFileStream::Open(const char* name, bool quiet, bool binaryFlag)
// Check if the file opened.
if(!*this && !quiet)
{
- cmSystemTools::Error("Cannot open file for write: ",
+ cmSystemTools::Error("Cannot open file for write: ",
this->TempName.c_str());
cmSystemTools::ReportLastSystemError("");
}
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index f88ab0b..7d8df37 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -13,181 +13,168 @@
#include "cmMakefile.h"
#include "cmTarget.h"
+#include "assert.h"
+
+#include <cmsys/String.h>
+
+#include "cmGeneratorExpressionEvaluator.h"
+#include "cmGeneratorExpressionLexer.h"
+#include "cmGeneratorExpressionParser.h"
+#include "cmGeneratorExpressionDAGChecker.h"
//----------------------------------------------------------------------------
cmGeneratorExpression::cmGeneratorExpression(
- cmMakefile* mf, const char* config,
- cmListFileBacktrace const& backtrace, bool quiet):
- Makefile(mf), Config(config), Backtrace(backtrace), Quiet(quiet)
+ cmListFileBacktrace const& backtrace):
+ Backtrace(backtrace), CompiledExpression(0)
{
- this->TargetInfo.compile("^\\$<TARGET"
- "(|_SONAME|_LINKER)" // File with what purpose?
- "_FILE(|_NAME|_DIR):" // Filename component.
- "([A-Za-z0-9_.-]+)" // Target name.
- ">$");
}
//----------------------------------------------------------------------------
-const char* cmGeneratorExpression::Process(std::string const& input)
+const cmCompiledGeneratorExpression &
+cmGeneratorExpression::Parse(std::string const& input)
{
- return this->Process(input.c_str());
+ return this->Parse(input.c_str());
}
//----------------------------------------------------------------------------
-const char* cmGeneratorExpression::Process(const char* input)
+const cmCompiledGeneratorExpression &
+cmGeneratorExpression::Parse(const char* input)
{
- this->Data.clear();
+ cmGeneratorExpressionLexer l;
+ std::vector<cmGeneratorExpressionToken> tokens = l.Tokenize(input);
+ bool needsParsing = l.GetSawGeneratorExpression();
+ std::vector<cmGeneratorExpressionEvaluator*> evaluators;
- // We construct and evaluate expressions directly in the output
- // buffer. Each expression is replaced by its own output value
- // after evaluation. A stack of barriers records the starting
- // indices of open (pending) expressions.
- for(const char* c = input; *c; ++c)
+ if (needsParsing)
{
- if(c[0] == '$' && c[1] == '<')
- {
- this->Barriers.push(this->Data.size());
- this->Data.push_back('$');
- this->Data.push_back('<');
- c += 1;
- }
- else if(c[0] == '>' && !this->Barriers.empty())
- {
- this->Data.push_back('>');
- if(!this->Evaluate()) { break; }
- this->Barriers.pop();
- }
- else
- {
- this->Data.push_back(c[0]);
- }
+ cmGeneratorExpressionParser p(tokens);
+ p.Parse(evaluators);
}
- // Return a null-terminated output value.
- this->Data.push_back('\0');
- return &*this->Data.begin();
+ delete this->CompiledExpression;
+ this->CompiledExpression = new cmCompiledGeneratorExpression(
+ this->Backtrace,
+ evaluators,
+ input,
+ needsParsing);
+ return *this->CompiledExpression;
}
-//----------------------------------------------------------------------------
-bool cmGeneratorExpression::Evaluate()
+cmGeneratorExpression::~cmGeneratorExpression()
{
- // The top-most barrier points at the beginning of the expression.
- size_t barrier = this->Barriers.top();
-
- // Construct a null-terminated representation of the expression.
- this->Data.push_back('\0');
- const char* expr = &*(this->Data.begin()+barrier);
-
- // Evaluate the expression.
- std::string result;
- if(this->Evaluate(expr, result))
- {
- // Success. Replace the expression with its evaluation result.
- this->Data.erase(this->Data.begin()+barrier, this->Data.end());
- this->Data.insert(this->Data.end(), result.begin(), result.end());
- return true;
- }
- else if(!this->Quiet)
- {
- // Failure. Report the error message.
- cmOStringStream e;
- e << "Error evaluating generator expression:\n"
- << " " << expr << "\n"
- << result;
- this->Makefile->GetCMakeInstance()
- ->IssueMessage(cmake::FATAL_ERROR, e.str().c_str(),
- this->Backtrace);
- return false;
- }
- return true;
+ delete this->CompiledExpression;
}
//----------------------------------------------------------------------------
-bool cmGeneratorExpression::Evaluate(const char* expr, std::string& result)
+const char *cmCompiledGeneratorExpression::Evaluate(
+ cmMakefile* mf, const char* config, bool quiet,
+ cmGeneratorTarget *target,
+ cmGeneratorExpressionDAGChecker *dagChecker) const
{
- if(this->TargetInfo.find(expr))
- {
- if(!this->EvaluateTargetInfo(result))
- {
- return false;
- }
- }
- else if(strcmp(expr, "$<CONFIGURATION>") == 0)
+ if (!this->NeedsParsing)
{
- result = this->Config? this->Config : "";
+ return this->Input;
}
- else
+
+ this->Output = "";
+
+ std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it
+ = this->Evaluators.begin();
+ const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end
+ = this->Evaluators.end();
+
+ cmGeneratorExpressionContext context;
+ context.Makefile = mf;
+ context.Config = config;
+ context.Quiet = quiet;
+ context.HadError = false;
+ context.Target = target;
+ context.Backtrace = this->Backtrace;
+
+ for ( ; it != end; ++it)
{
- result = "Expression syntax not recognized.";
- return false;
+ this->Output += (*it)->Evaluate(&context, dagChecker);
+ if (context.HadError)
+ {
+ this->Output = "";
+ break;
+ }
}
- return true;
+
+ this->Targets = context.Targets;
+ // TODO: Return a std::string from here instead?
+ return this->Output.c_str();
}
+cmCompiledGeneratorExpression::cmCompiledGeneratorExpression(
+ cmListFileBacktrace const& backtrace,
+ const std::vector<cmGeneratorExpressionEvaluator*> &evaluators,
+ const char *input, bool needsParsing)
+ : Backtrace(backtrace), Evaluators(evaluators), Input(input),
+ NeedsParsing(needsParsing)
+{
+
+}
+
+
//----------------------------------------------------------------------------
-bool cmGeneratorExpression::EvaluateTargetInfo(std::string& result)
+cmCompiledGeneratorExpression::~cmCompiledGeneratorExpression()
{
- // Lookup the referenced target.
- std::string name = this->TargetInfo.match(3);
- cmTarget* target = this->Makefile->FindTargetToUse(name.c_str());
- if(!target)
- {
- result = "No target \"" + name + "\"";
- return false;
- }
- if(target->GetType() >= cmTarget::UTILITY &&
- target->GetType() != cmTarget::UNKNOWN_LIBRARY)
- {
- result = "Target \"" + name + "\" is not an executable or library.";
- return false;
- }
- this->Targets.insert(target);
+ std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it
+ = this->Evaluators.begin();
+ const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end
+ = this->Evaluators.end();
- // Lookup the target file with the given purpose.
- std::string purpose = this->TargetInfo.match(1);
- if(purpose == "")
+ for ( ; it != end; ++it)
{
- // The target implementation file (.so.1.2, .dll, .exe, .a).
- result = target->GetFullPath(this->Config, false, true);
+ delete *it;
}
- else if(purpose == "_LINKER")
- {
- // The file used to link to the target (.so, .lib, .a).
- if(!target->IsLinkable())
- {
- result = ("TARGET_LINKER_FILE is allowed only for libraries and "
- "executables with ENABLE_EXPORTS.");
- return false;
- }
- result = target->GetFullPath(this->Config, target->HasImportLibrary());
- }
- else if(purpose == "_SONAME")
+}
+
+std::string cmGeneratorExpression::Preprocess(const std::string &input,
+ PreprocessContext context)
+{
+ if (context != StripAllGeneratorExpressions)
+ {
+ assert(!"cmGeneratorExpression::Preprocess called with invalid args");
+ return std::string();
+ }
+
+ std::string result;
+ std::string::size_type pos = 0;
+ std::string::size_type lastPos = pos;
+ while((pos = input.find("$<", lastPos)) != input.npos)
{
- // The target soname file (.so.1).
- if(target->IsDLLPlatform())
+ result += input.substr(lastPos, pos - lastPos);
+ pos += 2;
+ int nestingLevel = 1;
+ const char *c = input.c_str() + pos;
+ const char * const cStart = c;
+ for ( ; *c; ++c)
{
- result = "TARGET_SONAME_FILE is not allowed for DLL target platforms.";
- return false;
+ if(c[0] == '$' && c[1] == '<')
+ {
+ ++nestingLevel;
+ ++c;
+ continue;
+ }
+ if(c[0] == '>')
+ {
+ --nestingLevel;
+ if (nestingLevel == 0)
+ {
+ break;
+ }
+ }
}
- if(target->GetType() != cmTarget::SHARED_LIBRARY)
+ const std::string::size_type traversed = (c - cStart) + 1;
+ if (!*c)
{
- result = "TARGET_SONAME_FILE is allowed only for SHARED libraries.";
- return false;
+ result += "$<" + input.substr(pos, traversed);
}
- result = target->GetDirectory(this->Config);
- result += "/";
- result += target->GetSOName(this->Config);
- }
-
- // Extract the requested portion of the full path.
- std::string part = this->TargetInfo.match(2);
- if(part == "_NAME")
- {
- result = cmSystemTools::GetFilenameName(result);
- }
- else if(part == "_DIR")
- {
- result = cmSystemTools::GetFilenamePath(result);
+ pos += traversed;
+ lastPos = pos;
}
- return true;
+ result += input.substr(lastPos);
+ return result;
}
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 1a9d4c6..29d3f44 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -9,6 +9,10 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
+
+#ifndef cmGeneratorExpression_h
+#define cmGeneratorExpression_h
+
#include "cmStandardIncludes.h"
#include <stack>
@@ -16,9 +20,15 @@
#include <cmsys/RegularExpression.hxx>
class cmTarget;
+class cmGeneratorTarget;
class cmMakefile;
class cmListFileBacktrace;
+struct cmGeneratorExpressionEvaluator;
+struct cmGeneratorExpressionDAGChecker;
+
+class cmCompiledGeneratorExpression;
+
/** \class cmGeneratorExpression
* \brief Evaluate generate-time query expression syntax.
*
@@ -31,28 +41,59 @@ class cmListFileBacktrace;
class cmGeneratorExpression
{
public:
- /** Construct with an evaluation context and configuration. */
- cmGeneratorExpression(cmMakefile* mf, const char* config,
- cmListFileBacktrace const& backtrace,
- bool quiet = false);
+ /** Construct. */
+ cmGeneratorExpression(cmListFileBacktrace const& backtrace);
+ ~cmGeneratorExpression();
+
+ const cmCompiledGeneratorExpression& Parse(std::string const& input);
+ const cmCompiledGeneratorExpression& Parse(const char* input);
+
+ enum PreprocessContext {
+ StripAllGeneratorExpressions
+ };
- /** Evaluate generator expressions in a string. */
- const char* Process(std::string const& input);
- const char* Process(const char* input);
+ static std::string Preprocess(const std::string &input,
+ PreprocessContext context);
+
+private:
+ cmGeneratorExpression(const cmGeneratorExpression &);
+ void operator=(const cmGeneratorExpression &);
+
+ cmListFileBacktrace const& Backtrace;
+ cmCompiledGeneratorExpression *CompiledExpression;
+};
+
+class cmCompiledGeneratorExpression
+{
+public:
+ const char* Evaluate(cmMakefile* mf, const char* config,
+ bool quiet = false,
+ cmGeneratorTarget *target = 0,
+ cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
/** Get set of targets found during evaluations. */
std::set<cmTarget*> const& GetTargets() const
{ return this->Targets; }
+
+ ~cmCompiledGeneratorExpression();
+
private:
- cmMakefile* Makefile;
- const char* Config;
+ cmCompiledGeneratorExpression(cmListFileBacktrace const& backtrace,
+ const std::vector<cmGeneratorExpressionEvaluator*> &evaluators,
+ const char *input, bool needsParsing);
+
+ friend class cmGeneratorExpression;
+
+ cmCompiledGeneratorExpression(const cmCompiledGeneratorExpression &);
+ void operator=(const cmCompiledGeneratorExpression &);
+
cmListFileBacktrace const& Backtrace;
- bool Quiet;
- std::vector<char> Data;
- std::stack<size_t> Barriers;
- cmsys::RegularExpression TargetInfo;
- std::set<cmTarget*> Targets;
- bool Evaluate();
- bool Evaluate(const char* expr, std::string& result);
- bool EvaluateTargetInfo(std::string& result);
+ const std::vector<cmGeneratorExpressionEvaluator*> Evaluators;
+ const char* const Input;
+ const bool NeedsParsing;
+
+ mutable std::set<cmTarget*> Targets;
+ mutable std::string Output;
};
+
+#endif
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
new file mode 100644
index 0000000..bfb0ddf
--- /dev/null
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -0,0 +1,106 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2012 Stephen Kelly <steveire@gmail.com>
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#include "cmGeneratorExpressionDAGChecker.h"
+
+#include "cmMakefile.h"
+
+//----------------------------------------------------------------------------
+cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
+ const cmListFileBacktrace &backtrace,
+ const std::string &target,
+ const std::string &property,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *parent)
+ : Parent(parent), Target(target), Property(property),
+ Content(content), Backtrace(backtrace)
+{
+ this->IsDAG = this->isDAG();
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorExpressionDAGChecker::check() const
+{
+ return this->IsDAG;
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorExpressionDAGChecker::reportError(
+ cmGeneratorExpressionContext *context,
+ const std::string &expr)
+{
+ if (this->IsDAG)
+ {
+ return;
+ }
+
+ context->HadError = true;
+ if (context->Quiet)
+ {
+ return;
+ }
+
+ const cmGeneratorExpressionDAGChecker *parent = this->Parent;
+
+ if (parent && !parent->Parent)
+ {
+ cmOStringStream e;
+ e << "Error evaluating generator expression:\n"
+ << " " << expr << "\n"
+ << "Self reference on target \""
+ << context->Target->GetName() << "\".\n";
+ context->Makefile->GetCMakeInstance()
+ ->IssueMessage(cmake::FATAL_ERROR, e.str().c_str(),
+ parent->Backtrace);
+ return;
+ }
+
+ {
+ cmOStringStream e;
+ e << "Error evaluating generator expression:\n"
+ << " " << expr << "\n"
+ << "Dependency loop found.";
+ context->Makefile->GetCMakeInstance()
+ ->IssueMessage(cmake::FATAL_ERROR, e.str().c_str(),
+ context->Backtrace);
+ }
+
+ int loopStep = 1;
+ while (parent)
+ {
+ cmOStringStream e;
+ e << "Loop step " << loopStep << "\n"
+ << " "
+ << (parent->Content ? parent->Content->GetOriginalExpression() : expr)
+ << "\n";
+ context->Makefile->GetCMakeInstance()
+ ->IssueMessage(cmake::FATAL_ERROR, e.str().c_str(),
+ parent->Backtrace);
+ parent = parent->Parent;
+ ++loopStep;
+ }
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorExpressionDAGChecker::isDAG() const
+{
+ const cmGeneratorExpressionDAGChecker *parent = this->Parent;
+ while (parent)
+ {
+ if (this->Target == parent->Target && this->Property == parent->Property)
+ {
+ return false;
+ }
+ parent = parent->Parent;
+ }
+ return true;
+}
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
new file mode 100644
index 0000000..ffc84f8
--- /dev/null
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -0,0 +1,44 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2012 Stephen Kelly <steveire@gmail.com>
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmGeneratorExpressionDAGChecker_h
+#define cmGeneratorExpressionDAGChecker_h
+
+#include "cmStandardIncludes.h"
+
+#include "cmGeneratorExpressionEvaluator.h"
+
+//----------------------------------------------------------------------------
+struct cmGeneratorExpressionDAGChecker
+{
+ cmGeneratorExpressionDAGChecker(const cmListFileBacktrace &backtrace,
+ const std::string &target,
+ const std::string &property,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *parent);
+
+ bool check() const;
+
+ void reportError(cmGeneratorExpressionContext *context,
+ const std::string &expr);
+private:
+ bool isDAG() const;
+
+private:
+ const cmGeneratorExpressionDAGChecker * const Parent;
+ const std::string Target;
+ const std::string Property;
+ const GeneratorExpressionContent * const Content;
+ const cmListFileBacktrace Backtrace;
+ bool IsDAG;
+};
+
+#endif
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
new file mode 100644
index 0000000..2e123a4
--- /dev/null
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -0,0 +1,769 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2012 Stephen Kelly <steveire@gmail.com>
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#include "cmMakefile.h"
+
+#include "cmGeneratorExpressionEvaluator.h"
+#include "cmGeneratorExpressionParser.h"
+#include "cmGeneratorExpressionDAGChecker.h"
+#include "cmGeneratorExpression.h"
+
+#include <cmsys/String.h>
+
+//----------------------------------------------------------------------------
+#if !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x510
+static
+#endif
+void reportError(cmGeneratorExpressionContext *context,
+ const std::string &expr, const std::string &result)
+{
+ context->HadError = true;
+ if (context->Quiet)
+ {
+ return;
+ }
+
+ cmOStringStream e;
+ e << "Error evaluating generator expression:\n"
+ << " " << expr << "\n"
+ << result;
+ context->Makefile->GetCMakeInstance()
+ ->IssueMessage(cmake::FATAL_ERROR, e.str().c_str(),
+ context->Backtrace);
+}
+
+//----------------------------------------------------------------------------
+struct cmGeneratorExpressionNode
+{
+ virtual ~cmGeneratorExpressionNode() {}
+
+ virtual bool GeneratesContent() const { return true; }
+
+ virtual bool AcceptsSingleArbitraryContentParameter() const
+ { return false; }
+
+ virtual int NumExpectedParameters() const { return 1; }
+
+ virtual std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *dagChecker
+ ) const = 0;
+};
+
+//----------------------------------------------------------------------------
+static const struct ZeroNode : public cmGeneratorExpressionNode
+{
+ ZeroNode() {}
+
+ virtual bool GeneratesContent() const { return false; }
+
+ std::string Evaluate(const std::vector<std::string> &,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ // Unreachable
+ return std::string();
+ }
+} zeroNode;
+
+//----------------------------------------------------------------------------
+static const struct OneNode : public cmGeneratorExpressionNode
+{
+ OneNode() {}
+
+ virtual bool AcceptsSingleArbitraryContentParameter() const { return true; }
+
+ std::string Evaluate(const std::vector<std::string> &,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ // Unreachable
+ return std::string();
+ }
+} oneNode;
+
+//----------------------------------------------------------------------------
+#define BOOLEAN_OP_NODE(OPNAME, OP, SUCCESS_VALUE, FAILURE_VALUE) \
+static const struct OP ## Node : public cmGeneratorExpressionNode \
+{ \
+ OP ## Node () {} \
+/* We let -1 carry the meaning 'at least one' */ \
+ virtual int NumExpectedParameters() const { return -1; } \
+ \
+ std::string Evaluate(const std::vector<std::string> &parameters, \
+ cmGeneratorExpressionContext *context, \
+ const GeneratorExpressionContent *content, \
+ cmGeneratorExpressionDAGChecker *) const \
+ { \
+ std::vector<std::string>::const_iterator it = parameters.begin(); \
+ const std::vector<std::string>::const_iterator end = parameters.end(); \
+ for ( ; it != end; ++it) \
+ { \
+ if (*it == #FAILURE_VALUE) \
+ { \
+ return #FAILURE_VALUE; \
+ } \
+ else if (*it != #SUCCESS_VALUE) \
+ { \
+ reportError(context, content->GetOriginalExpression(), \
+ "Parameters to $<" #OP "> must resolve to either '0' or '1'."); \
+ return std::string(); \
+ } \
+ } \
+ return #SUCCESS_VALUE; \
+ } \
+} OPNAME;
+
+BOOLEAN_OP_NODE(andNode, AND, 1, 0)
+BOOLEAN_OP_NODE(orNode, OR, 0, 1)
+
+#undef BOOLEAN_OP_NODE
+
+//----------------------------------------------------------------------------
+static const struct NotNode : public cmGeneratorExpressionNode
+{
+ NotNode() {}
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ if (*parameters.begin() != "0" && *parameters.begin() != "1")
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<NOT> parameter must resolve to exactly one '0' or '1' value.");
+ return std::string();
+ }
+ return *parameters.begin() == "0" ? "1" : "0";
+ }
+} notNode;
+
+//----------------------------------------------------------------------------
+static const struct BoolNode : public cmGeneratorExpressionNode
+{
+ BoolNode() {}
+
+ virtual int NumExpectedParameters() const { return 1; }
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return !cmSystemTools::IsOff(parameters.begin()->c_str()) ? "1" : "0";
+ }
+} boolNode;
+
+//----------------------------------------------------------------------------
+static const struct StrEqualNode : public cmGeneratorExpressionNode
+{
+ StrEqualNode() {}
+
+ virtual int NumExpectedParameters() const { return 2; }
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return *parameters.begin() == parameters[1] ? "1" : "0";
+ }
+} strEqualNode;
+
+//----------------------------------------------------------------------------
+static const struct Angle_RNode : public cmGeneratorExpressionNode
+{
+ Angle_RNode() {}
+
+ virtual int NumExpectedParameters() const { return 0; }
+
+ std::string Evaluate(const std::vector<std::string> &,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return ">";
+ }
+} angle_rNode;
+
+//----------------------------------------------------------------------------
+static const struct CommaNode : public cmGeneratorExpressionNode
+{
+ CommaNode() {}
+
+ virtual int NumExpectedParameters() const { return 0; }
+
+ std::string Evaluate(const std::vector<std::string> &,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return ",";
+ }
+} commaNode;
+
+//----------------------------------------------------------------------------
+static const struct ConfigurationNode : public cmGeneratorExpressionNode
+{
+ ConfigurationNode() {}
+
+ virtual int NumExpectedParameters() const { return 0; }
+
+ std::string Evaluate(const std::vector<std::string> &,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return context->Config ? context->Config : "";
+ }
+} configurationNode;
+
+//----------------------------------------------------------------------------
+static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
+{
+ ConfigurationTestNode() {}
+
+ virtual int NumExpectedParameters() const { return 1; }
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ cmsys::RegularExpression configValidator;
+ configValidator.compile("^[A-Za-z0-9_]*$");
+ if (!configValidator.find(parameters.begin()->c_str()))
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "Expression syntax not recognized.");
+ return std::string();
+ }
+ if (!context->Config)
+ {
+ return parameters.front().empty() ? "1" : "0";
+ }
+
+ return cmsysString_strcasecmp(parameters.begin()->c_str(),
+ context->Config) == 0 ? "1" : "0";
+ }
+} configurationTestNode;
+
+//----------------------------------------------------------------------------
+static const struct TargetPropertyNode : public cmGeneratorExpressionNode
+{
+ TargetPropertyNode() {}
+
+ // This node handles errors on parameter count itself.
+ virtual int NumExpectedParameters() const { return -1; }
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *dagCheckerParent
+ ) const
+ {
+ if (parameters.size() != 1 && parameters.size() != 2)
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<TARGET_PROPERTY:...> expression requires one or two parameters");
+ return std::string();
+ }
+ cmsys::RegularExpression targetNameValidator;
+ // The ':' is supported to allow use with IMPORTED targets. At least
+ // Qt 4 and 5 IMPORTED targets use ':' as the namespace delimiter.
+ targetNameValidator.compile("^[A-Za-z0-9_.:-]+$");
+ cmsys::RegularExpression propertyNameValidator;
+ propertyNameValidator.compile("^[A-Za-z0-9_]+$");
+
+ cmGeneratorTarget* target = context->Target;
+ std::string propertyName = *parameters.begin();
+ if (parameters.size() == 2)
+ {
+ if (parameters.begin()->empty() && parameters[1].empty())
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty "
+ "target name and property name.");
+ return std::string();
+ }
+ if (parameters.begin()->empty())
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty "
+ "target name.");
+ return std::string();
+ }
+
+ std::string targetName = parameters.front();
+ propertyName = parameters[1];
+ if (!targetNameValidator.find(targetName.c_str()))
+ {
+ if (!propertyNameValidator.find(propertyName.c_str()))
+ {
+ ::reportError(context, content->GetOriginalExpression(),
+ "Target name and property name not supported.");
+ return std::string();
+ }
+ ::reportError(context, content->GetOriginalExpression(),
+ "Target name not supported.");
+ return std::string();
+ }
+ target = context->Makefile->FindGeneratorTargetToUse(
+ targetName.c_str());
+
+ if (!target)
+ {
+ cmOStringStream e;
+ e << "Target \""
+ << targetName
+ << "\" not found.";
+ reportError(context, content->GetOriginalExpression(), e.str());
+ return std::string();
+ }
+ }
+
+ if (propertyName.empty())
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<TARGET_PROPERTY:...> expression requires a non-empty property "
+ "name.");
+ return std::string();
+ }
+
+ if (!propertyNameValidator.find(propertyName.c_str()))
+ {
+ ::reportError(context, content->GetOriginalExpression(),
+ "Property name not supported.");
+ return std::string();
+ }
+
+ cmGeneratorExpressionDAGChecker dagChecker(context->Backtrace,
+ target->GetName(),
+ propertyName,
+ content,
+ dagCheckerParent);
+
+ if (!dagChecker.check())
+ {
+ dagChecker.reportError(context, content->GetOriginalExpression());
+ return std::string();
+ }
+
+ const char *prop = target->GetProperty(propertyName.c_str());
+ return prop ? prop : "";
+ }
+} targetPropertyNode;
+
+//----------------------------------------------------------------------------
+template<bool linker, bool soname>
+struct TargetFilesystemArtifactResultCreator
+{
+ static std::string Create(cmTarget* target,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *content);
+};
+
+//----------------------------------------------------------------------------
+template<>
+struct TargetFilesystemArtifactResultCreator<false, true>
+{
+ static std::string Create(cmTarget* target,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *content)
+ {
+ // The target soname file (.so.1).
+ if(target->IsDLLPlatform())
+ {
+ ::reportError(context, content->GetOriginalExpression(),
+ "TARGET_SONAME_FILE is not allowed "
+ "for DLL target platforms.");
+ return std::string();
+ }
+ if(target->GetType() != cmTarget::SHARED_LIBRARY)
+ {
+ ::reportError(context, content->GetOriginalExpression(),
+ "TARGET_SONAME_FILE is allowed only for "
+ "SHARED libraries.");
+ return std::string();
+ }
+ std::string result = target->GetDirectory(context->Config);
+ result += "/";
+ result += target->GetSOName(context->Config);
+ return result;
+ }
+};
+
+//----------------------------------------------------------------------------
+template<>
+struct TargetFilesystemArtifactResultCreator<true, false>
+{
+ static std::string Create(cmTarget* target,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *content)
+ {
+ // The file used to link to the target (.so, .lib, .a).
+ if(!target->IsLinkable())
+ {
+ ::reportError(context, content->GetOriginalExpression(),
+ "TARGET_LINKER_FILE is allowed only for libraries and "
+ "executables with ENABLE_EXPORTS.");
+ return std::string();
+ }
+ return target->GetFullPath(context->Config,
+ target->HasImportLibrary());
+ }
+};
+
+//----------------------------------------------------------------------------
+template<>
+struct TargetFilesystemArtifactResultCreator<false, false>
+{
+ static std::string Create(cmTarget* target,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *)
+ {
+ return target->GetFullPath(context->Config, false, true);
+ }
+};
+