summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Auxiliary/cmake-indent.vim2
-rw-r--r--Auxiliary/cmake-mode.el8
-rw-r--r--Auxiliary/cmake-syntax.vim2
-rw-r--r--CMakeCPackOptions.cmake.in8
-rw-r--r--CMakeLists.txt10
-rw-r--r--CONTRIBUTING.rst2
-rw-r--r--CTestCustom.cmake.in16
-rw-r--r--Help/command/add_executable.rst2
-rw-r--r--Help/command/add_library.rst6
-rw-r--r--Help/command/add_test.rst7
-rw-r--r--Help/command/ctest_read_custom_files.rst3
-rw-r--r--Help/command/ctest_test.rst3
-rw-r--r--Help/command/file.rst3
-rw-r--r--Help/command/get_filename_component.rst2
-rw-r--r--Help/command/install.rst8
-rw-r--r--Help/command/string.rst303
-rw-r--r--Help/command/try_compile.rst3
-rw-r--r--Help/manual/LINKS.txt10
-rw-r--r--Help/manual/OPTIONS_BUILD.txt43
-rw-r--r--Help/manual/cmake-buildsystem.7.rst7
-rw-r--r--Help/manual/cmake-developer.7.rst6
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst4
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/manual/cmake-properties.7.rst5
-rw-r--r--Help/manual/cmake-toolchains.7.rst17
-rw-r--r--Help/manual/cmake-variables.7.rst20
-rw-r--r--Help/manual/ctest.1.rst6
-rw-r--r--Help/policy/CMP0065.rst27
-rw-r--r--Help/prop_sf/OBJECT_DEPENDS.rst13
-rw-r--r--Help/prop_tgt/ENABLE_EXPORTS.rst5
-rw-r--r--Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst10
-rw-r--r--Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst10
-rw-r--r--Help/prop_tgt/VS_IOT_STARTUP_TASK.rst6
-rw-r--r--Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst10
-rw-r--r--Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst10
-rw-r--r--Help/release/3.4.rst273
-rw-r--r--Help/release/dev/0-sample-topic.rst7
-rw-r--r--Help/release/dev/ConcurrentFortran-compiler-id.rst5
-rw-r--r--Help/release/dev/ExternalProject-USES_TERMINAL.rst7
-rw-r--r--Help/release/dev/ExternalProject_init_selected_submodules.rst7
-rw-r--r--Help/release/dev/FindBISON-DEFINES_FILE.rst6
-rw-r--r--Help/release/dev/FindIce-imported-targets.rst4
-rw-r--r--Help/release/dev/FindTIFF-updates.rst5
-rw-r--r--Help/release/dev/FindXercesC-updates.rst5
-rw-r--r--Help/release/dev/GNUInstallDirs-special-prefixes.rst9
-rw-r--r--Help/release/dev/OUTPUT_DIRECTORY-genex.rst7
-rw-r--r--Help/release/dev/OUTPUT_NAME-genex.rst5
-rw-r--r--Help/release/dev/add-apple-swift-language.rst9
-rw-r--r--Help/release/dev/add-link-search-static-properties-defaults.rst9
-rw-r--r--Help/release/dev/auto_export_dll_symbols.rst6
-rw-r--r--Help/release/dev/cmake-W-options.rst13
-rw-r--r--Help/release/dev/compiler-launcher.rst8
-rw-r--r--Help/release/dev/ctest-test-load-option.rst9
-rw-r--r--Help/release/dev/doc-CMakeExpandImportedTargets-deprecated.rst5
-rw-r--r--Help/release/dev/find_program-NAMES_PER_DIR.rst6
-rw-r--r--Help/release/dev/get-filename-component-base-dir.rst6
-rw-r--r--Help/release/dev/if-TEST.rst5
-rw-r--r--Help/release/dev/java-updates.rst16
-rw-r--r--Help/release/dev/makefile-target-messages.rst6
-rw-r--r--Help/release/dev/modules-no-soname.rst7
-rw-r--r--Help/release/dev/remove-CMAKE_USE_RELATIVE_PATHS.rst5
-rw-r--r--Help/release/dev/string-append.rst4
-rw-r--r--Help/release/dev/target-directory-properties.rst5
-rw-r--r--Help/release/dev/trace-expand.rst5
-rw-r--r--Help/release/dev/vs-nsight-tegra-attributes.rst21
-rw-r--r--Help/release/index.rst3
-rw-r--r--Help/variable/CMAKE_ENABLE_EXPORTS.rst22
-rw-r--r--Help/variable/CMAKE_ERROR_DEPRECATED.rst4
-rw-r--r--Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_NAME.rst20
-rw-r--r--Help/variable/CMAKE_SYSTEM_VERSION.rst28
-rw-r--r--Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst11
-rw-r--r--Help/variable/CMAKE_WARN_DEPRECATED.rst4
-rw-r--r--Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst7
-rw-r--r--Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst7
-rw-r--r--Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst7
-rw-r--r--Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst7
-rw-r--r--Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst7
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst8
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst8
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst8
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst8
-rw-r--r--Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst7
-rw-r--r--Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst6
-rw-r--r--Help/variable/CTEST_CUSTOM_POST_TEST.rst6
-rw-r--r--Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst7
-rw-r--r--Help/variable/CTEST_CUSTOM_PRE_TEST.rst6
-rw-r--r--Help/variable/CTEST_CUSTOM_TEST_IGNORE.rst7
-rw-r--r--Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst7
-rw-r--r--Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst7
-rw-r--r--Help/variable/CTEST_CUSTOM_XXX.txt2
-rw-r--r--Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst7
-rw-r--r--Modules/BasicConfigVersion-AnyNewerVersion.cmake.in8
-rw-r--r--Modules/BasicConfigVersion-ExactVersion.cmake.in10
-rw-r--r--Modules/BasicConfigVersion-SameMajorVersion.cmake.in10
-rw-r--r--Modules/CMakeCCompiler.cmake.in10
-rw-r--r--Modules/CMakeCCompilerId.c.in11
-rw-r--r--Modules/CMakeCInformation.cmake6
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in10
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in10
-rw-r--r--Modules/CMakeCXXInformation.cmake6
-rw-r--r--Modules/CMakeClDeps.cmake34
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake3
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake3
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake81
-rw-r--r--Modules/CMakeDetermineSystem.cmake4
-rw-r--r--Modules/CMakeFortranCompiler.cmake.in1
-rw-r--r--Modules/CMakeFortranCompilerId.F.in4
-rw-r--r--Modules/CMakeFortranInformation.cmake6
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake2
-rw-r--r--Modules/CMakeTestSwiftCompiler.cmake52
-rw-r--r--Modules/CPack.cmake133
-rw-r--r--Modules/CPackComponent.cmake4
-rw-r--r--Modules/CPackDeb.cmake121
-rw-r--r--Modules/CPackNSIS.cmake2
-rw-r--r--Modules/CPackRPM.cmake4
-rw-r--r--Modules/CPackWIX.cmake4
-rw-r--r--Modules/CTestCoverageCollectGCOV.cmake2
-rw-r--r--Modules/CheckForPthreads.c2
-rw-r--r--Modules/CheckFunctionExists.c3
-rw-r--r--Modules/CheckFunctionExists.cmake14
-rw-r--r--Modules/CheckLibraryExists.cmake13
-rw-r--r--Modules/CheckSymbolExists.cmake10
-rw-r--r--Modules/Compiler/AppleClang-C.cmake7
-rw-r--r--Modules/Compiler/AppleClang-CXX.cmake8
-rw-r--r--Modules/Compiler/Clang-C.cmake11
-rw-r--r--Modules/Compiler/Clang-CXX.cmake9
-rw-r--r--Modules/Compiler/GNU-C.cmake16
-rw-r--r--Modules/Compiler/GNU-CXX.cmake7
-rw-r--r--Modules/Compiler/IAR.cmake4
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake9
-rw-r--r--Modules/CompilerId/VS-10.vcxproj.in1
-rw-r--r--Modules/CompilerId/main.swift.in2
-rw-r--r--Modules/ExternalProject.cmake27
-rw-r--r--Modules/FindHDF5.cmake30
-rw-r--r--Modules/FindMatlab.cmake1
-rw-r--r--Modules/FindOpenSSL.cmake35
-rw-r--r--Modules/FindPkgConfig.cmake30
-rw-r--r--Modules/FindPostgreSQL.cmake2
-rw-r--r--Modules/FindProtobuf.cmake67
-rw-r--r--Modules/FindPythonInterp.cmake2
-rw-r--r--Modules/FindPythonLibs.cmake86
-rw-r--r--Modules/FindThreads.cmake27
-rw-r--r--Modules/FindZLIB.cmake45
-rw-r--r--Modules/FindwxWidgets.cmake43
-rw-r--r--Modules/Internal/FeatureTesting.cmake2
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake4
-rw-r--r--Modules/Platform/GHS-MULTI-Initialize.cmake36
-rw-r--r--Modules/Platform/Windows-GNU.cmake2
-rw-r--r--Modules/Platform/Windows-MSVC.cmake8
-rw-r--r--Modules/ProcessorCount.cmake29
-rw-r--r--Modules/UseSWIG.cmake10
-rw-r--r--Modules/UseVTK40.cmake29
-rw-r--r--Modules/UseVTKBuildSettings40.cmake38
-rw-r--r--Modules/UseVTKConfig40.cmake409
-rw-r--r--Modules/readme.txt2
-rw-r--r--README.rst12
-rw-r--r--Source/CMakeLists.txt14
-rw-r--r--Source/CMakeVersion.cmake6
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx320
-rw-r--r--Source/CPack/cmCPackGenerator.cxx10
-rw-r--r--Source/CTest/cmCTestCurl.cxx6
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx9
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx8
-rw-r--r--Source/CTest/cmCTestTestHandler.h5
-rw-r--r--Source/Checks/cm_c11_thread_local.c2
-rw-r--r--Source/Checks/cm_c11_thread_local.cmake33
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.cxx8
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx17
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.cxx25
-rw-r--r--Source/CursesDialog/cmCursesWidget.cxx2
-rw-r--r--Source/QtDialog/CMakeLists.txt18
-rw-r--r--Source/bindexplib.cxx19
-rw-r--r--Source/cmArchiveWrite.cxx39
-rw-r--r--Source/cmArchiveWrite.h95
-rw-r--r--Source/cmBuildNameCommand.h1
-rw-r--r--Source/cmCTest.cxx41
-rw-r--r--Source/cmCommand.h9
-rw-r--r--Source/cmCommonTargetGenerator.cxx17
-rw-r--r--Source/cmCommonTargetGenerator.h1
-rw-r--r--Source/cmConditionEvaluator.cxx40
-rw-r--r--Source/cmConditionEvaluator.h9
-rw-r--r--Source/cmCoreTryCompile.cxx16
-rw-r--r--Source/cmExecProgramCommand.h6
-rw-r--r--Source/cmExportLibraryDependenciesCommand.h1
-rw-r--r--Source/cmFindBase.cxx6
-rw-r--r--Source/cmFindPackageCommand.cxx5
-rw-r--r--Source/cmGeneratedFileStream.h4
-rw-r--r--Source/cmGeneratorExpressionNode.cxx23
-rw-r--r--Source/cmGeneratorTarget.cxx28
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx23
-rw-r--r--Source/cmGlobalGenerator.cxx171
-rw-r--r--Source/cmGlobalGenerator.h14
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx33
-rw-r--r--Source/cmGlobalNinjaGenerator.h13
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx19
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx19
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h6
-rw-r--r--Source/cmGlobalVisualStudio11Generator.h5
-rw-r--r--Source/cmGlobalVisualStudio12Generator.h5
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx165
-rw-r--r--Source/cmGlobalVisualStudio14Generator.h16
-rw-r--r--Source/cmGlobalVisualStudio6Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx23
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h12
-rw-r--r--Source/cmIfCommand.cxx20
-rw-r--r--Source/cmInstallDirectoryGenerator.cxx47
-rw-r--r--Source/cmInstallDirectoryGenerator.h11
-rw-r--r--Source/cmInstallFilesCommand.h6
-rw-r--r--Source/cmInstallFilesGenerator.cxx25
-rw-r--r--Source/cmInstallFilesGenerator.h6
-rw-r--r--Source/cmInstallProgramsCommand.h6
-rw-r--r--Source/cmInstallTargetsCommand.h6
-rw-r--r--Source/cmLinkLibrariesCommand.h6
-rw-r--r--Source/cmLoadCommandCommand.h1
-rw-r--r--Source/cmLocalGenerator.cxx61
-rw-r--r--Source/cmLocalGenerator.h4
-rw-r--r--Source/cmLocalNinjaGenerator.cxx18
-rw-r--r--Source/cmLocalNinjaGenerator.h15
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx38
-rw-r--r--Source/cmMakeDirectoryCommand.h6
-rw-r--r--Source/cmMakefile.cxx18
-rw-r--r--Source/cmMakefile.h6
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx4
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx4
-rw-r--r--Source/cmMakefileTargetGenerator.cxx9
-rw-r--r--Source/cmMessageCommand.cxx14
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx13
-rw-r--r--Source/cmNinjaTargetGenerator.cxx15
-rw-r--r--Source/cmNinjaTargetGenerator.h8
-rw-r--r--Source/cmOutputConverter.cxx39
-rw-r--r--Source/cmOutputConverter.h2
-rw-r--r--Source/cmOutputRequiredFilesCommand.h1
-rw-r--r--Source/cmPolicies.h8
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx1074
-rw-r--r--Source/cmQtAutoGeneratorInitializer.h67
-rw-r--r--Source/cmQtAutoGenerators.cxx1066
-rw-r--r--Source/cmQtAutoGenerators.h29
-rw-r--r--Source/cmRemoveCommand.h6
-rw-r--r--Source/cmSetCommand.cxx4
-rw-r--r--Source/cmState.cxx12
-rw-r--r--Source/cmSubdirCommand.h6
-rw-r--r--Source/cmSubdirDependsCommand.h1
-rw-r--r--Source/cmSystemTools.cxx46
-rw-r--r--Source/cmSystemTools.h3
-rw-r--r--Source/cmTarget.cxx80
-rw-r--r--Source/cmTarget.h3
-rw-r--r--Source/cmUseMangledMesaCommand.h1
-rw-r--r--Source/cmUtilitySourceCommand.h1
-rw-r--r--Source/cmVariableRequiresCommand.h1
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx296
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h10
-rw-r--r--Source/cmWhileCommand.cxx15
-rw-r--r--Source/cmWriteFileCommand.h6
-rw-r--r--Source/cmake.cxx234
-rw-r--r--Source/cmake.h27
-rw-r--r--Source/cmake.version.manifest18
-rw-r--r--Source/cmcmd.cxx416
-rw-r--r--Source/cmcmd.h14
-rw-r--r--Source/ctest.cxx4
-rw-r--r--Source/kwsys/CMakeLists.txt190
-rw-r--r--Source/kwsys/CTestCustom.cmake.in3
-rw-r--r--Source/kwsys/CommandLineArguments.cxx103
-rw-r--r--Source/kwsys/CommandLineArguments.hxx.in56
-rw-r--r--Source/kwsys/Configure.hxx.in144
-rw-r--r--Source/kwsys/Directory.cxx21
-rw-r--r--Source/kwsys/Directory.hxx.in16
-rw-r--r--Source/kwsys/DynamicLoader.cxx28
-rw-r--r--Source/kwsys/DynamicLoader.hxx.in18
-rw-r--r--Source/kwsys/Encoding.hxx.in22
-rw-r--r--Source/kwsys/EncodingCXX.cxx16
-rw-r--r--Source/kwsys/FStream.hxx.in6
-rw-r--r--Source/kwsys/Glob.cxx93
-rw-r--r--Source/kwsys/Glob.hxx.in44
-rw-r--r--Source/kwsys/IOStream.cxx88
-rw-r--r--Source/kwsys/IOStream.hxx.in32
-rw-r--r--Source/kwsys/RegularExpression.hxx.in60
-rw-r--r--Source/kwsys/String.hxx.in10
-rw-r--r--Source/kwsys/SystemInformation.cxx344
-rw-r--r--Source/kwsys/SystemInformation.hxx.in35
-rw-r--r--Source/kwsys/SystemTools.cxx1022
-rw-r--r--Source/kwsys/SystemTools.hxx.in325
-rw-r--r--Source/kwsys/hash_fun.hxx.in46
-rw-r--r--Source/kwsys/hash_map.hxx.in124
-rw-r--r--Source/kwsys/hash_set.hxx.in122
-rw-r--r--Source/kwsys/hashtable.hxx.in387
-rw-r--r--Source/kwsys/kwsysPlatformTestsCXX.cxx274
-rw-r--r--Source/kwsys/kwsys_cstddef.hxx.in35
-rw-r--r--Source/kwsys/kwsys_ios_fstream.h.in46
-rw-r--r--Source/kwsys/kwsys_ios_iosfwd.h.in49
-rw-r--r--Source/kwsys/kwsys_ios_iostream.h.in99
-rw-r--r--Source/kwsys/kwsys_ios_sstream.h.in199
-rw-r--r--Source/kwsys/kwsys_stl.hxx.in49
-rw-r--r--Source/kwsys/kwsys_stl_string.hxx.in123
-rw-r--r--Source/kwsys/testCommandLineArguments.cxx70
-rw-r--r--Source/kwsys/testCommandLineArguments1.cxx34
-rw-r--r--Source/kwsys/testDynamicLoader.cxx27
-rw-r--r--Source/kwsys/testEncoding.cxx3
-rw-r--r--Source/kwsys/testFStream.cxx21
-rw-r--r--Source/kwsys/testHashSTL.cxx10
-rw-r--r--Source/kwsys/testIOS.cxx73
-rw-r--r--Source/kwsys/testSystemInformation.cxx22
-rw-r--r--Source/kwsys/testSystemTools.cxx368
-rw-r--r--Templates/CPack.GenericDescription.txt2
-rw-r--r--Templates/CPack.GenericLicense.txt2
-rw-r--r--Templates/Windows/SmallLogo44x44.pngbin0 -> 554 bytes
-rw-r--r--Tests/CMakeLists.txt47
-rw-r--r--Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in7
-rw-r--r--Tests/CPackComponents/CMakeLists.txt2
-rw-r--r--Tests/CPackComponentsDEB/CMakeLists.txt37
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake2
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake12
-rw-r--r--Tests/CPackComponentsDEB/license.txt2
-rw-r--r--Tests/CPackComponentsForAll/license.txt2
-rw-r--r--Tests/CPackWiXGenerator/CMakeLists.txt2
-rw-r--r--Tests/CTestCoverageCollectGCOV/test.cmake.in6
-rw-r--r--Tests/Contracts/Trilinos/CMakeLists.txt2
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt28
-rw-r--r--Tests/ExternalProject/Example/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/CMakeLists.txt3
-rw-r--r--Tests/FindPackageModeMakefileTest/Makefile.in5
-rw-r--r--Tests/FindThreads/C-only/CMakeLists.txt10
-rw-r--r--Tests/FindThreads/CMakeLists.txt11
-rw-r--r--Tests/FindThreads/CXX-only/CMakeLists.txt13
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt26
-rw-r--r--Tests/GeneratorExpression/check-common.cmake4
-rw-r--r--Tests/GeneratorExpression/check-part1.cmake2
-rw-r--r--Tests/GeneratorExpression/check-part4.cmake15
-rw-r--r--Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt6
-rw-r--r--Tests/MSManifest/CMakeLists.txt5
-rw-r--r--Tests/MSManifest/Subdir/CMakeLists.txt9
-rw-r--r--Tests/MSManifest/Subdir/check.cmake6
-rw-r--r--Tests/MSManifest/Subdir/main.c1
-rw-r--r--Tests/MSManifest/Subdir/test.manifest.in4
-rw-r--r--Tests/OutOfBinary/CMakeLists.txt2
-rw-r--r--Tests/OutOfBinary/outexe.c2
-rw-r--r--Tests/OutOfSource/SubDir/CMakeLists.txt2
-rw-r--r--Tests/OutOfSource/SubDir/subdir.c1
-rw-r--r--Tests/Plugin/src/example_exe.cxx2
-rw-r--r--Tests/QtAutogen/CMakeLists.txt9
-rw-r--r--Tests/QtAutogen/targetObjectsTest.cpp5
-rw-r--r--Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake19
-rw-r--r--Tests/RunCMake/BuildDepends/C-Exe-Manifest.step1.cmake6
-rw-r--r--Tests/RunCMake/BuildDepends/C-Exe-Manifest.step2.cmake6
-rw-r--r--Tests/RunCMake/BuildDepends/C-Exe.cmake12
-rw-r--r--Tests/RunCMake/BuildDepends/C-Exe.step1.cmake3
-rw-r--r--Tests/RunCMake/BuildDepends/C-Exe.step2.cmake3
-rw-r--r--Tests/RunCMake/BuildDepends/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake40
-rw-r--r--Tests/RunCMake/BuildDepends/check.cmake37
-rw-r--r--Tests/RunCMake/BuildDepends/main.c1
-rw-r--r--Tests/RunCMake/CMP0026/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMP0026/clear-cached-information.cmake14
-rw-r--r--Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt12
-rw-r--r--Tests/RunCMake/CMP0054/CMP0054-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt13
-rw-r--r--Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0064/CMP0064-WARN-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0064/CMP0064-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake15
-rw-r--r--Tests/RunCMake/CMP0065/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0065/NEWBad.cmake4
-rw-r--r--Tests/RunCMake/CMP0065/NEWGood.cmake4
-rw-r--r--Tests/RunCMake/CMP0065/OLDBad1.cmake4
-rw-r--r--Tests/RunCMake/CMP0065/OLDBad2.cmake4
-rw-r--r--Tests/RunCMake/CMP0065/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/CMP0065/WARN-OFF.cmake3
-rw-r--r--Tests/RunCMake/CMP0065/WARN-ON-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0065/WARN-ON.cmake3
-rw-r--r--Tests/RunCMake/CMP0065/subproject/CMakeLists.txt22
-rw-r--r--Tests/RunCMake/CMP0065/subproject/main.c7
-rw-r--r--Tests/RunCMake/CMakeLists.txt11
-rw-r--r--Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake5
-rw-r--r--Tests/RunCMake/CPack/CPackTestHelpers.cmake41
-rw-r--r--Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake5
-rw-r--r--Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake2
-rw-r--r--Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake6
-rw-r--r--Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake33
-rw-r--r--Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake16
-rw-r--r--Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake5
-rw-r--r--Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB/Helpers.cmake15
-rw-r--r--Tests/RunCMake/CPack/DEB_EXTRA.cmake28
-rw-r--r--Tests/RunCMake/CPack/DEPENDENCIES.cmake8
-rw-r--r--Tests/RunCMake/CPack/EMPTY_DIR.cmake4
-rw-r--r--Tests/RunCMake/CPack/PreTestError.cmake7
-rw-r--r--Tests/RunCMake/CPack/README.txt4
-rw-r--r--Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake5
-rw-r--r--Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt1
-rw-r--r--Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake5
-rw-r--r--Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt1
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake3
-rw-r--r--Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake1
-rw-r--r--Tests/RunCMake/CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake3
-rw-r--r--Tests/RunCMake/CPack/TGZ/Helpers.cmake10
-rw-r--r--Tests/RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake5
-rw-r--r--Tests/RunCMake/CPack/TGZ/Prerequirements.cmake4
-rw-r--r--Tests/RunCMake/CPack/VerifyResult.cmake7
-rw-r--r--Tests/RunCMake/CPackConfig/Default-check.cmake7
-rw-r--r--Tests/RunCMake/CPackConfig/Default.cmake3
-rw-r--r--Tests/RunCMake/CPackConfig/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/CPackConfig/Special-check.cmake5
-rw-r--r--Tests/RunCMake/CPackConfig/Special.cmake3
-rw-r--r--Tests/RunCMake/CPackConfig/Verbatim-check.cmake10
-rw-r--r--Tests/RunCMake/CPackConfig/Verbatim.cmake5
-rw-r--r--Tests/RunCMake/CPackConfig/check.cmake3
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake32
-rw-r--r--Tests/RunCMake/CTestCommandLine/SerialFailed-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/SerialFailed-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/SerialFailed-stdout.txt10
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestOutputSize-check.cmake17
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestOutputSize-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestOutputSize-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake46
-rw-r--r--Tests/RunCMake/CommandLine/W_bad-arg1-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/W_bad-arg2-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/Wdeprecated.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/Wdev-stderr.txt6
-rw-r--r--Tests/RunCMake/CommandLine/Wdev.cmake5
-rw-r--r--Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/Werror_deprecated.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/Werror_dev-stderr.txt5
-rw-r--r--Tests/RunCMake/CommandLine/Werror_dev.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/Wno-deprecated.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/Wno-dev.cmake5
-rw-r--r--Tests/RunCMake/CommandLine/Wno-error_deprecated.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/Wno-error_dev.cmake1
-rw-r--r--Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE-stdout.txt1
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE.cmake9
-rw-r--r--Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-result.txt (renamed from Tests/RunCMake/CommandLine/Werror_dev-result.txt)0
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-stderr.txt17
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadSHELL_PATH.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/LinkStatic/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/LinkStatic/LINK_SEARCH_STATIC.cmake (renamed from Tests/RunCMake/set_property/LINK_SEARCH_STATIC.cmake)2
-rw-r--r--Tests/RunCMake/LinkStatic/LinkStatic.c (renamed from Tests/RunCMake/set_property/LinkStatic.c)0
-rw-r--r--Tests/RunCMake/LinkStatic/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/RunCMake.cmake8
-rw-r--r--Tests/RunCMake/Swift/Enable-stdout.txt1
-rw-r--r--Tests/RunCMake/Swift/Enable.cmake1
-rw-r--r--Tests/RunCMake/Swift/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_test/CMakeLists.txt.in1
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake15
-rw-r--r--Tests/RunCMake/ctest_test/TestOutputSize-check.cmake17
-rwxr-xr-xTests/RunCMake/find_program/A/testAandB1
-rwxr-xr-xTests/RunCMake/find_program/B/testAandB1
-rw-r--r--Tests/RunCMake/find_program/EnvAndHints-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/EnvAndHints.cmake8
-rw-r--r--Tests/RunCMake/find_program/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-result.txt (renamed from Tests/RunCMake/CommandLine/Werror_deprecated-result.txt)0
-rw-r--r--Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-stderr.txt6
-rw-r--r--Tests/RunCMake/install/DIRECTORY-DESTINATION-bad.cmake1
-rw-r--r--Tests/RunCMake/install/FILES-DESTINATION-bad-result.txt (renamed from Tests/RunCMake/CommandLine/W_bad-arg3-result.txt)0
-rw-r--r--Tests/RunCMake/install/FILES-DESTINATION-bad-stderr.txt6
-rw-r--r--Tests/RunCMake/install/FILES-DESTINATION-bad.cmake1
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt2
-rw-r--r--Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake3
-rw-r--r--Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt1
-rw-r--r--Tests/RunCMake/set_property/COMPILE_FEATURES.cmake2
-rw-r--r--Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt2
-rw-r--r--Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake3
-rw-r--r--Tests/RunCMake/set_property/Common.cmake28
-rw-r--r--Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt2
-rw-r--r--Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake3
-rw-r--r--Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt1
-rw-r--r--Tests/RunCMake/set_property/LINK_LIBRARIES.cmake9
-rw-r--r--Tests/RunCMake/set_property/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/set_property/SOURCES-stdout.txt1
-rw-r--r--Tests/RunCMake/set_property/SOURCES.cmake2
-rw-r--r--Tests/RunCMake/set_property/USER_PROP-stdout.txt2
-rw-r--r--Tests/RunCMake/set_property/USER_PROP.cmake3
-rw-r--r--Tests/SimpleInstall/CMakeLists.txt10
-rw-r--r--Tests/SimpleInstallS2/CMakeLists.txt10
-rw-r--r--Tests/SwiftMix/SwiftMain.swift6
-rw-r--r--Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt6
-rw-r--r--Tests/VSWinStorePhone/CMakeLists.txt17
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.pngbin0 -> 554 bytes
-rw-r--r--Tests/VSWinStorePhone/cmake/Package_vc14.store.appxmanifest.in36
-rw-r--r--Utilities/Release/Cygwin/README.cygwin.in2
-rw-r--r--Utilities/Release/create-cmake-release.cmake1
-rw-r--r--Utilities/Release/dash2win64_cygwin.cmake1
-rw-r--r--Utilities/Release/dash2win64_release.cmake3
-rw-r--r--Utilities/Release/dashmacmini2_release.cmake2
-rw-r--r--Utilities/Release/dashmacmini5_release.cmake2
-rw-r--r--Utilities/Release/linux64_release.cmake1
-rw-r--r--Utilities/Release/magrathea_release.cmake1
-rwxr-xr-xUtilities/Release/release_cmake.sh.in12
-rw-r--r--Utilities/Release/upload_release.cmake2
-rw-r--r--Utilities/Sphinx/templates/layout.html2
-rw-r--r--Utilities/cmcurl/CMakeLists.txt8
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_reader.cpp2
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_writer.cpp4
-rwxr-xr-xbootstrap270
508 files changed, 7556 insertions, 7073 deletions
diff --git a/Auxiliary/cmake-indent.vim b/Auxiliary/cmake-indent.vim
index 6cee9c8..fa088e4 100644
--- a/Auxiliary/cmake-indent.vim
+++ b/Auxiliary/cmake-indent.vim
@@ -16,7 +16,7 @@
" Version: $Revision$
"
" Licence: The CMake license applies to this file. See
-" http://www.cmake.org/licensing
+" https://cmake.org/licensing
" This implies that distribution with Vim is allowed
if exists("b:did_indent")
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index 11e33b3..e50ae7b 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -70,11 +70,11 @@ set the path with these commands:
(defconst cmake-regex-indented
(rx-to-string `(and bol (* (group (or (regexp ,cmake-regex-token) (any space ?\n)))))))
(defconst cmake-regex-block-open
- (rx-to-string `(and bow (or ,@(append cmake-keywords-block-open
- (mapcar 'downcase cmake-keywords-block-open))) eow)))
+ (rx-to-string `(and symbol-start (or ,@(append cmake-keywords-block-open
+ (mapcar 'downcase cmake-keywords-block-open))) symbol-end)))
(defconst cmake-regex-block-close
- (rx-to-string `(and bow (or ,@(append cmake-keywords-block-close
- (mapcar 'downcase cmake-keywords-block-close))) eow)))
+ (rx-to-string `(and symbol-start (or ,@(append cmake-keywords-block-close
+ (mapcar 'downcase cmake-keywords-block-close))) symbol-end)))
(defconst cmake-regex-close
(rx-to-string `(and bol (* space) (regexp ,cmake-regex-block-close)
(* space) (regexp ,cmake-regex-paren-left))))
diff --git a/Auxiliary/cmake-syntax.vim b/Auxiliary/cmake-syntax.vim
index 3e4a122..624a8c4 100644
--- a/Auxiliary/cmake-syntax.vim
+++ b/Auxiliary/cmake-syntax.vim
@@ -16,7 +16,7 @@
" Version: $Revision$
"
" Licence: The CMake license applies to this file. See
-" http://www.cmake.org/licensing
+" https://cmake.org/licensing
" This implies that distribution with Vim is allowed
" For version 5.x: Clear all syntax items
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index a1e425a..b6013ef 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -14,14 +14,14 @@ if(CPACK_GENERATOR MATCHES "NSIS")
# tell cpack to create links to the doc files
set(CPACK_NSIS_MENU_LINKS
"@CMAKE_DOC_DIR@/html/index.html" "CMake Documentation"
- "http://www.cmake.org" "CMake Web Site"
+ "https://cmake.org" "CMake Web Site"
)
# Use the icon from cmake-gui for add-remove programs
set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
set(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@")
set(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system")
- set(CPACK_NSIS_HELP_LINK "http://www.cmake.org")
+ set(CPACK_NSIS_HELP_LINK "https://cmake.org")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
set(CPACK_NSIS_MODIFY_PATH ON)
@@ -35,7 +35,7 @@ if(CPACK_GENERATOR MATCHES "IFW")
# Installer configuration
set(CPACK_IFW_PACKAGE_TITLE "CMake Build Tool")
- set(CPACK_IFW_PRODUCT_URL "http://www.cmake.org")
+ set(CPACK_IFW_PRODUCT_URL "https://cmake.org")
@_CPACK_IFW_PACKAGE_ICON@
set(CPACK_IFW_PACKAGE_WINDOW_ICON
"@CMake_SOURCE_DIR@/Source/QtDialog/CMakeSetup128.png")
@@ -204,7 +204,7 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${patch}")
endif()
- set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "http://www.cmake.org")
+ set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://cmake.org")
set(CPACK_WIX_PROPERTY_ARPCONTACT "@CPACK_PACKAGE_CONTACT@")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e13a7e..c96f68b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,9 @@ cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
if(POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif()
+if(POLICY CMP0053)
+ cmake_policy(SET CMP0053 NEW)
+endif()
project(CMake)
if(CMAKE_BOOTSTRAP)
@@ -38,7 +41,12 @@ endif()
# Use most-recent available language dialects with GNU and Clang
if(NOT DEFINED CMAKE_C_STANDARD AND NOT CMake_NO_C_STANDARD)
- set(CMAKE_C_STANDARD 11)
+ include(${CMake_SOURCE_DIR}/Source/Checks/cm_c11_thread_local.cmake)
+ if(NOT CMake_C11_THREAD_LOCAL_BROKEN)
+ set(CMAKE_C_STANDARD 11)
+ else()
+ set(CMAKE_C_STANDARD 99)
+ endif()
endif()
if(NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMake_NO_CXX_STANDARD)
include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx14_cstdio.cmake)
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 5daaf9c..0e5c7e1 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -14,7 +14,7 @@ Please subscribe and post to the `CMake Developers List`_ to offer
contributions. Regular and productive contributors may be invited
to gain direct push access.
-.. _`CMake Developers List`: http://www.cmake.org/mailman/listinfo/cmake-developers
+.. _`CMake Developers List`: https://cmake.org/mailman/listinfo/cmake-developers
Patches
=======
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index d3cff51..2adf317 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -1,9 +1,7 @@
-set(CTEST_CUSTOM_ERROR_MATCH
- ${CTEST_CUSTOM_ERROR_MATCH}
+list(APPEND CTEST_CUSTOM_ERROR_MATCH
"ERROR:")
-set(CTEST_CUSTOM_WARNING_EXCEPTION
- ${CTEST_CUSTOM_WARNING_EXCEPTION}
+list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"xtree.[0-9]+. : warning C4702: unreachable code"
"warning LNK4221"
"warning LNK4204" # Occurs by race condition with objects in small libs
@@ -84,22 +82,18 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
)
if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
- set(CTEST_CUSTOM_COVERAGE_EXCLUDE
- ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
+ list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
"XCode"
)
endif ()
if(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
- set(CTEST_CUSTOM_COVERAGE_EXCLUDE
- ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
+ list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
"Kdevelop"
)
endif ()
-set(CTEST_CUSTOM_COVERAGE_EXCLUDE
- ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
-
+list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
# Exclude kwsys files from coverage results. They are reported
# (with better coverage results) on kwsys dashboards...
"/Source/(cm|kw)sys/"
diff --git a/Help/command/add_executable.rst b/Help/command/add_executable.rst
index 4ed10e1..8b3fb57 100644
--- a/Help/command/add_executable.rst
+++ b/Help/command/add_executable.rst
@@ -14,7 +14,7 @@ files listed in the command invocation. The ``<name>`` corresponds to the
logical target name and must be globally unique within a project. The
actual file name of the executable built is constructed based on
conventions of the native platform (such as ``<name>.exe`` or just
-``<name>``.
+``<name>``).
By default the executable file will be created in the build tree
directory corresponding to the source tree directory in which the
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index fe7735c..5033e18 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -36,6 +36,12 @@ property is set to ``ON`` automatically.
A ``SHARED`` library may be marked with the :prop_tgt:`FRAMEWORK`
target property to create an OS X Framework.
+If a library does not export any symbols, it must not be declared as a
+``SHARED`` library. For example, a Windows resource DLL or a managed C++/CLI
+DLL that exports no unmanaged symbols would need to be a ``MODULE`` library.
+This is because CMake expects a ``SHARED`` library to always have an
+associated import library on Windows.
+
By default the library file will be created in the build tree directory
corresponding to the source tree directory in which the command was
invoked. See documentation of the :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY`,
diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst
index 7e7e6bd..d8a96e9 100644
--- a/Help/command/add_test.rst
+++ b/Help/command/add_test.rst
@@ -28,6 +28,13 @@ quotes, or other characters special in CMake syntax. The options are:
directory set to the build directory corresponding to the
current source directory.
+The given test command is expected to exit with code ``0`` to pass and
+non-zero to fail, or vice-versa if the :prop_test:`WILL_FAIL` test
+property is set. Any output written to stdout or stderr will be
+captured by :manual:`ctest(1)` but does not affect the pass/fail status
+unless the :prop_test:`PASS_REGULAR_EXPRESSION` or
+:prop_test:`FAIL_REGULAR_EXPRESSION` test property is used.
+
The ``COMMAND`` and ``WORKING_DIRECTORY`` options may use "generator
expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
diff --git a/Help/command/ctest_read_custom_files.rst b/Help/command/ctest_read_custom_files.rst
index 0bc57cd..cf8e17a 100644
--- a/Help/command/ctest_read_custom_files.rst
+++ b/Help/command/ctest_read_custom_files.rst
@@ -9,3 +9,6 @@ read CTestCustom files.
Read all the CTestCustom.ctest or CTestCustom.cmake files from the
given directory.
+
+By default, invoking :manual:`ctest(1)` without a script will read custom
+files from the binary directory.
diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst
index 162db69..412e323 100644
--- a/Help/command/ctest_test.rst
+++ b/Help/command/ctest_test.rst
@@ -85,3 +85,6 @@ The options are:
been printed to the console. Output from the underlying test command is not
affected. Summary info detailing the percentage of passing tests is also
unaffected by the ``QUIET`` option.
+
+See also the :variable:`CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE`
+and :variable:`CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE` variables.
diff --git a/Help/command/file.rst b/Help/command/file.rst
index bbddd40..96ac6c7 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -103,7 +103,8 @@ Generate a list of files that match the ``<globbing-expressions>`` and
store it into the ``<variable>``. Globbing expressions are similar to
regular expressions, but much simpler. If ``RELATIVE`` flag is
specified, the results will be returned as relative paths to the given
-path.
+path. No specific order of results is defined. If order is important then
+sort the list explicitly (e.g. using the :command:`list(SORT)` command).
By default ``GLOB`` lists directories - directories are omited in result if
``LIST_DIRECTORIES`` is set to false.
diff --git a/Help/command/get_filename_component.rst b/Help/command/get_filename_component.rst
index 82f9120..14c8cf2 100644
--- a/Help/command/get_filename_component.rst
+++ b/Help/command/get_filename_component.rst
@@ -19,7 +19,7 @@ Set ``<VAR>`` to a component of ``<FileName>``, where ``<COMP>`` is one of:
NAME_WE = File name without directory or longest extension
PATH = Legacy alias for DIRECTORY (use for CMake <= 2.8.11)
-Paths are returned with forward slashes and have no trailing slahes.
+Paths are returned with forward slashes and have no trailing slashes.
The longest file extension is always considered. If the optional
``CACHE`` argument is specified, the result variable is added to the
cache.
diff --git a/Help/command/install.rst b/Help/command/install.rst
index c99ed73..423899e 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -192,6 +192,10 @@ The list of ``files...`` given to ``FILES`` or ``PROGRAMS`` may use
However, if any item begins in a generator expression it must evaluate
to a full path.
+The install destination given to the files install ``DESTINATION`` may
+use "generator expressions" with the syntax ``$<...>``. See the
+:manual:`cmake-generator-expressions(7)` manual for available expressions.
+
Installing Directories
^^^^^^^^^^^^^^^^^^^^^^
@@ -267,6 +271,10 @@ will install the ``icons`` directory to ``share/myproj/icons`` and the
file permissions, the scripts will be given specific permissions, and any
``CVS`` directories will be excluded.
+The install destination given to the directory install ``DESTINATION`` may
+use "generator expressions" with the syntax ``$<...>``. See the
+:manual:`cmake-generator-expressions(7)` manual for available expressions.
+
Custom Installation Logic
^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/command/string.rst b/Help/command/string.rst
index 20f8094..0361c74 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -1,102 +1,84 @@
string
------
+.. only:: html
+
+ .. contents::
+
String operations.
+Search and Replace
+^^^^^^^^^^^^^^^^^^
+
+FIND
+""""
+
::
- string(REGEX MATCH <regular_expression>
- <output variable> <input> [<input>...])
- string(REGEX MATCHALL <regular_expression>
- <output variable> <input> [<input>...])
- string(REGEX REPLACE <regular_expression>
- <replace_expression> <output variable>
- <input> [<input>...])
- string(REPLACE <match_string>
- <replace_string> <output variable>
- <input> [<input>...])
- string(APPEND <string variable> [<input>...])
- string(CONCAT <output variable> [<input>...])
- string(<MD5|SHA1|SHA224|SHA256|SHA384|SHA512>
- <output variable> <input>)
- string(COMPARE EQUAL <string1> <string2> <output variable>)
- string(COMPARE NOTEQUAL <string1> <string2> <output variable>)
- string(COMPARE LESS <string1> <string2> <output variable>)
- string(COMPARE GREATER <string1> <string2> <output variable>)
- string(ASCII <number> [<number> ...] <output variable>)
- string(CONFIGURE <string1> <output variable>
- [@ONLY] [ESCAPE_QUOTES])
- string(TOUPPER <string1> <output variable>)
- string(TOLOWER <string1> <output variable>)
- string(LENGTH <string> <output variable>)
- string(SUBSTRING <string> <begin> <length> <output variable>)
- string(STRIP <string> <output variable>)
- string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>]
- [RANDOM_SEED <seed>] <output variable>)
string(FIND <string> <substring> <output variable> [REVERSE])
- string(TIMESTAMP <output variable> [<format string>] [UTC])
- string(MAKE_C_IDENTIFIER <input string> <output variable>)
- string(GENEX_STRIP <input string> <output variable>)
- string(UUID <output variable> NAMESPACE <namespace> NAME <name>
- TYPE <MD5|SHA1> [UPPER])
-``REGEX MATCH`` will match the regular expression once and store the match
-in the output variable.
+Return the position where the given substring was found in
+the supplied string. If the ``REVERSE`` flag was used, the command will
+search for the position of the last occurrence of the specified
+substring. If the substring is not found, a position of -1 is returned.
-``REGEX MATCHALL`` will match the regular expression as many times as
-possible and store the matches in the output variable as a list.
+REPLACE
+"""""""
-``REGEX REPLACE`` will match the regular expression as many times as
-possible and substitute the replacement expression for the match in
-the output. The replace expression may refer to paren-delimited
-subexpressions of the match using \1, \2, ..., \9. Note that two
-backslashes (\\1) are required in CMake code to get a backslash
-through argument parsing.
+::
-``REPLACE`` will replace all occurrences of ``match_string`` in the input
+ string(REPLACE <match_string>
+ <replace_string> <output variable>
+ <input> [<input>...])
+
+Replace all occurrences of ``match_string`` in the input
with ``replace_string`` and store the result in the output.
-``APPEND`` will append all the input arguments to the string.
+Regular Expressions
+^^^^^^^^^^^^^^^^^^^
-``CONCAT`` will concatenate all the input arguments together and store
-the result in the named output variable.
+REGEX MATCH
+"""""""""""
-``MD5``, ``SHA1``, ``SHA224``, ``SHA256``, ``SHA384``, and ``SHA512`` will
-compute a cryptographic hash of the input string.
+::
-``COMPARE EQUAL``/``COMPARE NOTEQUAL``/``COMPARE LESS/GREATER`` will
-compare the strings and store true or false in the output variable.
+ string(REGEX MATCH <regular_expression>
+ <output variable> <input> [<input>...])
-``ASCII`` will convert all numbers into corresponding ASCII characters.
+Match the regular expression once and store the match in the output variable.
+All ``<input>`` arguments are concatenated before matching.
-``CONFIGURE`` will transform a string like :command:`configure_file`
-transforms a file.
+REGEX MATCHALL
+""""""""""""""
-``TOUPPER``/``TOLOWER`` will convert string to upper/lower characters.
+::
-``LENGTH`` will return a given string's length.
+ string(REGEX MATCHALL <regular_expression>
+ <output variable> <input> [<input>...])
-``SUBSTRING`` will return a substring of a given string. If length is -1
-the remainder of the string starting at begin will be returned.
-If string is shorter than length then end of string is used instead.
+Match the regular expression as many times as possible and store the matches
+in the output variable as a list.
+All ``<input>`` arguments are concatenated before matching.
-.. note::
- CMake 3.1 and below reported an error if length pointed past
- the end of string.
+REGEX REPLACE
+"""""""""""""
-``STRIP`` will return a substring of a given string with leading and
-trailing spaces removed.
+::
-``RANDOM`` will return a random string of given length consisting of
-characters from the given alphabet. Default length is 5 characters
-and default alphabet is all numbers and upper and lower case letters.
-If an integer ``RANDOM_SEED`` is given, its value will be used to seed the
-random number generator.
+ string(REGEX REPLACE <regular_expression>
+ <replace_expression> <output variable>
+ <input> [<input>...])
-``FIND`` will return the position where the given substring was found in
-the supplied string. If the ``REVERSE`` flag was used, the command will
-search for the position of the last occurrence of the specified
-substring. If the substring is not found, a position of -1 is returned.
+Match the regular expression as many times as possible and substitute the
+replacement expression for the match in the output.
+All ``<input>`` arguments are concatenated before matching.
+
+The replace expression may refer to paren-delimited subexpressions of the
+match using ``\1``, ``\2``, ..., ``\9``. Note that two backslashes (``\\1``)
+are required in CMake code to get a backslash through argument parsing.
+
+Regex Specification
+"""""""""""""""""""
The following characters have special meaning in regular expressions:
@@ -123,10 +105,159 @@ The following characters have special meaning in regular expressions:
``*``, ``+`` and ``?`` have higher precedence than concatenation. ``|``
has lower precedence than concatenation. This means that the regular
-expression "^ab+d$" matches "abbd" but not "ababd", and the regular
-expression "^(ab|cd)$" matches "ab" but not "abd".
+expression ``^ab+d$`` matches ``abbd`` but not ``ababd``, and the regular
+expression ``^(ab|cd)$`` matches ``ab`` but not ``abd``.
+
+Manipulation
+^^^^^^^^^^^^
+
+APPEND
+""""""
+
+::
+
+ string(APPEND <string variable> [<input>...])
+
+Append all the input arguments to the string.
+
+CONCAT
+""""""
+
+::
+
+ string(CONCAT <output variable> [<input>...])
+
+Concatenate all the input arguments together and store
+the result in the named output variable.
+
+TOLOWER
+"""""""
+
+::
+
+ string(TOLOWER <string1> <output variable>)
+
+Convert string to lower characters.
+
+TOUPPER
+"""""""
-``TIMESTAMP`` will write a string representation of the current date
+::
+
+ string(TOUPPER <string1> <output variable>)
+
+Convert string to upper characters.
+
+LENGTH
+""""""
+
+::
+
+ string(LENGTH <string> <output variable>)
+
+Store in an output variable a given string's length.
+
+SUBSTRING
+"""""""""
+
+::
+
+ string(SUBSTRING <string> <begin> <length> <output variable>)
+
+Store in an output variable a substring of a given string. If length is
+``-1`` the remainder of the string starting at begin will be returned.
+If string is shorter than length then end of string is used instead.
+
+.. note::
+ CMake 3.1 and below reported an error if length pointed past
+ the end of string.
+
+STRIP
+"""""
+
+::
+
+ string(STRIP <string> <output variable>)
+
+Store in an output variable a substring of a given string with leading and
+trailing spaces removed.
+
+GENEX_STRIP
+"""""""""""
+
+::
+
+ string(GENEX_STRIP <input string> <output variable>)
+
+Strip any :manual:`generator expressions <cmake-generator-expressions(7)>`
+from the ``input string`` and store the result in the ``output variable``.
+
+Comparison
+^^^^^^^^^^
+
+::
+
+ string(COMPARE EQUAL <string1> <string2> <output variable>)
+ string(COMPARE NOTEQUAL <string1> <string2> <output variable>)
+ string(COMPARE LESS <string1> <string2> <output variable>)
+ string(COMPARE GREATER <string1> <string2> <output variable>)
+
+Compare the strings and store true or false in the output variable.
+
+Hashing
+^^^^^^^
+
+::
+
+ string(<MD5|SHA1|SHA224|SHA256|SHA384|SHA512>
+ <output variable> <input>)
+
+Compute a cryptographic hash of the input string.
+
+Generation
+^^^^^^^^^^
+
+ASCII
+"""""
+
+::
+
+ string(ASCII <number> [<number> ...] <output variable>)
+
+Convert all numbers into corresponding ASCII characters.
+
+CONFIGURE
+"""""""""
+
+::
+
+ string(CONFIGURE <string1> <output variable>
+ [@ONLY] [ESCAPE_QUOTES])
+
+Transform a string like :command:`configure_file` transforms a file.
+
+RANDOM
+""""""
+
+::
+
+ string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>]
+ [RANDOM_SEED <seed>] <output variable>)
+
+Return a random string of given length consisting of
+characters from the given alphabet. Default length is 5 characters
+and default alphabet is all numbers and upper and lower case letters.
+If an integer ``RANDOM_SEED`` is given, its value will be used to seed the
+random number generator.
+
+TIMESTAMP
+"""""""""
+
+::
+
+ string(TIMESTAMP <output variable> [<format string>] [UTC])
+
+Write a string representation of the current date
and/or time to the output variable.
Should the command be unable to obtain a timestamp the output variable
@@ -163,14 +294,22 @@ If no explicit ``<format string>`` is given it will default to:
%Y-%m-%dT%H:%M:%S for local time.
%Y-%m-%dT%H:%M:%SZ for UTC.
-``MAKE_C_IDENTIFIER`` will write a string which can be used as an
-identifier in C.
-``GENEX_STRIP`` will strip any
-:manual:`generator expressions <cmake-generator-expressions(7)>` from the
-``input string`` and store the result in the ``output variable``.
+::
+
+ string(MAKE_C_IDENTIFIER <input string> <output variable>)
+
+Write a string which can be used as an identifier in C.
+
+UUID
+""""
+
+::
+
+ string(UUID <output variable> NAMESPACE <namespace> NAME <name>
+ TYPE <MD5|SHA1> [UPPER])
-``UUID`` creates a univerally unique identifier (aka GUID) as per RFC4122
+Create a univerally unique identifier (aka GUID) as per RFC4122
based on the hash of the combined values of ``<namespace>``
(which itself has to be a valid UUID) and ``<name>``.
The hash algorithm can be either ``MD5`` (Version 3 UUID) or
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst
index 1ed24df..28dae80 100644
--- a/Help/command/try_compile.rst
+++ b/Help/command/try_compile.rst
@@ -100,6 +100,7 @@ If set, the following variables are passed in to the generated
try_compile CMakeLists.txt to initialize compile target properties with
default values:
+* :variable:`CMAKE_ENABLE_EXPORTS`
* :variable:`CMAKE_LINK_SEARCH_START_STATIC`
* :variable:`CMAKE_LINK_SEARCH_END_STATIC`
* :variable:`CMAKE_POSITION_INDEPENDENT_CODE`
@@ -107,5 +108,7 @@ default values:
If :policy:`CMP0056` is set to ``NEW``, then
:variable:`CMAKE_EXE_LINKER_FLAGS` is passed in as well.
+The current setting of :policy:`CMP0065` is set in the generated project.
+
Set the :variable:`CMAKE_TRY_COMPILE_CONFIGURATION` variable to choose
a build configuration.
diff --git a/Help/manual/LINKS.txt b/Help/manual/LINKS.txt
index 38fd151..3993ff8 100644
--- a/Help/manual/LINKS.txt
+++ b/Help/manual/LINKS.txt
@@ -1,25 +1,25 @@
The following resources are available to get help using CMake:
Home Page
- http://www.cmake.org
+ https://cmake.org
The primary starting point for learning about CMake.
Frequently Asked Questions
- http://www.cmake.org/Wiki/CMake_FAQ
+ https://cmake.org/Wiki/CMake_FAQ
A Wiki is provided containing answers to frequently asked questions.
Online Documentation
- http://www.cmake.org/documentation
+ https://cmake.org/documentation
Links to available documentation may be found on this web page.
Mailing List
- http://www.cmake.org/mailing-lists
+ https://cmake.org/mailing-lists
For help and discussion about using cmake, a mailing list is
provided at cmake@cmake.org. 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
+ documentation at https://cmake.org before posting questions to
the list.
diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt
index b65b7c7..4207db4 100644
--- a/Help/manual/OPTIONS_BUILD.txt
+++ b/Help/manual/OPTIONS_BUILD.txt
@@ -77,49 +77,10 @@
Suppress developer warnings.
Suppress warnings that are meant for the author of the
- CMakeLists.txt files. By default this will also turn off
- deprecation warnings.
+ CMakeLists.txt files.
``-Wdev``
Enable developer warnings.
Enable warnings that are meant for the author of the CMakeLists.txt
- files. By default this will also turn on deprecation warnings.
-
-``-Werror=dev``
- Make developer warnings errors.
-
- Make warnings that are meant for the author of the CMakeLists.txt
- files errors. By default this will also turn on treatment of
- deprecation warnings as errors.
-
-``-Wno-error=dev``
- Make developer warnings not errors.
-
- Make warnings that are meant for the author of the CMakeLists.txt
- files not errors. By default this will also turn off treatment of
- deprecation warnings as errors.
-
-``-Wdeprecated``
- Enable deprecated macro and function warnings.
-
- Enable warnings for usage of deprecated macros and functions, that
- are meant for the author of the CMakeLists.txt files.
-
-``-Wno-deprecated``
- Suppress deprecated macro and function warnings.
-
- Suppress warnings for usage of deprecated macros and functions, that
- are meant for the author of the CMakeLists.txt files.
-
-``-Werror=deprecated``
- Make deprecated macro and function warnings errors.
-
- Make warnings for usage of deprecated macros and functions, that
- are meant for the author of the CMakeLists.txt files, errors.
-
-``-Wno-error=deprecated``
- Make deprecated macro and function warnings not errors.
-
- Make warnings for usage of deprecated macros and functions, that
- are meant for the author of the CMakeLists.txt files, not errors.
+ files.
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index 357aae9..bc633e6 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -80,6 +80,10 @@ regardless of the library type. The ``MODULE`` library type is
dissimilar in that it is generally not linked to -- it is not used in
the right-hand-side of the :command:`target_link_libraries` command.
It is a type which is loaded as a plugin using runtime techniques.
+If the library does not export any unmanaged symbols (e.g. Windows
+resource DLL, C++/CLI DLL), it is required that the library not be a
+``SHARED`` library because CMake expects ``SHARED`` libraries to export
+at least one symbol.
.. code-block:: cmake
@@ -781,7 +785,8 @@ An *archive* output artifact of a buildsystem target may be:
* On DLL platforms: the import library file (e.g. ``.lib``) of a shared
library target created by the :command:`add_library` command
- with the ``SHARED`` option.
+ with the ``SHARED`` option. This file is only guaranteed to exist if
+ the library exports at least one unmanaged symbol.
* On DLL platforms: the import library file (e.g. ``.lib``) of an
executable target created by the :command:`add_executable` command
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index 90a081d..a335384 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -52,9 +52,9 @@ When adding the first supported feature to a particular CompilerId, it is
necessary to list support for all features known to cmake (See
:variable:`CMAKE_C_COMPILE_FEATURES` and
:variable:`CMAKE_CXX_COMPILE_FEATURES` as appropriate), where available for
-the compiler. Furthermore, set ``CMAKE_<LANG>_STANDARD_DEFAULT`` to the
-default language standard level the compiler uses, or to the empty string
-if the compiler has no notion of standard levels (such as ``MSVC``).
+the compiler. Ensure that the ``CMAKE_<LANG>_STANDARD_DEFAULT`` is set to
+the computed internal variable ``CMAKE_<LANG>_STANDARD_COMPUTED_DEFAULT``
+for compiler versions which should be supported.
It is sensible to record the features for the most recent version of a
particular CompilerId first, and then work backwards. It is sensible to
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 189c3ef..13ee4bd 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -278,3 +278,7 @@ Available output expressions are:
object of type ``OBJECT_LIBRARY``. This expression may only be used in
the sources of :command:`add_library` and :command:`add_executable`
commands.
+``$<SHELL_PATH:...>``
+ Content of ``...`` converted to shell path style. For example, slashes are
+ converted to backslashes in Windows shells and drive letters are converted
+ to posix paths in MSYS shells. The ``...`` must be an absolute path.
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 590f10d..ae5354f 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -122,3 +122,4 @@ All Policies
/policy/CMP0062
/policy/CMP0063
/policy/CMP0064
+ /policy/CMP0065
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index ac893c2..931363c 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -254,17 +254,22 @@ Properties on Targets
/prop_tgt/TYPE
/prop_tgt/VERSION
/prop_tgt/VISIBILITY_INLINES_HIDDEN
+ /prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION
/prop_tgt/VS_DOTNET_REFERENCES
/prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION
/prop_tgt/VS_GLOBAL_KEYWORD
/prop_tgt/VS_GLOBAL_PROJECT_TYPES
/prop_tgt/VS_GLOBAL_ROOTNAMESPACE
/prop_tgt/VS_GLOBAL_variable
+ /prop_tgt/VS_IOT_EXTENSIONS_VERSION
+ /prop_tgt/VS_IOT_STARTUP_TASK
/prop_tgt/VS_KEYWORD
+ /prop_tgt/VS_MOBILE_EXTENSIONS_VERSION
/prop_tgt/VS_SCC_AUXPATH
/prop_tgt/VS_SCC_LOCALPATH
/prop_tgt/VS_SCC_PROJECTNAME
/prop_tgt/VS_SCC_PROVIDER
+ /prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
/prop_tgt/VS_WINRT_COMPONENT
/prop_tgt/VS_WINRT_EXTENSIONS
/prop_tgt/VS_WINRT_REFERENCES
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index a06dce7..492fcac 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -220,6 +220,23 @@ Windows CE to use. Currently version 8.0 (Windows Embedded Compact 2013) is
supported out of the box. Other versions may require one to set
:variable:`CMAKE_GENERATOR_TOOLSET` to the correct value.
+Cross Compiling for Windows 10 Universal Applications
+-----------------------------------------------------
+
+A toolchain file to configure a Visual Studio generator for a
+Windows 10 Universal Application may look like this:
+
+.. code-block:: cmake
+
+ set(CMAKE_SYSTEM_NAME WindowsStore)
+ set(CMAKE_SYSTEM_VERSION 10.0)
+
+A Windows 10 Universal Application targets both Windows Store and
+Windows Phone. Specify the :variable:`CMAKE_SYSTEM_VERSION` variable
+to be ``10.0`` to build with the latest available Windows 10 SDK.
+Specify a more specific version (e.g. ``10.0.10240.0`` for RTM)
+to build with the corresponding SDK.
+
Cross Compiling for Windows Phone
---------------------------------
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index e0dbdeb..2116900 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -82,6 +82,7 @@ Variables that Provide Information
/variable/CMAKE_VS_NsightTegra_VERSION
/variable/CMAKE_VS_PLATFORM_NAME
/variable/CMAKE_VS_PLATFORM_TOOLSET
+ /variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION
/variable/CMAKE_XCODE_PLATFORM_TOOLSET
/variable/PROJECT_BINARY_DIR
/variable/PROJECT-NAME_BINARY_DIR
@@ -245,6 +246,7 @@ Variables that Control the Build
/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG
/variable/CMAKE_CONFIG_POSTFIX
/variable/CMAKE_DEBUG_POSTFIX
+ /variable/CMAKE_ENABLE_EXPORTS
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG
/variable/CMAKE_EXE_LINKER_FLAGS
/variable/CMAKE_Fortran_FORMAT
@@ -374,6 +376,23 @@ Variables for CTest
/variable/CTEST_COVERAGE_COMMAND
/variable/CTEST_COVERAGE_EXTRA_FLAGS
/variable/CTEST_CURL_OPTIONS
+ /variable/CTEST_CUSTOM_COVERAGE_EXCLUDE
+ /variable/CTEST_CUSTOM_ERROR_EXCEPTION
+ /variable/CTEST_CUSTOM_ERROR_MATCH
+ /variable/CTEST_CUSTOM_ERROR_POST_CONTEXT
+ /variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT
+ /variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE
+ /variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS
+ /variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS
+ /variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
+ /variable/CTEST_CUSTOM_MEMCHECK_IGNORE
+ /variable/CTEST_CUSTOM_POST_MEMCHECK
+ /variable/CTEST_CUSTOM_POST_TEST
+ /variable/CTEST_CUSTOM_PRE_MEMCHECK
+ /variable/CTEST_CUSTOM_PRE_TEST
+ /variable/CTEST_CUSTOM_TEST_IGNORE
+ /variable/CTEST_CUSTOM_WARNING_EXCEPTION
+ /variable/CTEST_CUSTOM_WARNING_MATCH
/variable/CTEST_CVS_CHECKOUT
/variable/CTEST_CVS_COMMAND
/variable/CTEST_CVS_UPDATE_OPTIONS
@@ -383,6 +402,7 @@ Variables for CTest
/variable/CTEST_DROP_SITE_CDASH
/variable/CTEST_DROP_SITE_PASSWORD
/variable/CTEST_DROP_SITE_USER
+ /variable/CTEST_EXTRA_COVERAGE_GLOB
/variable/CTEST_GIT_COMMAND
/variable/CTEST_GIT_UPDATE_CUSTOM
/variable/CTEST_GIT_UPDATE_OPTIONS
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 50c856a..2fdf7f3 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -302,6 +302,12 @@ Options
``--test-command``
The test to run with the --build-and-test option.
+``--test-output-size-passed <size>``
+ Limit the output for passed tests to <size> bytes.
+
+``--test-output-size-failed <size>``
+ Limit the output for failed tests to <size> bytes.
+
``--test-timeout``
The time limit in seconds, internal use only.
diff --git a/Help/policy/CMP0065.rst b/Help/policy/CMP0065.rst
new file mode 100644
index 0000000..2ed775d
--- /dev/null
+++ b/Help/policy/CMP0065.rst
@@ -0,0 +1,27 @@
+CMP0065
+-------
+
+Do not add flags to export symbols from executables without
+the :prop_tgt:`ENABLE_EXPORTS` target property.
+
+CMake 3.3 and below, for historical reasons, always linked executables
+on some platforms with flags like ``-rdynamic`` to export symbols from
+the executables for use by any plugins they may load via ``dlopen``.
+CMake 3.4 and above prefer to do this only for executables that are
+explicitly marked with the :prop_tgt:`ENABLE_EXPORTS` target property.
+
+The ``OLD`` behavior of this policy is to always use the additional link
+flags when linking executables regardless of the value of the
+:prop_tgt:`ENABLE_EXPORTS` target property.
+
+The ``NEW`` behavior of this policy is to only use the additional link
+flags when linking executables if the :prop_tgt:`ENABLE_EXPORTS` target
+property is set to ``True``.
+
+This policy was introduced in CMake version 3.4. Unlike most policies,
+CMake version |release| does *not* warn by default when this policy
+is not set and simply uses OLD behavior. See documentation of the
+:variable:`CMAKE_POLICY_WARNING_CMP0065 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
+variable to control the warning.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/prop_sf/OBJECT_DEPENDS.rst b/Help/prop_sf/OBJECT_DEPENDS.rst
index 18022de..1d24960 100644
--- a/Help/prop_sf/OBJECT_DEPENDS.rst
+++ b/Help/prop_sf/OBJECT_DEPENDS.rst
@@ -3,9 +3,12 @@ OBJECT_DEPENDS
Additional files on which a compiled object file depends.
-Specifies a semicolon-separated list of full-paths to files on which
-any object files compiled from this source file depend. An object
-file will be recompiled if any of the named files is newer than it.
+Specifies a :ref:`;-list <CMake Language Lists>` of full-paths to
+files on which any object files compiled from this source file depend.
+On :ref:`Makefile Generators` and the :generator:`Ninja` generator an
+object file will be recompiled if any of the named files is newer than it.
+:ref:`Visual Studio Generators` and the :generator:`Xcode` generator
+cannot implement such compilation dependencies.
This property need not be used to specify the dependency of a source
file on a generated header file that it includes. Although the
@@ -14,5 +17,5 @@ necessary. If the generated header file is created by a custom
command in the same target as the source file, the automatic
dependency scanning process will recognize the dependency. If the
generated header file is created by another target, an inter-target
-dependency should be created with the add_dependencies command (if one
-does not already exist due to linking relationships).
+dependency should be created with the :command:`add_dependencies`
+command (if one does not already exist due to linking relationships).
diff --git a/Help/prop_tgt/ENABLE_EXPORTS.rst b/Help/prop_tgt/ENABLE_EXPORTS.rst
index 283f5a8..dfd4af7 100644
--- a/Help/prop_tgt/ENABLE_EXPORTS.rst
+++ b/Help/prop_tgt/ENABLE_EXPORTS.rst
@@ -7,7 +7,7 @@ Normally an executable does not export any symbols because it is the
final program. It is possible for an executable to export symbols to
be used by loadable modules. When this property is set to true CMake
will allow other targets to "link" to the executable with the
-TARGET_LINK_LIBRARIES command. On all platforms a target-level
+:command:`TARGET_LINK_LIBRARIES` command. On all platforms a target-level
dependency on the executable is created for targets that link to it.
For DLL platforms an import library will be created for the exported
symbols and then used for linking. All Windows-based systems
@@ -17,3 +17,6 @@ module will "link" to the executable using a flag like
"-bundle_loader". For other non-DLL platforms the link rule is simply
ignored since the dynamic loader will automatically bind symbols when
the module is loaded.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_ENABLE_EXPORTS` if it is set when a target is created.
diff --git a/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst
new file mode 100644
index 0000000..19d1620
--- /dev/null
+++ b/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst
@@ -0,0 +1,10 @@
+VS_DESKTOP_EXTENSIONS_VERSION
+-----------------------------
+
+Visual Studio Windows 10 Desktop Extensions Version
+
+Specifies the version of the Desktop Extensions that should be included in the
+target. For example ``10.0.10240.0``. If the value is not specified, the Desktop
+Extensions will not be included. To use the same version of the extensions as
+the Windows 10 SDK that is being used, you can use the
+:variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION` variable.
diff --git a/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst
new file mode 100644
index 0000000..27c8a3d
--- /dev/null
+++ b/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst
@@ -0,0 +1,10 @@
+VS_IOT_EXTENSIONS_VERSION
+-------------------------
+
+Visual Studio Windows 10 IoT Extensions Version
+
+Specifies the version of the IoT Extensions that should be included in the
+target. For example ``10.0.10240.0``. If the value is not specified, the IoT
+Extensions will not be included. To use the same version of the extensions as
+the Windows 10 SDK that is being used, you can use the
+:variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION` variable.
diff --git a/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst b/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst
new file mode 100644
index 0000000..add50cb
--- /dev/null
+++ b/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst
@@ -0,0 +1,6 @@
+VS_IOT_STARTUP_TASK
+-------------------
+
+Visual Studio Windows 10 IoT Continuous Background Task
+
+Specifies that the target should be compiled as a Continuous Background Task library.
diff --git a/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst
new file mode 100644
index 0000000..be3c9a0
--- /dev/null
+++ b/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst
@@ -0,0 +1,10 @@
+VS_MOBILE_EXTENSIONS_VERSION
+----------------------------
+
+Visual Studio Windows 10 Mobile Extensions Version
+
+Specifies the version of the Mobile Extensions that should be included in the
+target. For example ``10.0.10240.0``. If the value is not specified, the Mobile
+Extensions will not be included. To use the same version of the extensions as
+the Windows 10 SDK that is being used, you can use the
+:variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION` variable.
diff --git a/Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst b/Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst
new file mode 100644
index 0000000..1ad7a71
--- /dev/null
+++ b/Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst
@@ -0,0 +1,10 @@
+VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
+--------------------------------------
+
+Visual Studio Windows Target Platform Minimum Version
+
+For Windows 10. Specifies the minimum version of the OS that is being
+targeted. For example ``10.0.10240.0``. If the value is not specified, the
+value of :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION` will be used on
+WindowsStore projects otherwise the target platform minimum version will not
+be specified for the project.
diff --git a/Help/release/3.4.rst b/Help/release/3.4.rst
new file mode 100644
index 0000000..89c5561
--- /dev/null
+++ b/Help/release/3.4.rst
@@ -0,0 +1,273 @@
+CMake 3.4 Release Notes
+***********************
+
+.. only:: html
+
+ .. contents::
+
+Changes made since CMake 3.3 include the following.
+
+New Features
+============
+
+Generators
+----------
+
+* The :generator:`Visual Studio 14 2015` generator learned to select
+ a Windows 10 SDK based on the value of the :variable:`CMAKE_SYSTEM_VERSION`
+ variable and the SDKs available on the host.
+
+* CMake learned rudimentary support for the Apple Swift language. When using
+ the :generator:`Xcode` generator with Xcode 6.1 or higher, one may enable
+ the ``Swift`` language with the :command:`enable_language` command or the
+ :command:`project` command (this is an error with other generators or when
+ Xcode is too old). Then one may list ``.swift`` source files in targets
+ for compilation.
+
+Commands
+--------
+
+* The :command:`find_program` command learned a ``NAMES_PER_DIR``
+ option to consider all given ``NAMES`` in each directory before
+ moving on to the next directory.
+
+* The :command:`get_filename_component` command learned a new ``BASE_DIR``
+ subcommand. This is used to specify a base directory when calculating an
+ absolute path from a relative path.
+
+* The :command:`if` command learned a new ``TEST`` operator that evaluates
+ to true if a given test name has been defined by the :command:`add_test`
+ command. See policy :policy:`CMP0064`.
+
+* The :command:`install(DIRECTORY)` command ``DESTINATION`` option learned to
+ support :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+* The :command:`install(FILES)` command ``DESTINATION`` option learned to
+ support :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+* The :command:`string` command learned a new ``APPEND`` subcommand.
+
+Variables
+---------
+
+* The :ref:`Makefile Generators` and the :generator:`Ninja` generator
+ learned to add compiler launcher tools like distcc and ccache along
+ with the compiler for ``C`` and ``CXX`` languages. See the
+ :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable and
+ :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property for details.
+
+* New :variable:`CMAKE_LINK_SEARCH_START_STATIC` and
+ :variable:`CMAKE_LINK_SEARCH_END_STATIC` variables were
+ introduced to initialize the
+ :prop_tgt:`LINK_SEARCH_START_STATIC` and
+ :prop_tgt:`LINK_SEARCH_END_STATIC` target properties,
+ respectively.
+
+Properties
+----------
+
+* :ref:`Visual Studio Generators` learned to support additonal
+ target properties to customize projects for NVIDIA Nsight
+ Tegra Visual Studio Edition:
+
+ * :prop_tgt:`ANDROID_ANT_ADDITIONAL_OPTIONS`
+ * :prop_tgt:`ANDROID_ARCH`
+ * :prop_tgt:`ANDROID_ASSETS_DIRECTORIES`
+ * :prop_tgt:`ANDROID_JAR_DEPENDENCIES`
+ * :prop_tgt:`ANDROID_JAR_DIRECTORIES`
+ * :prop_tgt:`ANDROID_JAVA_SOURCE_DIR`
+ * :prop_tgt:`ANDROID_NATIVE_LIB_DEPENDENCIES`
+ * :prop_tgt:`ANDROID_NATIVE_LIB_DIRECTORIES`
+ * :prop_tgt:`ANDROID_PROCESS_MAX`
+ * :prop_tgt:`ANDROID_PROGUARD`
+ * :prop_tgt:`ANDROID_PROGUARD_CONFIG_PATH`
+ * :prop_tgt:`ANDROID_SECURE_PROPS_PATH`
+ * :prop_tgt:`ANDROID_SKIP_ANT_STEP`
+ * :prop_tgt:`ANDROID_STL_TYPE`
+
+* The :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY`,
+ :prop_tgt:`LIBRARY_OUTPUT_DIRECTORY`, and
+ :prop_tgt:`RUNTIME_OUTPUT_DIRECTORY` target properties learned to
+ support :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+* The :prop_tgt:`SOURCE_DIR` and :prop_tgt:`BINARY_DIR` target properties
+ were introduced to allow project code to query where a target is defined.
+
+* The :prop_tgt:`OUTPUT_NAME` target property and its variants learned to
+ support :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+* A :prop_gbl:`TARGET_MESSAGES` global property was added to tell the
+ :ref:`Makefile Generators` whether to generate commands to print output
+ after each target is completed.
+
+* On Windows with MS-compatible tools, CMake learned to optionally
+ generate a module definition (``.def``) file for ``SHARED`` libraries.
+ See the :prop_tgt:`WINDOWS_EXPORT_ALL_SYMBOLS` target property.
+
+Modules
+-------
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add`
+ function ``GIT_SUBMODULES`` option now also limits the set of
+ submodules that are initialized in addition to the prior behavior
+ of limiting the set of submodules that are updated.
+
+* The :module:`ExternalProject` module learned new ``USES_TERMINAL``
+ arguments for giving steps exclusive terminal access. This is
+ useful with the :generator:`Ninja` generator to monitor CMake
+ superbuild progress and prevent CPU oversubscription.
+
+* The :module:`FindBISON` module ``BISON_TARGET`` macro learned a
+ new ``DEFINES_FILE`` option to specify a custom output header
+ to be generated.
+
+* The :module:`FindHDF5` module learend a new ``HDF5_PREFER_PARALLEL``
+ option allowing users to specify that a parallel HDF5 tool is
+ preferred if both are available.
+
+* The :module:`FindIce` module now provides imported targets.
+
+* The :module:`FindJava` module learned to optionally find
+ the ``idlj`` and ``jarsigner`` tools.
+
+* The :module:`FindOpenSSL` module now provides imported targets.
+
+* The :module:`FindOpenSSL` module learned a new ``OPENSSL_USE_STATIC_LIBS``
+ option to search only for static libraries.
+
+* The :module:`FindPkgConfig` learned a new :command:`pkg_get_variable`
+ command which may be used to query for arbitrary variables from a package
+ (such as for related tools or data and plugin install paths).
+
+* The :module:`FindProtobuf` module gained a new
+ :command:`protobuf_generate_python` function to generate python
+ sources from ``.proto`` files.
+
+* The :module:`FindTIFF` module learned to search separately for
+ debug and release variants.
+
+* The :module:`FindwxWidgets` module learned to support version requests.
+
+* The :module:`FindXercesC` module learned to search separately for
+ debug and release variants.
+
+* The :module:`FindZLIB` module learned to search separately for
+ debug and release variants.
+
+* The :module:`GNUInstallDirs` module learned special default values
+ for certain installation prefixes according to the `GNU Coding
+ Standards`_ and the `Filesystem Hierarchy Standard`_.
+
+* The :module:`UseJava` module ``add_jar`` function learned
+ to support response files (e.g. ``@srcs.txt``) for source
+ specification.
+
+* The :module:`UseJava` module ``install_jar`` function learned
+ new ``DESTINATION`` and ``COMPONENT`` options to specify
+ the corresponding :command:`install` command options.
+
+* The :module:`UseJava` module gained a new ``create_javah``
+ function to create C headers from Java classes.
+
+.. _`GNU Coding Standards`: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
+.. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
+
+Generator Expressions
+---------------------
+
+* A new ``$<SHELL_PATH:...>``
+ :manual:`generator expression <cmake-generator-expressions(7)>`
+ has been added.
+
+CTest
+-----
+
+* CTest learned to optionally measure the CPU load during parallel
+ testing and avoid starting tests that may cause the load to exceed
+ a given threshold. See the :manual:`ctest(1)` command ``--test-load``
+ option, the ``TestLoad`` setting of the :ref:`CTest Test Step`,
+ the :variable:`CTEST_TEST_LOAD` variable, and the ``TEST_LOAD``
+ option of the :command:`ctest_test` command.
+
+* :manual:`ctest(1)` learned options
+ ``--test-output-size-passed`` and ``--test-output-size-failed``
+ to customize the limit on test output size submitted when
+ running as a :ref:`Dashboard Client`.
+
+CPack
+-----
+
+* The :module:`CPackDeb` module learned to set package dependencies
+ per component. See variables:
+
+ * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKS`
+ * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONFLICTS`
+ * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES`
+ * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS`
+ * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_PROVIDES`
+ * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDS`
+ * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACES`
+ * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTS`
+
+* The :module:`CPack` module learned to package empty directories.
+
+* The :module:`CPack` module gained a new setting, ``CPACK_VERBATIM_VARIABLES``,
+ which can be used to ensure the cpack program receives the settings' values
+ exactly as they were set, even if they contain CMake-special characters.
+ For compatibility, it's off by default.
+
+Other
+-----
+
+* The :manual:`Compile Features <cmake-compile-features(7)>` functionality
+ is now aware of features supported by GNU C compilers on Windows.
+
+* CMake learned to honor ``*.manifest`` source files with MSVC tools.
+ Manifest files named as sources of ``.exe`` and ``.dll`` targets
+ will be merged with linker-generated manifests and embedded in the
+ binary.
+
+* The `Concurrent Fortran 77 <https://ccur.com>`__ compiler is now supported.
+ Its :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` is ``CCur``.
+
+* :manual:`cmake(1)` gained a new ``--trace-expand`` command line option
+ that is like ``--trace`` but expands variable references in the output.
+
+Deprecated and Removed Features
+===============================
+
+* The :module:`CMakeExpandImportedTargets` module is now documented
+ as deprecated. See module documentation for an explanation.
+
+* The :variable:`CMAKE_USE_RELATIVE_PATHS` variable no longer has any
+ effect. Previously it was partially implemented and unreliable.
+
+Other Changes
+=============
+
+* The :module:`CheckFunctionExists`, :module:`CheckLibraryExists`,
+ :module:`CheckSymbolExists`, and :module:`FindThreads` modules learned to
+ work in environments where only CXX is enabled.
+
+* The :module:`CPackDeb` module now correctly excludes symlinks during package
+ checksum calculation.
+
+* The :module:`CPackDeb` no longer uses fakeroot and system tar program for
+ packaging.
+
+* The :module:`CPack` module no longer mangles settings with CMake-special
+ characters when they're used as defaults for other settings. The macro
+ ``cpack_set_if_not_set``, which was responsible for this, is now deprecated.
+
+* CMake no longer links executables with flags to export symbols
+ unless the :prop_tgt:`ENABLE_EXPORTS` target property is set.
+ See policy :policy:`CMP0065`.
+
+* The ``SONAME`` field is no longer set for ``MODULE`` libraries
+ created with the :command:`add_library` command. ``MODULE``
+ libraries are meant for explicit dynamic loading at runtime.
+ They cannot be linked so ``SONAME`` is not useful.
+
+* The internal :variable:`CMAKE_<LANG>_COMPILE_OBJECT` rule variable now
+ substitutes compiler include flags in a separate ``<INCLUDES>`` placeholder
+ instead of the main ``<FLAGS>`` placeholder.
diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst
deleted file mode 100644
index e4cc01e..0000000
--- a/Help/release/dev/0-sample-topic.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-0-sample-topic
---------------
-
-* This is a sample release note for the change in a topic.
- Developers should add similar notes for each topic branch
- making a noteworthy change. Each document should be named
- and titled to match the topic name to avoid merge conflicts.
diff --git a/Help/release/dev/ConcurrentFortran-compiler-id.rst b/Help/release/dev/ConcurrentFortran-compiler-id.rst
deleted file mode 100644
index 71e79aa..0000000
--- a/Help/release/dev/ConcurrentFortran-compiler-id.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-ConcurrentFortran-compiler-id
------------------------------
-
-* The `Concurrent Fortran 77 <https://ccur.com>`__ compiler is now supported.
- Its :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` is ``CCur``.
diff --git a/Help/release/dev/ExternalProject-USES_TERMINAL.rst b/Help/release/dev/ExternalProject-USES_TERMINAL.rst
deleted file mode 100644
index 415540d..0000000
--- a/Help/release/dev/ExternalProject-USES_TERMINAL.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-ExternalProject-USES_TERMINAL
------------------------------
-
-* The :module:`ExternalProject` module learned new ``USES_TERMINAL``
- arguments for giving steps exclusive terminal access. Especially
- useful with the :generator:`Ninja` generator to monitor CMake
- superbuild progress and prevent CPU oversubscription.
diff --git a/Help/release/dev/ExternalProject_init_selected_submodules.rst b/Help/release/dev/ExternalProject_init_selected_submodules.rst
deleted file mode 100644
index e642c19..0000000
--- a/Help/release/dev/ExternalProject_init_selected_submodules.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-ExternalProject_init_selected_submodules
-----------------------------------------
-
-* The :module:`ExternalProject` module :command:`ExternalProject_Add`
- function ``GIT_SUBMODULES`` option now also limits the set of
- submodules that are initialized in addition to the prior behavior
- of limiting the set of submodules that are updated.
diff --git a/Help/release/dev/FindBISON-DEFINES_FILE.rst b/Help/release/dev/FindBISON-DEFINES_FILE.rst
deleted file mode 100644
index 815d560..0000000
--- a/Help/release/dev/FindBISON-DEFINES_FILE.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-FindBISON-DEFINES_FILE
-----------------------
-
-* The :module:`FindBISON` module ``BISON_TARGET`` macro learned a
- new ``DEFINES_FILE`` option to specify a custom output header
- to be generated.
diff --git a/Help/release/dev/FindIce-imported-targets.rst b/Help/release/dev/FindIce-imported-targets.rst
deleted file mode 100644
index 7e1b2f4..0000000
--- a/Help/release/dev/FindIce-imported-targets.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-FindIce-imported-targets
-------------------------
-
-* The :module:`FindIce` module now provides imported targets.
diff --git a/Help/release/dev/FindTIFF-updates.rst b/Help/release/dev/FindTIFF-updates.rst
deleted file mode 100644
index 083e40f..0000000
--- a/Help/release/dev/FindTIFF-updates.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-FindTIFF-updates
-----------------
-
-* The :module:`FindTIFF` module learned to search separately for
- debug and release variants.
diff --git a/Help/release/dev/FindXercesC-updates.rst b/Help/release/dev/FindXercesC-updates.rst
deleted file mode 100644
index 47a8ada..0000000
--- a/Help/release/dev/FindXercesC-updates.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-FindXercesC-updates
--------------------
-
-* The :module:`FindXercesC` module learned to search separately for
- debug and release variants.
diff --git a/Help/release/dev/GNUInstallDirs-special-prefixes.rst b/Help/release/dev/GNUInstallDirs-special-prefixes.rst
deleted file mode 100644
index 83c1352..0000000
--- a/Help/release/dev/GNUInstallDirs-special-prefixes.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-GNUInstallDirs-special-prefixes
--------------------------------
-
-* The :module:`GNUInstallDirs` module learned special default values
- for certain installation prefixes according to the `GNU Coding
- Standards`_ and the `Filesystem Hierarchy Standard`_.
-
-.. _`GNU Coding Standards`: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
-.. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
diff --git a/Help/release/dev/OUTPUT_DIRECTORY-genex.rst b/Help/release/dev/OUTPUT_DIRECTORY-genex.rst
deleted file mode 100644
index 8b839c0..0000000
--- a/Help/release/dev/OUTPUT_DIRECTORY-genex.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-OUTPUT_DIRECTORY-genex
-----------------------
-
-* The :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY`,
- :prop_tgt:`LIBRARY_OUTPUT_DIRECTORY`, and
- :prop_tgt:`RUNTIME_OUTPUT_DIRECTORY` target properties learned to
- support :manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/release/dev/OUTPUT_NAME-genex.rst b/Help/release/dev/OUTPUT_NAME-genex.rst
deleted file mode 100644
index 0a39820..0000000
--- a/Help/release/dev/OUTPUT_NAME-genex.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-OUTPUT_NAME-genex
------------------
-
-* The :prop_tgt:`OUTPUT_NAME` target property and its variants learned to
- support :manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/release/dev/add-apple-swift-language.rst b/Help/release/dev/add-apple-swift-language.rst
deleted file mode 100644
index 60ce5d8..0000000
--- a/Help/release/dev/add-apple-swift-language.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-add-apple-swift-language
-------------------------
-
-* CMake learned rudimentary support for the Apple Swift language. When using
- the :generator:`Xcode` generator with Xcode 6.1 or higher, one may enable
- the ``Swift`` language with the :command:`enable_language` command or the
- :command:`project` command (this is an error with other generators or when
- Xcode is too old). Then one may list ``.swift`` source files in targets
- for compilation.
diff --git a/Help/release/dev/add-link-search-static-properties-defaults.rst b/Help/release/dev/add-link-search-static-properties-defaults.rst
deleted file mode 100644
index 98dda30..0000000
--- a/Help/release/dev/add-link-search-static-properties-defaults.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-add-link-search-static-properties-defaults
-------------------------------------------
-
-* New :variable:`CMAKE_LINK_SEARCH_START_STATIC` and
- :variable:`CMAKE_LINK_SEARCH_END_STATIC` variables were
- introduced to initialize the
- :prop_tgt:`LINK_SEARCH_START_STATIC` and
- :prop_tgt:`LINK_SEARCH_END_STATIC` target properties,
- respectively.
diff --git a/Help/release/dev/auto_export_dll_symbols.rst b/Help/release/dev/auto_export_dll_symbols.rst
deleted file mode 100644
index 9db2b5e..0000000
--- a/Help/release/dev/auto_export_dll_symbols.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-auto_export_dll_symbols
------------------------
-
-* On Windows with MS-compatible tools, CMake learned to optionally
- generate a module definition (``.def``) file for ``SHARED`` libraries.
- See the :prop_tgt:`WINDOWS_EXPORT_ALL_SYMBOLS` target property.
diff --git a/Help/release/dev/cmake-W-options.rst b/Help/release/dev/cmake-W-options.rst
deleted file mode 100644
index c0b51d0..0000000
--- a/Help/release/dev/cmake-W-options.rst
+++ /dev/null
@@ -1,13 +0,0 @@
-cmake-W-options
----------------
-
-* The :variable:`CMAKE_ERROR_DEPRECATED` variable can now be set using the
- ``-Werror=deprecated`` and ``-Wno-error=deprecated`` :manual:`cmake(1)`
- options.
-
-* The :variable:`CMAKE_WARN_DEPRECATED` variable can now be set using the
- ``-Wdeprecated`` and ``-Wno-deprecated`` :manual:`cmake(1)` options.
-
-* :manual:`cmake(1)` gained options ``-Werror=dev`` and ``-Wno-error=dev``
- to control whether developer warnings intended for project authors
- are treated as errors.
diff --git a/Help/release/dev/compiler-launcher.rst b/Help/release/dev/compiler-launcher.rst
deleted file mode 100644
index 3ba692d..0000000
--- a/Help/release/dev/compiler-launcher.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-compiler-launcher
------------------
-
-* The :ref:`Makefile Generators` and the :generator:`Ninja` generator
- learned to add compiler launcher tools like distcc and ccache along with the
- compiler for ``C`` and ``CXX`` languages. See the
- :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable and
- :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property for details.
diff --git a/Help/release/dev/ctest-test-load-option.rst b/Help/release/dev/ctest-test-load-option.rst
deleted file mode 100644
index 069f49a..0000000
--- a/Help/release/dev/ctest-test-load-option.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-ctest-test-load-option
-----------------------
-
-* CTest learned to optionally measure the CPU load during parallel
- testing and avoid starting tests that may cause the load to exceed
- a given threshold. See the :manual:`ctest(1)` command ``--test-load``
- option, the ``TestLoad`` setting of the :ref:`CTest Test Step`,
- the :variable:`CTEST_TEST_LOAD` variable, and the ``TEST_LOAD``
- option of the :command:`ctest_test` command.
diff --git a/Help/release/dev/doc-CMakeExpandImportedTargets-deprecated.rst b/Help/release/dev/doc-CMakeExpandImportedTargets-deprecated.rst
deleted file mode 100644
index 3bdaebe..0000000
--- a/Help/release/dev/doc-CMakeExpandImportedTargets-deprecated.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-doc-CMakeExpandImportedTargets-deprecated
------------------------------------------
-
-* The :module:`CMakeExpandImportedTargets` module is now documented
- as deprecated. See module documentation for an explanation.
diff --git a/Help/release/dev/find_program-NAMES_PER_DIR.rst b/Help/release/dev/find_program-NAMES_PER_DIR.rst
deleted file mode 100644
index 04cd170..0000000
--- a/Help/release/dev/find_program-NAMES_PER_DIR.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-find_program-NAMES_PER_DIR
---------------------------
-
-* The :command:`find_program` command learned a ``NAMES_PER_DIR``
- option to consdier all given ``NAMES`` in each directory before
- moving on to the next directory.
diff --git a/Help/release/dev/get-filename-component-base-dir.rst b/Help/release/dev/get-filename-component-base-dir.rst
deleted file mode 100644
index c0df759..0000000
--- a/Help/release/dev/get-filename-component-base-dir.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-get-filename-component-base-dir
--------------------------------
-
-* The :command:`get_filename_component` command learned a new ``BASE_DIR``
- subcommand. This is used to specify a base directory when calculating an
- absolute path from a relative path.
diff --git a/Help/release/dev/if-TEST.rst b/Help/release/dev/if-TEST.rst
deleted file mode 100644
index 05bf71c..0000000
--- a/Help/release/dev/if-TEST.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-if-TEST
--------
-
-* Add a new TEST operator to if() that evaluates to true
- if a given test name has been defined.
diff --git a/Help/release/dev/java-updates.rst b/Help/release/dev/java-updates.rst
deleted file mode 100644
index 8fd4ed6..0000000
--- a/Help/release/dev/java-updates.rst
+++ /dev/null
@@ -1,16 +0,0 @@
-java-updates
-------------
-
-* The :module:`FindJava` module learned to optionally find
- the ``idlj`` and ``jarsigner`` tools.
-
-* The :module:`UseJava` module ``add_jar`` function learned
- to support response files (e.g. ``@srcs.txt``) for source
- specification.
-
-* The :module:`UseJava` module ``install_jar`` function learned
- new ``DESTINATION`` and ``COMPONENT`` options to specify
- the corresponding :command:`install` command options.
-
-* The :module:`UseJava` module gained a new ``create_javah``
- function to create C headers from Java classes.
diff --git a/Help/release/dev/makefile-target-messages.rst b/Help/release/dev/makefile-target-messages.rst
deleted file mode 100644
index 3d2cd9b..0000000
--- a/Help/release/dev/makefile-target-messages.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-makefile-target-messages
-------------------------
-
-* A :prop_gbl:`TARGET_MESSAGES` global property was added to tell the
- :ref:`Makefile Generators` whether to generate commands to print output
- after each target is completed.
diff --git a/Help/release/dev/modules-no-soname.rst b/Help/release/dev/modules-no-soname.rst
deleted file mode 100644
index 8fe74f8..0000000
--- a/Help/release/dev/modules-no-soname.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-modules-no-soname
------------------
-
-* The ``SONAME`` field is no longer set for ``MODULE`` libraries
- created with the :command:`add_library` command. ``MODULE``
- libraries are meant for explicit dynamic loading at runtime.
- They cannot be linked so ``SONAME`` is not useful.
diff --git a/Help/release/dev/remove-CMAKE_USE_RELATIVE_PATHS.rst b/Help/release/dev/remove-CMAKE_USE_RELATIVE_PATHS.rst
deleted file mode 100644
index dd52ace..0000000
--- a/Help/release/dev/remove-CMAKE_USE_RELATIVE_PATHS.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-remove-CMAKE_USE_RELATIVE_PATHS
--------------------------------
-
-* The :variable:`CMAKE_USE_RELATIVE_PATHS` variable no longer has any
- effect. Previously it was partially implemented and unreliable.
diff --git a/Help/release/dev/string-append.rst b/Help/release/dev/string-append.rst
deleted file mode 100644
index 190b51e..0000000
--- a/Help/release/dev/string-append.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-string-append
--------------
-
-* The :command:`string` command learned a new ``APPEND`` subcommand.
diff --git a/Help/release/dev/target-directory-properties.rst b/Help/release/dev/target-directory-properties.rst
deleted file mode 100644
index 5ab2938..0000000
--- a/Help/release/dev/target-directory-properties.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-target-directory-properties
----------------------------
-
-* The :prop_tgt:`SOURCE_DIR` and :prop_tgt:`BINARY_DIR` target properties
- were introduced to allow project code to query where a target is defined.
diff --git a/Help/release/dev/trace-expand.rst b/Help/release/dev/trace-expand.rst
deleted file mode 100644
index 383326e..0000000
--- a/Help/release/dev/trace-expand.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-trace-expand
-------------
-
-* Add ``--trace-expand`` argument to CMake. Acts like ``--trace``, but expands
- variable references in the output.
diff --git a/Help/release/dev/vs-nsight-tegra-attributes.rst b/Help/release/dev/vs-nsight-tegra-attributes.rst
deleted file mode 100644
index 7ebea33..0000000
--- a/Help/release/dev/vs-nsight-tegra-attributes.rst
+++ /dev/null
@@ -1,21 +0,0 @@
-vs-nsight-tegra-attributes
---------------------------
-
-* :ref:`Visual Studio Generators` learned to support additonal
- target properties to customize projects for NVIDIA Nsight
- Tegra Visual Studio Edition:
-
- * :prop_tgt:`ANDROID_ANT_ADDITIONAL_OPTIONS`
- * :prop_tgt:`ANDROID_ARCH`
- * :prop_tgt:`ANDROID_ASSETS_DIRECTORIES`
- * :prop_tgt:`ANDROID_JAR_DEPENDENCIES`
- * :prop_tgt:`ANDROID_JAR_DIRECTORIES`
- * :prop_tgt:`ANDROID_JAVA_SOURCE_DIR`
- * :prop_tgt:`ANDROID_NATIVE_LIB_DEPENDENCIES`
- * :prop_tgt:`ANDROID_NATIVE_LIB_DIRECTORIES`
- * :prop_tgt:`ANDROID_PROCESS_MAX`
- * :prop_tgt:`ANDROID_PROGUARD`
- * :prop_tgt:`ANDROID_PROGUARD_CONFIG_PATH`
- * :prop_tgt:`ANDROID_SECURE_PROPS_PATH`
- * :prop_tgt:`ANDROID_SKIP_ANT_STEP`
- * :prop_tgt:`ANDROID_STL_TYPE`
diff --git a/Help/release/index.rst b/Help/release/index.rst
index b558e9d..5d1a3f7 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -5,14 +5,13 @@ CMake Release Notes
This file should include the adjacent "dev.txt" file
in development versions but not in release versions.
-.. include:: dev.txt
-
Releases
========
.. toctree::
:maxdepth: 1
+ 3.4 <3.4>
3.3 <3.3>
3.2 <3.2>
3.1 <3.1>
diff --git a/Help/variable/CMAKE_ENABLE_EXPORTS.rst b/Help/variable/CMAKE_ENABLE_EXPORTS.rst
new file mode 100644
index 0000000..1f9ba6f
--- /dev/null
+++ b/Help/variable/CMAKE_ENABLE_EXPORTS.rst
@@ -0,0 +1,22 @@
+CMAKE_ENABLE_EXPORTS
+--------------------
+
+Specify whether an executable exports symbols for loadable modules.
+
+Normally an executable does not export any symbols because it is the
+final program. It is possible for an executable to export symbols to
+be used by loadable modules. When this property is set to true CMake
+will allow other targets to "link" to the executable with the
+:command:`TARGET_LINK_LIBRARIES` command. On all platforms a target-level
+dependency on the executable is created for targets that link to it.
+For DLL platforms an import library will be created for the exported
+symbols and then used for linking. All Windows-based systems
+including Cygwin are DLL platforms. For non-DLL platforms that
+require all symbols to be resolved at link time, such as Mac OS X, the
+module will "link" to the executable using a flag like
+"-bundle_loader". For other non-DLL platforms the link rule is simply
+ignored since the dynamic loader will automatically bind symbols when
+the module is loaded.
+
+This variable is used to initialize the target property
+:prop_tgt:`ENABLE_EXPORTS` for executable targets.
diff --git a/Help/variable/CMAKE_ERROR_DEPRECATED.rst b/Help/variable/CMAKE_ERROR_DEPRECATED.rst
index 39dc4a8..277a4cc 100644
--- a/Help/variable/CMAKE_ERROR_DEPRECATED.rst
+++ b/Help/variable/CMAKE_ERROR_DEPRECATED.rst
@@ -6,7 +6,3 @@ Whether to issue deprecation errors for macros and functions.
If ``TRUE``, this can be used by macros and functions to issue fatal
errors when deprecated macros or functions are used. This variable is
``FALSE`` by default.
-
-These errors can be enabled with the ``-Werror=deprecated`` option, or
-disabled with the ``-Wno-error=deprecated`` option, when running
-:manual:`cmake(1)`.
diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
index 8de0d56..582f9e4 100644
--- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
+++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
@@ -13,6 +13,8 @@ warn by default:
policy :policy:`CMP0056`.
* ``CMAKE_POLICY_WARNING_CMP0060`` controls the warning for
policy :policy:`CMP0060`.
+* ``CMAKE_POLICY_WARNING_CMP0065`` controls the warning for
+ policy :policy:`CMP0065`.
This variable should not be set by a project in CMake code. Project
developers running CMake may set this variable in their cache to
diff --git a/Help/variable/CMAKE_SYSTEM_NAME.rst b/Help/variable/CMAKE_SYSTEM_NAME.rst
index 0466da4..c3a42e5 100644
--- a/Help/variable/CMAKE_SYSTEM_NAME.rst
+++ b/Help/variable/CMAKE_SYSTEM_NAME.rst
@@ -1,8 +1,20 @@
CMAKE_SYSTEM_NAME
-----------------
-Name of the operating system CMake is building for.
+The name of the operating system for which CMake is to build.
+See the :variable:`CMAKE_SYSTEM_VERSION` variable for the OS version.
-This is the name of the operating system on which CMake is targeting. This
-variable is the same as :variable:`CMAKE_HOST_SYSTEM_NAME` if you build for the
-host system instead of the target system when cross compiling.
+System Name for Host Builds
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``CMAKE_SYSTEM_NAME`` is by default set to the same value as the
+:variable:`CMAKE_HOST_SYSTEM_NAME` variable so that the build
+targets the host system.
+
+System Name for Cross Compiling
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``CMAKE_SYSTEM_NAME`` may be set explicitly when first configuring a new build
+tree in order to enable :ref:`cross compiling <Cross Compiling Toolchain>`.
+In this case the :variable:`CMAKE_SYSTEM_VERSION` variable must also be
+set explicitly.
diff --git a/Help/variable/CMAKE_SYSTEM_VERSION.rst b/Help/variable/CMAKE_SYSTEM_VERSION.rst
index 3b3cdc5..aba8ca3 100644
--- a/Help/variable/CMAKE_SYSTEM_VERSION.rst
+++ b/Help/variable/CMAKE_SYSTEM_VERSION.rst
@@ -1,8 +1,28 @@
CMAKE_SYSTEM_VERSION
--------------------
-The operating system version CMake is building for.
+The version of the operating system for which CMake is to build.
+See the :variable:`CMAKE_SYSTEM_NAME` variable for the OS name.
-This variable is the same as :variable:`CMAKE_HOST_SYSTEM_VERSION` if
-you build for the host system instead of the target system when
-cross compiling.
+System Version for Host Builds
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When the :variable:`CMAKE_SYSTEM_NAME` variable takes its default value
+then ``CMAKE_SYSTEM_VERSION`` is by default set to the same value as the
+:variable:`CMAKE_HOST_SYSTEM_VERSION` variable so that the build targets
+the host system version.
+
+In the case of a host build then ``CMAKE_SYSTEM_VERSION`` may be set
+explicitly when first configuring a new build tree in order to enable
+targeting the build for a different version of the host operating system
+than is actually running on the host. This is allowed and not considered
+cross compiling so long as the binaries built for the specified OS version
+can still run on the host.
+
+System Version for Cross Compiling
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When the :variable:`CMAKE_SYSTEM_NAME` variable is set explicitly to
+enable :ref:`cross compiling <Cross Compiling Toolchain>` then the
+value of ``CMAKE_SYSTEM_VERSION`` must also be set explicitly to specify
+the target system version.
diff --git a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst
new file mode 100644
index 0000000..6392849
--- /dev/null
+++ b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst
@@ -0,0 +1,11 @@
+CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION
+----------------------------------------
+
+Visual Studio Windows Target Platform Version.
+
+When targeting Windows 10 and above Visual Studio 2015 and above support
+specification of a target Windows version to select a corresponding SDK.
+The :variable:`CMAKE_SYSTEM_VERSION` variable may be set to specify a
+version. Otherwise CMake computes a default version based on the Windows
+SDK versions available. The chosen Windows target version number is provided
+in ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION``.
diff --git a/Help/variable/CMAKE_WARN_DEPRECATED.rst b/Help/variable/CMAKE_WARN_DEPRECATED.rst
index 7b8533c..662cbd8 100644
--- a/Help/variable/CMAKE_WARN_DEPRECATED.rst
+++ b/Help/variable/CMAKE_WARN_DEPRECATED.rst
@@ -5,7 +5,3 @@ Whether to issue deprecation warnings for macros and functions.
If ``TRUE``, this can be used by macros and functions to issue deprecation
warnings. This variable is ``FALSE`` by default.
-
-These warnings can be enabled with the ``-Wdeprecated`` option, or
-disabled with the ``-Wno-deprecated`` option, when running
-:manual:`cmake(1)`.
diff --git a/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst b/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst
new file mode 100644
index 0000000..d5893c9
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst
@@ -0,0 +1,7 @@
+CTEST_CUSTOM_COVERAGE_EXCLUDE
+-----------------------------
+
+A list of regular expressions which will be used to exclude files by their
+path from coverage output by the :command:`ctest_coverage` command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst b/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst
new file mode 100644
index 0000000..cd65ae3
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst
@@ -0,0 +1,7 @@
+CTEST_CUSTOM_ERROR_EXCEPTION
+----------------------------
+
+A list of regular expressions which will be used to exclude when detecting
+error messages in build outputs by the :command:`ctest_test` command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst b/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst
new file mode 100644
index 0000000..558f5e5
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst
@@ -0,0 +1,7 @@
+CTEST_CUSTOM_ERROR_MATCH
+------------------------
+
+A list of regular expressions which will be used to detect error messages in
+build outputs by the :command:`ctest_test` command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst b/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst
new file mode 100644
index 0000000..614859b
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst
@@ -0,0 +1,7 @@
+CTEST_CUSTOM_ERROR_POST_CONTEXT
+-------------------------------
+
+The number of lines to include as context which follow an error message by the
+:command:`ctest_test` command. The default is 10.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst b/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst
new file mode 100644
index 0000000..74dc47a
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst
@@ -0,0 +1,7 @@
+CTEST_CUSTOM_ERROR_PRE_CONTEXT
+------------------------------
+
+The number of lines to include as context which precede an error message by
+the :command:`ctest_test` command. The default is 10.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
new file mode 100644
index 0000000..5aeae88
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
@@ -0,0 +1,8 @@
+CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE
+--------------------------------------------
+
+When saving a failing test's output, this is the maximum size, in bytes, that
+will be collected by the :command:`ctest_test` command. Defaults to 307200
+(300 KiB).
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst
new file mode 100644
index 0000000..920cb04
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst
@@ -0,0 +1,8 @@
+CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS
+-------------------------------------
+
+The maximum number of errors in a single build step which will be detected.
+After this, the :command:`ctest_test` command will truncate the output.
+Defaults to 50.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst
new file mode 100644
index 0000000..a1f1cc1
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst
@@ -0,0 +1,8 @@
+CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS
+---------------------------------------
+
+The maximum number of warnings in a single build step which will be detected.
+After this, the :command:`ctest_test` command will truncate the output.
+Defaults to 50.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
new file mode 100644
index 0000000..1fbb8c5
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
@@ -0,0 +1,8 @@
+CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
+--------------------------------------------
+
+When saving a passing test's output, this is the maximum size, in bytes, that
+will be collected by the :command:`ctest_test` command. Defaults to 1024
+(1 KiB).
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst b/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst
new file mode 100644
index 0000000..578576c
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst
@@ -0,0 +1,7 @@
+CTEST_CUSTOM_MEMCHECK_IGNORE
+----------------------------
+
+A list of regular expressions to use to exclude tests during the
+:command:`ctest_memcheck` command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst b/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst
new file mode 100644
index 0000000..40291fe
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst
@@ -0,0 +1,6 @@
+CTEST_CUSTOM_POST_MEMCHECK
+--------------------------
+
+A list of commands to run at the end of the :command:`ctest_memcheck` command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_POST_TEST.rst b/Help/variable/CTEST_CUSTOM_POST_TEST.rst
new file mode 100644
index 0000000..791292c
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_POST_TEST.rst
@@ -0,0 +1,6 @@
+CTEST_CUSTOM_POST_TEST
+----------------------
+
+A list of commands to run at the end of the :command:`ctest_test` command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst b/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst
new file mode 100644
index 0000000..00de8aa
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst
@@ -0,0 +1,7 @@
+CTEST_CUSTOM_PRE_MEMCHECK
+-------------------------
+
+A list of commands to run at the start of the :command:`ctest_memcheck`
+command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_PRE_TEST.rst b/Help/variable/CTEST_CUSTOM_PRE_TEST.rst
new file mode 100644
index 0000000..6af7152
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_PRE_TEST.rst
@@ -0,0 +1,6 @@
+CTEST_CUSTOM_PRE_TEST
+----------------------
+
+A list of commands to run at the start of the :command:`ctest_test` command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_TEST_IGNORE.rst b/Help/variable/CTEST_CUSTOM_TEST_IGNORE.rst
new file mode 100644
index 0000000..6114e60
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_TEST_IGNORE.rst
@@ -0,0 +1,7 @@
+CTEST_CUSTOM_TEST_IGNORE
+------------------------
+
+A list of regular expressions to use to exclude tests during the
+:command:`ctest_test` command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst b/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst
new file mode 100644
index 0000000..36fa37d
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst
@@ -0,0 +1,7 @@
+CTEST_CUSTOM_WARNING_EXCEPTION
+------------------------------
+
+A list of regular expressions which will be used to exclude when detecting
+warning messages in build outputs by the :command:`ctest_test` command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst b/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst
new file mode 100644
index 0000000..a35be96
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst
@@ -0,0 +1,7 @@
+CTEST_CUSTOM_WARNING_MATCH
+--------------------------
+
+A list of regular expressions which will be used to detect warning messages in
+build outputs by the :command:`ctest_test` command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_XXX.txt b/Help/variable/CTEST_CUSTOM_XXX.txt
new file mode 100644
index 0000000..02d1547
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_XXX.txt
@@ -0,0 +1,2 @@
+It is initialized by :manual:`ctest(1)`, but may be edited in a ``CTestCustom``
+file. See :command:`ctest_read_custom_files` documentation.
diff --git a/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst b/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst
new file mode 100644
index 0000000..286f7df
--- /dev/null
+++ b/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst
@@ -0,0 +1,7 @@
+CTEST_EXTRA_COVERAGE_GLOB
+-------------------------
+
+A list of regular expressions which will be used to find files which should be
+covered by the :command:`ctest_coverage` command.
+
+.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
index b1c4fdf..bc78016 100644
--- a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
+++ b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
@@ -9,22 +9,22 @@
set(PACKAGE_VERSION "@CVF_VERSION@")
-if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
+if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
- if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
-if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
+if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
-if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@")
+if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
diff --git a/Modules/BasicConfigVersion-ExactVersion.cmake.in b/Modules/BasicConfigVersion-ExactVersion.cmake.in
index 9fd0136..de4a23a 100644
--- a/Modules/BasicConfigVersion-ExactVersion.cmake.in
+++ b/Modules/BasicConfigVersion-ExactVersion.cmake.in
@@ -17,30 +17,30 @@ else()
set(CVF_VERSION_NO_TWEAK "@CVF_VERSION@")
endif()
-if("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version
+if(PACKAGE_FIND_VERSION MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version
set(REQUESTED_VERSION_NO_TWEAK "${CMAKE_MATCH_1}")
else()
set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")
endif()
-if("${REQUESTED_VERSION_NO_TWEAK}" STREQUAL "${CVF_VERSION_NO_TWEAK}")
+if(REQUESTED_VERSION_NO_TWEAK STREQUAL CVF_VERSION_NO_TWEAK)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
-if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
+if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
-if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
+if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
-if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@")
+if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
diff --git a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
index 4acd9bb..a32245d 100644
--- a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
+++ b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
@@ -11,7 +11,7 @@
set(PACKAGE_VERSION "@CVF_VERSION@")
-if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
+if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
@@ -21,25 +21,25 @@ else()
set(CVF_VERSION_MAJOR "@CVF_VERSION@")
endif()
- if("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "${CVF_VERSION_MAJOR}")
+ if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
- if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
-if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
+if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
-if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@")
+if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 86cd894..a1bfc70 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -2,6 +2,8 @@ set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
+set(CMAKE_C_COMPILER_LINKS_STATICALLY "@CMAKE_C_COMPILER_LINKS_STATICALLY@")
+set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "@CMAKE_C_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_C_COMPILE_FEATURES "@CMAKE_C_COMPILE_FEATURES@")
set(CMAKE_C90_COMPILE_FEATURES "@CMAKE_C90_COMPILE_FEATURES@")
set(CMAKE_C99_COMPILE_FEATURES "@CMAKE_C99_COMPILE_FEATURES@")
@@ -52,12 +54,14 @@ if(CMAKE_C_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
endif()
+set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "@CMAKE_C_CL_SHOWINCLUDES_PREFIX@")
+if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
+ set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
+endif()
+
@CMAKE_C_SYSROOT_FLAG_CODE@
@CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
-
-@SET_CMAKE_CMCLDEPS_EXECUTABLE@
-@SET_CMAKE_CL_SHOWINCLUDES_PREFIX@
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 09ae509..b224007 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -24,6 +24,17 @@ char const* qnxnto = "INFO" ":" "qnxnto[]";
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
+const char* info_language_dialect_default = "INFO" ":" "dialect_default["
+#if !defined(__STDC_VERSION__)
+ "90"
+#elif __STDC_VERSION__ >= 201000L
+ "11"
+#elif __STDC_VERSION__ >= 199901L
+ "99"
+#else
+#endif
+"]";
+
/*--------------------------------------------------------------------------*/
#ifdef ID_VOID_MAIN
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index 7bcbb19..0d102a1 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -75,6 +75,10 @@ if(CMAKE_C_SIZEOF_DATA_PTR)
unset(CMAKE_C_ABI_FILES)
endif()
+if(CMAKE_C_COMPILER_LINKS_STATICALLY)
+ set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+endif()
+
# This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here.
@@ -175,7 +179,7 @@ endif()
# Create a static archive incrementally for large object file counts.
# If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
if(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
- set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cq <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index af79a31..4218a6d 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -2,6 +2,8 @@ set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
+set(CMAKE_CXX_COMPILER_LINKS_STATICALLY "@CMAKE_CXX_COMPILER_LINKS_STATICALLY@")
+set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_CXX_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@")
set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@")
set(CMAKE_CXX11_COMPILE_FEATURES "@CMAKE_CXX11_COMPILE_FEATURES@")
@@ -53,12 +55,14 @@ if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
endif()
+set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "@CMAKE_CXX_CL_SHOWINCLUDES_PREFIX@")
+if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
+ set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
+endif()
+
@CMAKE_CXX_SYSROOT_FLAG_CODE@
@CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
-
-@SET_CMAKE_CMCLDEPS_EXECUTABLE@
-@SET_CMAKE_CL_SHOWINCLUDES_PREFIX@
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index cc3ab49..d467507 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -23,6 +23,16 @@ char const* qnxnto = "INFO" ":" "qnxnto[]";
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@
+const char* info_language_dialect_default = "INFO" ":" "dialect_default["
+#if __cplusplus >= 201402L
+ "14"
+#elif __cplusplus >= 201103L
+ "11"
+#else
+ "98"
+#endif
+"]";
+
/*--------------------------------------------------------------------------*/
int main(int argc, char* argv[])
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 1aac9d3..dad7969 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -74,6 +74,10 @@ if(CMAKE_CXX_SIZEOF_DATA_PTR)
unset(CMAKE_CXX_ABI_FILES)
endif()
+if(CMAKE_CXX_COMPILER_LINKS_STATICALLY)
+ set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+endif()
+
# This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here.
@@ -266,7 +270,7 @@ endif()
# Create a static archive incrementally for large object file counts.
# If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these.
if(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
- set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cq <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake
deleted file mode 100644
index b46e7c2..0000000
--- a/Modules/CMakeClDeps.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-
-#=============================================================================
-# Copyright 2012 Kitware, Inc.
-#
-# 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.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-#
-# When using Ninja cl.exe is wrapped by cmcldeps to extract the included
-# headers for dependency tracking.
-#
-# cmcldeps path is set, and cmcldeps needs to know the localized string
-# in front of each include path, so it can remove it.
-#
-
-if(CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
- string(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
- set(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
- file(WRITE ${showdir}/foo.h "\n")
- file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
- execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
- WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE outLine)
- string(REGEX MATCH "\n([^:]*:[^:]*:[ \t]*)" tmp "${outLine}")
- set(localizedPrefix "${CMAKE_MATCH_1}")
- set(SET_CMAKE_CMCLDEPS_EXECUTABLE "set(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
- set(SET_CMAKE_CL_SHOWINCLUDES_PREFIX "set(CMAKE_CL_SHOWINCLUDES_PREFIX \"${localizedPrefix}\")")
-endif()
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 9bd1d67..e0b5468 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -101,7 +101,7 @@ if(NOT CMAKE_C_COMPILER_ID_RUN)
CMAKE_C_COMPILER_ID_PLATFORM_CONTENT)
# The IAR compiler produces weird output.
- # See http://www.cmake.org/Bug/view.php?id=10176#c19598
+ # See https://cmake.org/Bug/view.php?id=10176#c19598
list(APPEND CMAKE_C_COMPILER_ID_VENDORS IAR)
set(CMAKE_C_COMPILER_ID_VENDOR_FLAGS_IAR )
set(CMAKE_C_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler")
@@ -173,7 +173,6 @@ endif ()
include(CMakeFindBinUtils)
if(MSVC_C_ARCHITECTURE_ID)
- include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
set(SET_MSVC_C_ARCHITECTURE_ID
"set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
endif()
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index f25a2db..3c9bbc2 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -96,7 +96,7 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN)
CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT)
# The IAR compiler produces weird output.
- # See http://www.cmake.org/Bug/view.php?id=10176#c19598
+ # See https://cmake.org/Bug/view.php?id=10176#c19598
list(APPEND CMAKE_CXX_COMPILER_ID_VENDORS IAR)
set(CMAKE_CXX_COMPILER_ID_VENDOR_FLAGS_IAR )
set(CMAKE_CXX_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler")
@@ -171,7 +171,6 @@ endif ()
include(CMakeFindBinUtils)
if(MSVC_CXX_ARCHITECTURE_ID)
- include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
set(SET_MSVC_CXX_ARCHITECTURE_ID
"set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
endif()
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index c699315..2e74100 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -75,6 +75,12 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
endif()
+ if(CMAKE_GENERATOR STREQUAL "Ninja" AND MSVC_${lang}_ARCHITECTURE_ID)
+ CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX(${lang})
+ else()
+ set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "")
+ endif()
+
# Display the final identification result.
if(CMAKE_${lang}_COMPILER_ID)
if(CMAKE_${lang}_COMPILER_VERSION)
@@ -99,9 +105,12 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE)
+ set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX}" PARENT_SCOPE)
+ set(CMAKE_${lang}_COMPILER_LINKS_STATICALLY "${CMAKE_${lang}_COMPILER_LINKS_STATICALLY}" PARENT_SCOPE)
set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE)
set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE)
+ set(CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT "${CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT}" PARENT_SCOPE)
endfunction()
include(CMakeCompilerIdDetection)
@@ -201,6 +210,9 @@ Id flags: ${testflags}
else()
set(id_system_version "")
endif()
+ if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION)
+ set(id_WindowsTargetPlatformVersion "<WindowsTargetPlatformVersion>${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}</WindowsTargetPlatformVersion>")
+ endif()
if(id_platform STREQUAL ARM)
set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>")
else()
@@ -313,29 +325,17 @@ Id flags: ${testflags}
endif()
endif()
else()
- if(COMMAND EXECUTE_PROCESS)
- execute_process(
- COMMAND "${CMAKE_${lang}_COMPILER}"
- ${CMAKE_${lang}_COMPILER_ID_ARG1}
- ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
- ${testflags}
- "${src}"
- WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
- OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
- ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
- RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
- )
- else()
- exec_program(
- "${CMAKE_${lang}_COMPILER}" ${CMAKE_${lang}_COMPILER_ID_DIR}
- ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
- ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
- ${testflags}
- \"${src}\"
- OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
- RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
- )
- endif()
+ execute_process(
+ COMMAND "${CMAKE_${lang}_COMPILER}"
+ ${CMAKE_${lang}_COMPILER_ID_ARG1}
+ ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
+ ${testflags}
+ "${src}"
+ WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
+ OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+ ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+ RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
+ )
endif()
# Check the result of compilation.
@@ -487,6 +487,9 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
if("${info}" MATCHES "INFO:qnxnto\\[\\]")
set(COMPILER_QNXNTO 1)
endif()
+ if("${info}" MATCHES "INFO:dialect_default\\[([^]\"]*)\\]")
+ set(CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT "${CMAKE_MATCH_1}")
+ endif()
endforeach()
# Construct compiler version from components if needed.
@@ -530,6 +533,13 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
endif()
endif()
+ if(UNIX)
+ execute_process(COMMAND file "${file}" OUTPUT_VARIABLE out ERROR_VARIABLE out)
+ if(out MATCHES "statically linked")
+ set(CMAKE_${lang}_COMPILER_LINKS_STATICALLY 1 PARENT_SCOPE)
+ endif()
+ endif()
+
# Check if a valid compiler and platform were found.
if(COMPILER_ID AND NOT COMPILER_ID_TWICE)
set(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
@@ -590,6 +600,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE)
set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
set(COMPILER_QNXNTO "${COMPILER_QNXNTO}" PARENT_SCOPE)
+ set(CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT "${CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT}" PARENT_SCOPE)
endfunction()
#-----------------------------------------------------------------------------
@@ -645,3 +656,27 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
endif()
endforeach()
endfunction()
+
+function(CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX lang)
+ # Run this MSVC-compatible compiler to detect what the /showIncludes
+ # option displays. We can use a C source even with the C++ compiler
+ # because MSVC-compatible compilers handle both and show the same output.
+ set(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
+ file(WRITE ${showdir}/foo.h "\n")
+ file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
+ execute_process(
+ COMMAND "${CMAKE_${lang}_COMPILER}"
+ ${CMAKE_${lang}_COMPILER_ID_ARG1}
+ ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
+ /nologo /showIncludes /c main.c
+ WORKING_DIRECTORY ${showdir}
+ OUTPUT_VARIABLE out
+ ERROR_VARIABLE err
+ RESULT_VARIABLE res
+ )
+ if(res EQUAL 0 AND "${out}" MATCHES "\n([^:]*:[^:]*:[ \t]*)")
+ set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_1}" PARENT_SCOPE)
+ else()
+ set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "" PARENT_SCOPE)
+ endif()
+endfunction()
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index fa14641..d9f7579 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -123,7 +123,9 @@ elseif(CMAKE_VS_WINCE_VERSION)
set(PRESET_CMAKE_SYSTEM_NAME TRUE)
else()
set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
- set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
+ if(NOT DEFINED CMAKE_SYSTEM_VERSION)
+ set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
+ endif()
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
set(CMAKE_CROSSCOMPILING FALSE)
set(PRESET_CMAKE_SYSTEM_NAME FALSE)
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index 14fdd60..6b984e5 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -2,6 +2,7 @@ set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
set(CMAKE_Fortran_COMPILER_VERSION "@CMAKE_Fortran_COMPILER_VERSION@")
+set(CMAKE_Fortran_COMPILER_LINKS_STATICALLY "@CMAKE_Fortran_COMPILER_LINKS_STATICALLY@")
set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@")
set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@")
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 2533d3f..017af91 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -17,7 +17,9 @@
# if defined(_MSC_VER)
PRINT *, 'INFO:simulate[MSVC]'
-# if _MSC_VER >= 1800
+# if _MSC_VER >= 1900
+ PRINT *, 'INFO:simulate_version[019.00]'
+# elif _MSC_VER >= 1800
PRINT *, 'INFO:simulate_version[018.00]'
# elif _MSC_VER >= 1700
PRINT *, 'INFO:simulate_version[017.00]'
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 835ffcf..aa48df7 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -51,6 +51,10 @@ if(CMAKE_Fortran_SIZEOF_DATA_PTR)
unset(CMAKE_Fortran_ABI_FILES)
endif()
+if(CMAKE_Fortran_COMPILER_LINKS_STATICALLY)
+ set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+endif()
+
# This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here.
@@ -194,7 +198,7 @@ endif()
# Create a static archive incrementally for large object file counts.
# If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
- set(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cq <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
set(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index 8abc465..59092bd 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -31,7 +31,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
# Construct a regex to match linker lines. It must match both the
# whole line and just the command (argv[0]).
set(linker_regex "^( *|.*[/\\])(${linker}|([^/\\]+-)?ld|collect2)[^/\\]*( |$)")
- set(linker_exclude_regex "collect2 version ")
+ set(linker_exclude_regex "collect2 version |^[A-Za-z0-9_]+=")
set(log "${log} link line regex: [${linker_regex}]\n")
string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")
foreach(line IN LISTS output_lines)
diff --git a/Modules/CMakeTestSwiftCompiler.cmake b/Modules/CMakeTestSwiftCompiler.cmake
index 9186426..89849fb 100644
--- a/Modules/CMakeTestSwiftCompiler.cmake
+++ b/Modules/CMakeTestSwiftCompiler.cmake
@@ -12,4 +12,54 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-set(CMAKE_Swift_COMPILER_WORKS 1)
+if(CMAKE_Swift_COMPILER_FORCED)
+ # The compiler configuration was forced by the user.
+ # Assume the user has configured all compiler information.
+ set(CMAKE_Swift_COMPILER_WORKS TRUE)
+ return()
+endif()
+
+include(CMakeTestCompilerCommon)
+
+# Remove any cached result from an older CMake version.
+# We now store this in CMakeSwiftCompiler.cmake.
+unset(CMAKE_Swift_COMPILER_WORKS CACHE)
+
+# This file is used by EnableLanguage in cmGlobalGenerator to
+# determine that that selected C++ compiler can actually compile
+# and link the most basic of programs. If not, a fatal error
+# is set and cmake stops processing commands and will not generate
+# any makefiles or projects.
+if(NOT CMAKE_Swift_COMPILER_WORKS)
+ PrintTestCompilerStatus("Swift" "")
+ file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift
+ "import Foundation\n"
+ "print(\"CMake\")\n")
+ try_compile(CMAKE_Swift_COMPILER_WORKS ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift
+ OUTPUT_VARIABLE __CMAKE_Swift_COMPILER_OUTPUT)
+ # Move result from cache to normal variable.
+ set(CMAKE_Swift_COMPILER_WORKS ${CMAKE_Swift_COMPILER_WORKS})
+ unset(CMAKE_Swift_COMPILER_WORKS CACHE)
+ set(Swift_TEST_WAS_RUN 1)
+endif()
+
+if(NOT CMAKE_Swift_COMPILER_WORKS)
+ PrintTestCompilerStatus("Swift" " -- broken")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the Swift compiler works failed with "
+ "the following output:\n${__CMAKE_Swift_COMPILER_OUTPUT}\n\n")
+ message(FATAL_ERROR "The Swift compiler \"${CMAKE_Swift_COMPILER}\" "
+ "is not able to compile a simple test program.\nIt fails "
+ "with the following output:\n ${__CMAKE_Swift_COMPILER_OUTPUT}\n\n"
+ "CMake will not be able to correctly generate this project.")
+else()
+ if(Swift_TEST_WAS_RUN)
+ PrintTestCompilerStatus("Swift" " -- works")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining if the Swift compiler works passed with "
+ "the following output:\n${__CMAKE_Swift_COMPILER_OUTPUT}\n\n")
+ endif()
+endif()
+
+unset(__CMAKE_Swift_COMPILER_OUTPUT)
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index e223286..5756001 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -182,6 +182,17 @@
# will be a boolean variable which enables stripping of all files (a list
# of files evaluates to TRUE in CMake, so this change is compatible).
#
+# .. variable:: CPACK_VERBATIM_VARIABLES
+#
+# If set to TRUE, values of variables prefixed with CPACK_ will be escaped
+# before being written to the configuration files, so that the cpack program
+# receives them exactly as they were specified. If not, characters like quotes
+# and backslashes can cause parsing errors or alter the value received by the
+# cpack program. Defaults to FALSE for backwards compatibility.
+#
+# * Mandatory : NO
+# * Default : FALSE
+#
# The following CPack variables are specific to source packages, and
# will not affect binary packages:
#
@@ -299,49 +310,68 @@ endif()
include(CPackComponent)
# Macro for setting values if a user did not overwrite them
+# Mangles CMake-special characters. Only kept for backwards compatibility.
macro(cpack_set_if_not_set name value)
- if(NOT DEFINED "${name}")
- set(${name} "${value}")
- endif()
+ message(DEPRECATION "cpack_set_if_not_set is obsolete; do not use.")
+ _cpack_set_default("${name}" "${value}")
endmacro()
-# cpack_encode_variables - Macro to encode variables for the configuration file
+# cpack_encode_variables - Function to encode variables for the configuration file
# find any variable that starts with CPACK and create a variable
# _CPACK_OTHER_VARIABLES_ that contains SET commands for
# each cpack variable. _CPACK_OTHER_VARIABLES_ is then
# used as an @ replacment in configure_file for the CPackConfig.
-macro(cpack_encode_variables)
- set(_CPACK_OTHER_VARIABLES_)
+function(cpack_encode_variables)
+ set(commands "")
get_cmake_property(res VARIABLES)
foreach(var ${res})
if(var MATCHES "^CPACK")
- set(_CPACK_OTHER_VARIABLES_
- "${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
+ if(CPACK_VERBATIM_VARIABLES)
+ _cpack_escape_for_cmake(value "${${var}}")
+ else()
+ set(value "${${var}}")
endif()
+
+ set(commands "${commands}\nSET(${var} \"${value}\")")
+ endif()
endforeach()
-endmacro()
+
+ set(_CPACK_OTHER_VARIABLES_ "${commands}" PARENT_SCOPE)
+endfunction()
+
+# Internal use functions
+function(_cpack_set_default name value)
+ if(NOT DEFINED "${name}")
+ set("${name}" "${value}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(_cpack_escape_for_cmake var value)
+ string(REGEX REPLACE "([\\\$\"])" "\\\\\\1" escaped "${value}")
+ set("${var}" "${escaped}" PARENT_SCOPE)
+endfunction()
# Set the package name
-cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
-cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MAJOR "0")
-cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MINOR "1")
-cpack_set_if_not_set(CPACK_PACKAGE_VERSION_PATCH "1")
-cpack_set_if_not_set(CPACK_PACKAGE_VERSION
+_cpack_set_default(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
+_cpack_set_default(CPACK_PACKAGE_VERSION_MAJOR "0")
+_cpack_set_default(CPACK_PACKAGE_VERSION_MINOR "1")
+_cpack_set_default(CPACK_PACKAGE_VERSION_PATCH "1")
+_cpack_set_default(CPACK_PACKAGE_VERSION
"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
-cpack_set_if_not_set(CPACK_PACKAGE_VENDOR "Humanity")
-cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
+_cpack_set_default(CPACK_PACKAGE_VENDOR "Humanity")
+_cpack_set_default(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"${CMAKE_PROJECT_NAME} built using CMake")
-cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_FILE
+_cpack_set_default(CPACK_PACKAGE_DESCRIPTION_FILE
"${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
-cpack_set_if_not_set(CPACK_RESOURCE_FILE_LICENSE
+_cpack_set_default(CPACK_RESOURCE_FILE_LICENSE
"${CMAKE_ROOT}/Templates/CPack.GenericLicense.txt")
-cpack_set_if_not_set(CPACK_RESOURCE_FILE_README
+_cpack_set_default(CPACK_RESOURCE_FILE_README
"${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
-cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME
+_cpack_set_default(CPACK_RESOURCE_FILE_WELCOME
"${CMAKE_ROOT}/Templates/CPack.GenericWelcome.txt")
-cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
+_cpack_set_default(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
if(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
@@ -359,7 +389,7 @@ if(__cpack_system_name MATCHES "Windows")
set(__cpack_system_name win32)
endif()
endif()
-cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
+_cpack_set_default(CPACK_SYSTEM_NAME "${__cpack_system_name}")
# Root dir: default value should be the string literal "$PROGRAMFILES"
# for backwards compatibility. Projects may set this value to anything.
@@ -369,17 +399,17 @@ if("x${__cpack_system_name}" STREQUAL "xwin64")
else()
set(__cpack_root_default "$PROGRAMFILES")
endif()
-cpack_set_if_not_set(CPACK_NSIS_INSTALL_ROOT "${__cpack_root_default}")
+_cpack_set_default(CPACK_NSIS_INSTALL_ROOT "${__cpack_root_default}")
# <project>-<major>.<minor>.<patch>-<release>-<platform>.<pkgtype>
-cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME
+_cpack_set_default(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
-cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_DIRECTORY
+_cpack_set_default(CPACK_PACKAGE_INSTALL_DIRECTORY
"${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
-cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
+_cpack_set_default(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
"${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-cpack_set_if_not_set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
-cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true")
+_cpack_set_default(CPACK_PACKAGE_DEFAULT_LOCATION "/")
+_cpack_set_default(CPACK_PACKAGE_RELOCATABLE "true")
# always force to exactly "true" or "false" for CPack.Info.plist.in:
if(CPACK_PACKAGE_RELOCATABLE)
@@ -519,10 +549,10 @@ mark_as_advanced(
)
# Set some other variables
-cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS
+_cpack_set_default(CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
-cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
-cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
+_cpack_set_default(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
+_cpack_set_default(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
# if the user has set CPACK_NSIS_DISPLAY_NAME remember it
if(DEFINED CPACK_NSIS_DISPLAY_NAME)
set(CPACK_NSIS_DISPLAY_NAME_SET TRUE)
@@ -531,34 +561,32 @@ endif()
# explicitly, then use that as the default
# value of CPACK_NSIS_PACKAGE_NAME instead
# of CPACK_PACKAGE_INSTALL_DIRECTORY
-cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+_cpack_set_default(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
if(CPACK_NSIS_DISPLAY_NAME_SET)
- string(REPLACE "\\" "\\\\"
- _NSIS_DISPLAY_NAME_TMP "${CPACK_NSIS_DISPLAY_NAME}")
- cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${_NSIS_DISPLAY_NAME_TMP}")
+ _cpack_set_default(CPACK_NSIS_PACKAGE_NAME "${CPACK_NSIS_DISPLAY_NAME}")
else()
- cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+ _cpack_set_default(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
endif()
-cpack_set_if_not_set(CPACK_OUTPUT_CONFIG_FILE
+_cpack_set_default(CPACK_OUTPUT_CONFIG_FILE
"${CMAKE_BINARY_DIR}/CPackConfig.cmake")
-cpack_set_if_not_set(CPACK_SOURCE_OUTPUT_CONFIG_FILE
+_cpack_set_default(CPACK_SOURCE_OUTPUT_CONFIG_FILE
"${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake")
-cpack_set_if_not_set(CPACK_SET_DESTDIR OFF)
-cpack_set_if_not_set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
+_cpack_set_default(CPACK_SET_DESTDIR OFF)
+_cpack_set_default(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-cpack_set_if_not_set(CPACK_NSIS_INSTALLER_ICON_CODE "")
-cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
+_cpack_set_default(CPACK_NSIS_INSTALLER_ICON_CODE "")
+_cpack_set_default(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
# WiX specific variables
-cpack_set_if_not_set(CPACK_WIX_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}")
+_cpack_set_default(CPACK_WIX_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}")
# set sysroot so SDK tools can be used
if(CMAKE_OSX_SYSROOT)
- cpack_set_if_not_set(CPACK_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}")
+ _cpack_set_default(CPACK_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}")
endif()
if(DEFINED CPACK_COMPONENTS_ALL)
@@ -598,13 +626,20 @@ cpack_encode_variables()
configure_file("${cpack_input_file}" "${CPACK_OUTPUT_CONFIG_FILE}" @ONLY)
# Generate source file
-cpack_set_if_not_set(CPACK_SOURCE_INSTALLED_DIRECTORIES
+_cpack_set_default(CPACK_SOURCE_INSTALLED_DIRECTORIES
"${CMAKE_SOURCE_DIR};/")
-cpack_set_if_not_set(CPACK_SOURCE_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}-Source")
-cpack_set_if_not_set(CPACK_SOURCE_PACKAGE_FILE_NAME
+_cpack_set_default(CPACK_SOURCE_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}-Source")
+_cpack_set_default(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Source")
-cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES
- "/CVS/;/\\\\\\\\.svn/;/\\\\\\\\.bzr/;/\\\\\\\\.hg/;/\\\\\\\\.git/;\\\\\\\\.swp$;\\\\\\\\.#;/#")
+
+set(__cpack_source_ignore_files_default
+ "/CVS/;/\\.svn/;/\\.bzr/;/\\.hg/;/\\.git/;\\.swp$;\\.#;/#")
+if(NOT CPACK_VERBATIM_VARIABLES)
+ _cpack_escape_for_cmake(__cpack_source_ignore_files_default
+ "${__cpack_source_ignore_files_default}")
+endif()
+_cpack_set_default(CPACK_SOURCE_IGNORE_FILES "${__cpack_source_ignore_files_default}")
+
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
set(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
set(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index 573e5aa..96d5609 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -263,7 +263,7 @@
#
# The site argument is a URL where the archives for downloadable
# components will reside, e.g.,
-# http://www.cmake.org/files/2.6.1/installer/ All of the archives
+# https://cmake.org/files/2.6.1/installer/ All of the archives
# produced by CPack should be uploaded to that location.
#
# UPLOAD_DIRECTORY is the local directory where CPack will create the
@@ -301,7 +301,7 @@
if(NOT CPackComponent_CMake_INCLUDED)
set(CPackComponent_CMake_INCLUDED 1)
-# Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments
+# Argument-parsing macro from https://cmake.org/Wiki/CMakeMacroParseArguments
macro(cpack_parse_arguments prefix arg_names option_names)
set(${prefix}_DEFAULT_ARGS)
foreach(arg_name ${arg_names})
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 75e9966..60e0d1f 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -9,7 +9,7 @@
#
# CPackDeb may be used to create Deb package using CPack.
# CPackDeb is a CPack generator thus it uses the CPACK_XXX variables
-# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration.
+# used by CPack : https://cmake.org/Wiki/CMake:CPackConfiguration.
# CPackDeb generator should work on any linux host but it will produce
# better deb package when Debian specific tools 'dpkg-xxx' are usable on
# the build system.
@@ -23,7 +23,7 @@
# a component GROUP name.
#
# You'll find a detailed usage on the wiki:
-# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 .
+# https://cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 .
# However as a handy reminder here comes the list of specific variables:
#
# .. variable:: CPACK_DEBIAN_PACKAGE_NAME
@@ -78,6 +78,7 @@
#
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libc6 (< 2.4)")
#
+#
# .. variable:: CPACK_DEBIAN_PACKAGE_MAINTAINER
#
# The Debian package maintainer
@@ -152,7 +153,7 @@
# You may need set :variable:`CMAKE_INSTALL_RPATH` to an appropriate value
# if you use this feature, because if you don't :code:`dpkg-shlibdeps`
# may fail to find your own shared libs.
-# See http://www.cmake.org/Wiki/CMake_RPATH_handling.
+# See https://cmake.org/Wiki/CMake_RPATH_handling.
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_DEBUG
@@ -164,6 +165,7 @@
# * Default : -
#
# .. variable:: CPACK_DEBIAN_PACKAGE_PREDEPENDS
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS
#
# Sets the `Pre-Depends` field of the Debian package.
# Like :variable:`Depends <CPACK_DEBIAN_PACKAGE_DEPENDS>`, except that it
@@ -172,11 +174,16 @@
# pre-dependency.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_PREDEPENDS` for component-based
+# installations.
#
# See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
#
# .. variable:: CPACK_DEBIAN_PACKAGE_ENHANCES
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES
#
# Sets the `Enhances` field of the Debian package.
# Similar to :variable:`Suggests <CPACK_DEBIAN_PACKAGE_SUGGESTS>` but works
@@ -184,11 +191,16 @@
# functionality of another package.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_ENHANCES` for component-based
+# installations.
#
# See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
#
# .. variable:: CPACK_DEBIAN_PACKAGE_BREAKS
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKS
#
# Sets the `Breaks` field of the Debian package.
# When a binary package (P) declares that it breaks other packages (B),
@@ -199,12 +211,17 @@
# packages (B) cannot be reconfigured again.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_BREAKS` for component-based
+# installations.
#
# See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-breaks
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_CONFLICTS
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONFLICTS
#
# Sets the `Conflicts` field of the Debian package.
# When one binary package declares a conflict with another using a `Conflicts`
@@ -212,7 +229,11 @@
# the same time.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_CONFLICTS` for component-based
+# installations.
#
# See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-conflicts
#
@@ -225,48 +246,68 @@
# time.
#
# .. variable:: CPACK_DEBIAN_PACKAGE_PROVIDES
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_PROVIDES
#
# Sets the `Provides` field of the Debian package.
# A virtual package is one which appears in the `Provides` control field of
# another package.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_PROVIDES` for component-based
+# installations.
#
# See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-virtual
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_REPLACES
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACES
#
# Sets the `Replaces` field of the Debian package.
# Packages can declare in their control file that they should overwrite
# files in certain other packages, or completely replace other packages.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_REPLACES` for component-based
+# installations.
#
# See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_RECOMMENDS
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDS
#
# Sets the `Recommends` field of the Debian package.
# Allows packages to declare a strong, but not absolute, dependency on other
# packages.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_RECOMMENDS` for component-based
+# installations.
#
# See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_SUGGESTS
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTS
#
# Sets the `Suggests` field of the Debian package.
# Allows packages to declare a suggested package install grouping.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_SUGGESTS` for component-based
+# installations.
#
# See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
#
@@ -285,6 +326,34 @@
#
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
+#
+# .. note::
+#
+# The original permissions of the files will be used in the final
+# package unless the variable
+# :variable:`CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION` is set.
+# In particular, the scripts should have the proper executable
+# flag prior to the generation of the package.
+#
+# .. variable:: CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_STRICT_PERMISSION
+#
+# This variable indicates if the Debian policy on control files should be
+# strictly followed.
+#
+# * Mandatory : NO
+# * Default : FALSE
+#
+# Usage::
+#
+# set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
+#
+# .. note::
+#
+# This overrides the permissions on the original files, following the rules
+# set by Debian policy
+# https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
+#
#=============================================================================
@@ -321,11 +390,6 @@ function(cpack_deb_prepare_package_vars)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
endif()
- find_program(FAKEROOT_EXECUTABLE fakeroot)
- if(FAKEROOT_EXECUTABLE)
- set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
- endif()
-
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_PATH}")
# per component automatic discover: some of the component might not have
@@ -496,18 +560,21 @@ function(cpack_deb_prepare_package_vars)
# You should set: DEBIAN_PACKAGE_DEPENDS
# TODO: automate 'objdump -p | grep NEEDED'
- # if per-component dependency, overrides the global CPACK_DEBIAN_PACKAGE_DEPENDS
+ # if per-component dependency, overrides the global CPACK_DEBIAN_PACKAGE_${dependency_type_}
# automatic dependency discovery will be performed afterwards.
if(CPACK_DEB_PACKAGE_COMPONENT)
- set(_component_depends_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_DEPENDS")
+ foreach(dependency_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES)
+ set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${dependency_type_}")
- # if set, overrides the global dependency
- if(DEFINED ${_component_depends_var})
- set(CPACK_DEBIAN_PACKAGE_DEPENDS "${${_component_depends_var}}")
- if(CPACK_DEBIAN_PACKAGE_DEBUG)
- message("CPackDeb Debug: component '${_local_component_name}' dependencies set to '${CPACK_DEBIAN_PACKAGE_DEPENDS}'")
+ # if set, overrides the global dependency
+ if(DEFINED ${_component_var})
+ set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${${_component_var}}")
+ if(CPACK_DEBIAN_PACKAGE_DEBUG)
+ message("CPackDeb Debug: component '${_local_component_name}' ${dependency_type_}"
+ "dependencies set to '${CPACK_DEBIAN_PACKAGE_${dependency_}}'")
+ endif()
endif()
- endif()
+ endforeach()
endif()
# at this point, the CPACK_DEBIAN_PACKAGE_DEPENDS is properly set
@@ -591,7 +658,7 @@ function(cpack_deb_prepare_package_vars)
# Are we packaging components ?
if(CPACK_DEB_PACKAGE_COMPONENT)
# override values with per component version if set
- foreach(VAR_NAME_ "PACKAGE_CONTROL_EXTRA")
+ foreach(VAR_NAME_ "PACKAGE_CONTROL_EXTRA" "PACKAGE_CONTROL_STRICT_PERMISSION")
if(CPACK_DEBIAN_${_local_component_name}_${VAR_NAME_})
set(CPACK_DEBIAN_${VAR_NAME_} "${CPACK_DEBIAN_${_local_component_name}_${VAR_NAME_}}")
endif()
@@ -613,6 +680,7 @@ function(cpack_deb_prepare_package_vars)
message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
+ message("CPackDeb:Debug: CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION = ${CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION}")
endif()
# For debian source packages:
@@ -638,7 +706,6 @@ function(cpack_deb_prepare_package_vars)
set(GEN_CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_DEBIAN_PACKAGE_MAINTAINER}" PARENT_SCOPE)
set(GEN_CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_DEBIAN_PACKAGE_DESCRIPTION}" PARENT_SCOPE)
set(GEN_CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}" PARENT_SCOPE)
- set(GEN_CPACK_DEBIAN_FAKEROOT_EXECUTABLE "${CPACK_DEBIAN_FAKEROOT_EXECUTABLE}" PARENT_SCOPE)
set(GEN_CPACK_DEBIAN_COMPRESSION_TYPE "${CPACK_DEBIAN_COMPRESSION_TYPE}" PARENT_SCOPE)
set(GEN_CPACK_DEBIAN_PACKAGE_RECOMMENDS "${CPACK_DEBIAN_PACKAGE_RECOMMENDS}" PARENT_SCOPE)
set(GEN_CPACK_DEBIAN_PACKAGE_SUGGESTS "${CPACK_DEBIAN_PACKAGE_SUGGESTS}" PARENT_SCOPE)
@@ -650,6 +717,8 @@ function(cpack_deb_prepare_package_vars)
set(GEN_CPACK_DEBIAN_PACKAGE_PROVIDES "${CPACK_DEBIAN_PACKAGE_PROVIDES}" PARENT_SCOPE)
set(GEN_CPACK_DEBIAN_PACKAGE_REPLACES "${CPACK_DEBIAN_PACKAGE_REPLACES}" PARENT_SCOPE)
set(GEN_CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA}" PARENT_SCOPE)
+ set(GEN_CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION
+ "${CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION}" PARENT_SCOPE)
set(GEN_WDIR "${WDIR}" PARENT_SCOPE)
endfunction()
diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake
index 4b2e0eb..c6b3d19 100644
--- a/Modules/CPackNSIS.cmake
+++ b/Modules/CPackNSIS.cmake
@@ -115,7 +115,7 @@
#
# set(CPACK_NSIS_MENU_LINKS
# "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html"
-# "CMake Help" "http://www.cmake.org" "CMake Web Site")
+# "CMake Help" "https://cmake.org" "CMake Web Site")
#
#=============================================================================
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 7c1db14..1e7b055 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -9,7 +9,7 @@
#
# CPackRPM may be used to create RPM package using CPack. CPackRPM is a
# CPack generator thus it uses the CPACK_XXX variables used by CPack :
-# http://www.cmake.org/Wiki/CMake:CPackConfiguration
+# https://cmake.org/Wiki/CMake:CPackConfiguration
#
# However CPackRPM has specific features which are controlled by the
# specifics CPACK_RPM_XXX variables. CPackRPM is a component aware
@@ -24,7 +24,7 @@
#
# ::
#
-# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
+# https://cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
#
# However as a handy reminder here comes the list of specific variables:
#
diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index 5fe51a6..bef8e16 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -16,7 +16,7 @@
#
# Will be automatically generated unless explicitly provided.
#
-# It should be explicitly set to a constant generated gloabally unique
+# It should be explicitly set to a constant generated globally unique
# identifier (GUID) to allow your installers to replace existing
# installations that use the same GUID.
#
@@ -226,7 +226,7 @@
# This variable can be used to provide a value for
# the Windows Installer property ``<PROPERTY>``
#
-# The follwing list contains some example properties that can be used to
+# The following list contains some example properties that can be used to
# customize information under
# "Programs and Features" (also known as "Add or Remove Programs")
#
diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index 6c74cf3..ef3aa76 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -161,7 +161,7 @@ function(ctest_coverage_collect_gcov)
message(STATUS "Could not determine source file corresponding to: ${gcov_file}")
endif()
- foreach(exclude_entry ${CTEST_CUSTOM_COVERAGE_EXCLUDE})
+ foreach(exclude_entry IN LISTS CTEST_CUSTOM_COVERAGE_EXCLUDE)
if(source_file MATCHES "${exclude_entry}")
set(is_excluded true)
diff --git a/Modules/CheckForPthreads.c b/Modules/CheckForPthreads.c
index 7250fbf..2732957 100644
--- a/Modules/CheckForPthreads.c
+++ b/Modules/CheckForPthreads.c
@@ -31,7 +31,7 @@ void* runner(void* args)
int cc;
for ( cc = 0; cc < 10; cc ++ )
{
- printf("%d CC: %d\n", (int)args, cc);
+ printf("%p CC: %d\n", args, cc);
}
res ++;
return 0;
diff --git a/Modules/CheckFunctionExists.c b/Modules/CheckFunctionExists.c
index 607b3e8..fd29618 100644
--- a/Modules/CheckFunctionExists.c
+++ b/Modules/CheckFunctionExists.c
@@ -1,5 +1,8 @@
#ifdef CHECK_FUNCTION_EXISTS
+#ifdef __cplusplus
+extern "C"
+#endif
char CHECK_FUNCTION_EXISTS();
#ifdef __CLASSIC_C__
int main(){
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index d277c32..5dd3751 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -57,14 +57,26 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
else()
set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES)
endif()
+
+ if(CMAKE_C_COMPILER_LOADED)
+ set(_cfe_source ${CMAKE_ROOT}/Modules/CheckFunctionExists.c)
+ elseif(CMAKE_CXX_COMPILER_LOADED)
+ set(_cfe_source ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists/CheckFunctionExists.cxx)
+ configure_file(${CMAKE_ROOT}/Modules/CheckFunctionExists.c "${_cfe_source}" COPYONLY)
+ else()
+ message(FATAL_ERROR "CHECK_FUNCTION_EXISTS needs either C or CXX language enabled")
+ endif()
+
try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
- ${CMAKE_ROOT}/Modules/CheckFunctionExists.c
+ ${_cfe_source}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CHECK_FUNCTION_EXISTS_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
+ unset(_cfe_source)
+
if(${VARIABLE})
set(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
if(NOT CMAKE_REQUIRED_QUIET)
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index 95c595a..6b53823 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -53,15 +53,26 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
set(CHECK_LIBRARY_EXISTS_LIBRARIES
${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES})
endif()
+
+ if(CMAKE_C_COMPILER_LOADED)
+ set(_cle_source ${CMAKE_ROOT}/Modules/CheckFunctionExists.c)
+ elseif(CMAKE_CXX_COMPILER_LOADED)
+ set(_cle_source ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckLibraryExists/CheckFunctionExists.cxx)
+ configure_file(${CMAKE_ROOT}/Modules/CheckFunctionExists.c "${_cle_source}" COPYONLY)
+ else()
+ message(FATAL_ERROR "CHECK_FUNCTION_EXISTS needs either C or CXX language enabled")
+ endif()
+
try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
- ${CMAKE_ROOT}/Modules/CheckFunctionExists.c
+ ${_cle_source}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_LIBRARY_EXISTS_DEFINITION}
-DLINK_DIRECTORIES:STRING=${LOCATION}
OUTPUT_VARIABLE OUTPUT)
+ unset(_cle_source)
if(${VARIABLE})
if(NOT CMAKE_REQUIRED_QUIET)
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index 79c5ba7..c4dff3f 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -44,10 +44,14 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-
-
macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
- _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
+ if(CMAKE_C_COMPILER_LOADED)
+ _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
+ elseif(CMAKE_CXX_COMPILER_LOADED)
+ _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
+ else()
+ message(FATAL_ERROR "CHECK_SYMBOL_EXISTS needs either C or CXX language enabled")
+ endif()
endmacro()
macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index 10454f6..5908c26 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -13,7 +13,12 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
- set(CMAKE_C_STANDARD_DEFAULT 99)
+ if (NOT CMAKE_C_COMPILER_FORCED)
+ if (NOT CMAKE_C_STANDARD_COMPUTED_DEFAULT)
+ message(FATAL_ERROR "CMAKE_C_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER}) version ${CMAKE_C_COMPILER_VERSION}")
+ endif()
+ set(CMAKE_C_STANDARD_DEFAULT ${CMAKE_C_STANDARD_COMPUTED_DEFAULT})
+ endif()
endif()
macro(cmake_record_c_compile_features)
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake
index 1ba8a77..c4e342b 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -23,9 +23,15 @@ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
endif()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
- set(CMAKE_CXX_STANDARD_DEFAULT 98)
+ if (NOT CMAKE_CXX_COMPILER_FORCED)
+ if (NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT)
+ message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}")
+ endif()
+ set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT})
+ endif()
endif()
+
macro(cmake_record_cxx_compile_features)
macro(_get_appleclang_features std_version list)
record_compiler_features(CXX "${std_version}" ${list})
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index 548d0a5..a2e81c1 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -17,10 +17,13 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
endif()
-if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6)
- set(CMAKE_C_STANDARD_DEFAULT 11)
-elseif(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
- set(CMAKE_C_STANDARD_DEFAULT 99)
+if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
+ if (NOT CMAKE_C_COMPILER_FORCED)
+ if (NOT CMAKE_C_STANDARD_COMPUTED_DEFAULT)
+ message(FATAL_ERROR "CMAKE_C_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER}) version ${CMAKE_C_COMPILER_VERSION}")
+ endif()
+ set(CMAKE_C_STANDARD_DEFAULT ${CMAKE_C_STANDARD_COMPUTED_DEFAULT})
+ endif()
endif()
macro(cmake_record_c_compile_features)
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 84b2c74..055a8ee 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -31,8 +31,13 @@ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
endif()
-if(UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
- set(CMAKE_CXX_STANDARD_DEFAULT 98)
+if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
+ if (NOT CMAKE_CXX_COMPILER_FORCED)
+ if (NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT)
+ message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}")
+ endif()
+ set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT})
+ endif()
endif()
macro(cmake_record_cxx_compile_features)
diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake
index 89704e6..d979fb7 100644
--- a/Modules/Compiler/GNU-C.cmake
+++ b/Modules/Compiler/GNU-C.cmake
@@ -22,22 +22,26 @@ elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x")
endif()
-if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
- set(CMAKE_C_STANDARD_DEFAULT 11)
-elseif(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
- set(CMAKE_C_STANDARD_DEFAULT 90)
+if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
+ if (NOT CMAKE_C_COMPILER_FORCED)
+ if (NOT CMAKE_C_STANDARD_COMPUTED_DEFAULT)
+ message(FATAL_ERROR "CMAKE_C_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER}) version ${CMAKE_C_COMPILER_VERSION}")
+ endif()
+ set(CMAKE_C_STANDARD_DEFAULT ${CMAKE_C_STANDARD_COMPUTED_DEFAULT})
+ endif()
endif()
+
macro(cmake_record_c_compile_features)
macro(_get_gcc_features std_version list)
record_compiler_features(C "${std_version}" ${list})
endmacro()
set(_result 0)
- if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
_get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES)
endif()
- if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
if (_result EQUAL 0)
_get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES)
endif()
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index 2dc02f0..a7e71c3 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -35,7 +35,12 @@ elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
endif()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
- set(CMAKE_CXX_STANDARD_DEFAULT 98)
+ if (NOT CMAKE_CXX_COMPILER_FORCED)
+ if (NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT)
+ message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}")
+ endif()
+ set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT})
+ endif()
endif()
macro(cmake_record_cxx_compile_features)
diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake
index 00e4713..8c6c3f6 100644
--- a/Modules/Compiler/IAR.cmake
+++ b/Modules/Compiler/IAR.cmake
@@ -1,6 +1,6 @@
# This file is processed when the IAR compiler is used for a C or C++ file
# Documentation can be downloaded here: http://www.iar.com/website1/1.0.1.0/675/1/
-# The initial feature request is here: http://www.cmake.org/Bug/view.php?id=10176
+# The initial feature request is here: https://cmake.org/Bug/view.php?id=10176
# It also contains additional links and information.
if(_IAR_CMAKE_LOADED)
@@ -39,7 +39,7 @@ endif()
if(NOT IAR_TARGET_ARCHITECTURE)
message(FATAL_ERROR "The IAR compiler for this architecture is not yet supported "
- " by CMake. Please go to http://www.cmake.org/Bug and enter a feature request there.")
+ " by CMake. Please go to https://cmake.org/Bug and enter a feature request there.")
endif()
set(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE)
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index e0c02d9..50d68ee 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -36,8 +36,13 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11")
endif()
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
- set(CMAKE_CXX_STANDARD_DEFAULT 98)
+if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ if (NOT CMAKE_CXX_COMPILER_FORCED)
+ if (NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT)
+ message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}")
+ endif()
+ set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT})
+ endif()
endif()
macro(cmake_record_cxx_compile_features)
diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in
index a17d03d..2870a11 100644
--- a/Modules/CompilerId/VS-10.vcxproj.in
+++ b/Modules/CompilerId/VS-10.vcxproj.in
@@ -12,6 +12,7 @@
<Keyword>Win32Proj</Keyword>
@id_system@
@id_system_version@
+ @id_WindowsTargetPlatformVersion@
@id_WindowsSDKDesktopARMSupport@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
diff --git a/Modules/CompilerId/main.swift.in b/Modules/CompilerId/main.swift.in
index 962e857..13f0ba0 100644
--- a/Modules/CompilerId/main.swift.in
+++ b/Modules/CompilerId/main.swift.in
@@ -1 +1 @@
-println("CMakeSwiftCompilerId")
+print("CMakeSwiftCompilerId")
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 0fbf7c3..c822bdb 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -646,6 +646,11 @@ endfunction()
function(_ep_write_gitupdate_script script_filename git_EXECUTABLE git_tag git_submodules git_repository work_dir)
+ if(NOT GIT_VERSION_STRING VERSION_LESS 1.7.6)
+ set(git_stash_save_options --all --quiet)
+ else()
+ set(git_stash_save_options --quiet)
+ endif()
file(WRITE ${script_filename}
"if(\"${git_tag}\" STREQUAL \"\")
message(FATAL_ERROR \"Tag for git checkout should not be empty.\")
@@ -724,7 +729,7 @@ if(error_code OR is_remote_ref OR NOT (\"\${tag_sha}\" STREQUAL \"\${head_sha}\"
# perform git pull --rebase
if(need_stash)
execute_process(
- COMMAND \"${git_EXECUTABLE}\" stash save --all --quiet
+ COMMAND \"${git_EXECUTABLE}\" stash save ${git_stash_save_options}
WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code
)
@@ -1631,20 +1636,6 @@ function(_ep_add_mkdir_command name)
endfunction()
-function(_ep_get_git_version git_EXECUTABLE git_version_var)
- if(git_EXECUTABLE)
- execute_process(
- COMMAND "${git_EXECUTABLE}" --version
- OUTPUT_VARIABLE ov
- ERROR_VARIABLE ev
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- string(REGEX REPLACE "^git version (.+)$" "\\1" version "${ov}")
- set(${git_version_var} "${version}" PARENT_SCOPE)
- endif()
-endfunction()
-
-
function(_ep_is_dir_empty dir empty_var)
file(GLOB gr "${dir}/*")
if("${gr}" STREQUAL "")
@@ -1740,6 +1731,7 @@ function(_ep_add_download_command name)
--non-interactive ${svn_trust_cert_args} ${svn_user_pw_args} ${src_name})
list(APPEND depends ${stamp_dir}/${name}-svninfo.txt)
elseif(git_repository)
+ unset(CMAKE_MODULE_PATH) # Use CMake builtin find module
find_package(Git QUIET)
if(NOT GIT_EXECUTABLE)
message(FATAL_ERROR "error: could not find git for clone of ${name}")
@@ -1747,9 +1739,8 @@ function(_ep_add_download_command name)
# The git submodule update '--recursive' flag requires git >= v1.6.5
#
- _ep_get_git_version("${GIT_EXECUTABLE}" git_version)
- if(git_version VERSION_LESS 1.6.5)
- message(FATAL_ERROR "error: git version 1.6.5 or later required for 'git submodule update --recursive': git_version='${git_version}'")
+ if(GIT_VERSION_STRING VERSION_LESS 1.6.5)
+ message(FATAL_ERROR "error: git version 1.6.5 or later required for 'git submodule update --recursive': GIT_VERSION_STRING='${GIT_VERSION_STRING}'")
endif()
get_property(git_tag TARGET ${name} PROPERTY _EP_GIT_TAG)
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index a449132..9f6e666 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -31,6 +31,12 @@
# Find module will then look in this path when searching for HDF5
# executables, paths, and libraries.
#
+# Both the serial and parallel HDF5 wrappers are considered and the first
+# directory to contain either one will be used. In the event that both appear
+# in the same directory the serial version is preferentially selected. This
+# behavior can be reversed by setting the variable HDF5_PREFER_PARALLEL to
+# true.
+#
# In addition to finding the includes and libraries required to compile
# an HDF5 client application, this module also makes an effort to find
# tools that come with the HDF5 distribution that may be useful for
@@ -103,28 +109,43 @@ else()
endforeach()
endif()
+# Determine whether to search for serial or parallel executable first
+if(HDF5_PREFER_PARALLEL)
+ set(HDF5_C_COMPILER_NAMES h5pcc h5cc)
+ set(HDF5_CXX_COMPILER_NAMES h5pc++ h5c++)
+ set(HDF5_Fortran_COMPILER_NAMES h5pfc h5fc)
+else()
+ set(HDF5_C_COMPILER_NAMES h5cc h5pcc)
+ set(HDF5_CXX_COMPILER_NAMES h5c++ h5pc++)
+ set(HDF5_Fortran_COMPILER_NAMES h5fc h5pfc)
+endif()
+
# try to find the HDF5 wrapper compilers
find_program( HDF5_C_COMPILER_EXECUTABLE
- NAMES h5cc h5pcc
+ NAMES ${HDF5_C_COMPILER_NAMES} NAMES_PER_DIR
HINTS ENV HDF5_ROOT
PATH_SUFFIXES bin Bin
DOC "HDF5 Wrapper compiler. Used only to detect HDF5 compile flags." )
mark_as_advanced( HDF5_C_COMPILER_EXECUTABLE )
find_program( HDF5_CXX_COMPILER_EXECUTABLE
- NAMES h5c++ h5pc++
+ NAMES ${HDF5_CXX_COMPILER_NAMES} NAMES_PER_DIR
HINTS ENV HDF5_ROOT
PATH_SUFFIXES bin Bin
DOC "HDF5 C++ Wrapper compiler. Used only to detect HDF5 compile flags." )
mark_as_advanced( HDF5_CXX_COMPILER_EXECUTABLE )
find_program( HDF5_Fortran_COMPILER_EXECUTABLE
- NAMES h5fc h5pfc
+ NAMES ${HDF5_Fortran_COMPILER_NAMES} NAMES_PER_DIR
HINTS ENV HDF5_ROOT
PATH_SUFFIXES bin Bin
DOC "HDF5 Fortran Wrapper compiler. Used only to detect HDF5 compile flags." )
mark_as_advanced( HDF5_Fortran_COMPILER_EXECUTABLE )
+unset(HDF5_C_COMPILER_NAMES)
+unset(HDF5_CXX_COMPILER_NAMES)
+unset(HDF5_Fortran_COMPILER_NAMES)
+
find_program( HDF5_DIFF_EXECUTABLE
NAMES h5diff
HINTS ENV HDF5_ROOT
@@ -286,7 +307,7 @@ if( NOT HDF5_FOUND )
if( UNIX AND HDF5_USE_STATIC_LIBRARIES )
# According to bug 1643 on the CMake bug tracker, this is the
# preferred method for searching for a static library.
- # See http://www.cmake.org/Bug/view.php?id=1643. We search
+ # See https://cmake.org/Bug/view.php?id=1643. We search
# first for the full static library name, but fall back to a
# generic search on the name if the static search fails.
set( THIS_LIBRARY_SEARCH_DEBUG lib${LIB}d.a ${LIB}d )
@@ -378,4 +399,3 @@ find_package_handle_standard_args( HDF5
REQUIRED_VARS HDF5_LIBRARIES HDF5_INCLUDE_DIRS
VERSION_VAR HDF5_VERSION
)
-
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index a47a69c..7a36719 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -229,6 +229,7 @@ if(NOT MATLAB_ADDITIONAL_VERSIONS)
endif()
set(MATLAB_VERSIONS_MAPPING
+ "R2015b=8.6"
"R2015a=8.5"
"R2014b=8.4"
"R2014a=8.3"
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 434ef58..d75e8ab 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -36,6 +36,7 @@
# ^^^^^
#
# Set ``OPENSSL_ROOT_DIR`` to the root directory of an OpenSSL installation.
+# Set ``OPENSSL_USE_STATIC_LIBS`` to ``TRUE`` to look for static libraries.
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -57,6 +58,16 @@ if (UNIX)
pkg_check_modules(_OPENSSL QUIET openssl)
endif ()
+# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
+if(OPENSSL_USE_STATIC_LIBS)
+ set(_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ if(WIN32)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ else()
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
+ endif()
+endif()
+
if (WIN32)
# http://www.slproweb.com/products/Win32OpenSSL.html
set(_OPENSSL_ROOT_HINTS
@@ -113,12 +124,21 @@ if(WIN32 AND NOT CYGWIN)
# We are using the libraries located in the VC subdir instead of the parent directory eventhough :
# libeay32MD.lib is identical to ../libeay32.lib, and
# ssleay32MD.lib is identical to ../ssleay32.lib
+ # enable OPENSSL_USE_STATIC_LIBS to use the static libs located in lib/VC/static
- set(_OPENSSL_PATH_SUFFIXES
- "lib"
- "VC"
- "lib/VC"
- )
+ if(OPENSSL_USE_STATIC_LIBS)
+ set(_OPENSSL_PATH_SUFFIXES
+ "lib"
+ "VC/static"
+ "lib/VC/static"
+ )
+ else()
+ set(_OPENSSL_PATH_SUFFIXES
+ "lib"
+ "VC"
+ "lib/VC"
+ )
+ endif ()
find_library(LIB_EAY_DEBUG
NAMES
@@ -414,3 +434,8 @@ if(OPENSSL_FOUND)
endif()
endif()
endif()
+
+# Restore the original find library ordering
+if(OPENSSL_USE_STATIC_LIBS)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
+endif()
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index ae6903e..e822b9c 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -70,14 +70,14 @@ macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist}
OUTPUT_VARIABLE _pkgconfig_invoke_result
- RESULT_VARIABLE _pkgconfig_failed)
+ RESULT_VARIABLE _pkgconfig_failed
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
if (_pkgconfig_failed)
set(_pkgconfig_${_varname} "")
_pkgconfig_unset(${_prefix}_${_varname})
else()
string(REGEX REPLACE "[\r\n]" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
- string(REGEX REPLACE " +$" "" _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
if (NOT ${_regexp} STREQUAL "")
string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
@@ -91,6 +91,26 @@ macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
endif()
endmacro()
+#[========================================[.rst:
+.. command:: pkg_get_variable
+
+ Retrieves the value of a variable from a package::
+
+ pkg_get_variable(<RESULT> <MODULE> <VARIABLE>)
+
+ For example:
+
+ .. code-block:: cmake
+
+ pkg_get_variable(GI_GIRDIR gobject-introspection-1.0 girdir)
+#]========================================]
+function (pkg_get_variable result pkg variable)
+ _pkgconfig_invoke("${pkg}" "prefix" "result" "" "--variable=${variable}")
+ set("${result}"
+ "${prefix_result}"
+ PARENT_SCOPE)
+endfunction ()
+
# Invokes pkgconfig two times; once without '--static' and once with
# '--static'
macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp)
@@ -356,9 +376,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
endif()
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION "" --modversion )
- _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX "" --variable=prefix )
- _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR "" --variable=includedir )
- _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" LIBDIR "" --variable=libdir )
+ pkg_get_variable("${_pkg_check_prefix}_PREFIX" ${_pkg_check_modules_pkg} "prefix")
+ pkg_get_variable("${_pkg_check_prefix}_INCLUDEDIR" ${_pkg_check_modules_pkg} "includedir")
+ pkg_get_variable("${_pkg_check_prefix}_LIBDIR" ${_pkg_check_modules_pkg} "libdir")
if (NOT ${_is_silent})
message(STATUS " Found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}")
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 3ce2c73..d05d3da 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -81,7 +81,7 @@ set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to wher
set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
- "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
+ "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
# Define additional search paths for root directories.
set( PostgreSQL_ROOT_DIRECTORIES
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 335c408..4a68cd1 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -57,17 +57,18 @@
# include_directories(${PROTOBUF_INCLUDE_DIRS})
# include_directories(${CMAKE_CURRENT_BINARY_DIR})
# protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS foo.proto)
+# protobuf_generate_python(PROTO_PY foo.proto)
# add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS})
# target_link_libraries(bar ${PROTOBUF_LIBRARIES})
#
# .. note::
-# The PROTOBUF_GENERATE_CPP macro and add_executable() or
-# add_library() calls only work properly within the same
-# directory.
+# The ``protobuf_generate_cpp`` and ``protobuf_generate_python``
+# functions and :command:`add_executable` or :command:`add_library`
+# calls only work properly within the same directory.
#
# .. command:: protobuf_generate_cpp
#
-# Add custom commands to process ``.proto`` files::
+# Add custom commands to process ``.proto`` files to C++::
#
# protobuf_generate_cpp (<SRCS> <HDRS> [<ARGN>...])
#
@@ -77,6 +78,17 @@
# Variable to define with autogenerated header files
# ``ARGN``
# ``.proto`` files
+#
+# .. command:: protobuf_generate_python
+#
+# Add custom commands to process ``.proto`` files to Python::
+#
+# protobuf_generate_python (<PY> [<ARGN>...])
+#
+# ``PY``
+# Variable to define with autogenerated Python files
+# ``ARGN``
+# ``.proto`` filess
#=============================================================================
# Copyright 2009 Kitware, Inc.
@@ -147,6 +159,53 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
set(${HDRS} ${${HDRS}} PARENT_SCOPE)
endfunction()
+function(PROTOBUF_GENERATE_PYTHON SRCS)
+ if(NOT ARGN)
+ message(SEND_ERROR "Error: PROTOBUF_GENERATE_PYTHON() called without any proto files")
+ return()
+ endif()
+
+ if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
+ # Create an include path for each file specified
+ foreach(FIL ${ARGN})
+ get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
+ get_filename_component(ABS_PATH ${ABS_FIL} PATH)
+ list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
+ if(${_contains_already} EQUAL -1)
+ list(APPEND _protobuf_include_path -I ${ABS_PATH})
+ endif()
+ endforeach()
+ else()
+ set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
+ endif()
+
+ if(DEFINED PROTOBUF_IMPORT_DIRS)
+ foreach(DIR ${PROTOBUF_IMPORT_DIRS})
+ get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
+ list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
+ if(${_contains_already} EQUAL -1)
+ list(APPEND _protobuf_include_path -I ${ABS_PATH})
+ endif()
+ endforeach()
+ endif()
+
+ set(${SRCS})
+ foreach(FIL ${ARGN})
+ get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
+ get_filename_component(FIL_WE ${FIL} NAME_WE)
+
+ list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py")
+ add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py"
+ COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
+ DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}
+ COMMENT "Running Python protocol buffer compiler on ${FIL}"
+ VERBATIM )
+ endforeach()
+
+ set(${SRCS} ${${SRCS}} PARENT_SCOPE)
+endfunction()
+
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_PROTOBUF_ARCH_DIR x64/)
endif()
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 8784e18..879192e 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -51,7 +51,7 @@ unset(_Python_NAMES)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
-set(_PYTHON3_VERSIONS 3.4 3.3 3.2 3.1 3.0)
+set(_PYTHON3_VERSIONS 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
if(PythonInterp_FIND_VERSION)
if(PythonInterp_FIND_VERSION_COUNT GREATER 1)
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index b80d3ce..68e1228 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -49,6 +49,25 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# Use the executable's path as a hint
+set(_Python_LIBRARY_PATH_HINT)
+if(PYTHON_EXECUTABLE)
+ if(WIN32)
+ get_filename_component(_Python_PREFIX ${PYTHON_EXECUTABLE} PATH)
+ if(_Python_PREFIX)
+ set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/libs)
+ endif()
+ unset(_Python_PREFIX)
+ else()
+ get_filename_component(_Python_PREFIX ${PYTHON_EXECUTABLE} PATH)
+ get_filename_component(_Python_PREFIX ${_Python_PREFIX} PATH)
+ if(_Python_PREFIX)
+ set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/lib)
+ endif()
+ unset(_Python_PREFIX)
+ endif()
+endif()
+
include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindFrameworks.cmake)
# Search for the python framework on Apple.
CMAKE_FIND_FRAMEWORKS(Python)
@@ -64,7 +83,7 @@ set(CMAKE_FIND_FRAMEWORK LAST)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
-set(_PYTHON3_VERSIONS 3.4 3.3 3.2 3.1 3.0)
+set(_PYTHON3_VERSIONS 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
if(PythonLibs_FIND_VERSION)
if(PythonLibs_FIND_VERSION_COUNT GREATER 1)
@@ -112,6 +131,7 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
if(WIN32)
find_library(PYTHON_DEBUG_LIBRARY
NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
+ HINTS ${_Python_LIBRARY_PATH_HINT}
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
@@ -134,6 +154,8 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
python${_CURRENT_VERSION}m
python${_CURRENT_VERSION}u
python${_CURRENT_VERSION}
+ HINTS
+ ${_Python_LIBRARY_PATH_HINT}
PATHS
${PYTHON_FRAMEWORK_LIBRARIES}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
@@ -150,33 +172,42 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
PATH_SUFFIXES python${_CURRENT_VERSION}/config
)
- # For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if
- # PYTHON_INCLUDE_DIR is not set.
- if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
- set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
- "Path to where Python.h is found" FORCE)
- endif()
+ # Don't search for include dir until library location is known
+ if(PYTHON_LIBRARY)
- set(PYTHON_FRAMEWORK_INCLUDES)
- if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
- foreach(dir ${Python_FRAMEWORKS})
- list(APPEND PYTHON_FRAMEWORK_INCLUDES
- ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
- endforeach()
- endif()
+ # Use the library's install prefix as a hint
+ set(_Python_INCLUDE_PATH_HINT)
+ get_filename_component(_Python_PREFIX ${PYTHON_LIBRARY} PATH)
+ get_filename_component(_Python_PREFIX ${_Python_PREFIX} PATH)
+ if(_Python_PREFIX)
+ set(_Python_INCLUDE_PATH_HINT ${_Python_PREFIX}/include)
+ endif()
+ unset(_Python_PREFIX)
+
+ # Add framework directories to the search paths
+ set(PYTHON_FRAMEWORK_INCLUDES)
+ if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+ foreach(dir ${Python_FRAMEWORKS})
+ list(APPEND PYTHON_FRAMEWORK_INCLUDES
+ ${dir}/Versions/${_CURRENT_VERSION}/include)
+ endforeach()
+ endif()
- find_path(PYTHON_INCLUDE_DIR
- NAMES Python.h
- PATHS
- ${PYTHON_FRAMEWORK_INCLUDES}
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
- PATH_SUFFIXES
- python${_CURRENT_VERSION}mu
- python${_CURRENT_VERSION}m
- python${_CURRENT_VERSION}u
- python${_CURRENT_VERSION}
- )
+ find_path(PYTHON_INCLUDE_DIR
+ NAMES Python.h
+ HINTS
+ ${_Python_INCLUDE_PATH_HINT}
+ PATHS
+ ${PYTHON_FRAMEWORK_INCLUDES}
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
+ PATH_SUFFIXES
+ python${_CURRENT_VERSION}mu
+ python${_CURRENT_VERSION}m
+ python${_CURRENT_VERSION}u
+ python${_CURRENT_VERSION}
+ )
+ endif()
# For backward compatibility, set PYTHON_INCLUDE_PATH.
set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
@@ -194,6 +225,9 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
endif()
endforeach()
+unset(_Python_INCLUDE_PATH_HINT)
+unset(_Python_LIBRARY_PATH_HINT)
+
mark_as_advanced(
PYTHON_DEBUG_LIBRARY
PYTHON_LIBRARY
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index a0bc4d1..c607923 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -39,7 +39,7 @@
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
-# Copyright 2011-2014 Rolf Eike Beer <eike@sf-mail.de>
+# Copyright 2011-2015 Rolf Eike Beer <eike@sf-mail.de>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -51,15 +51,23 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-include (CheckIncludeFiles)
include (CheckLibraryExists)
include (CheckSymbolExists)
set(Threads_FOUND FALSE)
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
set(CMAKE_REQUIRED_QUIET ${Threads_FIND_QUIETLY})
+if(CMAKE_C_COMPILER_LOADED)
+ include (CheckIncludeFile)
+elseif(CMAKE_CXX_COMPILER_LOADED)
+ include (CheckIncludeFileCXX)
+else()
+ message(FATAL_ERROR "FindThreads only works if either C or CXX language is enabled")
+endif()
+
# Do we have sproc?
if(CMAKE_SYSTEM_NAME MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
+ include (CheckIncludeFiles)
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H)
endif()
@@ -83,11 +91,18 @@ macro(_check_pthreads_flag)
# If we did not found -lpthread, -lpthread, or -lthread, look for -pthread
if(NOT DEFINED THREADS_HAVE_PTHREAD_ARG)
message(STATUS "Check if compiler accepts -pthread")
+ if(CMAKE_C_COMPILER_LOADED)
+ set(_threads_src ${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c)
+ elseif(CMAKE_CXX_COMPILER_LOADED)
+ set(_threads_src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindThreads/CheckForPthreads.cxx)
+ configure_file(${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c "${_threads_src}" COPYONLY)
+ endif()
try_run(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
${CMAKE_BINARY_DIR}
- ${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c
+ ${_threads_src}
CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread
COMPILE_OUTPUT_VARIABLE OUTPUT)
+ unset(_threads_src)
if(THREADS_HAVE_PTHREAD_ARG)
if(THREADS_PTHREAD_ARG STREQUAL "2")
@@ -120,7 +135,11 @@ if(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD)
set(CMAKE_USE_SPROC_INIT 1)
else()
# Do we have pthreads?
- CHECK_INCLUDE_FILES("pthread.h" CMAKE_HAVE_PTHREAD_H)
+ if(CMAKE_C_COMPILER_LOADED)
+ CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
+ else()
+ CHECK_INCLUDE_FILE_CXX("pthread.h" CMAKE_HAVE_PTHREAD_H)
+ endif()
if(CMAKE_HAVE_PTHREAD_H)
#
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index d4a27d5..a57f450 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -74,14 +74,28 @@ set(_ZLIB_SEARCH_NORMAL
)
list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
-set(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1)
+set(ZLIB_NAMES z zlib zdll zlib1)
+set(ZLIB_NAMES_DEBUG zlibd zlibd1)
# Try each search configuration.
foreach(search ${_ZLIB_SEARCHES})
- find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
- find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
+ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
endforeach()
+# Allow ZLIB_LIBRARY to be set manually, as the location of the zlib library
+if(NOT ZLIB_LIBRARY)
+ foreach(search ${_ZLIB_SEARCHES})
+ find_library(ZLIB_LIBRARY_RELEASE NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
+ find_library(ZLIB_LIBRARY_DEBUG NAMES ${ZLIB_NAMES_DEBUG} ${${search}} PATH_SUFFIXES lib)
+ endforeach()
+
+ include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+ select_library_configurations(ZLIB)
+endif()
+
+unset(ZLIB_NAMES)
+unset(ZLIB_NAMES_DEBUG)
+
mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
@@ -112,12 +126,33 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_D
if(ZLIB_FOUND)
set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
- set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+
+ if(NOT ZLIB_LIBRARIES)
+ set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+ endif()
if(NOT TARGET ZLIB::ZLIB)
add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
set_target_properties(ZLIB::ZLIB PROPERTIES
- IMPORTED_LOCATION "${ZLIB_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
+
+ if(ZLIB_LIBRARY_RELEASE)
+ set_property(TARGET ZLIB::ZLIB APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(ZLIB::ZLIB PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${ZLIB_LIBRARY_RELEASE}")
+ endif()
+
+ if(ZLIB_LIBRARY_DEBUG)
+ set_property(TARGET ZLIB::ZLIB APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(ZLIB::ZLIB PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${ZLIB_LIBRARY_DEBUG}")
+ endif()
+
+ if(NOT ZLIB_LIBRARY_RELEASE AND NOT ZLIB_LIBRARY_DEBUG)
+ set_property(TARGET ZLIB::ZLIB APPEND PROPERTY
+ IMPORTED_LOCATION "${ZLIB_LIBRARY}")
+ endif()
endif()
endif()
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 9a70678..9037594 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -193,8 +193,8 @@ set(wxWidgets_CXX_FLAGS "")
# to prevent UsewxWidgets.cmake from using SYSTEM.
#
# See cmake mailing list discussions for more info:
-# http://www.cmake.org/pipermail/cmake/2008-April/021115.html
-# http://www.cmake.org/pipermail/cmake/2008-April/021146.html
+# https://cmake.org/pipermail/cmake/2008-April/021115.html
+# https://cmake.org/pipermail/cmake/2008-April/021146.html
#
if(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
set(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1)
@@ -302,6 +302,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Find wxWidgets multilib base libraries.
find_library(WX_base${_DBG}
NAMES
+ wxbase31${_UCD}${_DBG}
wxbase30${_UCD}${_DBG}
wxbase29${_UCD}${_DBG}
wxbase28${_UCD}${_DBG}
@@ -315,6 +316,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
foreach(LIB net odbc xml)
find_library(WX_${LIB}${_DBG}
NAMES
+ wxbase31${_UCD}${_DBG}_${LIB}
wxbase30${_UCD}${_DBG}_${LIB}
wxbase29${_UCD}${_DBG}_${LIB}
wxbase28${_UCD}${_DBG}_${LIB}
@@ -330,6 +332,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Find wxWidgets monolithic library.
find_library(WX_mono${_DBG}
NAMES
+ wxmsw${_UNV}31${_UCD}${_DBG}
wxmsw${_UNV}30${_UCD}${_DBG}
wxmsw${_UNV}29${_UCD}${_DBG}
wxmsw${_UNV}28${_UCD}${_DBG}
@@ -346,6 +349,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
stc ribbon propgrid webview)
find_library(WX_${LIB}${_DBG}
NAMES
+ wxmsw${_UNV}31${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}30${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}29${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}28${_UCD}${_DBG}_${LIB}
@@ -386,7 +390,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Clear wxWidgets multilib libraries.
foreach(LIB core adv aui html media xrc dbgrid gl qa richtext
- stc ribbon propgrid)
+ webview stc ribbon propgrid)
WX_CLEAR_LIB(WX_${LIB}${_DBG})
endforeach()
endmacro()
@@ -741,7 +745,7 @@ else()
#-----------------------------------------------------------------
# Support cross-compiling, only search in the target platform.
find_program(wxWidgets_CONFIG_EXECUTABLE
- NAMES wx-config wx-config-3.0 wx-config-2.9 wx-config-2.8
+ NAMES wx-config wx-config-3.1 wx-config-3.0 wx-config-2.9 wx-config-2.8
DOC "Location of wxWidgets library configuration provider binary (wx-config)."
ONLY_CMAKE_FIND_ROOT_PATH
)
@@ -857,6 +861,28 @@ else()
endif()
endif()
+# Check if a specfic version was requested by find_package().
+if(wxWidgets_FOUND)
+ find_file(_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} NO_DEFAULT_PATH)
+ dbg_msg("_filename: ${_filename}")
+
+ if(NOT _filename)
+ message(FATAL_ERROR "wxWidgets wx/version.h file not found in ${wxWidgets_INCLUDE_DIRS}.")
+ endif()
+
+ file(READ ${_filename} _wx_version_h)
+
+ string(REGEX REPLACE "^(.*\n)?#define +wxMAJOR_VERSION +([0-9]+).*"
+ "\\2" wxWidgets_VERSION_MAJOR "${_wx_version_h}" )
+ string(REGEX REPLACE "^(.*\n)?#define +wxMINOR_VERSION +([0-9]+).*"
+ "\\2" wxWidgets_VERSION_MINOR "${_wx_version_h}" )
+ string(REGEX REPLACE "^(.*\n)?#define +wxRELEASE_NUMBER +([0-9]+).*"
+ "\\2" wxWidgets_VERSION_PATCH "${_wx_version_h}" )
+ set(wxWidgets_VERSION_STRING
+ "${wxWidgets_VERSION_MAJOR}.${wxWidgets_VERSION_MINOR}.${wxWidgets_VERSION_PATCH}" )
+ dbg_msg("wxWidgets_VERSION_STRING: ${wxWidgets_VERSION_STRING}")
+endif()
+
# Debug output:
DBG_MSG("wxWidgets_FOUND : ${wxWidgets_FOUND}")
DBG_MSG("wxWidgets_INCLUDE_DIRS : ${wxWidgets_INCLUDE_DIRS}")
@@ -867,10 +893,13 @@ DBG_MSG("wxWidgets_USE_FILE : ${wxWidgets_USE_FILE}")
#=====================================================================
#=====================================================================
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(wxWidgets DEFAULT_MSG wxWidgets_FOUND)
-# Maintain consistency with all other variables.
-set(wxWidgets_FOUND ${WXWIDGETS_FOUND})
+
+find_package_handle_standard_args(wxWidgets
+ REQUIRED_VARS wxWidgets_LIBRARIES wxWidgets_INCLUDE_DIRS
+ VERSION_VAR wxWidgets_VERSION_STRING
+ )
#=====================================================================
# Macros for use in wxWidgets apps.
diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake
index abd9a26..86b89b2 100644
--- a/Modules/Internal/FeatureTesting.cmake
+++ b/Modules/Internal/FeatureTesting.cmake
@@ -5,7 +5,7 @@ macro(record_compiler_features lang compile_flags feature_list)
string(TOLOWER ${lang} lang_lc)
file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin")
file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" "
- const char features[] = {\"\"\n")
+ const char features[] = {\"\\n\"\n")
get_property(known_features GLOBAL PROPERTY CMAKE_${lang}_KNOWN_FEATURES)
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 62fb985..a08411b 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -100,6 +100,10 @@ elseif("${CMAKE_GENERATOR}" MATCHES Xcode
"Instead using SDK:\n \"${_CMAKE_OSX_SYSROOT_DEFAULT}\"."
)
endif()
+ if(NOT CMAKE_OSX_DEPLOYMENT_TARGET AND _CURRENT_OSX_VERSION VERSION_LESS _CMAKE_OSX_DEPLOYMENT_TARGET)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET ${_CURRENT_OSX_VERSION} CACHE STRING
+ "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value." FORCE)
+ endif()
else()
# Assume developer files are in root (such as Xcode 4.5 command-line tools).
set(_CMAKE_OSX_SYSROOT_DEFAULT "")
diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Initialize.cmake
index 342ad21..9eb7a8a 100644
--- a/Modules/Platform/GHS-MULTI-Initialize.cmake
+++ b/Modules/Platform/GHS-MULTI-Initialize.cmake
@@ -13,13 +13,35 @@
# License text for the above reference.)
#Setup Greenhills MULTI specific compilation information
-find_path(GHS_INT_DIRECTORY INTEGRITY.ld PATHS
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware6433c345;InstallLocation]" #int1122
- "C:/ghs/int1122"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware289b6625;InstallLocation]" #int1104
- "C:/ghs/int1104"
- DOC "Path to integrity directory"
- )
+
+if (NOT GHS_INT_DIRECTORY)
+ #Assume the C:/ghs/int#### directory that is latest is prefered
+ set(GHS_EXPECTED_ROOT "C:/ghs")
+ if (EXISTS ${GHS_EXPECTED_ROOT})
+ FILE(GLOB GHS_CANDIDATE_INT_DIRS RELATIVE
+ ${GHS_EXPECTED_ROOT} ${GHS_EXPECTED_ROOT}/*)
+ string(REGEX MATCHALL "int[0-9][0-9][0-9][0-9]" GHS_CANDIDATE_INT_DIRS
+ ${GHS_CANDIDATE_INT_DIRS})
+ if (GHS_CANDIDATE_INT_DIRS)
+ list(SORT GHS_CANDIDATE_INT_DIRS)
+ list(GET GHS_CANDIDATE_INT_DIRS -1 GHS_INT_DIRECTORY)
+ string(CONCAT GHS_INT_DIRECTORY ${GHS_EXPECTED_ROOT} "/"
+ ${GHS_INT_DIRECTORY})
+ endif ()
+ endif ()
+
+ #Try to look for known registry values
+ if (NOT GHS_INT_DIRECTORY)
+ find_path(GHS_INT_DIRECTORY INTEGRITY.ld PATHS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware6433c345;InstallLocation]" #int1122
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware289b6625;InstallLocation]" #int1104
+ )
+ endif ()
+
+ set(GHS_INT_DIRECTORY ${GHS_INT_DIRECTORY} CACHE PATH
+ "Path to integrity directory")
+endif ()
+
set(GHS_OS_DIR ${GHS_INT_DIRECTORY} CACHE PATH "OS directory")
set(GHS_PRIMARY_TARGET "arm_integrity.tgt" CACHE STRING "target for compilation")
set(GHS_BSP_NAME "simarm" CACHE STRING "BSP name")
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index b97409c..d8a423e 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -65,7 +65,7 @@ macro(__windows_compiler_gnu lang)
if(MSYS OR MINGW)
# Create archiving rules to support large object file lists for static libraries.
- set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> cq <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_${lang}_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 94470c3..b421b0d 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -179,7 +179,9 @@ elseif(WINDOWS_PHONE OR WINDOWS_STORE)
set(_PLATFORM_DEFINES "/DWIN32")
set(_FLAGS_C " /DUNICODE /D_UNICODE")
set(_FLAGS_CXX " /DUNICODE /D_UNICODE /GR /EHsc")
- if(WINDOWS_PHONE)
+ if(WINDOWS_STORE AND MSVC_VERSION GREATER 1899)
+ set(CMAKE_C_STANDARD_LIBRARIES_INIT "WindowsApp.lib")
+ elseif(WINDOWS_PHONE)
set(CMAKE_C_STANDARD_LIBRARIES_INIT "WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib")
elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM")
set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib")
@@ -274,8 +276,8 @@ set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZER
macro(__windows_compiler_msvc lang)
if(NOT MSVC_VERSION LESS 1400)
# for 2005 make sure the manifest is put in the dll with mt
- set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll ")
- set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe ")
+ set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll --intdir=<OBJECT_DIR> --manifests <MANIFESTS> -- ")
+ set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe --intdir=<OBJECT_DIR> --manifests <MANIFESTS> -- ")
endif()
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
"${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 8f21adf..2c5d5ae 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -171,17 +171,30 @@ function(ProcessorCount var)
endif()
if(NOT count)
- # Sun (systems where uname -X emits "NumCPU" in its output):
- find_program(ProcessorCount_cmd_uname uname)
- mark_as_advanced(ProcessorCount_cmd_uname)
- if(ProcessorCount_cmd_uname)
- execute_process(COMMAND ${ProcessorCount_cmd_uname} -X
+ # Sun (systems where psrinfo tool is available)
+ find_program(ProcessorCount_cmd_psrinfo psrinfo PATHS /usr/sbin /sbin)
+ mark_as_advanced(ProcessorCount_cmd_psrinfo)
+ if (ProcessorCount_cmd_psrinfo)
+ execute_process(COMMAND ${ProcessorCount_cmd_psrinfo} -p -v
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
- OUTPUT_VARIABLE uname_X_output)
- string(REGEX MATCHALL "NumCPU = ([0-9]+)" procs "${uname_X_output}")
+ OUTPUT_VARIABLE psrinfo_output)
+ string(REGEX MATCH "([0-9]+) virtual processor" procs "${psrinfo_output}")
set(count "${CMAKE_MATCH_1}")
- #message("ProcessorCount: trying uname -X '${ProcessorCount_cmd_uname}'")
+ #message("ProcessorCount: trying psrinfo -p -v '${ProcessorCount_cmd_prvinfo}'")
+ else()
+ # Sun (systems where uname -X emits "NumCPU" in its output):
+ find_program(ProcessorCount_cmd_uname uname)
+ mark_as_advanced(ProcessorCount_cmd_uname)
+ if(ProcessorCount_cmd_uname)
+ execute_process(COMMAND ${ProcessorCount_cmd_uname} -X
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ OUTPUT_VARIABLE uname_X_output)
+ string(REGEX MATCHALL "NumCPU = ([0-9]+)" procs "${uname_X_output}")
+ set(count "${CMAKE_MATCH_1}")
+ #message("ProcessorCount: trying uname -X '${ProcessorCount_cmd_uname}'")
+ endif()
endif()
endif()
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 96b0b35..d757f65 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -153,10 +153,12 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
else()
set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
endif()
- SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE}
- swig_extra_generated_files
- "${swig_outdir}"
- "${swig_source_file_fullname}")
+ if (NOT SWIG_MODULE_${name}_NOPROXY)
+ SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE}
+ swig_extra_generated_files
+ "${swig_outdir}"
+ "${swig_source_file_fullname}")
+ endif()
set(swig_generated_file_fullname
"${swig_outdir}/${swig_source_file_name_we}")
# add the language into the name of the file (i.e. TCL_wrap)
diff --git a/Modules/UseVTK40.cmake b/Modules/UseVTK40.cmake
deleted file mode 100644
index d6bdaaa..0000000
--- a/Modules/UseVTK40.cmake
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-
-#=============================================================================
-# Copyright 2002-2009 Kitware, Inc.
-#
-# 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.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-# This is an implementation detail for using VTK 4.0 with the
-# FindVTK.cmake module. Do not include directly by name. This should
-# be included only when FindVTK.cmake sets the VTK_USE_FILE variable
-# to point here.
-
-# Add compiler flags needed to use VTK.
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VTK_REQUIRED_C_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VTK_REQUIRED_CXX_FLAGS}")
-
-# Add include directories needed to use VTK.
-include_directories(${VTK_INCLUDE_DIRS})
-
-# Add link directories needed to use VTK.
-link_directories(${VTK_LIBRARY_DIRS})
diff --git a/Modules/UseVTKBuildSettings40.cmake b/Modules/UseVTKBuildSettings40.cmake
deleted file mode 100644
index 474f67c..0000000
--- a/Modules/UseVTKBuildSettings40.cmake
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-
-#=============================================================================
-# Copyright 2002-2009 Kitware, Inc.
-#
-# 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.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-# Implementation detail for FindVTK.cmake to let it provide a
-# VTK_BUILD_SETTINGS_FILE for VTK 4.0.
-
-set(CMAKE_BUILD_SETTING_CMAKE_MAJOR_VERSION "${VTK40_CMAKE_MAJOR_VERSION}")
-set(CMAKE_BUILD_SETTING_CMAKE_MINOR_VERSION "${VTK40_CMAKE_MINOR_VERSION}")
-set(CMAKE_BUILD_SETTING_PROJECT_NAME "VTK")
-
-set(CMAKE_BUILD_SETTING_C_COMPILER "${VTK40_CMAKE_C_COMPILER}")
-set(CMAKE_BUILD_SETTING_C_FLAGS "${VTK40_CMAKE_C_FLAGS}")
-set(CMAKE_BUILD_SETTING_C_FLAGS_DEBUG "${VTK40_CMAKE_C_FLAGS_DEBUG}")
-set(CMAKE_BUILD_SETTING_C_FLAGS_RELEASE "${VTK40_CMAKE_C_FLAGS_RELEASE}")
-set(CMAKE_BUILD_SETTING_C_FLAGS_MINSIZEREL "${VTK40_CMAKE_C_FLAGS_MINSIZEREL}")
-set(CMAKE_BUILD_SETTING_C_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_C_FLAGS_RELWITHDEBINFO}")
-
-set(CMAKE_BUILD_SETTING_CXX_COMPILER "${VTK40_CMAKE_CXX_COMPILER}")
-set(CMAKE_BUILD_SETTING_CXX_FLAGS "${VTK40_CMAKE_CXX_FLAGS}")
-set(CMAKE_BUILD_SETTING_CXX_FLAGS_DEBUG "${VTK40_CMAKE_CXX_FLAGS_DEBUG}")
-set(CMAKE_BUILD_SETTING_CXX_FLAGS_RELEASE "${VTK40_CMAKE_CXX_FLAGS_RELEASE}")
-set(CMAKE_BUILD_SETTING_CXX_FLAGS_MINSIZEREL "${VTK40_CMAKE_CXX_FLAGS_MINSIZEREL}")
-set(CMAKE_BUILD_SETTING_CXX_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
-
-set(CMAKE_BUILD_SETTING_BUILD_TYPE "${VTK40_CMAKE_BUILD_TYPE}")
-set(CMAKE_BUILD_SETTING_BUILD_TOOL "${VTK40_CMAKE_BUILD_TOOL}")
diff --git a/Modules/UseVTKConfig40.cmake b/Modules/UseVTKConfig40.cmake
deleted file mode 100644
index c5022e4..0000000
--- a/Modules/UseVTKConfig40.cmake
+++ /dev/null
@@ -1,409 +0,0 @@
-#
-
-#=============================================================================
-# Copyright 2002-2009 Kitware, Inc.
-#
-# 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.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-# This is an implementation detail for using VTK 4.0 with the
-# FindVTK.cmake module. Do not include directly.
-
-# Hard-code the version number since it isn't provided by VTK 4.0.
-set(VTK_MAJOR_VERSION 4)
-set(VTK_MINOR_VERSION 0)
-set(VTK_BUILD_VERSION 2)
-
-# Provide a new UseVTK file that doesn't do a full LOAD_CACHE.
-set(VTK_USE_FILE ${CMAKE_ROOT}/Modules/UseVTK40.cmake)
-
-# Provide a build settings file.
-set(VTK_BUILD_SETTINGS_FILE ${CMAKE_ROOT}/Modules/UseVTKBuildSettings40.cmake)
-
-# There are no CMake extensions for VTK 4.0.
-set(VTK_CMAKE_EXTENSIONS_DIR "")
-
-# grep "VTK40_" UseVTKConfig40.cmake |sed 's/.*VTK40_\([A-Za-z0-9_]*\).*/ \1/'
-load_cache(${VTK_DIR} READ_WITH_PREFIX VTK40_
- BUILD_SHARED_LIBS
- CMAKE_BUILD_TOOL
- CMAKE_BUILD_TYPE
- CMAKE_CACHE_MAJOR_VERSION
- CMAKE_CACHE_MINOR_VERSION
- CMAKE_CXX_COMPILER
- CMAKE_CXX_FLAGS
- CMAKE_CXX_FLAGS_DEBUG
- CMAKE_CXX_FLAGS_MINSIZEREL
- CMAKE_CXX_FLAGS_RELEASE
- CMAKE_CXX_FLAGS_RELWITHDEBINFO
- CMAKE_C_COMPILER
- CMAKE_C_FLAGS
- CMAKE_C_FLAGS_DEBUG
- CMAKE_C_FLAGS_MINSIZEREL
- CMAKE_C_FLAGS_RELEASE
- CMAKE_C_FLAGS_RELWITHDEBINFO
- CMAKE_INSTALL_PREFIX
- CMAKE_Xutil_INCLUDE_PATH
- EXECUTABLE_OUTPUT_PATH
- JAVA_INCLUDE_PATH2
- LIBRARY_OUTPUT_PATH
- MPIRUN
- MPI_INCLUDE_PATH
- MPI_POSTFLAGS
- MPI_PREFLAGS
- OPENGL_INCLUDE_DIR
- OSMESA_INCLUDE_PATH
- PYTHON_INCLUDE_PATH
- TCL_INCLUDE_PATH
- VLI_INCLUDE_PATH_FOR_VG500
- VLI_INCLUDE_PATH_FOR_VP1000
- VTK_BINARY_DIR
- VTK_DEBUG_LEAKS
- VTK_HAVE_VG500
- VTK_HAVE_VP1000
- VTK_MANGLE_MESA
- VTK_OPENGL_HAS_OSMESA
- VTK_PARSE_JAVA_EXE
- VTK_SOURCE_DIR
- VTK_USE_64BIT_IDS
- VTK_USE_ANSI_STDLIB
- VTK_USE_HYBRID
- VTK_USE_MATROX_IMAGING
- VTK_USE_MPI
- VTK_USE_PARALLEL
- VTK_USE_PATENTED
- VTK_USE_RENDERING
- VTK_USE_VIDEO_FOR_WINDOWS
- VTK_USE_VOLUMEPRO
- VTK_USE_X
- VTK_WRAP_JAVA
- VTK_WRAP_JAVA_EXE
- VTK_WRAP_PYTHON
- VTK_WRAP_PYTHON_EXE
- VTK_WRAP_TCL
- VTK_WRAP_TCL_EXE
- vtkCommonJava_LIB_DEPENDS
- vtkCommonPython_LIB_DEPENDS
- vtkCommonTCL_LIB_DEPENDS
- vtkCommon_LIB_DEPENDS
- vtkFilteringJava_LIB_DEPENDS
- vtkFilteringPython_LIB_DEPENDS
- vtkFilteringTCL_LIB_DEPENDS
- vtkFiltering_LIB_DEPENDS
- vtkGraphicsJava_LIB_DEPENDS
- vtkGraphicsPython_LIB_DEPENDS
- vtkGraphicsTCL_LIB_DEPENDS
- vtkGraphics_LIB_DEPENDS
- vtkHybridJava_LIB_DEPENDS
- vtkHybridPython_LIB_DEPENDS
- vtkHybridTCL_LIB_DEPENDS
- vtkHybrid_LIB_DEPENDS
- vtkIOJava_LIB_DEPENDS
- vtkIOPython_LIB_DEPENDS
- vtkIOTCL_LIB_DEPENDS
- vtkIO_LIB_DEPENDS
- vtkImagingJava_LIB_DEPENDS
- vtkImagingPython_LIB_DEPENDS
- vtkImagingTCL_LIB_DEPENDS
- vtkImaging_LIB_DEPENDS
- vtkParallelJava_LIB_DEPENDS
- vtkParallelPython_LIB_DEPENDS
- vtkParallelTCL_LIB_DEPENDS
- vtkParallel_LIB_DEPENDS
- vtkPatentedJava_LIB_DEPENDS
- vtkPatentedPython_LIB_DEPENDS
- vtkPatentedTCL_LIB_DEPENDS
- vtkPatented_LIB_DEPENDS
- vtkRenderingJava_LIB_DEPENDS
- vtkRenderingPythonTkWidgets_LIB_DEPENDS
- vtkRenderingPython_LIB_DEPENDS
- vtkRenderingTCL_LIB_DEPENDS
- vtkRendering_LIB_DEPENDS
- vtkjpeg_LIB_DEPENDS
- vtkpng_LIB_DEPENDS
- vtkzlib_LIB_DEPENDS
-)
-
-# Copy needed settings from the VTK 4.0 cache.
-set(VTK_BUILD_SHARED ${VTK40_BUILD_SHARED_LIBS})
-set(VTK_DEBUG_LEAKS ${VTK40_VTK_DEBUG_LEAKS})
-set(VTK_HAVE_VG500 ${VTK40_VTK_HAVE_VG500})
-set(VTK_HAVE_VP1000 ${VTK40_VTK_HAVE_VP1000})
-set(VTK_USE_MANGLED_MESA ${VTK40_VTK_MANGLE_MESA})
-set(VTK_MPIRUN_EXE ${VTK40_MPIRUN})
-set(VTK_MPI_POSTFLAGS ${VTK40_MPI_POSTFLAGS})
-set(VTK_MPI_PREFLAGS ${VTK40_MPI_PREFLAGS})
-set(VTK_OPENGL_HAS_OSMESA ${VTK40_VTK_OPENGL_HAS_OSMESA})
-set(VTK_USE_64BIT_IDS ${VTK40_VTK_USE_64BIT_IDS})
-set(VTK_USE_ANSI_STDLIB ${VTK40_VTK_USE_ANSI_STDLIB})
-set(VTK_USE_HYBRID ${VTK40_VTK_USE_HYBRID})
-set(VTK_USE_MATROX_IMAGING ${VTK40_VTK_USE_MATROX_IMAGING})
-set(VTK_USE_MPI ${VTK40_VTK_USE_MPI})
-set(VTK_USE_PARALLEL ${VTK40_VTK_USE_PARALLEL})
-set(VTK_USE_PATENTED ${VTK40_VTK_USE_PATENTED})
-set(VTK_USE_RENDERING ${VTK40_VTK_USE_RENDERING})
-set(VTK_USE_VIDEO_FOR_WINDOWS ${VTK40_VTK_USE_VIDEO_FOR_WINDOWS})
-set(VTK_USE_VOLUMEPRO ${VTK40_VTK_USE_VOLUMEPRO})
-set(VTK_USE_X ${VTK40_VTK_USE_X})
-set(VTK_WRAP_JAVA ${VTK40_VTK_WRAP_JAVA})
-set(VTK_WRAP_PYTHON ${VTK40_VTK_WRAP_PYTHON})
-set(VTK_WRAP_TCL ${VTK40_VTK_WRAP_TCL})
-
-# Create the list of available kits.
-set(VTK_KITS COMMON FILTERING GRAPHICS IMAGING IO)
-if(VTK_USE_RENDERING)
- set(VTK_KITS ${VTK_KITS} RENDERING)
-endif()
-if(VTK_USE_HYBRID)
- set(VTK_KITS ${VTK_KITS} HYBRID)
-endif()
-if(VTK_USE_PARALLEL)
- set(VTK_KITS ${VTK_KITS} PARALLEL)
-endif()
-if(VTK_USE_PATENTED)
- set(VTK_KITS ${VTK_KITS} PATENTED)
-endif()
-
-# Create the list of available languages.
-set(VTK_LANGUAGES "")
-if(VTK_WRAP_TCL)
- set(VTK_LANGUAGES ${VTK_LANGUAGES} TCL)
-endif()
-if(VTK_WRAP_PYTHON)
- set(VTK_LANGUAGES ${VTK_LANGUAGES} PYTHON)
-endif()
-if(VTK_WRAP_JAVA)
- set(VTK_LANGUAGES ${VTK_LANGUAGES} JAVA)
-endif()
-
-# Include directories for other projects installed on the system and
-# used by VTK.
-set(VTK_INCLUDE_DIRS_SYS "")
-if(VTK_USE_RENDERING)
- set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
- ${VTK40_OPENGL_INCLUDE_PATH} ${VTK40_OPENGL_INCLUDE_DIR})
- if(VTK_USE_X)
- set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
- ${VTK40_CMAKE_Xlib_INCLUDE_PATH} ${VTK40_CMAKE_Xutil_INCLUDE_PATH})
- endif()
-endif()
-
-if(VTK_OPENGL_HAS_OSMESA)
- set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
- ${VTK40_OSMESA_INCLUDE_PATH})
-endif()
-
-if(VTK_USE_MPI)
- set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_MPI_INCLUDE_PATH})
-endif()
-
-if(VTK_WRAP_TCL)
- set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_TCL_INCLUDE_PATH})
-endif()
-
-if(VTK_WRAP_PYTHON)
- set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_PYTHON_INCLUDE_PATH})
-endif()
-
-if(VTK_WRAP_JAVA)
- set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
- ${VTK40_JAVA_INCLUDE_PATH} ${VTK40_JAVA_INCLUDE_PATH2})
-endif()
-
-if(VTK_HAVE_VG500)
- set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
- ${VTK40_VLI_INCLUDE_PATH_FOR_VG500})
-endif()
-
-if(VTK_HAVE_VP1000)
- set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
- ${VTK40_VLI_INCLUDE_PATH_FOR_VP1000})
-endif()
-
-# See if this is a build tree or install tree.
-if(EXISTS ${VTK_DIR}/Common)
- # This is a VTK 4.0 build tree.
-
- set(VTK_LIBRARY_DIRS ${VTK40_LIBRARY_OUTPUT_PATH})
-
- # Determine the include directories needed.
- set(VTK_INCLUDE_DIRS ${VTK40_VTK_BINARY_DIR})
- if(VTK_USE_PARALLEL)
- set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Parallel)
- endif()
- if(VTK_USE_HYBRID)
- set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Hybrid)
- endif()
- if(VTK_USE_PATENTED)
- set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Patented)
- endif()
- if(VTK_USE_RENDERING)
- set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Rendering)
- endif()
-
- # These directories are always needed.
- set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
- ${VTK40_VTK_SOURCE_DIR}/IO
- ${VTK40_VTK_SOURCE_DIR}/Imaging
- ${VTK40_VTK_SOURCE_DIR}/Graphics
- ${VTK40_VTK_SOURCE_DIR}/Filtering
- ${VTK40_VTK_SOURCE_DIR}/Common)
-
- # Give access to a few utilities.
- set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
- ${VTK40_VTK_BINARY_DIR}/Utilities/png
- ${VTK40_VTK_SOURCE_DIR}/Utilities/png
- ${VTK40_VTK_BINARY_DIR}/Utilities/zlib
- ${VTK40_VTK_SOURCE_DIR}/Utilities/zlib)
-
- # Executable locations.
- if(VTK_WRAP_TCL)
- set(VTK_TCL_EXE ${VTK40_EXECUTABLE_OUTPUT_PATH}/vtk)
- set(VTK_WRAP_TCL_EXE ${VTK40_VTK_WRAP_TCL_EXE})
- set(VTK_TCL_HOME ${VTK40_VTK_SOURCE_DIR}/Wrapping/Tcl)
- endif()
- if(VTK_WRAP_PYTHON)
- set(VTK_WRAP_PYTHON_EXE ${VTK40_VTK_WRAP_PYTHON_EXE})
- endif()
- if(VTK_WRAP_JAVA)
- set(VTK_PARSE_JAVA_EXE ${VTK40_VTK_PARSE_JAVA_EXE})
- set(VTK_WRAP_JAVA_EXE ${VTK40_VTK_WRAP_JAVA_EXE})
- endif()
-
-else()
- # This is a VTK 4.0 install tree.
-
- set(VTK_INCLUDE_DIRS ${VTK_DIR})
- set(VTK_LIBRARY_DIRS ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk)
-
- # Executable locations.
- if(VTK_WRAP_TCL)
- set(VTK_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtk)
- set(VTK_WRAP_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapTcl)
- set(VTK_TCL_HOME ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk/tcl)
- endif()
- if(VTK_WRAP_PYTHON)
- set(VTK_WRAP_PYTHON_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapPython)
- endif()
- if(VTK_WRAP_JAVA)
- set(VTK_PARSE_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkParseJava)
- set(VTK_WRAP_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapJava)
- endif()
-endif()
-
-# Add the system include directories last.
-set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS_SYS})
-
-# Find the required C and C++ compiler flags.
-if(CMAKE_COMPILER_IS_GNUCXX)
- if(WIN32)
- # The platform is gcc on cygwin.
- set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mwin32")
- set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mwin32")
- endif()
-else()
- if(CMAKE_ANSI_CFLAGS)
- set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
- endif()
- if(CMAKE_SYSTEM MATCHES "OSF1-V")
- set(VTK_REQUIRED_CXX_FLAGS
- "${VTK_REQUIRED_CXX_FLAGS} -timplicit_local -no_implicit_include")
- endif()
-endif()
-
-if(VTK_USE_X)
- if(CMAKE_X_CFLAGS)
- set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_X_CFLAGS}")
- set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} ${CMAKE_X_CFLAGS}")
- endif()
-endif()
-
-# Copy library dependencies.
-set(vtkCommonJava_LIB_DEPENDS "${VTK40_vtkCommonJava_LIB_DEPENDS}")
-set(vtkCommonPython_LIB_DEPENDS "${VTK40_vtkCommonPython_LIB_DEPENDS}")
-set(vtkCommonTCL_LIB_DEPENDS "${VTK40_vtkCommonTCL_LIB_DEPENDS}")
-set(vtkCommon_LIB_DEPENDS "${VTK40_vtkCommon_LIB_DEPENDS}")
-set(vtkFilteringJava_LIB_DEPENDS "${VTK40_vtkFilteringJava_LIB_DEPENDS}")
-set(vtkFilteringPython_LIB_DEPENDS "${VTK40_vtkFilteringPython_LIB_DEPENDS}")
-set(vtkFilteringTCL_LIB_DEPENDS "${VTK40_vtkFilteringTCL_LIB_DEPENDS}")
-set(vtkFiltering_LIB_DEPENDS "${VTK40_vtkFiltering_LIB_DEPENDS}")
-set(vtkGraphicsJava_LIB_DEPENDS "${VTK40_vtkGraphicsJava_LIB_DEPENDS}")
-set(vtkGraphicsPython_LIB_DEPENDS "${VTK40_vtkGraphicsPython_LIB_DEPENDS}")
-set(vtkGraphicsTCL_LIB_DEPENDS "${VTK40_vtkGraphicsTCL_LIB_DEPENDS}")
-set(vtkGraphics_LIB_DEPENDS "${VTK40_vtkGraphics_LIB_DEPENDS}")
-set(vtkHybridJava_LIB_DEPENDS "${VTK40_vtkHybridJava_LIB_DEPENDS}")
-set(vtkHybridPython_LIB_DEPENDS "${VTK40_vtkHybridPython_LIB_DEPENDS}")
-set(vtkHybridTCL_LIB_DEPENDS "${VTK40_vtkHybridTCL_LIB_DEPENDS}")
-set(vtkHybrid_LIB_DEPENDS "${VTK40_vtkHybrid_LIB_DEPENDS}")
-set(vtkIOJava_LIB_DEPENDS "${VTK40_vtkIOJava_LIB_DEPENDS}")
-set(vtkIOPython_LIB_DEPENDS "${VTK40_vtkIOPython_LIB_DEPENDS}")
-set(vtkIOTCL_LIB_DEPENDS "${VTK40_vtkIOTCL_LIB_DEPENDS}")
-set(vtkIO_LIB_DEPENDS "${VTK40_vtkIO_LIB_DEPENDS}")
-set(vtkImagingJava_LIB_DEPENDS "${VTK40_vtkImagingJava_LIB_DEPENDS}")
-set(vtkImagingPython_LIB_DEPENDS "${VTK40_vtkImagingPython_LIB_DEPENDS}")
-set(vtkImagingTCL_LIB_DEPENDS "${VTK40_vtkImagingTCL_LIB_DEPENDS}")
-set(vtkImaging_LIB_DEPENDS "${VTK40_vtkImaging_LIB_DEPENDS}")
-set(vtkParallelJava_LIB_DEPENDS "${VTK40_vtkParallelJava_LIB_DEPENDS}")
-set(vtkParallelPython_LIB_DEPENDS "${VTK40_vtkParallelPython_LIB_DEPENDS}")
-set(vtkParallelTCL_LIB_DEPENDS "${VTK40_vtkParallelTCL_LIB_DEPENDS}")
-set(vtkParallel_LIB_DEPENDS "${VTK40_vtkParallel_LIB_DEPENDS}")
-set(vtkPatentedJava_LIB_DEPENDS "${VTK40_vtkPatentedJava_LIB_DEPENDS}")
-set(vtkPatentedPython_LIB_DEPENDS "${VTK40_vtkPatentedPython_LIB_DEPENDS}")
-set(vtkPatentedTCL_LIB_DEPENDS "${VTK40_vtkPatentedTCL_LIB_DEPENDS}")
-set(vtkPatented_LIB_DEPENDS "${VTK40_vtkPatented_LIB_DEPENDS}")
-set(vtkRenderingJava_LIB_DEPENDS "${VTK40_vtkRenderingJava_LIB_DEPENDS}")
-set(vtkRenderingPythonTkWidgets_LIB_DEPENDS "${VTK40_vtkRenderingPythonTkWidgets_LIB_DEPENDS}")
-set(vtkRenderingPython_LIB_DEPENDS "${VTK40_vtkRenderingPython_LIB_DEPENDS}")
-set(vtkRenderingTCL_LIB_DEPENDS "${VTK40_vtkRenderingTCL_LIB_DEPENDS}")
-set(vtkRendering_LIB_DEPENDS "${VTK40_vtkRendering_LIB_DEPENDS}")
-set(vtkjpeg_LIB_DEPENDS "${VTK40_vtkjpeg_LIB_DEPENDS}")
-set(vtkpng_LIB_DEPENDS "${VTK40_vtkpng_LIB_DEPENDS}")
-set(vtkzlib_LIB_DEPENDS "${VTK40_vtkzlib_LIB_DEPENDS}")
-
-# List of VTK configuration variables set above.
-# grep "^[ ]*set(VTK" UseVTKConfig40.cmake |sed 's/[ ]*set(\([^ ]*\) .*/ \1/'
-set(VTK_SETTINGS
- VTK_BUILD_SHARED
- VTK_BUILD_VERSION
- VTK_DEBUG_LEAKS
- VTK_HAVE_VG500
- VTK_HAVE_VP1000
- VTK_INCLUDE_DIRS
- VTK_KITS
- VTK_LANGUAGES
- VTK_LIBRARY_DIRS
- VTK_MAJOR_VERSION
- VTK_MANGLE_MESA
- VTK_MINOR_VERSION
- VTK_MPIRUN_EXE
- VTK_MPI_POSTFLAGS
- VTK_MPI_PREFLAGS
- VTK_OPENGL_HAS_OSMESA
- VTK_PARSE_JAVA_EXE
- VTK_TCL_EXE
- VTK_TCL_HOME
- VTK_USE_64BIT_IDS
- VTK_USE_ANSI_STDLIB
- VTK_USE_HYBRID
- VTK_USE_MATROX_IMAGING
- VTK_USE_MPI
- VTK_USE_PARALLEL
- VTK_USE_PATENTED
- VTK_USE_RENDERING
- VTK_USE_VIDEO_FOR_WINDOWS
- VTK_USE_VOLUMEPRO
- VTK_USE_X
- VTK_WRAP_JAVA
- VTK_WRAP_JAVA_EXE
- VTK_WRAP_PYTHON
- VTK_WRAP_PYTHON_EXE
- VTK_WRAP_TCL
- VTK_WRAP_TCL_EXE
-)
diff --git a/Modules/readme.txt b/Modules/readme.txt
index b40f3d0..1e0c13b 100644
--- a/Modules/readme.txt
+++ b/Modules/readme.txt
@@ -1,4 +1,4 @@
See the "Find Modules" section of the cmake-developer(7) manual page.
For more information about how to contribute modules to CMake, see this page:
-http://www.cmake.org/Wiki/CMake:Module_Maintainers
+https://cmake.org/Wiki/CMake:Module_Maintainers
diff --git a/README.rst b/README.rst
index 120705c..5e7a323 100644
--- a/README.rst
+++ b/README.rst
@@ -8,8 +8,8 @@ CMake is a cross-platform, open-source build system generator.
For full documentation visit the `CMake Home Page`_ and the
`CMake Documentation Page`_.
-.. _`CMake Home Page`: http://www.cmake.org
-.. _`CMake Documentation Page`: http://www.cmake.org/cmake/help/documentation.html
+.. _`CMake Home Page`: https://cmake.org
+.. _`CMake Documentation Page`: https://cmake.org/cmake/help/documentation.html
CMake is maintained and supported by `Kitware`_ and developed in
collaboration with a productive community of contributors.
@@ -37,7 +37,7 @@ it should not be a major problem to port CMake to this platform.
Subscribe and post to the `CMake Users List`_ to ask if others have
had experience with the platform.
-.. _`CMake Users List`: http://www.cmake.org/mailman/listinfo/cmake
+.. _`CMake Users List`: https://cmake.org/mailman/listinfo/cmake
Building CMake from Scratch
---------------------------
@@ -63,7 +63,7 @@ You need to download and install a binary release of CMake in order to build
CMake. You can get these releases from the `CMake Download Page`_ . Then
proceed with the instructions below.
-.. _`CMake Download Page`: http://www.cmake.org/cmake/resources/software.html
+.. _`CMake Download Page`: https://cmake.org/cmake/resources/software.html
Building CMake with CMake
-------------------------
@@ -73,7 +73,7 @@ run the installed CMake on the sources of this CMake with your preferred
options and generators. Then build it and install it.
For instructions how to do this, see documentation on `Running CMake`_.
-.. _`Running CMake`: http://www.cmake.org/cmake/help/runningcmake.html
+.. _`Running CMake`: https://cmake.org/cmake/help/runningcmake.html
Reporting Bugs
==============
@@ -89,7 +89,7 @@ If you have found a bug:
3. Finally, if the issue is not resolved by the above steps, open
an entry in the `CMake Issue Tracker`_.
-.. _`CMake Issue Tracker`: http://www.cmake.org/Bug
+.. _`CMake Issue Tracker`: https://cmake.org/Bug
Contributing
============
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 16b9ea1..ae5b03f 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -327,6 +327,8 @@ set(SRCS
cmPropertyDefinitionMap.h
cmPropertyMap.cxx
cmPropertyMap.h
+ cmQtAutoGeneratorInitializer.cxx
+ cmQtAutoGeneratorInitializer.h
cmQtAutoGenerators.cxx
cmQtAutoGenerators.h
cmRST.cxx
@@ -502,6 +504,10 @@ if (WIN32)
cmGhsMultiGpj.cxx
cmGhsMultiGpj.h
)
+
+ # Add a manifest file to executables on Windows to allow for
+ # GetVersion to work properly on Windows 8 and above.
+ set(MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake.version.manifest)
endif()
endif ()
@@ -531,7 +537,7 @@ set(SRCS ${SRCS}
if(WIN32 AND NOT CYGWIN)
set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
- add_executable(cmcldeps cmcldeps.cxx)
+ add_executable(cmcldeps cmcldeps.cxx ${MANIFEST_FILE})
target_link_libraries(cmcldeps CMakeLib)
install(TARGETS cmcldeps DESTINATION bin)
endif()
@@ -720,15 +726,15 @@ if(APPLE)
endif()
# Build CMake executable
-add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h)
+add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h ${MANIFEST_FILE})
target_link_libraries(cmake CMakeLib)
# Build CTest executable
-add_executable(ctest ctest.cxx)
+add_executable(ctest ctest.cxx ${MANIFEST_FILE})
target_link_libraries(ctest CTestLib)
# Build CPack executable
-add_executable(cpack CPack/cpack.cxx)
+add_executable(cpack CPack/cpack.cxx ${MANIFEST_FILE})
target_link_libraries(cpack CPackLib)
# Curses GUI
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index ed72665..fef0b2e 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
-set(CMake_VERSION_MINOR 3)
-set(CMake_VERSION_PATCH 20150902)
-#set(CMake_VERSION_RC 1)
+set(CMake_VERSION_MINOR 4)
+set(CMake_VERSION_PATCH 0)
+set(CMake_VERSION_RC 2)
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 58bd947..70de757 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -78,7 +78,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
std::string rp = filePrefix + *fileIt;
cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: "
<< rp << std::endl);
- archive.Add(rp);
+ archive.Add(rp, 0, 0, false);
if (!archive)
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: "
@@ -284,7 +284,7 @@ int cmCPackArchiveGenerator::PackageFiles()
// Get the relative path to the file
std::string rp = cmSystemTools::RelativePath(toplevel.c_str(),
fileIt->c_str());
- archive.Add(rp);
+ archive.Add(rp, 0, 0, false);
if(!archive)
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< "
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 5049a3f..04efb71 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -15,6 +15,7 @@
#include "cmMakefile.h"
#include "cmGeneratedFileStream.h"
#include "cmCPackLog.h"
+#include "cmArchiveWrite.h"
#include <cmsys/SystemTools.hxx>
#include <cmsys/Glob.hxx>
@@ -94,6 +95,7 @@ int cmCPackDebGenerator::PackageOnePack(std::string initialTopLevel,
std::string findExpr(this->GetOption("GEN_WDIR"));
findExpr += "/*";
gl.RecurseOn();
+ gl.SetRecurseListDirs(true);
if ( !gl.FindFiles(findExpr) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -221,6 +223,7 @@ int cmCPackDebGenerator::PackageComponentsAllInOne()
std::string findExpr(this->GetOption("GEN_WDIR"));
findExpr += "/*";
gl.RecurseOn();
+ gl.SetRecurseListDirs(true);
if ( !gl.FindFiles(findExpr) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -388,9 +391,9 @@ int cmCPackDebGenerator::createDeb()
{
std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
dirName += '/';
- for (std::vector<std::string>::const_iterator fileIt =
- packageFiles.begin();
- fileIt != packageFiles.end(); ++ fileIt )
+ for (std::vector<std::string>::const_iterator fileIt =
+ packageFiles.begin();
+ fileIt != packageFiles.end(); ++ fileIt )
{
totalSize += cmSystemTools::FileLength(*fileIt);
}
@@ -401,8 +404,9 @@ int cmCPackDebGenerator::createDeb()
out << std::endl;
}
- std::string cmd(this->GetOption("GEN_CPACK_DEBIAN_FAKEROOT_EXECUTABLE"));
+ const std::string strGenWDIR(this->GetOption("GEN_WDIR"));
+ cmArchiveWrite::Compress tar_compression_type = cmArchiveWrite::CompressGZip;
const char* debian_compression_type =
this->GetOption("GEN_CPACK_DEBIAN_COMPRESSION_TYPE");
if(!debian_compression_type)
@@ -410,108 +414,136 @@ int cmCPackDebGenerator::createDeb()
debian_compression_type = "gzip";
}
- std::string cmake_tar = " ", compression_modifier = "a", compression_suffix;
+ std::string compression_suffix;
if(!strcmp(debian_compression_type, "lzma")) {
compression_suffix = ".lzma";
+ tar_compression_type = cmArchiveWrite::CompressLZMA;
} else if(!strcmp(debian_compression_type, "xz")) {
compression_suffix = ".xz";
+ tar_compression_type = cmArchiveWrite::CompressXZ;
} else if(!strcmp(debian_compression_type, "bzip2")) {
compression_suffix = ".bz2";
- compression_modifier = "j";
- cmake_tar += "\"" + cmSystemTools::GetCMakeCommand() + "\" -E ";
+ tar_compression_type = cmArchiveWrite::CompressBZip2;
} else if(!strcmp(debian_compression_type, "gzip")) {
compression_suffix = ".gz";
- compression_modifier = "z";
- cmake_tar += "\"" + cmSystemTools::GetCMakeCommand() + "\" -E ";
+ tar_compression_type = cmArchiveWrite::CompressGZip;
} else if(!strcmp(debian_compression_type, "none")) {
compression_suffix = "";
- compression_modifier = "";
- cmake_tar += "\"" + cmSystemTools::GetCMakeCommand() + "\" -E ";
+ tar_compression_type = cmArchiveWrite::CompressNone;
} else {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error unrecognized compression type: "
<< debian_compression_type << std::endl);
}
- cmd += cmake_tar + "tar c" + compression_modifier + "f data.tar"
- + compression_suffix;
- // now add all directories which have to be compressed
- // collect all top level install dirs for that
- // e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would give /usr and /opt
- size_t topLevelLength = std::string(this->GetOption("GEN_WDIR")).length();
- cmCPackLogger(cmCPackLog::LOG_DEBUG, "WDIR: \""
- << this->GetOption("GEN_WDIR")
- << "\", length = " << topLevelLength
+ std::string filename_data_tar = strGenWDIR
+ + "/data.tar" + compression_suffix;
+
+ // atomic file generation for data.tar
+ {
+ cmGeneratedFileStream fileStream_data_tar;
+ fileStream_data_tar.Open(filename_data_tar.c_str(), false, true);
+ if(!fileStream_data_tar)
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error opening the file \"" << filename_data_tar << "\" for writing"
<< std::endl);
- std::set<std::string> installDirs;
+ return 0;
+ }
+ cmArchiveWrite data_tar(fileStream_data_tar, tar_compression_type, "paxr");
+
+ // uid/gid should be the one of the root user, and this root user has
+ // always uid/gid equal to 0.
+ data_tar.SetUIDAndGID(0u, 0u);
+ data_tar.SetUNAMEAndGNAME("root", "root");
+
+ // now add all directories which have to be compressed
+ // collect all top level install dirs for that
+ // e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would
+ // give /usr and /opt
+ size_t topLevelLength = strGenWDIR.length();
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "WDIR: \""
+ << strGenWDIR
+ << "\", length = " << topLevelLength
+ << std::endl);
+ std::set<std::string> orderedFiles;
+
+ // we have to reconstruct the parent folders as well
+
for (std::vector<std::string>::const_iterator fileIt =
- packageFiles.begin();
- fileIt != packageFiles.end(); ++ fileIt )
- {
- cmCPackLogger(cmCPackLog::LOG_DEBUG, "FILEIT: \"" << *fileIt << "\""
- << std::endl);
- std::string::size_type slashPos = fileIt->find('/', topLevelLength+1);
- std::string relativeDir = fileIt->substr(topLevelLength,
- slashPos - topLevelLength);
- cmCPackLogger(cmCPackLog::LOG_DEBUG, "RELATIVEDIR: \"" << relativeDir
- << "\"" << std::endl);
- if (installDirs.find(relativeDir) == installDirs.end())
+ packageFiles.begin();
+ fileIt != packageFiles.end(); ++ fileIt )
{
- installDirs.insert(relativeDir);
- cmd += " .";
- cmd += relativeDir;
+ std::string currentPath = *fileIt;
+ while(currentPath != strGenWDIR)
+ {
+ // the last one IS strGenWDIR, but we do not want this one:
+ // XXX/application/usr/bin/myprogram with GEN_WDIR=XXX/application
+ // should not add XXX/application
+ orderedFiles.insert(currentPath);
+ currentPath = cmSystemTools::CollapseCombinedPath(currentPath, "..");
+ }
}
- }
- std::string output;
- int retval = -1;
- int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &output,
- &retval, this->GetOption("GEN_WDIR"), this->GeneratorVerbose, 0);
- if ( !res || retval )
- {
- std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
- tmpFile += "/Deb.log";
- cmGeneratedFileStream ofs(tmpFile.c_str());
- ofs << "# Run command: " << cmd << std::endl
- << "# Working directory: " << toplevel << std::endl
- << "# Output:" << std::endl
- << output << std::endl;
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running tar command: "
- << cmd << std::endl
- << "Please check " << tmpFile << " for errors" << std::endl);
- return 0;
- }
+ for (std::set<std::string>::const_iterator fileIt =
+ orderedFiles.begin();
+ fileIt != orderedFiles.end(); ++ fileIt )
+ {
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "FILEIT: \"" << *fileIt << "\""
+ << std::endl);
+ std::string::size_type slashPos = fileIt->find('/', topLevelLength+1);
+ std::string relativeDir = fileIt->substr(topLevelLength,
+ slashPos - topLevelLength);
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "RELATIVEDIR: \"" << relativeDir
+ << "\"" << std::endl);
+
+ // do not recurse because the loop will do it
+ if(!data_tar.Add(*fileIt, topLevelLength, ".", false))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Problem adding file to tar:" << std::endl
+ << "#top level directory: "
+ << strGenWDIR << std::endl
+ << "#file: " << *fileIt << std::endl
+ << "#error:" << data_tar.GetError() << std::endl);
+ return 0;
+ }
+ }
+ } // scope for file generation
- std::string md5filename;
- md5filename = this->GetOption("GEN_WDIR");
- md5filename += "/md5sums";
- { // the scope is needed for cmGeneratedFileStream
+ std::string md5filename = strGenWDIR + "/md5sums";
+ {
+ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(md5filename.c_str());
- std::vector<std::string>::const_iterator fileIt;
-// std::string topLevelWithTrailingSlash = toplevel;
+
std::string topLevelWithTrailingSlash =
this->GetOption("CPACK_TEMPORARY_DIRECTORY");
topLevelWithTrailingSlash += '/';
- for ( fileIt = packageFiles.begin();
- fileIt != packageFiles.end(); ++ fileIt )
+ for (std::vector<std::string>::const_iterator fileIt =
+ packageFiles.begin();
+ fileIt != packageFiles.end(); ++ fileIt )
{
- cmd = "\"";
- cmd += cmSystemTools::GetCMakeCommand();
- cmd += "\" -E md5sum \"";
- cmd += *fileIt;
- cmd += "\"";
- //std::string output;
- //int retVal = -1;
- res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &output,
- &retval, toplevel.c_str(), this->GeneratorVerbose, 0);
- if ( !res || retval )
+ // hash only regular files
+ if( cmSystemTools::FileIsDirectory(*fileIt)
+ || cmSystemTools::FileIsSymlink(*fileIt))
+ {
+ continue;
+ }
+
+ char md5sum[33];
+ if(!cmSystemTools::ComputeFileMD5(*fileIt, md5sum))
{
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running cmake -E md5sum "
- << cmd << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem computing the md5 of "
+ << *fileIt << std::endl);
}
+
+ md5sum[32] = 0;
+
+ std::string output(md5sum);
+ output += " " + *fileIt + "\n";
// debian md5sums entries are like this:
// 014f3604694729f3bf19263bac599765 usr/bin/ccmake
// thus strip the full path (with the trailing slash)
@@ -521,70 +553,116 @@ int cmCPackDebGenerator::createDeb()
}
// each line contains a eol.
// Do not end the md5sum file with yet another (invalid)
- }
+ }
- // set md5sum file permissins to RW-R--R-- so that deb lintian doesn't warn
- // about it
- cmSystemTools::SetPermissions(md5filename.c_str(),
- S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
- cmd = this->GetOption("GEN_CPACK_DEBIAN_FAKEROOT_EXECUTABLE");
- cmd += cmake_tar + "tar czf control.tar.gz ./control ./md5sums";
+
+ std::string filename_control_tar = strGenWDIR + "/control.tar.gz";
+ // atomic file generation for control.tar
+ {
+ cmGeneratedFileStream fileStream_control_tar;
+ fileStream_control_tar.Open(filename_control_tar.c_str(), false, true);
+ if(!fileStream_control_tar)
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error opening the file \"" << filename_control_tar
+ << "\" for writing" << std::endl);
+ return 0;
+ }
+ cmArchiveWrite control_tar(fileStream_control_tar,
+ cmArchiveWrite::CompressGZip,
+ "paxr");
+
+ // sets permissions and uid/gid for the files
+ control_tar.SetUIDAndGID(0u, 0u);
+ control_tar.SetUNAMEAndGNAME("root", "root");
+
+ /* permissions are set according to
+ https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
+ and
+ https://lintian.debian.org/tags/control-file-has-bad-permissions.html
+ */
+ const mode_t permission644 = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
+ const mode_t permissionExecute = S_IXUSR | S_IXGRP | S_IXOTH;
+ const mode_t permission755 = permission644 | permissionExecute;
+
+ // for md5sum and control (that we have generated here), we use 644
+ // (RW-R--R--)
+ // so that deb lintian doesn't warn about it
+ control_tar.SetPermissions(permission644);
+
+ // adds control and md5sums
+ if( !control_tar.Add(md5filename, strGenWDIR.length(), ".")
+ || !control_tar.Add(strGenWDIR + "/control", strGenWDIR.length(), "."))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error adding file to tar:" << std::endl
+ << "#top level directory: "
+ << strGenWDIR << std::endl
+ << "#file: \"control\" or \"md5sums\"" << std::endl
+ << "#error:" << control_tar.GetError() << std::endl);
+ return 0;
+ }
+
+ // for the other files, we use
+ // -either the original permission on the files
+ // -either a permission strictly defined by the Debian policies
const char* controlExtra =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA");
- if( controlExtra )
- {
- std::vector<std::string> controlExtraList;
- cmSystemTools::ExpandListArgument(controlExtra, controlExtraList);
- for(std::vector<std::string>::iterator i =
- controlExtraList.begin(); i != controlExtraList.end(); ++i)
+ if( controlExtra )
{
- std::string filenamename =
- cmsys::SystemTools::GetFilenameName(*i);
- std::string localcopy = this->GetOption("GEN_WDIR");
- localcopy += "/";
- localcopy += filenamename;
- // if we can copy the file, it means it does exist, let's add it:
- if( cmsys::SystemTools::CopyFileIfDifferent(
- *i, localcopy) )
+ // permissions are now controlled by the original file permissions
+
+ const bool permissionStrictPolicy =
+ this->IsSet("GEN_CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION");
+
+ static const char* strictFiles[] = {
+ "config", "postinst", "postrm", "preinst", "prerm"
+ };
+ std::set<std::string> setStrictFiles(
+ strictFiles,
+ strictFiles + sizeof(strictFiles)/sizeof(strictFiles[0]));
+
+ // default
+ control_tar.ClearPermissions();
+
+ std::vector<std::string> controlExtraList;
+ cmSystemTools::ExpandListArgument(controlExtra, controlExtraList);
+ for(std::vector<std::string>::iterator i = controlExtraList.begin();
+ i != controlExtraList.end(); ++i)
{
- // debian is picky and need relative to ./ path in the tar.*
- cmd += " ./";
- cmd += filenamename;
+ std::string filenamename =
+ cmsys::SystemTools::GetFilenameName(*i);
+ std::string localcopy = strGenWDIR + "/" + filenamename;
+
+ if(permissionStrictPolicy)
+ {
+ control_tar.SetPermissions(setStrictFiles.count(filenamename) ?
+ permission755 : permission644);
+ }
+
+ // if we can copy the file, it means it does exist, let's add it:
+ if( cmsys::SystemTools::CopyFileIfDifferent(*i, localcopy) )
+ {
+ control_tar.Add(localcopy, strGenWDIR.length(), ".");
+ }
}
}
- }
- res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &output,
- &retval, this->GetOption("GEN_WDIR"), this->GeneratorVerbose, 0);
+ }
- if ( !res || retval )
- {
- std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
- tmpFile += "/Deb.log";
- cmGeneratedFileStream ofs(tmpFile.c_str());
- ofs << "# Run command: " << cmd << std::endl
- << "# Working directory: " << toplevel << std::endl
- << "# Output:" << std::endl
- << output << std::endl;
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running tar command: "
- << cmd << std::endl
- << "Please check " << tmpFile << " for errors" << std::endl);
- return 0;
- }
// ar -r your-package-name.deb debian-binary control.tar.* data.tar.*
// since debian packages require BSD ar (most Linux distros and even
// FreeBSD and NetBSD ship GNU ar) we use a copy of OpenBSD ar here.
std::vector<std::string> arFiles;
- std::string topLevelString = this->GetOption("GEN_WDIR");
- topLevelString += "/";
+ std::string topLevelString = strGenWDIR + "/";
arFiles.push_back(topLevelString + "debian-binary");
arFiles.push_back(topLevelString + "control.tar.gz");
arFiles.push_back(topLevelString + "data.tar" + compression_suffix);
- std::string outputFileName = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
- outputFileName += "/";
- outputFileName += this->GetOption("CPACK_OUTPUT_FILE_NAME");
- res = ar_append(outputFileName.c_str(), arFiles);
+ std::string outputFileName = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
+ outputFileName += "/";
+ outputFileName += this->GetOption("CPACK_OUTPUT_FILE_NAME");
+ int res = ar_append(outputFileName.c_str(), arFiles);
if ( res!=0 )
{
std::string tmpFile = this->GetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME");
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 92a4b2b..def9fc7 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -367,6 +367,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install directory: " << top << std::endl);
gl.RecurseOn();
+ gl.SetRecurseListDirs(true);
if ( !gl.FindFiles(findExpr) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -379,7 +380,11 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
for ( gfit = files.begin(); gfit != files.end(); ++ gfit )
{
bool skip = false;
- std::string &inFile = *gfit;
+ std::string inFile = *gfit;
+ if(cmSystemTools::FileIsDirectory(*gfit))
+ {
+ inFile += '/';
+ }
for ( regIt= ignoreFilesRegex.begin();
regIt!= ignoreFilesRegex.end();
++ regIt)
@@ -869,6 +874,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmsys::Glob glB;
findExpr += "/*";
glB.RecurseOn();
+ glB.SetRecurseListDirs(true);
glB.FindFiles(findExpr);
filesBefore = glB.GetFiles();
std::sort(filesBefore.begin(),filesBefore.end());
@@ -908,6 +914,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
{
cmsys::Glob glA;
glA.RecurseOn();
+ glA.SetRecurseListDirs(true);
glA.FindFiles(findExpr);
std::vector<std::string> filesAfter = glA.GetFiles();
std::sort(filesAfter.begin(),filesAfter.end());
@@ -1074,6 +1081,7 @@ int cmCPackGenerator::DoPackage()
std::string findExpr = tempDirectory;
findExpr += "/*";
gl.RecurseOn();
+ gl.SetRecurseListDirs(true);
gl.SetRecurseThroughSymlinks(false);
if ( !gl.FindFiles(findExpr) )
{
diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx
index b4c0137..fb6cc00 100644
--- a/Source/CTest/cmCTestCurl.cxx
+++ b/Source/CTest/cmCTestCurl.cxx
@@ -166,6 +166,10 @@ bool cmCTestCurl::UploadFile(std::string const& local_file,
curlWriteMemoryCallback);
::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION,
curlDebugCallback);
+ // Be sure to set Content-Type to satisfy fussy modsecurity rules
+ struct curl_slist *headers = ::curl_slist_append(NULL,
+ "Content-Type: text/xml");
+ ::curl_easy_setopt(this->Curl, CURLOPT_HTTPHEADER, headers);
std::vector<char> responseData;
std::vector<char> debugData;
::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData);
@@ -174,6 +178,8 @@ bool cmCTestCurl::UploadFile(std::string const& local_file,
// Now run off and do what you've been told!
::curl_easy_perform(this->Curl);
::fclose(ftpfile);
+ ::curl_easy_setopt(this->Curl, CURLOPT_HTTPHEADER, NULL);
+ ::curl_slist_free_all(headers);
if ( responseData.size() > 0 )
{
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 4832186..7c7f5df 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -198,6 +198,10 @@ void cmCTestMultiProcessHandler::UnlockResources(int index)
{
this->LockedResources.erase(*i);
}
+ if (this->Properties[index]->RunSerial)
+ {
+ this->SerialTestRunning = false;
+ }
}
//---------------------------------------------------------
@@ -451,11 +455,6 @@ bool cmCTestMultiProcessHandler::CheckOutput()
this->WriteCheckpoint(test);
this->UnlockResources(test);
this->RunningCount -= GetProcessorsUsed(test);
- if (this->Properties[test]->RunSerial)
- {
- this->SerialTestRunning = false;
- }
-
delete p;
}
return true;
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 1e12f15..833cad6 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -338,6 +338,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
CURLcode res;
FILE* ftpfile;
char error_buffer[1024];
+ struct curl_slist *headers = ::curl_slist_append(NULL,
+ "Content-Type: text/xml");
/* In windows, this will init the winsock stuff */
::curl_global_init(CURL_GLOBAL_ALL);
@@ -420,6 +422,9 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
::curl_easy_setopt(curl, CURLOPT_PUT, 1);
::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+ // Be sure to set Content-Type to satisfy fussy modsecurity rules
+ ::curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
+
std::string local_file = *file;
if ( !cmSystemTools::FileExists(local_file.c_str()) )
{
@@ -477,6 +482,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: "
<< local_file << std::endl);
::curl_easy_cleanup(curl);
+ ::curl_slist_free_all(headers);
::curl_global_cleanup();
return false;
}
@@ -621,6 +627,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
<< std::endl);
}
::curl_easy_cleanup(curl);
+ ::curl_slist_free_all(headers);
::curl_global_cleanup();
return false;
}
@@ -630,6 +637,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
" Uploaded: " + local_file << std::endl, this->Quiet);
}
}
+ ::curl_slist_free_all(headers);
::curl_global_cleanup();
return true;
}
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 14067d5..c635430 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -65,6 +65,11 @@ public:
void SetMaxIndex(int n) {this->MaxIndex = n;}
int GetMaxIndex() {return this->MaxIndex;}
+ void SetTestOutputSizePassed(int n)
+ { this->CustomMaximumPassedTestOutputSize = n; }
+ void SetTestOutputSizeFailed(int n)
+ { this->CustomMaximumFailedTestOutputSize = n; }
+
///! pass the -I argument down
void SetTestsToRunInformation(const char*);
diff --git a/Source/Checks/cm_c11_thread_local.c b/Source/Checks/cm_c11_thread_local.c
new file mode 100644
index 0000000..ab780f2
--- /dev/null
+++ b/Source/Checks/cm_c11_thread_local.c
@@ -0,0 +1,2 @@
+_Thread_local int i = 42;
+int main(void) { return 0; }
diff --git a/Source/Checks/cm_c11_thread_local.cmake b/Source/Checks/cm_c11_thread_local.cmake
new file mode 100644
index 0000000..6b8d10b
--- /dev/null
+++ b/Source/Checks/cm_c11_thread_local.cmake
@@ -0,0 +1,33 @@
+set(CMake_C11_THREAD_LOCAL_BROKEN 0)
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_C11_STANDARD_COMPILE_OPTION)
+ if(NOT DEFINED CMake_C11_THREAD_LOCAL_WORKS)
+ message(STATUS "Checking if compiler supports C11 _Thread_local")
+ try_compile(CMake_C11_THREAD_LOCAL_WORKS
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_LIST_DIR}/cm_c11_thread_local.c
+ CMAKE_FLAGS -DCMAKE_C_STANDARD=11
+ OUTPUT_VARIABLE OUTPUT
+ )
+ if(CMake_C11_THREAD_LOCAL_WORKS AND "${OUTPUT}" MATCHES "error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'")
+ set_property(CACHE CMake_C11_THREAD_LOCAL_WORKS PROPERTY VALUE 0)
+ endif()
+ if(CMake_C11_THREAD_LOCAL_WORKS)
+ message(STATUS "Checking if compiler supports C11 _Thread_local - yes")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining if compiler supports C11 _Thread_local passed with the following output:\n"
+ "${OUTPUT}\n"
+ "\n"
+ )
+ else()
+ message(STATUS "Checking if compiler supports C11 _Thread_local - no")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if compiler supports C11 _Thread_local failed with the following output:\n"
+ "${OUTPUT}\n"
+ "\n"
+ )
+ endif()
+ endif()
+ if(NOT CMake_C11_THREAD_LOCAL_WORKS)
+ set(CMake_C11_THREAD_LOCAL_BROKEN 1)
+ endif()
+endif()
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index 67e4aab..6144ddc 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -80,12 +80,13 @@ void cmCursesLongMessageForm::UpdateStatusBar()
sprintf(version+sideSpace, "%s", vertmp);
version[width] = '\0';
+ char fmt_s[] = "%s";
curses_move(y-4,0);
attron(A_STANDOUT);
- printw(bar);
+ printw(fmt_s, bar);
attroff(A_STANDOUT);
curses_move(y-3,0);
- printw(version);
+ printw(fmt_s, version);
pos_form_cursor(this->Form);
}
@@ -101,8 +102,9 @@ void cmCursesLongMessageForm::PrintKeys()
char firstLine[512];
sprintf(firstLine, "Press [e] to exit help");
+ char fmt_s[] = "%s";
curses_move(y-2,0);
- printw(firstLine);
+ printw(fmt_s, firstLine);
pos_form_cursor(this->Form);
}
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index be17a9f..a2fc2c0 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -451,24 +451,25 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
}
curses_move(y-4,0);
+ char fmt_s[] = "%s";
char fmt[512] = "Press [enter] to edit option";
if ( process )
{
strcpy(fmt, " ");
}
- printw(fmt);
+ printw(fmt_s, fmt);
curses_move(y-3,0);
- printw(firstLine);
+ printw(fmt_s, firstLine);
curses_move(y-2,0);
- printw(secondLine);
+ printw(fmt_s, secondLine);
curses_move(y-1,0);
- printw(thirdLine);
+ printw(fmt_s, thirdLine);
if (cw)
{
sprintf(firstLine, "Page %d of %d", cw->GetPage(), this->NumberOfPages);
curses_move(0,65-static_cast<unsigned int>(strlen(firstLine))-1);
- printw(firstLine);
+ printw(fmt_s, firstLine);
}
// }
@@ -612,13 +613,13 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
version[width] = '\0';
// Now print both lines
+ char fmt_s[] = "%s";
curses_move(y-5,0);
attron(A_STANDOUT);
- char format[] = "%s";
- printw(format, bar);
+ printw(fmt_s, bar);
attroff(A_STANDOUT);
curses_move(y-4,0);
- printw(version);
+ printw(fmt_s, version);
pos_form_cursor(this->Form);
}
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index acf262f..6eb15c1 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -168,17 +168,16 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
else if ( key == 127 ||
key == KEY_BACKSPACE )
{
- if ( form->curcol > 0 )
- {
+ FIELD *cur = current_field(form);
form_driver(form, REQ_DEL_PREV);
- }
+ if (current_field(form) != cur)
+ {
+ set_current_field(form, cur);
+ }
}
else if ( key == ctrl('d') ||key == KEY_DC )
{
- if ( form->curcol >= 0 )
- {
- form_driver(form, REQ_DEL_CHAR);
- }
+ form_driver(form, REQ_DEL_CHAR);
}
else
{
@@ -221,6 +220,7 @@ bool cmCursesStringWidget::PrintKeys()
}
if (this->InEdit)
{
+ char fmt_s[] = "%s";
char firstLine[512];
// Clean the toolbar
for(int i=0; i<512; i++)
@@ -229,17 +229,16 @@ bool cmCursesStringWidget::PrintKeys()
}
firstLine[511] = '\0';
curses_move(y-4,0);
- printw(firstLine);
+ printw(fmt_s, firstLine);
curses_move(y-3,0);
- printw(firstLine);
+ printw(fmt_s, firstLine);
curses_move(y-2,0);
- printw(firstLine);
+ printw(fmt_s, firstLine);
curses_move(y-1,0);
- printw(firstLine);
+ printw(fmt_s, firstLine);
- sprintf(firstLine, "Editing option, press [enter] to leave edit.");
curses_move(y-3,0);
- printw(firstLine);
+ printw(fmt_s, "Editing option, press [enter] to leave edit.");
return true;
}
else
diff --git a/Source/CursesDialog/cmCursesWidget.cxx b/Source/CursesDialog/cmCursesWidget.cxx
index e5363f4..a12e4c2 100644
--- a/Source/CursesDialog/cmCursesWidget.cxx
+++ b/Source/CursesDialog/cmCursesWidget.cxx
@@ -49,7 +49,7 @@ void cmCursesWidget::Move(int x, int y, bool isNewPage)
void cmCursesWidget::SetValue(const std::string& value)
{
this->Value = value;
- set_field_buffer(this->Field, 0, value.c_str());
+ set_field_buffer(this->Field, 0, const_cast<char *>(value.c_str()));
}
const char* cmCursesWidget::GetValue()
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index ad6a7fb..66fd18b 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -78,9 +78,12 @@ if (Qt5Widgets_FOUND)
endif()
endif()
- if(WIN32 AND TARGET Qt5::Core)
+ if(TARGET Qt5::Core)
get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION)
get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH)
+ if(APPLE)
+ get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH)
+ endif()
endif()
else()
set(QT_MIN_VERSION "4.4.0")
@@ -94,12 +97,6 @@ else()
set(CMake_QT_LIBRARIES ${QT_LIBRARIES})
- if(WIN32 AND EXISTS "${QT_QMAKE_EXECUTABLE}")
- get_filename_component(_Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
- if(EXISTS "${_Qt_BIN_DIR}/QtCore4.dll")
- set(Qt_BIN_DIR ${_Qt_BIN_DIR})
- endif()
- endif()
endif()
set(SRCS
@@ -155,11 +152,8 @@ endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS})
+add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS} ${MANIFEST_FILE})
target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES})
-if(Qt_BIN_DIR)
- set_property(TARGET cmake-gui PROPERTY Qt_BIN_DIR ${Qt_BIN_DIR})
-endif()
if(APPLE)
file(STRINGS "${CMake_SOURCE_DIR}/Copyright.txt" copyright_line
@@ -223,7 +217,7 @@ if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32))
install(CODE "
include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\")
set(BU_CHMOD_BUNDLE_ITEMS ON)
- fixup_bundle(\"${fixup_exe}\" \"${QT_PLUGINS}\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR}\")
+ fixup_bundle(\"${fixup_exe}\" \"${QT_PLUGINS}\" \"${Qt_BIN_DIR};${QT_LIBRARY_DIR};${QT_BINARY_DIR}\")
" ${COMPONENT})
endif()
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 11e3f34..dc4db63 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -173,7 +173,7 @@ public:
*/
DumpSymbols(ObjectHeaderType* ih,
- FILE* fout) {
+ FILE* fout, bool is64) {
this->ObjectImageHeader = ih;
this->SymbolTable = (SymbolTableType*)
((DWORD_PTR)this->ObjectImageHeader
@@ -183,6 +183,7 @@ public:
GetSectionHeaderOffset(this->ObjectImageHeader);
this->ImportFlag = true;
this->SymbolCount = this->ObjectImageHeader->NumberOfSymbols;
+ this->Is64Bit = is64;
}
/*
@@ -287,7 +288,14 @@ public:
symbol.erase(posAt);
}
}
- if (symbol[0] == '_') symbol.erase(0,1);
+ // For 64 bit builds we don't need to remove _
+ if(!this->Is64Bit)
+ {
+ if (symbol[0] == '_')
+ {
+ symbol.erase(0,1);
+ }
+ }
if (this->ImportFlag) {
this->ImportFlag = false;
fprintf(this->FileOut,"EXPORTS \n");
@@ -355,6 +363,7 @@ private:
PIMAGE_SECTION_HEADER SectionHeaders;
ObjectHeaderType* ObjectImageHeader;
SymbolTableType* SymbolTable;
+ bool Is64Bit;
};
bool
@@ -406,7 +415,8 @@ DumpFile(const char* filename, FILE *fout)
* and IMAGE_FILE_HEADER.SizeOfOptionalHeader == 0;
*/
DumpSymbols<IMAGE_FILE_HEADER, IMAGE_SYMBOL>
- symbolDumper((PIMAGE_FILE_HEADER) lpFileBase, fout);
+ symbolDumper((PIMAGE_FILE_HEADER) lpFileBase, fout,
+ (dosHeader->e_magic == IMAGE_FILE_MACHINE_AMD64));
symbolDumper.DumpObjFile();
} else {
// check for /bigobj format
@@ -414,7 +424,8 @@ DumpFile(const char* filename, FILE *fout)
(cmANON_OBJECT_HEADER_BIGOBJ*) lpFileBase;
if(h->Sig1 == 0x0 && h->Sig2 == 0xffff) {
DumpSymbols<cmANON_OBJECT_HEADER_BIGOBJ, cmIMAGE_SYMBOL_EX>
- symbolDumper((cmANON_OBJECT_HEADER_BIGOBJ*) lpFileBase, fout);
+ symbolDumper((cmANON_OBJECT_HEADER_BIGOBJ*) lpFileBase, fout,
+ (dosHeader->e_magic == IMAGE_FILE_MACHINE_AMD64));
symbolDumper.DumpObjFile();
} else {
printf("unrecognized file format in '%s'\n", filename);
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 9f56324..7946950 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -181,7 +181,10 @@ cmArchiveWrite::~cmArchiveWrite()
}
//----------------------------------------------------------------------------
-bool cmArchiveWrite::Add(std::string path, size_t skip, const char* prefix)
+bool cmArchiveWrite::Add(std::string path,
+ size_t skip,
+ const char* prefix,
+ bool recursive)
{
if(this->Okay())
{
@@ -189,20 +192,21 @@ bool cmArchiveWrite::Add(std::string path, size_t skip, const char* prefix)
{
path.erase(path.size()-1);
}
- this->AddPath(path.c_str(), skip, prefix);
+ this->AddPath(path.c_str(), skip, prefix, recursive);
}
return this->Okay();
}
//----------------------------------------------------------------------------
bool cmArchiveWrite::AddPath(const char* path,
- size_t skip, const char* prefix)
+ size_t skip, const char* prefix,
+ bool recursive)
{
if(!this->AddFile(path, skip, prefix))
{
return false;
}
- if(!cmSystemTools::FileIsDirectory(path) ||
+ if((!cmSystemTools::FileIsDirectory(path) || !recursive) ||
cmSystemTools::FileIsSymlink(path))
{
return true;
@@ -278,6 +282,33 @@ bool cmArchiveWrite::AddFile(const char* file,
}
archive_entry_set_mtime(e, t, 0);
}
+
+ // manages the uid/guid of the entry (if any)
+ if (this->Uid.IsSet() && this->Gid.IsSet())
+ {
+ archive_entry_set_uid(e, this->Uid.Get());
+ archive_entry_set_gid(e, this->Gid.Get());
+ }
+
+ if (this->Uname.size() && this->Gname.size())
+ {
+ archive_entry_set_uname(e, this->Uname.c_str());
+ archive_entry_set_gname(e, this->Gname.c_str());
+ }
+
+
+ // manages the permissions
+ if (this->Permissions.IsSet())
+ {
+ archive_entry_set_perm(e, this->Permissions.Get());
+ }
+
+ if (this->PermissionsMask.IsSet())
+ {
+ mode_t perm = archive_entry_perm(e);
+ archive_entry_set_perm(e, perm & this->PermissionsMask.Get());
+ }
+
// Clear acl and xattr fields not useful for distribution.
archive_entry_acl_clear(e);
archive_entry_xattr_clear(e);
diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h
index e6f515d..8dbbb83 100644
--- a/Source/cmArchiveWrite.h
+++ b/Source/cmArchiveWrite.h
@@ -18,6 +18,22 @@
# error "cmArchiveWrite not allowed during bootstrap build!"
#endif
+template<typename T>
+class cmArchiveWriteOptional
+{
+public:
+ cmArchiveWriteOptional() {this->Clear();}
+ explicit cmArchiveWriteOptional(T val) {this->Set(val);}
+
+ void Set(T val) {this->IsValueSet = true; this->Value=val;}
+ void Clear() {this->IsValueSet = false;}
+ bool IsSet() const {return this->IsValueSet;}
+ T Get() const {return Value;}
+private:
+ T Value;
+ bool IsValueSet;
+};
+
/** \class cmArchiveWrite
* \brief Wrapper around libarchive for writing.
*
@@ -52,7 +68,10 @@ public:
* skip. The remaining part of the input path is appended to the
* "prefix" value to construct the final name in the archive.
*/
- bool Add(std::string path, size_t skip = 0, const char* prefix = 0);
+ bool Add(std::string path,
+ size_t skip = 0,
+ const char* prefix = 0,
+ bool recursive = true);
/** Returns true if there has been no error. */
operator safe_bool() const
@@ -69,9 +88,65 @@ public:
void SetVerbose(bool v) { this->Verbose = v; }
void SetMTime(std::string const& t) { this->MTime = t; }
+
+ //! Sets the permissions of the added files/folders
+ void SetPermissions(mode_t permissions_)
+ {
+ this->Permissions.Set(permissions_);
+ }
+
+ //! Clears permissions - default is used instead
+ void ClearPermissions() { this->Permissions.Clear(); }
+
+ //! Sets the permissions mask of files/folders
+ //!
+ //! The permissions will be copied from the existing file
+ //! or folder. The mask will then be applied to unset
+ //! some of them
+ void SetPermissionsMask(mode_t permissionsMask_)
+ {
+ this->PermissionsMask.Set(permissionsMask_);
+ }
+
+ //! Clears permissions mask - default is used instead
+ void ClearPermissionsMask()
+ {
+ this->PermissionsMask.Clear();
+ }
+
+ //! Sets UID and GID to be used in the tar file
+ void SetUIDAndGID(int uid_, int gid_)
+ {
+ this->Uid.Set(uid_);
+ this->Gid.Set(gid_);
+ }
+
+ //! Clears UID and GID to be used in the tar file - default is used instead
+ void ClearUIDAndGID()
+ {
+ this->Uid.Clear();
+ this->Gid.Clear();
+ }
+
+ //! Sets UNAME and GNAME to be used in the tar file
+ void SetUNAMEAndGNAME(const std::string& uname_, const std::string& gname_)
+ {
+ this->Uname = uname_;
+ this->Gname = gname_;
+ }
+
+ //! Clears UNAME and GNAME to be used in the tar file
+ //! default is used instead
+ void ClearUNAMEAndGNAME()
+ {
+ this->Uname = "";
+ this->Gname = "";
+ }
+
private:
bool Okay() const { return this->Error.empty(); }
- bool AddPath(const char* path, size_t skip, const char* prefix);
+ bool AddPath(const char* path, size_t skip, const char* prefix,
+ bool recursive = true);
bool AddFile(const char* file, size_t skip, const char* prefix);
bool AddData(const char* file, size_t size);
@@ -87,6 +162,22 @@ private:
std::string Format;
std::string Error;
std::string MTime;
+
+ //! UID of the user in the tar file
+ cmArchiveWriteOptional<int> Uid;
+
+ //! GUID of the user in the tar file
+ cmArchiveWriteOptional<int> Gid;
+
+ //! UNAME/GNAME of the user (does not override UID/GID)
+ //!@{
+ std::string Uname;
+ std::string Gname;
+ //!@}
+
+ //! Permissions on files/folders
+ cmArchiveWriteOptional<mode_t> Permissions;
+ cmArchiveWriteOptional<mode_t> PermissionsMask;
};
#endif
diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h
index 8f8038f..47455f8 100644
--- a/Source/cmBuildNameCommand.h
+++ b/Source/cmBuildNameCommand.h
@@ -23,7 +23,6 @@ public:
cmExecutionStatus &status);
virtual std::string GetName() const {return "build_name";}
virtual bool IsScriptable() const { return true; }
- virtual bool IsDiscouraged() const { return true; }
};
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index b2ad4a8..6e55d89 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2165,7 +2165,46 @@ bool cmCTest::HandleCommandLineArguments(size_t &i,
{
this->OutputTestOutputOnTestFailure = true;
}
-
+ if (this->CheckArgument(arg, "--test-output-size-passed") &&
+ i < args.size() - 1)
+ {
+ i++;
+ long outputSize;
+ if (cmSystemTools::StringToLong(args[i].c_str(), &outputSize))
+ {
+ if (cmCTestTestHandler *pCTestTestHandler =
+ static_cast<cmCTestTestHandler*>(this->TestingHandlers["test"]))
+ {
+ pCTestTestHandler->SetTestOutputSizePassed(int(outputSize));
+ }
+ }
+ else
+ {
+ cmCTestLog(this, WARNING,
+ "Invalid value for '--test-output-size-passed': " <<
+ args[i] << "\n");
+ }
+ }
+ if (this->CheckArgument(arg, "--test-output-size-failed") &&
+ i < args.size() - 1)
+ {
+ i++;
+ long outputSize;
+ if (cmSystemTools::StringToLong(args[i].c_str(), &outputSize))
+ {
+ if (cmCTestTestHandler *pCTestTestHandler =
+ static_cast<cmCTestTestHandler*>(this->TestingHandlers["test"]))
+ {
+ pCTestTestHandler->SetTestOutputSizeFailed(int(outputSize));
+ }
+ }
+ else
+ {
+ cmCTestLog(this, WARNING,
+ "Invalid value for '--test-output-size-failed': " <<
+ args[i] << "\n");
+ }
+ }
if(this->CheckArgument(arg, "-N", "--show-only"))
{
this->ShowOnly = true;
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 0548c6b..59bc396 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -102,15 +102,6 @@ public:
}
/**
- * This determines if usage of the method is discouraged or not.
- * This is currently only used for generating the documentation.
- */
- virtual bool IsDiscouraged() const
- {
- return false;
- }
-
- /**
* This is used to avoid including this command
* in documentation. This is mainly used by
* cmMacroHelperCommand and cmFunctionHelperCommand
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 4840e89..252e231 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -412,3 +412,20 @@ cmCommonTargetGenerator::GetLinkedTargetDirectories() const
}
return dirs;
}
+
+std::string cmCommonTargetGenerator::GetManifests()
+{
+ std::vector<cmSourceFile const*> manifest_srcs;
+ this->GeneratorTarget->GetManifests(manifest_srcs, this->ConfigName);
+
+ std::vector<std::string> manifests;
+ for (std::vector<cmSourceFile const*>::iterator mi = manifest_srcs.begin();
+ mi != manifest_srcs.end(); ++mi)
+ {
+ manifests.push_back(this->Convert((*mi)->GetFullPath(),
+ this->WorkingDirectory,
+ cmOutputConverter::SHELL));
+ }
+
+ return cmJoin(manifests, " ");
+}
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index 0a49e12..a4b2c10 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -88,6 +88,7 @@ protected:
ByLanguageMap DefinesByLanguage;
std::string GetIncludes(std::string const& l);
ByLanguageMap IncludesByLanguage;
+ std::string GetManifests();
std::vector<std::string> GetLinkedTargetDirectories() const;
};
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index 7874803..5330acd 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -11,9 +11,14 @@
============================================================================*/
#include "cmConditionEvaluator.h"
+#include "cmOutputConverter.h"
-cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile):
+cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile,
+ const cmListFileContext &context,
+ const cmListFileBacktrace& bt):
Makefile(makefile),
+ ExecutionContext(context),
+ Backtrace(bt),
Policy12Status(makefile.GetPolicyStatus(cmPolicies::CMP0012)),
Policy54Status(makefile.GetPolicyStatus(cmPolicies::CMP0054)),
Policy57Status(makefile.GetPolicyStatus(cmPolicies::CMP0057)),
@@ -98,6 +103,25 @@ bool cmConditionEvaluator::IsTrue(
errorString, status, true);
}
+cmListFileContext cmConditionEvaluator::GetConditionContext(
+ cmMakefile* mf,
+ const cmCommandContext& command,
+ const std::string& filePath)
+{
+ cmListFileContext context =
+ cmListFileContext::FromCommandContext(
+ command,
+ filePath);
+
+ if(!mf->GetCMakeInstance()->GetIsInTryCompile())
+ {
+ cmOutputConverter converter(mf->GetStateSnapshot());
+ context.FilePath = converter.Convert(context.FilePath,
+ cmOutputConverter::HOME);
+ }
+ return context;
+}
+
//=========================================================================
const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
cmExpandedCommandArgument const& argument) const
@@ -113,7 +137,8 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
if(def && argument.WasQuoted() && this->Policy54Status == cmPolicies::WARN)
{
- if(!this->Makefile.HasCMP0054AlreadyBeenReported())
+ if(!this->Makefile.HasCMP0054AlreadyBeenReported(
+ this->ExecutionContext))
{
std::ostringstream e;
e << (cmPolicies::GetPolicyWarning(cmPolicies::CMP0054)) << "\n";
@@ -122,7 +147,9 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
"when the policy is set to NEW. "
"Since the policy is not set the OLD behavior will be used.";
- this->Makefile.IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->Makefile.GetCMakeInstance()
+ ->IssueMessage(cmake::AUTHOR_WARNING, e.str(),
+ this->Backtrace);
}
}
@@ -159,7 +186,8 @@ bool cmConditionEvaluator::IsKeyword(std::string const& keyword,
if(isKeyword && argument.WasQuoted() &&
this->Policy54Status == cmPolicies::WARN)
{
- if(!this->Makefile.HasCMP0054AlreadyBeenReported())
+ if(!this->Makefile.HasCMP0054AlreadyBeenReported(
+ this->ExecutionContext))
{
std::ostringstream e;
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0054) << "\n";
@@ -168,7 +196,9 @@ bool cmConditionEvaluator::IsKeyword(std::string const& keyword,
"when the policy is set to NEW. "
"Since the policy is not set the OLD behavior will be used.";
- this->Makefile.IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->Makefile.GetCMakeInstance()
+ ->IssueMessage(cmake::AUTHOR_WARNING, e.str(),
+ this->Backtrace);
}
}
diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h
index c4e2d11..8600825 100644
--- a/Source/cmConditionEvaluator.h
+++ b/Source/cmConditionEvaluator.h
@@ -22,7 +22,9 @@ class cmConditionEvaluator
public:
typedef std::list<cmExpandedCommandArgument> cmArgumentList;
- cmConditionEvaluator(cmMakefile& makefile);
+ cmConditionEvaluator(cmMakefile& makefile,
+ cmListFileContext const& context,
+ cmListFileBacktrace const& bt);
// this is a shared function for both If and Else to determine if the
// arguments were valid, and if so, was the response true. If there is
@@ -31,6 +33,9 @@ public:
std::string &errorString,
cmake::MessageType &status);
+ static cmListFileContext GetConditionContext(cmMakefile* mf,
+ const cmCommandContext& command, std::string const& filePath);
+
private:
// Filter the given variable definition based on policy CMP0054.
const char* GetDefinitionIfUnquoted(
@@ -91,6 +96,8 @@ private:
cmake::MessageType &status);
cmMakefile& Makefile;
+ cmListFileContext ExecutionContext;
+ cmListFileBacktrace Backtrace;
cmPolicies::PolicyStatus Policy12Status;
cmPolicies::PolicyStatus Policy54Status;
cmPolicies::PolicyStatus Policy57Status;
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 9411555..3d9c4bf 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -29,7 +29,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
const char* sourceDirectory = argv[2].c_str();
const char* projectName = 0;
std::string targetName;
- std::vector<std::string> cmakeFlags;
+ std::vector<std::string> cmakeFlags(1, "CMAKE_FLAGS"); // fake argv[0]
std::vector<std::string> compileDefs;
std::string outputVariable;
std::string copyFile;
@@ -53,10 +53,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
if(argv[i] == "CMAKE_FLAGS")
{
doing = DoingCMakeFlags;
- // CMAKE_FLAGS is the first argument because we need an argv[0] that
- // is not used, so it matches regular command line parsing which has
- // the program name as arg 0
- cmakeFlags.push_back(argv[i]);
}
else if(argv[i] == "COMPILE_DEFINITIONS")
{
@@ -481,6 +477,16 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
fprintf(fout, "set(CMAKE_LINK_SEARCH_END_STATIC \"%s\")\n", lssDef);
}
+ /* Set the appropriate policy information for ENABLE_EXPORTS */
+ fprintf(fout, "cmake_policy(SET CMP0065 %s)\n",
+ this->Makefile->GetPolicyStatus(cmPolicies::CMP0065) ==
+ cmPolicies::NEW ? "NEW" : "OLD");
+ if(const char *ee = this->Makefile->GetDefinition(
+ "CMAKE_ENABLE_EXPORTS"))
+ {
+ fprintf(fout, "set(CMAKE_ENABLE_EXPORTS %s)\n", ee);
+ }
+
/* Put the executable at a known location (for COPY_FILE). */
fprintf(fout, "set(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n",
this->BinaryDirectory.c_str());
diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h
index 23d10f9..adefdf9 100644
--- a/Source/cmExecProgramCommand.h
+++ b/Source/cmExecProgramCommand.h
@@ -50,12 +50,6 @@ public:
*/
virtual bool IsScriptable() const { return true; }
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
cmTypeMacro(cmExecProgramCommand, cmCommand);
private:
static bool RunCommand(const char* command, std::string& output,
diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h
index 2ea4e79..81aa21a 100644
--- a/Source/cmExportLibraryDependenciesCommand.h
+++ b/Source/cmExportLibraryDependenciesCommand.h
@@ -22,7 +22,6 @@ public:
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
virtual std::string GetName() const { return "export_library_dependencies";}
- virtual bool IsDiscouraged() const { return true; }
virtual void FinalPass();
virtual bool HasFinalPass() const { return true; }
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index 7959ffe..fa9b381 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -207,6 +207,10 @@ void cmFindBase::ExpandPaths()
{
this->FillCMakeEnvironmentPath();
}
+ }
+ this->FillUserHintsPath();
+ if(!this->NoDefaultPath)
+ {
if(!this->NoSystemEnvironmentPath)
{
this->FillSystemEnvironmentPath();
@@ -216,8 +220,6 @@ void cmFindBase::ExpandPaths()
this->FillCMakeSystemVariablePath();
}
}
-
- this->FillUserHintsPath();
this->FillUserGuessPath();
}
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 9b9071d..64176e7 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1133,6 +1133,10 @@ void cmFindPackageCommand::ComputePrefixes()
{
this->FillPrefixesCMakeEnvironment();
}
+ }
+ this->FillPrefixesUserHints();
+ if(!this->NoDefaultPath)
+ {
if(!this->NoSystemEnvironmentPath)
{
this->FillPrefixesSystemEnvironment();
@@ -1150,7 +1154,6 @@ void cmFindPackageCommand::ComputePrefixes()
this->FillPrefixesSystemRegistry();
}
}
- this->FillPrefixesUserHints();
this->FillPrefixesUserGuess();
this->ComputeFinalPaths();
diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h
index 2aa6beb..8df3e1a 100644
--- a/Source/cmGeneratedFileStream.h
+++ b/Source/cmGeneratedFileStream.h
@@ -56,10 +56,10 @@ protected:
// Whether the real file stream was valid when it was closed.
bool Okay;
- // Whether the destionation file is compressed
+ // Whether the destination file is compressed
bool Compress;
- // Whether the destionation file is compressed
+ // Whether the destination file is compressed
bool CompressExtraExtension;
};
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 31b6766..1c350ab 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -13,6 +13,7 @@
#include "cmGeneratorExpressionNode.h"
#include "cmGlobalGenerator.h"
#include "cmAlgorithms.h"
+#include "cmOutputConverter.h"
//----------------------------------------------------------------------------
std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
@@ -1792,6 +1793,27 @@ static const
TargetFilesystemArtifactNodeGroup<ArtifactPdbTag> targetPdbNodeGroup;
//----------------------------------------------------------------------------
+static const struct ShellPathNode : public cmGeneratorExpressionNode
+{
+ ShellPathNode() {}
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ if (!cmSystemTools::FileIsFullPath(parameters.front()))
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "\"" + parameters.front() + "\" is not an absolute path.");
+ return std::string();
+ }
+ cmOutputConverter converter(context->Makefile->GetStateSnapshot());
+ return converter.ConvertDirectorySeparatorsForShell(parameters.front());
+ }
+} shellPathNode;
+
+//----------------------------------------------------------------------------
const cmGeneratorExpressionNode*
cmGeneratorExpressionNode::GetNode(const std::string &identifier)
{
@@ -1846,6 +1868,7 @@ cmGeneratorExpressionNode::GetNode(const std::string &identifier)
nodeMap["JOIN"] = &joinNode;
nodeMap["LINK_ONLY"] = &linkOnlyNode;
nodeMap["COMPILE_LANGUAGE"] = &languageNode;
+ nodeMap["SHELL_PATH"] = &shellPathNode;
}
NodeMap::const_iterator i = nodeMap.find(identifier);
if (i == nodeMap.end())
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 09387b7..62598f4 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -75,6 +75,7 @@ struct IDLSourcesTag {};
struct ResxTag {};
struct ModuleDefinitionFileTag {};
struct AppManifestTag{};
+struct ManifestsTag{};
struct CertificatesTag{};
struct XamlTag{};
@@ -216,6 +217,10 @@ struct TagVisitor
{
DoAccept<IsSameTag<Tag, AppManifestTag>::Result>::Do(this->Data, sf);
}
+ else if (ext == "manifest")
+ {
+ DoAccept<IsSameTag<Tag, ManifestsTag>::Result>::Do(this->Data, sf);
+ }
else if (ext == "pfx")
{
DoAccept<IsSameTag<Tag, CertificatesTag>::Result>::Do(this->Data, sf);
@@ -270,6 +275,8 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
this->LocalGenerator = lg;
this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
+ this->GlobalGenerator->ComputeTargetObjectDirectory(this);
+
CreatePropertyGeneratorExpressions(
t->GetIncludeDirectoriesEntries(),
t->GetIncludeDirectoriesBacktraces(),
@@ -626,6 +633,15 @@ cmGeneratorTarget
//----------------------------------------------------------------------------
void
cmGeneratorTarget
+::GetManifests(std::vector<cmSourceFile const*>& data,
+ const std::string& config) const
+{
+ IMPLEMENT_VISIT(Manifests);
+}
+
+//----------------------------------------------------------------------------
+void
+cmGeneratorTarget
::GetCertificates(std::vector<cmSourceFile const*>& data,
const std::string& config) const
{
@@ -2204,7 +2220,7 @@ cmGeneratorTarget::GetIncludeDirectories(const std::string& config,
"INCLUDE_DIRECTORIES")
!= debugProperties.end();
- if (this->Makefile->IsConfigured())
+ if (this->GlobalGenerator->GetConfigureDoneCMP0026())
{
this->DebugIncludesDone = true;
}
@@ -2351,7 +2367,7 @@ void cmGeneratorTarget::GetCompileOptions(std::vector<std::string> &result,
"COMPILE_OPTIONS")
!= debugProperties.end();
- if (this->Makefile->IsConfigured())
+ if (this->GlobalGenerator->GetConfigureDoneCMP0026())
{
this->DebugCompileOptionsDone = true;
}
@@ -2421,7 +2437,7 @@ void cmGeneratorTarget::GetCompileFeatures(std::vector<std::string> &result,
"COMPILE_FEATURES")
!= debugProperties.end();
- if (this->Makefile->IsConfigured())
+ if (this->GlobalGenerator->GetConfigureDoneCMP0026())
{
this->DebugCompileFeaturesDone = true;
}
@@ -2489,7 +2505,7 @@ void cmGeneratorTarget::GetCompileDefinitions(std::vector<std::string> &list,
"COMPILE_DEFINITIONS")
!= debugProperties.end();
- if (this->Makefile->IsConfigured())
+ if (this->GlobalGenerator->GetConfigureDoneCMP0026())
{
this->DebugCompileDefinitionsDone = true;
}
@@ -3923,7 +3939,7 @@ cmGeneratorTarget::ReportPropertyOrigin(const std::string &p,
p)
!= debugProperties.end();
- if (this->Target->GetMakefile()->IsConfigured())
+ if (this->GlobalGenerator->GetConfigureDoneCMP0026())
{
this->DebugCompatiblePropertiesDone[p] = true;
}
@@ -4490,7 +4506,7 @@ void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages,
std::vector<cmGeneratorTarget*> objectLibraries;
std::vector<cmSourceFile const*> externalObjects;
- if (!this->Makefile->IsConfigured())
+ if (!this->GlobalGenerator->GetConfigureDoneCMP0026())
{
std::vector<cmTarget*> objectTargets;
this->Target->GetObjectLibrariesCMP0026(objectTargets);
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 06d9a1f..916f281 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -71,6 +71,8 @@ public:
const std::string& config) const;
void GetAppManifest(std::vector<cmSourceFile const*>&,
const std::string& config) const;
+ void GetManifests(std::vector<cmSourceFile const*>&,
+ const std::string& config) const;
void GetCertificates(std::vector<cmSourceFile const*>&,
const std::string& config) const;
void GetXamlSources(std::vector<cmSourceFile const*>&,
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 846b6e2..cae5c2f 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -151,10 +151,6 @@ void cmGhsMultiTargetGenerator::Generate()
this->WriteTargetLinkLibraries();
}
this->WriteCustomCommands();
- if (this->DynamicDownload)
- {
- *this->GetFolderBuildStreams() << " " << this->DDOption << std::endl;
- }
this->WriteSources(objectSources);
}
@@ -230,9 +226,11 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string &config,
}
if (this->IsTargetGroup())
{
- *this->GetFolderBuildStreams() << " -non_shared" << std::endl;
- *this->GetFolderBuildStreams() << " -o \"" << outputDir
- << outputFilename << ".elf\""
+ *this->GetFolderBuildStreams()
+ << " {optgroup=GhsCommonOptions} -o \"" << outputDir
+ << outputFilename << ".elf\"" << std::endl;
+ *this->GetFolderBuildStreams() << " :extraOutputFile=\"" << outputDir
+ << outputFilename << ".elf.ael\""
<< std::endl;
}
else
@@ -454,14 +452,17 @@ void cmGhsMultiTargetGenerator::WriteSources(
this->Makefile->GetHomeOutputDirectory(), sgPath,
GhsMultiGpj::SUBPROJECT, this->RelBuildFilePath);
- if ((*si)->GetExtension() == ".int")
+ std::string fullSourcePath((*si)->GetFullPath());
+ if ((*si)->GetExtension() == "int" || (*si)->GetExtension() == "bsp")
{
- *this->FolderBuildStreams[sgPath] << "\"" << (*si)->GetFullPath() << "\""
- << std::endl;
+ *this->FolderBuildStreams[sgPath] << fullSourcePath << std::endl;
}
else
{
- *this->FolderBuildStreams[sgPath] << (*si)->GetFullPath() << std::endl;
+ //WORKAROUND: GHS MULTI needs the path to use backslashes without quotes
+ // to open files in search as of version 6.1.6
+ cmsys::SystemTools::ReplaceString(fullSourcePath, "/", "\\");
+ *this->FolderBuildStreams[sgPath] << fullSourcePath << std::endl;
}
if ("ld" != (*si)->GetExtension() && "int" != (*si)->GetExtension() &&
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 49f3b29..4a48b5d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -14,20 +14,6 @@
#if defined(_MSC_VER) && _MSC_VER >= 1800
# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
#endif
-typedef struct {
- ULONG dwOSVersionInfoSize;
- ULONG dwMajorVersion;
- ULONG dwMinorVersion;
- ULONG dwBuildNumber;
- ULONG dwPlatformId;
- WCHAR szCSDVersion[128];
- USHORT wServicePackMajor;
- USHORT wServicePackMinor;
- USHORT wSuiteMask;
- UCHAR wProductType;
- UCHAR wReserved;
-} CMRTL_OSVERSIONINFOEXW;
-
#endif
#include "cmGlobalGenerator.h"
@@ -36,7 +22,7 @@ typedef struct {
#include "cmake.h"
#include "cmState.h"
#include "cmMakefile.h"
-#include "cmQtAutoGenerators.h"
+#include "cmQtAutoGeneratorInitializer.h"
#include "cmSourceFile.h"
#include "cmVersion.h"
#include "cmTargetExport.h"
@@ -86,6 +72,8 @@ cmGlobalGenerator::cmGlobalGenerator(cmake* cm)
this->ExtraGenerator = 0;
this->CurrentMakefile = 0;
this->TryCompileOuterMakefile = 0;
+
+ this->ConfigureDoneCMP0026 = false;
}
cmGlobalGenerator::~cmGlobalGenerator()
@@ -446,45 +434,26 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
if (!mf->GetDefinition("CMAKE_SYSTEM"))
{
#if defined(_WIN32) && !defined(__CYGWIN__)
- CMRTL_OSVERSIONINFOEXW osviex;
+ /* Windows version number data. */
+ OSVERSIONINFOEXW osviex;
ZeroMemory(&osviex, sizeof(osviex));
osviex.dwOSVersionInfoSize = sizeof(osviex);
- typedef LONG (FAR WINAPI *cmRtlGetVersion)(CMRTL_OSVERSIONINFOEXW*);
- cmRtlGetVersion rtlGetVersion = reinterpret_cast<cmRtlGetVersion>(
- GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "RtlGetVersion"));
- if (rtlGetVersion && rtlGetVersion(&osviex) == 0)
- {
- std::ostringstream windowsVersionString;
- windowsVersionString << osviex.dwMajorVersion << "."
- << osviex.dwMinorVersion << "."
- << osviex.dwBuildNumber;
- windowsVersionString.str();
- mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION",
- windowsVersionString.str().c_str());
- }
- else
- {
- // RtlGetVersion failed, so use the deprecated GetVersionEx function.
- /* Windows version number data. */
- OSVERSIONINFO osvi;
- ZeroMemory(&osvi, sizeof(osvi));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
# pragma warning (push)
# pragma warning (disable:4996)
#endif
- GetVersionEx (&osvi);
+ GetVersionExW((OSVERSIONINFOW*)&osviex);
#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
# pragma warning (pop)
#endif
- std::ostringstream windowsVersionString;
- windowsVersionString << osvi.dwMajorVersion << "."
- << osvi.dwMinorVersion;
- windowsVersionString.str();
- mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION",
- windowsVersionString.str().c_str());
- }
+ std::ostringstream windowsVersionString;
+ windowsVersionString << osviex.dwMajorVersion << "."
+ << osviex.dwMinorVersion << "."
+ << osviex.dwBuildNumber;
+ windowsVersionString.str();
+ mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION",
+ windowsVersionString.str().c_str());
#endif
// Read the DetermineSystem file
std::string systemFile = mf->GetModulesFile("CMakeDetermineSystem.cmake");
@@ -1122,6 +1091,18 @@ void cmGlobalGenerator::ClearEnabledLanguages()
return this->CMakeInstance->GetState()->ClearEnabledLanguages();
}
+void cmGlobalGenerator::CreateLocalGenerators()
+{
+ cmDeleteAll(this->LocalGenerators);
+ this->LocalGenerators.clear();
+ this->LocalGenerators.reserve(this->Makefiles.size());
+ for (std::vector<cmMakefile*>::const_iterator it = this->Makefiles.begin();
+ it != this->Makefiles.end(); ++it)
+ {
+ this->LocalGenerators.push_back(this->CreateLocalGenerator(*it));
+ }
+}
+
void cmGlobalGenerator::Configure()
{
this->FirstTimeProgress = 0.0f;
@@ -1130,8 +1111,6 @@ void cmGlobalGenerator::Configure()
cmMakefile* dirMf =
new cmMakefile(this, this->GetCMakeInstance()->GetCurrentSnapshot());
this->Makefiles.push_back(dirMf);
- cmLocalGenerator *lg = this->CreateLocalGenerator(dirMf);
- this->LocalGenerators.push_back(lg);
// set the Start directories
dirMf->SetCurrentSourceDirectory
@@ -1143,9 +1122,12 @@ void cmGlobalGenerator::Configure()
this->CMakeInstance->GetHomeOutputDirectory());
// now do it
+ this->ConfigureDoneCMP0026 = false;
dirMf->Configure();
dirMf->EnforceDirectoryLevelRules();
+ this->ConfigureDoneCMP0026 = true;
+
// Put a copy of each global target in every directory.
cmTargets globalTargets;
this->CreateDefaultGlobalTargets(&globalTargets);
@@ -1203,6 +1185,7 @@ void cmGlobalGenerator::Configure()
void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
{
+ this->CreateLocalGenerators();
cmDeleteAll(this->GeneratorTargets);
this->GeneratorTargets.clear();
this->CreateGeneratorTargets(targetTypes);
@@ -1268,30 +1251,23 @@ bool cmGlobalGenerator::Compute()
#ifdef CMAKE_BUILD_WITH_CMAKE
// Iterate through all targets and set up automoc for those which have
// the AUTOMOC, AUTOUIC or AUTORCC property set
- AutogensType autogens;
- this->CreateQtAutoGeneratorsTargets(autogens);
+ std::vector<cmTarget const*> autogenTargets =
+ this->CreateQtAutoGeneratorsTargets();
#endif
unsigned int i;
- for (i = 0; i < this->LocalGenerators.size(); ++i)
- {
- this->LocalGenerators[i]->ComputeObjectMaxPath();
- }
-
// Add generator specific helper commands
for (i = 0; i < this->LocalGenerators.size(); ++i)
{
this->LocalGenerators[i]->AddHelperCommands();
}
- this->InitGeneratorTargets();
-
#ifdef CMAKE_BUILD_WITH_CMAKE
- for (AutogensType::iterator it = autogens.begin(); it != autogens.end();
- ++it)
+ for (std::vector<cmTarget const*>::iterator it = autogenTargets.begin();
+ it != autogenTargets.end(); ++it)
{
- it->first.SetupAutoGenerateTarget(it->second);
+ cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(*it);
}
#endif
@@ -1427,8 +1403,11 @@ bool cmGlobalGenerator::ComputeTargetDepends()
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
+std::vector<const cmTarget*>
+cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
{
+ std::vector<const cmTarget*> autogenTargets;
+
#ifdef CMAKE_BUILD_WITH_CMAKE
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{
@@ -1443,37 +1422,48 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
{
continue;
}
+ if(ti->second.GetType() != cmTarget::EXECUTABLE &&
+ ti->second.GetType() != cmTarget::STATIC_LIBRARY &&
+ ti->second.GetType() != cmTarget::SHARED_LIBRARY &&
+ ti->second.GetType() != cmTarget::MODULE_LIBRARY &&
+ ti->second.GetType() != cmTarget::OBJECT_LIBRARY)
+ {
+ continue;
+ }
+ if((!ti->second.GetPropertyAsBool("AUTOMOC")
+ && !ti->second.GetPropertyAsBool("AUTOUIC")
+ && !ti->second.GetPropertyAsBool("AUTORCC"))
+ || ti->second.IsImported())
+ {
+ continue;
+ }
+ // don't do anything if there is no Qt4 or Qt5Core (which contains moc):
+ cmMakefile* mf = ti->second.GetMakefile();
+ std::string qtMajorVersion = mf->GetSafeDefinition("QT_VERSION_MAJOR");
+ if (qtMajorVersion == "")
+ {
+ qtMajorVersion = mf->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
+ }
+ if (qtMajorVersion != "4" && qtMajorVersion != "5")
+ {
+ continue;
+ }
+
+ cmQtAutoGeneratorInitializer::InitializeAutogenSources(&ti->second);
targetNames.push_back(ti->second.GetName());
}
for(std::vector<std::string>::iterator ti = targetNames.begin();
ti != targetNames.end(); ++ti)
{
- cmTarget& target = *this->LocalGenerators[i]
+ cmTarget* target = this->LocalGenerators[i]
->GetMakefile()->FindTarget(*ti, true);
- if(target.GetType() == cmTarget::EXECUTABLE ||
- target.GetType() == cmTarget::STATIC_LIBRARY ||
- target.GetType() == cmTarget::SHARED_LIBRARY ||
- target.GetType() == cmTarget::MODULE_LIBRARY ||
- target.GetType() == cmTarget::OBJECT_LIBRARY)
- {
- if((target.GetPropertyAsBool("AUTOMOC")
- || target.GetPropertyAsBool("AUTOUIC")
- || target.GetPropertyAsBool("AUTORCC"))
- && !target.IsImported())
- {
- cmQtAutoGenerators autogen;
- if(autogen.InitializeAutogenTarget(this->LocalGenerators[i],
- &target))
- {
- autogens.push_back(std::make_pair(autogen, &target));
- }
- }
- }
+ cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
+ this->LocalGenerators[i], target);
+ autogenTargets.push_back(target);
}
}
-#else
- (void)autogens;
#endif
+ return autogenTargets;
}
//----------------------------------------------------------------------------
@@ -1566,19 +1556,6 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::InitGeneratorTargets()
-{
- for(cmGeneratorTargetsType::iterator ti =
- this->GeneratorTargets.begin(); ti != this->GeneratorTargets.end(); ++ti)
- {
- if (!ti->second->Target->IsImported())
- {
- this->ComputeTargetObjectDirectory(ti->second);
- }
- }
-}
-
-//----------------------------------------------------------------------------
void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes)
{
// Construct per-target generator information.
@@ -1964,12 +1941,6 @@ void cmGlobalGenerator::AddMakefile(cmMakefile *mf)
this->CMakeInstance->UpdateProgress("Configuring", prog);
}
-//----------------------------------------------------------------------------
-void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg)
-{
- this->LocalGenerators.push_back(lg);
-}
-
void cmGlobalGenerator::AddInstallComponent(const char* component)
{
if(component && *component)
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 9fc2d45..ba74c9e 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -41,7 +41,6 @@ class cmTarget;
class cmInstallTargetGenerator;
class cmInstallFilesGenerator;
class cmExportBuildFileGenerator;
-class cmQtAutoGenerators;
/** \class cmGlobalGenerator
* \brief Responsible for overseeing the generation process for the entire tree
@@ -124,7 +123,7 @@ public:
/**
* Try to determine system information, get it from another generator
*/
- virtual void EnableLanguagesFromGenerator(cmGlobalGenerator *gen,
+ void EnableLanguagesFromGenerator(cmGlobalGenerator *gen,
cmMakefile* mf);
/**
@@ -186,7 +185,6 @@ public:
{this->CurrentMakefile = mf;}
void AddMakefile(cmMakefile *mf);
- void AddLocalGenerator(cmLocalGenerator *lg);
///! Set an generator for an "external makefile based project"
void SetExternalMakefileProjectGenerator(
@@ -363,6 +361,8 @@ public:
cmFileLockPool& GetFileLockPool() { return FileLockPool; }
#endif
+ bool GetConfigureDoneCMP0026() const { return this->ConfigureDoneCMP0026; }
+
std::string MakeSilentFlag;
protected:
typedef std::vector<cmLocalGenerator*> GeneratorVector;
@@ -384,9 +384,7 @@ protected:
virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const;
- typedef std::vector<std::pair<cmQtAutoGenerators,
- cmTarget const*> > AutogensType;
- void CreateQtAutoGeneratorsTargets(AutogensType& autogens);
+ std::vector<cmTarget const*> CreateQtAutoGeneratorsTargets();
std::string SelectMakeProgram(const std::string& makeProgram,
const std::string& makeDefault = "") const;
@@ -464,6 +462,8 @@ private:
virtual void ForceLinkerLanguages();
+ void CreateLocalGenerators();
+
void CheckCompilerIdCompatibility(cmMakefile* mf,
std::string const& lang) const;
@@ -480,7 +480,6 @@ private:
cmGeneratorTargetsType GeneratorTargets;
friend class cmake;
void CreateGeneratorTargets(TargetTypes targetTypes, cmLocalGenerator* lg);
- void InitGeneratorTargets();
void CreateGeneratorTargets(TargetTypes targetTypes);
void ClearGeneratorMembers();
@@ -520,6 +519,7 @@ protected:
bool ForceUnixPaths;
bool ToolSupportsColor;
bool InstallTargetEnabled;
+ bool ConfigureDoneCMP0026;
};
#endif
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 120bb03..9d8193b 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -818,6 +818,17 @@ void cmGlobalNinjaGenerator::CloseRulesFileStream()
}
}
+std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path)
+{
+ cmLocalNinjaGenerator *ng =
+ static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]);
+ std::string convPath = ng->Convert(path, cmOutputConverter::HOME_OUTPUT);
+#ifdef _WIN32
+ cmSystemTools::ReplaceString(convPath, "/", "\\");
+#endif
+ return convPath;
+}
+
void cmGlobalNinjaGenerator::AddCXXCompileCommand(
const std::string &commandLine,
const std::string &sourceFile)
@@ -907,8 +918,6 @@ cmGlobalNinjaGenerator
{
std::string configName =
target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
- cmLocalNinjaGenerator *ng =
- static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]);
// for frameworks, we want the real name, not smple name
// frameworks always appear versioned, and the build.ninja
@@ -923,13 +932,13 @@ cmGlobalNinjaGenerator
case cmTarget::MODULE_LIBRARY:
{
cmGeneratorTarget *gtgt = this->GetGeneratorTarget(target);
- outputs.push_back(ng->ConvertToNinjaPath(
+ outputs.push_back(this->ConvertToNinjaPath(
gtgt->GetFullPath(configName, false, realname)));
break;
}
case cmTarget::OBJECT_LIBRARY:
case cmTarget::UTILITY: {
- std::string path = ng->ConvertToNinjaPath(
+ std::string path = this->ConvertToNinjaPath(
target->GetMakefile()->GetCurrentBinaryDirectory());
if (path.empty() || path == ".")
outputs.push_back(target->GetName());
@@ -1041,8 +1050,6 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
//get the list of files that cmake itself has generated as a
//product of configuration.
- cmLocalNinjaGenerator *ng =
- static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]);
for (std::vector<cmLocalGenerator *>::const_iterator i =
this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i)
@@ -1054,7 +1061,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
typedef std::vector<std::string>::const_iterator vect_it;
for(vect_it j = files.begin(); j != files.end(); ++j)
{
- knownDependencies.insert( ng->ConvertToNinjaPath( *j ) );
+ knownDependencies.insert( this->ConvertToNinjaPath( *j ) );
}
//get list files which are implicit dependencies as well and will be phony
//for rebuild manifest
@@ -1062,7 +1069,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
typedef std::vector<std::string>::const_iterator vect_it;
for(vect_it j = lf.begin(); j != lf.end(); ++j)
{
- knownDependencies.insert( ng->ConvertToNinjaPath( *j ) );
+ knownDependencies.insert( this->ConvertToNinjaPath( *j ) );
}
std::vector<cmGeneratorExpressionEvaluationFile*> const& ef =
(*i)->GetMakefile()->GetEvaluationFiles();
@@ -1074,7 +1081,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
std::vector<std::string> evaluationFiles = (*li)->GetFiles();
for(vect_it j = evaluationFiles.begin(); j != evaluationFiles.end(); ++j)
{
- knownDependencies.insert( ng->ConvertToNinjaPath( *j ) );
+ knownDependencies.insert( this->ConvertToNinjaPath( *j ) );
}
}
}
@@ -1084,7 +1091,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
i != this->TargetAliases.end();
++i)
{
- knownDependencies.insert( ng->ConvertToNinjaPath(i->first) );
+ knownDependencies.insert( this->ConvertToNinjaPath(i->first) );
}
//remove all source files we know will exist.
@@ -1093,7 +1100,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
i != this->AssumedSourceDependencies.end();
++i)
{
- knownDependencies.insert( ng->ConvertToNinjaPath(i->first) );
+ knownDependencies.insert( this->ConvertToNinjaPath(i->first) );
}
//now we difference with CombinedCustomCommandExplicitDependencies to find
@@ -1214,8 +1221,6 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
/*restat=*/ "",
/*generator=*/ true);
- cmLocalNinjaGenerator *ng = static_cast<cmLocalNinjaGenerator *>(lg);
-
cmNinjaDeps implicitDeps;
for(std::vector<cmLocalGenerator*>::const_iterator i =
this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i)
@@ -1224,7 +1229,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
for(std::vector<std::string>::const_iterator fi = lf.begin();
fi != lf.end(); ++fi)
{
- implicitDeps.push_back(ng->ConvertToNinjaPath(*fi));
+ implicitDeps.push_back(this->ConvertToNinjaPath(*fi));
}
}
implicitDeps.push_back("CMakeCache.txt");
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index d204a50..292f7c7 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -220,6 +220,19 @@ public:
cmGeneratedFileStream* GetRulesFileStream() const {
return this->RulesFileStream; }
+ std::string ConvertToNinjaPath(const std::string& path);
+
+ struct MapToNinjaPathImpl {
+ cmGlobalNinjaGenerator* GG;
+ MapToNinjaPathImpl(cmGlobalNinjaGenerator* gg): GG(gg) {}
+ std::string operator()(std::string const& path) {
+ return this->GG->ConvertToNinjaPath(path);
+ }
+ };
+ MapToNinjaPathImpl MapToNinjaPath() {
+ return MapToNinjaPathImpl(this);
+ }
+
void AddCXXCompileCommand(const std::string &commandLine,
const std::string &sourceFile);
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index cf4fd69..0064713 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -578,23 +578,18 @@ void cmGlobalUnixMakefileGenerator3
if (!targetName.empty())
{
cmMakefile* mf;
- cmLocalUnixMakefileGenerator3 *lg;
- if (!this->LocalGenerators.empty())
+ if (!this->Makefiles.empty())
{
- lg = static_cast<cmLocalUnixMakefileGenerator3 *>
- (this->LocalGenerators[0]);
- mf = lg->GetMakefile();
+ mf = this->Makefiles[0];
}
else
{
cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot();
mf = new cmMakefile(this, snapshot);
- lg = static_cast<cmLocalUnixMakefileGenerator3 *>
- (this->CreateLocalGenerator(mf));
// set the Start directories
- lg->GetMakefile()->SetCurrentSourceDirectory
+ mf->SetCurrentSourceDirectory
(this->CMakeInstance->GetHomeDirectory());
- lg->GetMakefile()->SetCurrentBinaryDirectory
+ mf->SetCurrentBinaryDirectory
(this->CMakeInstance->GetHomeOutputDirectory());
}
@@ -603,12 +598,12 @@ void cmGlobalUnixMakefileGenerator3
{
tname += "/fast";
}
- tname = lg->Convert(tname,cmLocalGenerator::HOME_OUTPUT);
+ cmOutputConverter conv(mf->GetStateSnapshot());
+ tname = conv.Convert(tname,cmOutputConverter::HOME_OUTPUT);
cmSystemTools::ConvertToOutputSlashes(tname);
makeCommand.push_back(tname);
- if (this->LocalGenerators.empty())
+ if (this->Makefiles.empty())
{
- delete lg;
delete mf;
}
}
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 44d632d..59e8f8c 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -176,7 +176,14 @@ cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts,
//----------------------------------------------------------------------------
bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
{
- if (this->SystemName == "WindowsCE")
+ if (this->SystemName == "Windows")
+ {
+ if (!this->InitializeWindows(mf))
+ {
+ return false;
+ }
+ }
+ else if (this->SystemName == "WindowsCE")
{
this->SystemIsWindowsCE = true;
if (!this->InitializeWindowsCE(mf))
@@ -184,7 +191,7 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
return false;
}
}
- else if(this->SystemName == "WindowsPhone")
+ else if (this->SystemName == "WindowsPhone")
{
this->SystemIsWindowsPhone = true;
if(!this->InitializeWindowsPhone(mf))
@@ -192,7 +199,7 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
return false;
}
}
- else if(this->SystemName == "WindowsStore")
+ else if (this->SystemName == "WindowsStore")
{
this->SystemIsWindowsStore = true;
if(!this->InitializeWindowsStore(mf))
@@ -229,6 +236,12 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
}
//----------------------------------------------------------------------------
+bool cmGlobalVisualStudio10Generator::InitializeWindows(cmMakefile*)
+{
+ return true;
+}
+
+//----------------------------------------------------------------------------
bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf)
{
if (this->DefaultPlatformName != "Win32")
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 8de7b09..f4861dc 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -74,6 +74,10 @@ public:
/** Return the CMAKE_SYSTEM_VERSION. */
std::string const& GetSystemVersion() const { return this->SystemVersion; }
+ /** Return the Windows version targeted on VS 2015 and above. */
+ std::string const& GetWindowsTargetPlatformVersion() const
+ { return this->WindowsTargetPlatformVersion; }
+
/** Return true if building for WindowsCE */
bool TargetsWindowsCE() const
{ return this->SystemIsWindowsCE; }
@@ -105,6 +109,7 @@ public:
protected:
virtual void Generate();
virtual bool InitializeSystem(cmMakefile* mf);
+ virtual bool InitializeWindows(cmMakefile* mf);
virtual bool InitializeWindowsCE(cmMakefile* mf);
virtual bool InitializeWindowsPhone(cmMakefile* mf);
virtual bool InitializeWindowsStore(cmMakefile* mf);
@@ -119,6 +124,7 @@ protected:
std::string GeneratorToolset;
std::string DefaultPlatformToolset;
+ std::string WindowsTargetPlatformVersion;
std::string SystemName;
std::string SystemVersion;
std::string NsightTegraVersion;
diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h
index b50f4c9..9499d80 100644
--- a/Source/cmGlobalVisualStudio11Generator.h
+++ b/Source/cmGlobalVisualStudio11Generator.h
@@ -34,9 +34,12 @@ protected:
virtual bool SelectWindowsPhoneToolset(std::string& toolset) const;
virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
+ // Used to verify that the Desktop toolset for the current generator is
+ // installed on the machine.
+ virtual bool IsWindowsDesktopToolsetInstalled() const;
+
// These aren't virtual because we need to check if the selected version
// of the toolset is installed
- bool IsWindowsDesktopToolsetInstalled() const;
bool IsWindowsPhoneToolsetInstalled() const;
bool IsWindowsStoreToolsetInstalled() const;
diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h
index bce9e0c..a7939aa 100644
--- a/Source/cmGlobalVisualStudio12Generator.h
+++ b/Source/cmGlobalVisualStudio12Generator.h
@@ -38,9 +38,12 @@ protected:
virtual bool SelectWindowsPhoneToolset(std::string& toolset) const;
virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
+ // Used to verify that the Desktop toolset for the current generator is
+ // installed on the machine.
+ virtual bool IsWindowsDesktopToolsetInstalled() const;
+
// These aren't virtual because we need to check if the selected version
// of the toolset is installed
- bool IsWindowsDesktopToolsetInstalled() const;
bool IsWindowsPhoneToolsetInstalled() const;
bool IsWindowsStoreToolsetInstalled() const;
virtual const char* GetIDEVersion() { return "12.0"; }
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index 2cf55d4..41825fb 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -111,6 +111,84 @@ cmGlobalVisualStudio14Generator::MatchesGeneratorName(
}
//----------------------------------------------------------------------------
+bool cmGlobalVisualStudio14Generator::InitializeWindows(cmMakefile* mf)
+{
+ if (cmHasLiteralPrefix(this->SystemVersion, "10.0"))
+ {
+ return this->SelectWindows10SDK(mf);
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf)
+{
+ std::ostringstream e;
+ if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset))
+ {
+ if(this->DefaultPlatformToolset.empty())
+ {
+ e << this->GetName() << " supports Windows Store '8.0', '8.1' and "
+ "'10.0', but not '" << this->SystemVersion <<
+ "'. Check CMAKE_SYSTEM_VERSION.";
+ }
+ else
+ {
+ e << "A Windows Store component with CMake requires both the Windows "
+ << "Desktop SDK as well as the Windows Store '" << this->SystemVersion
+ << "' SDK. Please make sure that you have both installed";
+ }
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ return false;
+ }
+ if (cmHasLiteralPrefix(this->SystemVersion, "10.0"))
+ {
+ return this->SelectWindows10SDK(mf);
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf)
+{
+ // Find the default version of the Windows 10 SDK.
+ this->WindowsTargetPlatformVersion = this->GetWindows10SDKVersion();
+ if (this->WindowsTargetPlatformVersion.empty())
+ {
+ std::ostringstream e;
+ e << "Could not find an appropriate version of the Windows 10 SDK"
+ << " installed on this machine";
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ return false;
+ }
+ mf->AddDefinition("CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION",
+ this->WindowsTargetPlatformVersion.c_str());
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio14Generator::SelectWindowsStoreToolset(
+ std::string& toolset) const
+{
+ if (cmHasLiteralPrefix(this->SystemVersion, "10.0"))
+ {
+ if (this->IsWindowsStoreToolsetInstalled() &&
+ this->IsWindowsDesktopToolsetInstalled())
+ {
+ toolset = "v140";
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return
+ this->cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset(toolset);
+}
+
+//----------------------------------------------------------------------------
void cmGlobalVisualStudio14Generator::WriteSLNHeader(std::ostream& fout)
{
// Visual Studio 14 writes .sln format 12.00
@@ -124,3 +202,90 @@ void cmGlobalVisualStudio14Generator::WriteSLNHeader(std::ostream& fout)
fout << "# Visual Studio 14\n";
}
}
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio14Generator::IsWindowsDesktopToolsetInstalled() const
+{
+ const char desktop10Key[] =
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+ "VisualStudio\\14.0\\VC\\Runtimes";
+
+ std::vector<std::string> vc14;
+ return cmSystemTools::GetRegistrySubKeys(desktop10Key,
+ vc14, cmSystemTools::KeyWOW64_32);
+}
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio14Generator::IsWindowsStoreToolsetInstalled() const
+{
+ const char universal10Key[] =
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+ "VisualStudio\\14.0\\Setup\\Build Tools for Windows 10;SrcPath";
+
+ std::string win10SDK;
+ return cmSystemTools::ReadRegistryValue(universal10Key,
+ win10SDK, cmSystemTools::KeyWOW64_32);
+}
+
+//----------------------------------------------------------------------------
+std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion()
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ // This logic is taken from the vcvarsqueryregistry.bat file from VS2015
+ // Try HKLM and then HKCU.
+ std::string win10Root;
+ if (!cmSystemTools::ReadRegistryValue(
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+ "Windows Kits\\Installed Roots;KitsRoot10", win10Root,
+ cmSystemTools::KeyWOW64_32) &&
+ !cmSystemTools::ReadRegistryValue(
+ "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\"
+ "Windows Kits\\Installed Roots;KitsRoot10", win10Root,
+ cmSystemTools::KeyWOW64_32))
+ {
+ return std::string();
+ }
+
+ std::vector<std::string> sdks;
+ std::string path = win10Root + "Include/*";
+ // Grab the paths of the different SDKs that are installed
+ cmSystemTools::GlobDirs(path, sdks);
+ if (!sdks.empty())
+ {
+ // Only use the filename, which will be the SDK version.
+ for (std::vector<std::string>::iterator i = sdks.begin();
+ i != sdks.end(); ++i)
+ {
+ *i = cmSystemTools::GetFilenameName(*i);
+ }
+
+ // Sort the results to make sure we select the most recent one that
+ // has a version less or equal to our version of the operating system
+ std::sort(sdks.begin(), sdks.end(), cmSystemTools::VersionCompareGreater);
+
+ // Select a suitable SDK version.
+ if (this->SystemVersion == "10.0")
+ {
+ // Use the latest Windows 10 SDK since no build version was given.
+ return sdks.at(0);
+ }
+ else
+ {
+ // Find the SDK less or equal to our specified version
+ for (std::vector<std::string>::iterator i = sdks.begin();
+ i != sdks.end(); ++i)
+ {
+ if (!cmSystemTools::VersionCompareGreater(*i, this->SystemVersion))
+ {
+ // This is the most recent SDK that we can run safely
+ return *i;
+ }
+ }
+ }
+ }
+#endif
+ // Return an empty string
+ return std::string();
+}
diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h
index aa817be..76c15d9 100644
--- a/Source/cmGlobalVisualStudio14Generator.h
+++ b/Source/cmGlobalVisualStudio14Generator.h
@@ -30,7 +30,23 @@ public:
virtual const char* GetToolsVersion() { return "14.0"; }
protected:
+ virtual bool InitializeWindows(cmMakefile* mf);
+ virtual bool InitializeWindowsStore(cmMakefile* mf);
+ virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
+
+ // These aren't virtual because we need to check if the selected version
+ // of the toolset is installed
+ bool IsWindowsStoreToolsetInstalled() const;
+
virtual const char* GetIDEVersion() { return "14.0"; }
+ virtual bool SelectWindows10SDK(cmMakefile* mf);
+
+ // Used to verify that the Desktop toolset for the current generator is
+ // installed on the machine.
+ virtual bool IsWindowsDesktopToolsetInstalled() const;
+
+ std::string GetWindows10SDKVersion();
+
private:
class Factory;
};
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index df49948..14de698 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -217,7 +217,7 @@ void cmGlobalVisualStudio6Generator
TargetDependSet projectTargets;
TargetDependSet originalTargets;
this->GetTargetSets(projectTargets, originalTargets, root, generators);
- OrderedTargetDependSet orderedProjectTargets(projectTargets);
+ OrderedTargetDependSet orderedProjectTargets(projectTargets, "ALL_BUILD");
for(OrderedTargetDependSet::const_iterator
tt = orderedProjectTargets.begin();
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 607642c..b913afc 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -94,7 +94,7 @@ void cmGlobalVisualStudio71Generator
TargetDependSet projectTargets;
TargetDependSet originalTargets;
this->GetTargetSets(projectTargets, originalTargets, root, generators);
- OrderedTargetDependSet orderedProjectTargets(projectTargets);
+ OrderedTargetDependSet orderedProjectTargets(projectTargets, "ALL_BUILD");
this->WriteTargetsToSolution(fout, root, orderedProjectTargets);
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 0175062..05da022 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -568,7 +568,7 @@ void cmGlobalVisualStudio7Generator
TargetDependSet projectTargets;
TargetDependSet originalTargets;
this->GetTargetSets(projectTargets, originalTargets, root, generators);
- OrderedTargetDependSet orderedProjectTargets(projectTargets);
+ OrderedTargetDependSet orderedProjectTargets(projectTargets, "ALL_BUILD");
this->WriteTargetsToSolution(fout, root, orderedProjectTargets);
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 28f0425..70c00e9 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -449,7 +449,7 @@ void cmGlobalVisualStudio8Generator::WriteProjectDepends(
{
cmGeneratorTarget* gt = this->GetGeneratorTarget(&t);
TargetDependSet const& unordered = this->GetTargetDirectDepends(gt);
- OrderedTargetDependSet depends(unordered);
+ OrderedTargetDependSet depends(unordered, std::string());
for(OrderedTargetDependSet::const_iterator i = depends.begin();
i != depends.end(); ++i)
{
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 2bf04b4..7552d67 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -192,7 +192,7 @@ void cmGlobalVisualStudioGenerator::ConfigureCMakeVisualStudioMacros()
cmMakefile* mf = this->LocalGenerators[0]->GetMakefile();
std::string dir = this->GetUserMacrosDirectory();
- if (mf != 0 && dir != "")
+ if (dir != "")
{
std::string src = mf->GetRequiredDefinition("CMAKE_ROOT");
src += "/Templates/" CMAKE_VSMACROS_FILENAME;
@@ -233,13 +233,12 @@ cmGlobalVisualStudioGenerator
std::string dir = this->GetUserMacrosDirectory();
// Only really try to call the macro if:
- // - mf is non-NULL
// - there is a UserMacrosDirectory
// - the CMake vsmacros file exists
// - the CMake vsmacros file is registered
// - there were .sln/.vcproj files changed during generation
//
- if (mf != 0 && dir != "")
+ if (dir != "")
{
std::string macrosFile = dir + "/CMakeMacros/" CMAKE_VSMACROS_FILENAME;
std::string nextSubkeyName;
@@ -864,28 +863,34 @@ bool
cmGlobalVisualStudioGenerator::TargetCompare
::operator()(cmGeneratorTarget const* l, cmGeneratorTarget const* r) const
{
- // Make sure ALL_BUILD is first so it is the default active project.
- if(r->GetName() == "ALL_BUILD")
+ // Make sure a given named target is ordered first,
+ // e.g. to set ALL_BUILD as the default active project.
+ // When the empty string is named this is a no-op.
+ if (r->GetName() == this->First)
{
return false;
}
- if(l->GetName() == "ALL_BUILD")
+ if (l->GetName() == this->First)
{
return true;
}
- return strcmp(l->GetName().c_str(), r->GetName().c_str()) < 0;
+ return l->GetName() < r->GetName();
}
//----------------------------------------------------------------------------
cmGlobalVisualStudioGenerator::OrderedTargetDependSet
-::OrderedTargetDependSet(TargetDependSet const& targets)
+::OrderedTargetDependSet(TargetDependSet const& targets,
+ std::string const& first):
+ derived(TargetCompare(first))
{
this->insert(targets.begin(), targets.end());
}
//----------------------------------------------------------------------------
cmGlobalVisualStudioGenerator::OrderedTargetDependSet
-::OrderedTargetDependSet(TargetSet const& targets)
+::OrderedTargetDependSet(TargetSet const& targets,
+ std::string const& first):
+ derived(TargetCompare(first))
{
for (TargetSet::const_iterator it = targets.begin();
it != targets.end(); ++it)
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index 64440ad..c940eb3 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -89,8 +89,11 @@ public:
virtual bool TargetsWindowsCE() const { return false; }
class TargetSet: public std::set<cmTarget const*> {};
- struct TargetCompare
+ class TargetCompare
{
+ std::string First;
+ public:
+ TargetCompare(std::string const& first): First(first) {}
bool operator()(cmGeneratorTarget const* l,
cmGeneratorTarget const* r) const;
};
@@ -151,11 +154,14 @@ class cmGlobalVisualStudioGenerator::OrderedTargetDependSet:
public std::multiset<cmTargetDepend,
cmGlobalVisualStudioGenerator::TargetCompare>
{
+ typedef std::multiset<cmTargetDepend,
+ cmGlobalVisualStudioGenerator::TargetCompare>
+ derived;
public:
typedef cmGlobalGenerator::TargetDependSet TargetDependSet;
typedef cmGlobalVisualStudioGenerator::TargetSet TargetSet;
- OrderedTargetDependSet(TargetDependSet const&);
- OrderedTargetDependSet(TargetSet const&);
+ OrderedTargetDependSet(TargetDependSet const&, std::string const& first);
+ OrderedTargetDependSet(TargetSet const&, std::string const& first);
};
#endif
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 20448c1..9e71d37 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -106,7 +106,14 @@ IsFunctionBlocked(const cmListFileFunction& lff,
cmake::MessageType messType;
- cmConditionEvaluator conditionEvaluator(mf);
+ cmListFileContext conditionContext =
+ cmConditionEvaluator::GetConditionContext(
+ &mf, this->Functions[c],
+ this->GetStartingContext().FilePath);
+
+ cmConditionEvaluator conditionEvaluator(
+ mf, conditionContext,
+ mf.GetBacktrace(this->Functions[c]));
bool isTrue = conditionEvaluator.IsTrue(
expandedArguments, errorString, messType);
@@ -195,7 +202,16 @@ bool cmIfCommand
cmake::MessageType status;
- cmConditionEvaluator conditionEvaluator(*(this->Makefile));
+ cmListFileContext execContext = this->Makefile->GetExecutionContext();
+
+ cmCommandContext commandContext;
+ commandContext.Line = execContext.Line;
+ commandContext.Name = execContext.Name;
+
+ cmConditionEvaluator conditionEvaluator(
+ *(this->Makefile), cmConditionEvaluator::GetConditionContext(
+ this->Makefile, commandContext, execContext.FilePath),
+ this->Makefile->GetBacktrace());
bool isTrue = conditionEvaluator.IsTrue(
expandedArguments, errorString, status);
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index 7593380..78cb5f0 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -12,6 +12,8 @@
#include "cmInstallDirectoryGenerator.h"
#include "cmTarget.h"
+#include "cmGeneratorExpression.h"
+#include "cmLocalGenerator.h"
//----------------------------------------------------------------------------
cmInstallDirectoryGenerator
@@ -25,10 +27,16 @@ cmInstallDirectoryGenerator
const char* literal_args,
bool optional):
cmInstallGenerator(dest, configurations, component, message),
+ LocalGenerator(0),
Directories(dirs),
FilePermissions(file_permissions), DirPermissions(dir_permissions),
LiteralArguments(literal_args), Optional(optional)
{
+ // We need per-config actions if destination have generator expressions.
+ if(cmGeneratorExpression::Find(Destination) != std::string::npos)
+ {
+ this->ActionsPerConfig = true;
+ }
}
//----------------------------------------------------------------------------
@@ -37,15 +45,43 @@ cmInstallDirectoryGenerator
{
}
+void cmInstallDirectoryGenerator::Compute(cmLocalGenerator* lg)
+{
+ LocalGenerator = lg;
+}
+
//----------------------------------------------------------------------------
void
cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os,
Indent const& indent)
{
+ if(this->ActionsPerConfig)
+ {
+ this->cmInstallGenerator::GenerateScriptActions(os, indent);
+ }
+ else
+ {
+ this->AddDirectoryInstallRule(os, "", indent);
+ }
+}
+
+void cmInstallDirectoryGenerator::GenerateScriptForConfig(
+ std::ostream& os,
+ const std::string& config,
+ Indent const& indent)
+{
+ this->AddDirectoryInstallRule(os, config, indent);
+}
+
+void cmInstallDirectoryGenerator::AddDirectoryInstallRule(
+ std::ostream& os,
+ const std::string& config,
+ Indent const& indent)
+{
// Write code to install the directories.
const char* no_rename = 0;
this->AddInstallRule(os,
- this->Destination,
+ this->GetDestination(config),
cmInstallType_DIRECTORY,
this->Directories,
this->Optional,
@@ -54,3 +90,12 @@ cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os,
no_rename, this->LiteralArguments.c_str(),
indent);
}
+
+//----------------------------------------------------------------------------
+std::string
+cmInstallDirectoryGenerator::GetDestination(std::string const& config) const
+{
+ cmGeneratorExpression ge;
+ return ge.Parse(this->Destination)
+ ->Evaluate(this->LocalGenerator->GetMakefile(), config);
+}
diff --git a/Source/cmInstallDirectoryGenerator.h b/Source/cmInstallDirectoryGenerator.h
index 165ab91..04107e1 100644
--- a/Source/cmInstallDirectoryGenerator.h
+++ b/Source/cmInstallDirectoryGenerator.h
@@ -31,8 +31,19 @@ public:
bool optional = false);
virtual ~cmInstallDirectoryGenerator();
+ void Compute(cmLocalGenerator* lg);
+
+ std::string GetDestination(std::string const& config) const;
+
protected:
virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
+ virtual void GenerateScriptForConfig(std::ostream& os,
+ const std::string& config,
+ Indent const& indent);
+ void AddDirectoryInstallRule(std::ostream& os,
+ const std::string& config,
+ Indent const& indent);
+ cmLocalGenerator* LocalGenerator;
std::vector<std::string> Directories;
std::string FilePermissions;
std::string DirPermissions;
diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h
index 4551ab1..8062d11 100644
--- a/Source/cmInstallFilesCommand.h
+++ b/Source/cmInstallFilesCommand.h
@@ -52,12 +52,6 @@ public:
virtual void FinalPass();
virtual bool HasFinalPass() const { return !this->IsFilesForm; }
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
cmTypeMacro(cmInstallFilesCommand, cmCommand);
protected:
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index c18b174..e2c16c8 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -34,6 +34,12 @@ cmInstallFilesGenerator
Programs(programs),
Optional(optional)
{
+ // We need per-config actions if the destination has generator expressions.
+ if(cmGeneratorExpression::Find(Destination) != std::string::npos)
+ {
+ this->ActionsPerConfig = true;
+ }
+
// We need per-config actions if any files have generator expressions.
for(std::vector<std::string>::const_iterator i = files.begin();
!this->ActionsPerConfig && i != files.end(); ++i)
@@ -57,14 +63,25 @@ void cmInstallFilesGenerator::Compute(cmLocalGenerator* lg)
}
//----------------------------------------------------------------------------
+std::string
+cmInstallFilesGenerator::GetDestination(std::string const& config) const
+{
+ cmGeneratorExpression ge;
+ return ge.Parse(this->Destination)
+ ->Evaluate(this->LocalGenerator->GetMakefile(), config);
+}
+
+//----------------------------------------------------------------------------
void cmInstallFilesGenerator::AddFilesInstallRule(
- std::ostream& os, Indent const& indent,
+ std::ostream& os,
+ const std::string config,
+ Indent const& indent,
std::vector<std::string> const& files)
{
// Write code to install the files.
const char* no_dir_permissions = 0;
this->AddInstallRule(os,
- this->Destination,
+ this->GetDestination(config),
(this->Programs
? cmInstallType_PROGRAMS
: cmInstallType_FILES),
@@ -84,7 +101,7 @@ void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os,
}
else
{
- this->AddFilesInstallRule(os, indent, this->Files);
+ this->AddFilesInstallRule(os, "", indent, this->Files);
}
}
@@ -102,5 +119,5 @@ void cmInstallFilesGenerator::GenerateScriptForConfig(std::ostream& os,
cmSystemTools::ExpandListArgument(cge->Evaluate(
this->LocalGenerator->GetMakefile(), config), files);
}
- this->AddFilesInstallRule(os, indent, files);
+ this->AddFilesInstallRule(os, config, indent, files);
}
diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h
index 00b3a79..bfe4039 100644
--- a/Source/cmInstallFilesGenerator.h
+++ b/Source/cmInstallFilesGenerator.h
@@ -32,12 +32,16 @@ public:
void Compute(cmLocalGenerator* lg);
+ std::string GetDestination(std::string const& config) const;
+
protected:
virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
virtual void GenerateScriptForConfig(std::ostream& os,
const std::string& config,
Indent const& indent);
- void AddFilesInstallRule(std::ostream& os, Indent const& indent,
+ void AddFilesInstallRule(std::ostream& os,
+ const std::string config,
+ Indent const& indent,
std::vector<std::string> const& files);
cmLocalGenerator* LocalGenerator;
diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h
index 90c7ba3..524debf 100644
--- a/Source/cmInstallProgramsCommand.h
+++ b/Source/cmInstallProgramsCommand.h
@@ -53,12 +53,6 @@ public:
virtual bool HasFinalPass() const { return true; }
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
cmTypeMacro(cmInstallProgramsCommand, cmCommand);
protected:
diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h
index e6cbe6e..05160eb 100644
--- a/Source/cmInstallTargetsCommand.h
+++ b/Source/cmInstallTargetsCommand.h
@@ -44,12 +44,6 @@ public:
*/
virtual std::string GetName() const { return "install_targets";}
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
cmTypeMacro(cmInstallTargetsCommand, cmCommand);
};
diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h
index c572439..1ddefc4 100644
--- a/Source/cmLinkLibrariesCommand.h
+++ b/Source/cmLinkLibrariesCommand.h
@@ -44,12 +44,6 @@ public:
*/
virtual std::string GetName() const { return "link_libraries";}
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
cmTypeMacro(cmLinkLibrariesCommand, cmCommand);
};
diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h
index 4581269..445e167 100644
--- a/Source/cmLoadCommandCommand.h
+++ b/Source/cmLoadCommandCommand.h
@@ -21,7 +21,6 @@ public:
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
virtual std::string GetName() const {return "load_command";}
- virtual bool IsDiscouraged() const { return true; }
cmTypeMacro(cmLoadCommandCommand, cmCommand);
};
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b360c22..3230403 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -54,6 +54,8 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg,
this->EmitUniversalBinaryFlags = true;
this->BackwardsCompatibility = 0;
this->BackwardsCompatibilityFinal = false;
+
+ this->ComputeObjectMaxPath();
}
cmLocalGenerator::~cmLocalGenerator()
@@ -487,7 +489,7 @@ cmState* cmLocalGenerator::GetState() const
cmState::Snapshot cmLocalGenerator::GetStateSnapshot() const
{
- return this->StateSnapshot;
+ return this->Makefile->GetStateSnapshot();
}
// List of variables that are replaced when
@@ -525,6 +527,13 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
return replaceValues.LinkFlags;
}
}
+ if(replaceValues.Manifests)
+ {
+ if(variable == "MANIFESTS")
+ {
+ return replaceValues.Manifests;
+ }
+ }
if(replaceValues.Flags)
{
if(variable == "FLAGS")
@@ -1533,13 +1542,49 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR");
// Flags to link an executable to shared libraries.
- std::string linkFlagsVar = "CMAKE_SHARED_LIBRARY_LINK_";
- linkFlagsVar += linkLanguage;
- linkFlagsVar += "_FLAGS";
- if( tgt.GetType() == cmTarget::EXECUTABLE )
+ if (tgt.GetType() == cmTarget::EXECUTABLE &&
+ this->StateSnapshot.GetState()->
+ GetGlobalPropertyAsBool("TARGET_SUPPORTS_SHARED_LIBS"))
{
- linkLibs = this->Makefile->GetSafeDefinition(linkFlagsVar);
- linkLibs += " ";
+ bool add_shlib_flags = false;
+ switch(tgt.Target->GetPolicyStatusCMP0065())
+ {
+ case cmPolicies::WARN:
+ if(!tgt.GetPropertyAsBool("ENABLE_EXPORTS") &&
+ this->Makefile->PolicyOptionalWarningEnabled(
+ "CMAKE_POLICY_WARNING_CMP0065"))
+ {
+ std::ostringstream w;
+ w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0065) << "\n"
+ "For compatibility with older versions of CMake, "
+ "additional flags may be added to export symbols on all "
+ "executables regardless of thier ENABLE_EXPORTS property.";
+ this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ }
+ case cmPolicies::OLD:
+ // OLD behavior is to always add the flags
+ add_shlib_flags = true;
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ this->Makefile->IssueMessage(
+ cmake::FATAL_ERROR,
+ cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0065)
+ );
+ case cmPolicies::NEW:
+ // NEW behavior is to only add the flags if ENABLE_EXPORTS is on
+ add_shlib_flags = tgt.GetPropertyAsBool("ENABLE_EXPORTS");
+ break;
+ }
+
+ if(add_shlib_flags)
+ {
+ std::string linkFlagsVar = "CMAKE_SHARED_LIBRARY_LINK_";
+ linkFlagsVar += linkLanguage;
+ linkFlagsVar += "_FLAGS";
+ linkLibs = this->Makefile->GetSafeDefinition(linkFlagsVar);
+ linkLibs += " ";
+ }
}
// Append the framework search path flags.
@@ -2843,7 +2888,7 @@ cmIML_INT_uint64_t cmLocalGenerator::GetBackwardsCompatibility()
}
}
this->BackwardsCompatibility = CMake_VERSION_ENCODE(major, minor, patch);
- this->BackwardsCompatibilityFinal = this->Makefile->IsConfigured();
+ this->BackwardsCompatibilityFinal = true;
}
return this->BackwardsCompatibility;
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index b051e5d..6ea414a 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -219,6 +219,7 @@ public:
const char* TargetSOName;
const char* TargetInstallNameDir;
const char* LinkFlags;
+ const char* Manifests;
const char* LanguageCompileFlags;
const char* Defines;
const char* Includes;
@@ -299,7 +300,6 @@ public:
void CreateEvaluationFileOutputs(const std::string& config);
void ProcessEvaluationFiles(std::vector<std::string>& generatedFiles);
- void ComputeObjectMaxPath();
protected:
///! put all the libraries for a target on into the given stream
void OutputLinkLibraries(std::string& linkLibraries,
@@ -359,6 +359,8 @@ private:
bool GetShouldUseOldFlags(bool shared, const std::string &lang) const;
void AddPositionIndependentFlags(std::string& flags, std::string const& l,
int targetType);
+
+ void ComputeObjectMaxPath();
};
#endif
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 7525bf2..c46adc1 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -284,15 +284,6 @@ void cmLocalNinjaGenerator::WriteProcessedMakefile(std::ostream& os)
os << std::endl;
}
-std::string cmLocalNinjaGenerator::ConvertToNinjaPath(const std::string& path)
-{
- std::string convPath = this->Convert(path, cmLocalGenerator::HOME_OUTPUT);
-#ifdef _WIN32
- cmSystemTools::ReplaceString(convPath, "/", "\\");
-#endif
- return convPath;
-}
-
void
cmLocalNinjaGenerator
::AppendTargetOutputs(cmTarget* target, cmNinjaDeps& outputs)
@@ -316,7 +307,8 @@ void cmLocalNinjaGenerator::AppendCustomCommandDeps(
i != deps.end(); ++i) {
std::string dep;
if (this->GetRealDependency(*i, this->GetConfigName(), dep))
- ninjaDeps.push_back(ConvertToNinjaPath(dep));
+ ninjaDeps.push_back(
+ this->GetGlobalNinjaGenerator()->ConvertToNinjaPath(dep));
}
}
@@ -413,9 +405,11 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
at us. How to know which ExternalProject step actually provides it?
#endif
std::transform(outputs.begin(), outputs.end(),
- ninjaOutputs.begin(), MapToNinjaPath());
+ ninjaOutputs.begin(),
+ this->GetGlobalNinjaGenerator()->MapToNinjaPath());
std::transform(byproducts.begin(), byproducts.end(),
- ninjaOutputs.begin() + outputs.size(), MapToNinjaPath());
+ ninjaOutputs.begin() + outputs.size(),
+ this->GetGlobalNinjaGenerator()->MapToNinjaPath());
this->AppendCustomCommandDeps(ccg, ninjaDeps);
for (cmNinjaDeps::iterator i = ninjaOutputs.begin(); i != ninjaOutputs.end();
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index 8d3d49c..1645a8d 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -50,21 +50,6 @@ public:
std::string GetHomeRelativeOutputPath() const
{ return this->HomeRelativeOutputPath; }
- std::string ConvertToNinjaPath(const std::string& path);
-
- struct map_to_ninja_path {
- cmLocalNinjaGenerator *LocalGenerator;
- map_to_ninja_path(cmLocalNinjaGenerator *LocalGen)
- : LocalGenerator(LocalGen) {}
- std::string operator()(const std::string &path) {
- return LocalGenerator->ConvertToNinjaPath(path);
- }
- };
-
- map_to_ninja_path MapToNinjaPath() {
- return map_to_ninja_path(this);
- }
-
void ExpandRuleVariables(std::string& string,
const RuleVariables& replaceValues) {
cmLocalGenerator::ExpandRuleVariables(string, replaceValues);
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index cf67251..a4bce8a 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -972,25 +972,43 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
fout << "\t\t\t\tProxyFileName=\"$(InputName)_p.c\"/>\n";
// end of <Tool Name=VCMIDLTool
- // Check if we need the FAT32 workaround.
+ // Add manifest tool settings.
if(targetBuilds && this->GetVersion() >= cmGlobalVisualStudioGenerator::VS8)
{
+ const char* manifestTool = "VCManifestTool";
+ if (this->FortranProject)
+ {
+ manifestTool = "VFManifestTool";
+ }
+ fout <<
+ "\t\t\t<Tool\n"
+ "\t\t\t\tName=\"" << manifestTool << "\"";
+
+ std::vector<cmSourceFile const*> manifest_srcs;
+ gt->GetManifests(manifest_srcs, configName);
+ if (!manifest_srcs.empty())
+ {
+ fout << "\n\t\t\t\tAdditionalManifestFiles=\"";
+ for (std::vector<cmSourceFile const*>::const_iterator
+ mi = manifest_srcs.begin(); mi != manifest_srcs.end(); ++mi)
+ {
+ std::string m = (*mi)->GetFullPath();
+ fout << this->ConvertToXMLOutputPath(m.c_str()) << ";";
+ }
+ fout << "\"";
+ }
+
+ // Check if we need the FAT32 workaround.
// Check the filesystem type where the target will be written.
- if(cmLVS6G_IsFAT(target.GetDirectory(configName).c_str()))
+ if (cmLVS6G_IsFAT(target.GetDirectory(configName).c_str()))
{
// Add a flag telling the manifest tool to use a workaround
// for FAT32 file systems, which can cause an empty manifest
// to be embedded into the resulting executable. See CMake
// bug #2617.
- const char* manifestTool = "VCManifestTool";
- if(this->FortranProject)
- {
- manifestTool = "VFManifestTool";
- }
- fout << "\t\t\t<Tool\n\t\t\t\tName=\"" << manifestTool << "\"\n"
- << "\t\t\t\tUseFAT32Workaround=\"true\"\n"
- << "\t\t\t/>\n";
+ fout << "\n\t\t\t\tUseFAT32Workaround=\"true\"";
}
+ fout << "/>\n";
}
this->OutputTargetRules(fout, configName, target, libName);
diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h
index 71b97eb..617f1fe 100644
--- a/Source/cmMakeDirectoryCommand.h
+++ b/Source/cmMakeDirectoryCommand.h
@@ -51,12 +51,6 @@ public:
*/
virtual bool IsScriptable() const { return true; }
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
cmTypeMacro(cmMakeDirectoryCommand, cmCommand);
};
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8a3d197..cb66a75 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -54,7 +54,6 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused();
this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
- this->Configured = false;
this->SuppressWatches = false;
// Setup the default include file regular expression (match everything).
@@ -1658,7 +1657,6 @@ void cmMakefile::Configure()
cmParseFileScope pfs(this);
if (!listFile.ParseFile(currentStart.c_str(), this->IsRootMakefile(), this))
{
- this->SetConfigured();
return;
}
}
@@ -1679,7 +1677,6 @@ void cmMakefile::Configure()
}
this->AddCMakeDependFilesFromUser();
- this->SetConfigured();
}
void cmMakefile::ConfigureSubDirectory(cmMakefile *mf)
@@ -1723,7 +1720,6 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile *mf)
// NEW behavior prints the error.
this->IssueMessage(cmake::FATAL_ERROR, e.str());
}
- mf->SetConfigured();
return;
}
// finally configure the subdir
@@ -1756,11 +1752,6 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
cmMakefile* subMf = new cmMakefile(this->GlobalGenerator, newSnapshot);
this->GetGlobalGenerator()->AddMakefile(subMf);
- // create a new local generator and set its parent
- cmLocalGenerator *lg2 = this->GetGlobalGenerator()
- ->CreateLocalGenerator(subMf);
- this->GetGlobalGenerator()->AddLocalGenerator(lg2);
-
// set the subdirs start dirs
subMf->SetCurrentSourceDirectory(srcPath);
subMf->SetCurrentBinaryDirectory(binPath);
@@ -3227,7 +3218,7 @@ void cmMakefile::AddDefaultDefinitions()
//----------------------------------------------------------------------------
std::string
cmMakefile::GetConfigurations(std::vector<std::string>& configs,
- bool single) const
+ bool singleConfig) const
{
if(this->GetGlobalGenerator()->IsMultiConfig())
{
@@ -3241,7 +3232,7 @@ cmMakefile::GetConfigurations(std::vector<std::string>& configs,
else
{
const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE");
- if(single && !buildType.empty())
+ if(singleConfig && !buildType.empty())
{
configs.push_back(buildType);
}
@@ -4667,9 +4658,10 @@ bool cmMakefile::SetPolicyVersion(const char *version)
}
//----------------------------------------------------------------------------
-bool cmMakefile::HasCMP0054AlreadyBeenReported() const
+bool cmMakefile::HasCMP0054AlreadyBeenReported(
+ cmListFileContext const& context) const
{
- return !this->CMP0054ReportedIds.insert(this->GetExecutionContext()).second;
+ return !this->CMP0054ReportedIds.insert(context).second;
}
//----------------------------------------------------------------------------
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 3cf20a6..111f074 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -336,7 +336,7 @@ public:
* Determine if the given context, name pair has already been reported
* in context of CMP0054.
*/
- bool HasCMP0054AlreadyBeenReported() const;
+ bool HasCMP0054AlreadyBeenReported(const cmListFileContext &context) const;
bool IgnoreErrorsCMP0061() const;
@@ -750,9 +750,6 @@ public:
cmStringRange GetCompileDefinitionsEntries() const;
cmBacktraceRange GetCompileDefinitionsBacktraces() const;
- bool IsConfigured() const { return this->Configured; }
- void SetConfigured(){ this->Configured = true; }
-
void AddQtUiFileWithOptions(cmSourceFile *sf);
std::vector<cmSourceFile*> GetQtUiFilesWithOptions() const;
@@ -988,7 +985,6 @@ private:
bool WarnUnused;
bool CheckSystemVars;
bool CheckCMP0000;
- bool Configured;
bool IsSourceFileTryCompile;
mutable bool SuppressWatches;
};
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index ccb0974..90f679e 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -353,6 +353,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
useResponseFileForObjects, buildObjs, depends,
useWatcomQuote);
+ std::string manifests = this->GetManifests();
+
cmLocalGenerator::RuleVariables vars;
vars.RuleLauncher = "RULE_LAUNCH_LINK";
vars.CMTarget = this->Target;
@@ -391,6 +393,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
vars.LinkLibraries = linkLibs.c_str();
vars.Flags = flags.c_str();
vars.LinkFlags = linkFlags.c_str();
+ vars.Manifests = manifests.c_str();
+
// Expand placeholders in the commands.
this->LocalGenerator->TargetImplib = targetOutPathImport;
for(std::vector<std::string>::iterator i = real_link_commands.begin();
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 2f995e8..cd387a0 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -616,6 +616,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
}
}
+ std::string manifests = this->GetManifests();
+
cmLocalGenerator::RuleVariables vars;
vars.TargetPDB = targetOutPathPDB.c_str();
@@ -660,6 +662,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
}
vars.LinkFlags = linkFlags.c_str();
+ vars.Manifests = manifests.c_str();
+
// Compute the directory portion of the install_name setting.
std::string install_name_dir;
if(this->Target->GetType() == cmTarget::SHARED_LIBRARY)
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index cf88a74..b278087 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1493,6 +1493,15 @@ void cmMakefileTargetGenerator
depends.push_back(this->ModuleDefinitionFile);
}
+ // Add a dependency on user-specified manifest files, if any.
+ std::vector<cmSourceFile const*> manifest_srcs;
+ this->GeneratorTarget->GetManifests(manifest_srcs, this->ConfigName);
+ for (std::vector<cmSourceFile const*>::iterator mi = manifest_srcs.begin();
+ mi != manifest_srcs.end(); ++mi)
+ {
+ depends.push_back((*mi)->GetFullPath());
+ }
+
// Add user-specified dependencies.
if(const char* linkDepends =
this->Target->GetProperty("LINK_DEPENDS"))
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx
index 467555f..2854a82 100644
--- a/Source/cmMessageCommand.cxx
+++ b/Source/cmMessageCommand.cxx
@@ -43,19 +43,7 @@ bool cmMessageCommand
}
else if (*i == "AUTHOR_WARNING")
{
- if (this->Makefile->IsOn("CMAKE_ERROR_DEVELOPER_WARNINGS"))
- {
- fatal = true;
- type = cmake::AUTHOR_ERROR;
- }
- else if (!this->Makefile->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"))
- {
- type = cmake::AUTHOR_WARNING;
- }
- else
- {
- return true;
- }
+ type = cmake::AUTHOR_WARNING;
++i;
}
else if (*i == "STATUS")
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index b855bea..84c19a3 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -237,6 +237,7 @@ cmNinjaNormalTargetGenerator
vars.Flags = "$FLAGS";
vars.LinkFlags = "$LINK_FLAGS";
+ vars.Manifests = "$MANIFESTS";
std::string langFlags;
if (targetType != cmTarget::EXECUTABLE)
@@ -509,6 +510,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
vars["LINK_FLAGS"] = cmGlobalNinjaGenerator
::EncodeLiteral(vars["LINK_FLAGS"]);
+ vars["MANIFESTS"] = this->GetManifests();
+
vars["LINK_PATH"] = frameworkPath + linkPath;
// Compute architecture specific link flags. Yes, these go into a different
@@ -579,11 +582,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
vars["TARGET_PDB"] = base + suffix + dbg_suffix;
}
+ const std::string objPath = GetTarget()->GetSupportDirectory();
+ vars["OBJECT_DIR"] =
+ this->GetLocalGenerator()->ConvertToOutputFormat(
+ this->ConvertToNinjaPath(objPath), cmLocalGenerator::SHELL);
+ EnsureDirectoryExists(objPath);
+
if (this->GetGlobalGenerator()->IsGCCOnWindows())
{
- const std::string objPath = GetTarget()->GetSupportDirectory();
- vars["OBJECT_DIR"] = ConvertToNinjaPath(objPath);
- EnsureDirectoryExists(objPath);
// ar.exe can't handle backslashes in rsp files (implicitly used by gcc)
std::string& linkLibraries = vars["LINK_LIBRARIES"];
std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/');
@@ -627,7 +633,6 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
std::string cmakeCommand =
this->GetLocalGenerator()->ConvertToOutputFormat(
cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
- std::string dllname = targetOutput;
std::string name_of_def_file
= target.GetSupportDirectory();
name_of_def_file += "/" + target.GetName();
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 81fdde2..6e6dc60 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -209,6 +209,15 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
result.push_back(this->ConvertToNinjaPath(this->ModuleDefinitionFile));
}
+ // Add a dependency on user-specified manifest files, if any.
+ std::vector<cmSourceFile const*> manifest_srcs;
+ this->GeneratorTarget->GetManifests(manifest_srcs, this->ConfigName);
+ for (std::vector<cmSourceFile const*>::iterator mi = manifest_srcs.begin();
+ mi != manifest_srcs.end(); ++mi)
+ {
+ result.push_back(this->ConvertToNinjaPath((*mi)->GetFullPath()));
+ }
+
// Add user-specified dependencies.
if (const char* linkDepends = this->Target->GetProperty("LINK_DEPENDS"))
{
@@ -362,7 +371,7 @@ cmNinjaTargetGenerator
mf->GetSafeDefinition("CMAKE_C_COMPILER") :
mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
cldeps = "\"";
- cldeps += mf->GetSafeDefinition("CMAKE_CMCLDEPS_EXECUTABLE");
+ cldeps += cmSystemTools::GetCMClDepsCommand();
cldeps += "\" " + lang + " $in \"$DEP_FILE\" $out \"";
cldeps += mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDES_PREFIX");
cldeps += "\" \"" + cl + "\" ";
@@ -762,14 +771,14 @@ cmNinjaTargetGenerator::MacOSXContentGeneratorType::operator()(
// Get the input file location.
std::string input = source.GetFullPath();
input =
- this->Generator->GetLocalGenerator()->ConvertToNinjaPath(input);
+ this->Generator->GetGlobalGenerator()->ConvertToNinjaPath(input);
// Get the output file location.
std::string output = macdir;
output += "/";
output += cmSystemTools::GetFilenameName(input);
output =
- this->Generator->GetLocalGenerator()->ConvertToNinjaPath(output);
+ this->Generator->GetGlobalGenerator()->ConvertToNinjaPath(output);
// Write a build statement to copy the content into the bundle.
this->Generator->GetGlobalGenerator()->WriteMacOSXContentBuild(input,
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index a10ceba..0267f63 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -17,11 +17,11 @@
#include "cmStandardIncludes.h"
#include "cmNinjaTypes.h"
+#include "cmGlobalNinjaGenerator.h"
#include "cmLocalNinjaGenerator.h"
#include "cmOSXBundleGenerator.h"
class cmTarget;
-class cmGlobalNinjaGenerator;
class cmGeneratedFileStream;
class cmGeneratorTarget;
class cmMakefile;
@@ -87,10 +87,10 @@ protected:
const std::string& language);
std::string ConvertToNinjaPath(const std::string& path) const {
- return this->GetLocalGenerator()->ConvertToNinjaPath(path);
+ return this->GetGlobalGenerator()->ConvertToNinjaPath(path);
}
- cmLocalNinjaGenerator::map_to_ninja_path MapToNinjaPath() const {
- return this->GetLocalGenerator()->MapToNinjaPath();
+ cmGlobalNinjaGenerator::MapToNinjaPathImpl MapToNinjaPath() const {
+ return this->GetGlobalGenerator()->MapToNinjaPath();
}
/// @return the list of link dependency for the given target @a target.
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 7be5b3f..5acae2f 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -142,21 +142,7 @@ std::string cmOutputConverter::ConvertToOutputFormat(const std::string& source,
}
else if(output == SHELL || output == WATCOMQUOTE)
{
- // For the MSYS shell convert drive letters to posix paths, so
- // that c:/some/path becomes /c/some/path. This is needed to
- // avoid problems with the shell path translation.
- if(this->GetState()->UseMSYSShell() && !this->LinkScriptShell)
- {
- if(result.size() > 2 && result[1] == ':')
- {
- result[1] = result[0];
- result[0] = '/';
- }
- }
- if(this->GetState()->UseWindowsShell())
- {
- std::replace(result.begin(), result.end(), '/', '\\');
- }
+ result = this->ConvertDirectorySeparatorsForShell(source);
result = this->EscapeForShell(result, true, false, output == WATCOMQUOTE);
}
else if(output == RESPONSE)
@@ -167,6 +153,29 @@ std::string cmOutputConverter::ConvertToOutputFormat(const std::string& source,
}
//----------------------------------------------------------------------------
+std::string cmOutputConverter::ConvertDirectorySeparatorsForShell(
+ const std::string& source) const
+{
+ std::string result = source;
+ // For the MSYS shell convert drive letters to posix paths, so
+ // that c:/some/path becomes /c/some/path. This is needed to
+ // avoid problems with the shell path translation.
+ if(this->GetState()->UseMSYSShell() && !this->LinkScriptShell)
+ {
+ if(result.size() > 2 && result[1] == ':')
+ {
+ result[1] = result[0];
+ result[0] = '/';
+ }
+ }
+ if(this->GetState()->UseWindowsShell())
+ {
+ std::replace(result.begin(), result.end(), '/', '\\');
+ }
+ return result;
+}
+
+//----------------------------------------------------------------------------
std::string cmOutputConverter::Convert(RelativeRoot remote,
const std::string& local,
OutputFormat output,
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index ed7739e..852df5d 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -45,6 +45,8 @@ public:
std::string Convert(RelativeRoot remote, const std::string& local,
OutputFormat output = UNCHANGED,
bool optional = false) const;
+ std::string ConvertDirectorySeparatorsForShell(
+ const std::string& source) const;
/**
* Get path for the specified relative root.
diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h
index 95eba38..6a09673 100644
--- a/Source/cmOutputRequiredFilesCommand.h
+++ b/Source/cmOutputRequiredFilesCommand.h
@@ -23,7 +23,6 @@ public:
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
virtual std::string GetName() const { return "output_required_files";}
- virtual bool IsDiscouraged() const { return true; }
void ListDependencies(cmDependInformation const *info,
FILE *fout,
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index a791b89..a549d18 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -220,7 +220,11 @@ class cmPolicy;
3, 3, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0064, \
"Support new TEST if() operator.", \
- 3, 3, 0, cmPolicies::WARN)
+ 3, 4, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0065, \
+ "Do not add flags to export symbols from executables without " \
+ "the ENABLE_EXPORTS target property.", \
+ 3, 4, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
#define CM_FOR_EACH_POLICY_ID(POLICY) \
@@ -231,7 +235,7 @@ class cmPolicy;
* \brief Handles changes in CMake behavior and policies
*
* See the cmake wiki section on
- * <a href="http://www.cmake.org/Wiki/CMake/Policies">policies</a>
+ * <a href="https://cmake.org/Wiki/CMake/Policies">policies</a>
* for an overview of this class's purpose
*/
class cmPolicies
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
new file mode 100644
index 0000000..d52ab78
--- /dev/null
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -0,0 +1,1074 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2004-2011 Kitware, Inc.
+ Copyright 2011 Alexander Neundorf (neundorf@kde.org)
+
+ 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 "cmQtAutoGeneratorInitializer.h"
+
+#include "cmLocalGenerator.h"
+#include "cmMakefile.h"
+#include "cmSourceFile.h"
+
+#include <sys/stat.h>
+
+#include <cmsys/FStream.hxx>
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+# include "cmGlobalVisualStudioGenerator.h"
+#endif
+
+std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName(
+ cmTarget const* target)
+{
+ std::string autogenTargetName = target->GetName();
+ autogenTargetName += "_automoc";
+ return autogenTargetName;
+}
+
+std::string cmQtAutoGeneratorInitializer::GetAutogenTargetDir(
+ cmTarget const* target)
+{
+ cmMakefile* makefile = target->GetMakefile();
+ std::string targetDir = makefile->GetCurrentBinaryDirectory();
+ targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory();
+ targetDir += "/";
+ targetDir += cmQtAutoGeneratorInitializer::GetAutogenTargetName(target);
+ targetDir += ".dir/";
+ return targetDir;
+}
+
+static void copyTargetProperty(cmTarget* destinationTarget,
+ cmTarget* sourceTarget,
+ const std::string& propertyName)
+{
+ const char* propertyValue = sourceTarget->GetProperty(propertyName);
+ if (propertyValue)
+ {
+ destinationTarget->SetProperty(propertyName, propertyValue);
+ }
+}
+
+static std::string cmQtAutoGeneratorsStripCR(std::string const& line)
+{
+ // Strip CR characters rcc may have printed (possibly more than one!).
+ std::string::size_type cr = line.find('\r');
+ if (cr != line.npos)
+ {
+ return line.substr(0, cr);
+ }
+ return line;
+}
+
+static std::string ReadAll(const std::string& filename)
+{
+ cmsys::ifstream file(filename.c_str());
+ std::stringstream stream;
+ stream << file.rdbuf();
+ file.close();
+ return stream.str();
+}
+
+std::string cmQtAutoGeneratorInitializer::ListQt5RccInputs(cmSourceFile* sf,
+ cmTarget const* target,
+ std::vector<std::string>& depends)
+{
+ std::string rccCommand
+ = cmQtAutoGeneratorInitializer::GetRccExecutable(target);
+ std::vector<std::string> qrcEntries;
+
+ std::vector<std::string> command;
+ command.push_back(rccCommand);
+ command.push_back("--list");
+
+ std::string absFile = cmsys::SystemTools::GetRealPath(
+ sf->GetFullPath());
+
+ command.push_back(absFile);
+
+ std::string rccStdOut;
+ std::string rccStdErr;
+ int retVal = 0;
+ bool result = cmSystemTools::RunSingleCommand(
+ command, &rccStdOut, &rccStdErr,
+ &retVal, 0, cmSystemTools::OUTPUT_NONE);
+ if (!result || retVal)
+ {
+ std::cerr << "AUTOGEN: error: Rcc list process for " << sf->GetFullPath()
+ << " failed:\n" << rccStdOut << "\n" << rccStdErr << std::endl;
+ return std::string();
+ }
+
+ {
+ std::istringstream ostr(rccStdOut);
+ std::string oline;
+ while(std::getline(ostr, oline))
+ {
+ oline = cmQtAutoGeneratorsStripCR(oline);
+ if(!oline.empty())
+ {
+ qrcEntries.push_back(oline);
+ }
+ }
+ }
+
+ {
+ std::istringstream estr(rccStdErr);
+ std::string eline;
+ while(std::getline(estr, eline))
+ {
+ eline = cmQtAutoGeneratorsStripCR(eline);
+ if (cmHasLiteralPrefix(eline, "RCC: Error in"))
+ {
+ static std::string searchString = "Cannot find file '";
+
+ std::string::size_type pos = eline.find(searchString);
+ if (pos == std::string::npos)
+ {
+ std::cerr << "AUTOGEN: error: Rcc lists unparsable output "
+ << eline << std::endl;
+ return std::string();
+ }
+ pos += searchString.length();
+ std::string::size_type sz = eline.size() - pos - 1;
+ qrcEntries.push_back(eline.substr(pos, sz));
+ }
+ }
+ }
+
+ depends.insert(depends.end(), qrcEntries.begin(), qrcEntries.end());
+ return cmJoin(qrcEntries, "@list_sep@");
+}
+
+std::string cmQtAutoGeneratorInitializer::ListQt4RccInputs(cmSourceFile* sf,
+ std::vector<std::string>& depends)
+{
+ const std::string qrcContents = ReadAll(sf->GetFullPath());
+
+ cmsys::RegularExpression fileMatchRegex("(<file[^<]+)");
+
+ std::string entriesList;
+ const char* sep = "";
+
+ size_t offset = 0;
+ while (fileMatchRegex.find(qrcContents.c_str() + offset))
+ {
+ std::string qrcEntry = fileMatchRegex.match(1);
+
+ offset += qrcEntry.size();
+
+ cmsys::RegularExpression fileReplaceRegex("(^<file[^>]*>)");
+ fileReplaceRegex.find(qrcEntry);
+ std::string tag = fileReplaceRegex.match(1);
+
+ qrcEntry = qrcEntry.substr(tag.size());
+
+ if (!cmSystemTools::FileIsFullPath(qrcEntry.c_str()))
+ {
+ qrcEntry = sf->GetLocation().GetDirectory() + "/" + qrcEntry;
+ }
+
+ entriesList += sep;
+ entriesList += qrcEntry;
+ sep = "@list_sep@";
+ depends.push_back(qrcEntry);
+ }
+ return entriesList;
+}
+
+
+void cmQtAutoGeneratorInitializer::InitializeAutogenSources(cmTarget* target)
+{
+ cmMakefile* makefile = target->GetMakefile();
+
+ if (target->GetPropertyAsBool("AUTOMOC"))
+ {
+ std::string automocTargetName =
+ cmQtAutoGeneratorInitializer::GetAutogenTargetName(target);
+ std::string mocCppFile = makefile->GetCurrentBinaryDirectory();
+ mocCppFile += "/";
+ mocCppFile += automocTargetName;
+ mocCppFile += ".cpp";
+ makefile->GetOrCreateSource(mocCppFile, true);
+ makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
+ mocCppFile.c_str(), false);
+
+ target->AddSource(mocCppFile);
+ }
+}
+
+void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
+ cmLocalGenerator* lg,
+ cmTarget* target)
+{
+ cmMakefile* makefile = target->GetMakefile();
+
+ std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
+ if (qtMajorVersion == "")
+ {
+ qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
+ }
+
+ // create a custom target for running generators at buildtime:
+ std::string autogenTargetName =
+ cmQtAutoGeneratorInitializer::GetAutogenTargetName(target);
+
+ std::string targetDir =
+ cmQtAutoGeneratorInitializer::GetAutogenTargetDir(target);
+
+ cmCustomCommandLine currentLine;
+ currentLine.push_back(cmSystemTools::GetCMakeCommand());
+ currentLine.push_back("-E");
+ currentLine.push_back("cmake_autogen");
+ currentLine.push_back(targetDir);
+ currentLine.push_back("$<CONFIGURATION>");
+
+ cmCustomCommandLines commandLines;
+ commandLines.push_back(currentLine);
+
+ std::string workingDirectory = cmSystemTools::CollapseFullPath(
+ "", makefile->GetCurrentBinaryDirectory());
+
+ std::vector<std::string> depends;
+ if (const char *autogenDepends =
+ target->GetProperty("AUTOGEN_TARGET_DEPENDS"))
+ {
+ cmSystemTools::ExpandListArgument(autogenDepends, depends);
+ }
+ std::vector<std::string> toolNames;
+ if (target->GetPropertyAsBool("AUTOMOC"))
+ {
+ toolNames.push_back("moc");
+ }
+ if (target->GetPropertyAsBool("AUTOUIC"))
+ {
+ toolNames.push_back("uic");
+ }
+ if (target->GetPropertyAsBool("AUTORCC"))
+ {
+ toolNames.push_back("rcc");
+ }
+
+ std::string tools = toolNames[0];
+ toolNames.erase(toolNames.begin());
+ while (toolNames.size() > 1)
+ {
+ tools += ", " + toolNames[0];
+ toolNames.erase(toolNames.begin());
+ }
+ if (toolNames.size() == 1)
+ {
+ tools += " and " + toolNames[0];
+ }
+ std::string autogenComment = "Automatic " + tools + " for target ";
+ autogenComment += target->GetName();
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ bool usePRE_BUILD = false;
+ cmGlobalGenerator* gg = lg->GetGlobalGenerator();
+ if(gg->GetName().find("Visual Studio") != std::string::npos)
+ {
+ cmGlobalVisualStudioGenerator* vsgg =
+ static_cast<cmGlobalVisualStudioGenerator*>(gg);
+ // Under VS >= 7 use a PRE_BUILD event instead of a separate target to
+ // reduce the number of targets loaded into the IDE.
+ // This also works around a VS 11 bug that may skip updating the target:
+ // https://connect.microsoft.com/VisualStudio/feedback/details/769495
+ usePRE_BUILD = vsgg->GetVersion() >= cmGlobalVisualStudioGenerator::VS7;
+ if(usePRE_BUILD)
+ {
+ for (std::vector<std::string>::iterator it = depends.begin();
+ it != depends.end(); ++it)
+ {
+ if(!makefile->FindTargetToUse(it->c_str()))
+ {
+ usePRE_BUILD = false;
+ break;
+ }
+ }
+ }
+ }
+#endif
+
+ std::vector<std::string> rcc_output;
+ bool const isNinja =
+ lg->GetGlobalGenerator()->GetName() == "Ninja";
+ if(isNinja
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ || usePRE_BUILD
+#endif
+ )
+ {
+ std::vector<cmSourceFile*> srcFiles;
+ cmGeneratorTarget* gtgt =
+ lg->GetGlobalGenerator()->GetGeneratorTarget(target);
+ gtgt->GetConfigCommonSourceFiles(srcFiles);
+ for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
+ fileIt != srcFiles.end();
+ ++fileIt)
+ {
+ cmSourceFile* sf = *fileIt;
+ std::string absFile = cmsys::SystemTools::GetRealPath(
+ sf->GetFullPath());
+
+ std::string ext = sf->GetExtension();
+
+ if (target->GetPropertyAsBool("AUTORCC"))
+ {
+ if (ext == "qrc"
+ && !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")))
+ {
+ std::string basename = cmsys::SystemTools::
+ GetFilenameWithoutLastExtension(absFile);
+
+ std::string rcc_output_dir = target->GetSupportDirectory();
+ cmSystemTools::MakeDirectory(rcc_output_dir.c_str());
+ std::string rcc_output_file = rcc_output_dir;
+ rcc_output_file += "/qrc_" + basename + ".cpp";
+ rcc_output.push_back(rcc_output_file);
+
+ if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED")))
+ {
+ if (qtMajorVersion == "5")
+ {
+ cmQtAutoGeneratorInitializer::ListQt5RccInputs(sf, target,
+ depends);
+ }
+ else
+ {
+ cmQtAutoGeneratorInitializer::ListQt4RccInputs(sf, depends);
+ }
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ // Cannot use PRE_BUILD because the resource files themselves
+ // may not be sources within the target so VS may not know the
+ // target needs to re-build at all.
+ usePRE_BUILD = false;
+#endif
+ }
+ }
+ }
+ }
+ }
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if(usePRE_BUILD)
+ {
+ // Add the pre-build command directly to bypass the OBJECT_LIBRARY
+ // rejection in cmMakefile::AddCustomCommandToTarget because we know
+ // PRE_BUILD will work for an OBJECT_LIBRARY in this specific case.
+ std::vector<std::string> no_output;
+ std::vector<std::string> no_byproducts;
+ cmCustomCommand cc(makefile, no_output, no_byproducts, depends,
+ commandLines, autogenComment.c_str(),
+ workingDirectory.c_str());
+ cc.SetEscapeOldStyle(false);
+ cc.SetEscapeAllowMakeVars(true);
+ target->AddPreBuildCommand(cc);
+ }
+ else
+#endif
+ {
+ cmTarget* autogenTarget = makefile->AddUtilityCommand(
+ autogenTargetName, true,
+ workingDirectory.c_str(),
+ /*byproducts=*/rcc_output, depends,
+ commandLines, false, autogenComment.c_str());
+
+ cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
+ makefile->AddGeneratorTarget(autogenTarget, gt);
+
+ // Set target folder
+ const char* autogenFolder = makefile->GetState()
+ ->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER");
+ if (!autogenFolder)
+ {
+ autogenFolder = makefile->GetState()
+ ->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER");
+ }
+ if (autogenFolder && *autogenFolder)
+ {
+ autogenTarget->SetProperty("FOLDER", autogenFolder);
+ }
+ else
+ {
+ // inherit FOLDER property from target (#13688)
+ copyTargetProperty(autogenTarget, target, "FOLDER");
+ }
+
+ target->AddUtility(autogenTargetName);
+ }
+}
+
+static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
+ const std::string& config,
+ std::string &incs,
+ std::string &defs)
+{
+ cmMakefile* makefile = target->GetMakefile();
+ cmGlobalGenerator* globalGen = makefile->GetGlobalGenerator();
+ std::vector<std::string> includeDirs;
+ cmGeneratorTarget *gtgt = globalGen->GetGeneratorTarget(target);
+ cmLocalGenerator *localGen = gtgt->GetLocalGenerator();
+ // Get the include dirs for this target, without stripping the implicit
+ // include dirs off, see http://public.kitware.com/Bug/view.php?id=13667
+ localGen->GetIncludeDirectories(includeDirs, gtgt, "CXX", config, false);
+
+ incs = cmJoin(includeDirs, ";");
+
+ std::set<std::string> defines;
+ localGen->AddCompileDefinitions(defines, target, config, "CXX");
+
+ defs += cmJoin(defines, ";");
+}
+
+void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
+ cmTarget const* target)
+{
+ cmMakefile* makefile = target->GetMakefile();
+
+ // forget the variables added here afterwards again:
+ cmMakefile::ScopePushPop varScope(makefile);
+ static_cast<void>(varScope);
+
+ // create a custom target for running generators at buildtime:
+ std::string autogenTargetName =
+ cmQtAutoGeneratorInitializer::GetAutogenTargetName(target);
+
+ makefile->AddDefinition("_moc_target_name",
+ cmOutputConverter::EscapeForCMake(autogenTargetName).c_str());
+ makefile->AddDefinition("_origin_target_name",
+ cmOutputConverter::EscapeForCMake(target->GetName()).c_str());
+
+ std::string targetDir =
+ cmQtAutoGeneratorInitializer::GetAutogenTargetDir(target);
+
+ const char *qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
+ if (!qtVersion)
+ {
+ qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
+ }
+ cmGeneratorTarget *gtgt = target->GetMakefile()
+ ->GetGlobalGenerator()
+ ->GetGeneratorTarget(target);
+ if (const char *targetQtVersion =
+ gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
+ {
+ qtVersion = targetQtVersion;
+ }
+ if (qtVersion)
+ {
+ makefile->AddDefinition("_target_qt_version", qtVersion);
+ }
+
+ std::vector<std::string> skipUic;
+ std::vector<std::string> skipMoc;
+ std::vector<std::string> mocSources;
+ std::vector<std::string> mocHeaders;
+ std::map<std::string, std::string> configIncludes;
+ std::map<std::string, std::string> configDefines;
+ std::map<std::string, std::string> configUicOptions;
+
+ if (target->GetPropertyAsBool("AUTOMOC")
+ || target->GetPropertyAsBool("AUTOUIC")
+ || target->GetPropertyAsBool("AUTORCC"))
+ {
+ cmQtAutoGeneratorInitializer::SetupSourceFiles(target, skipMoc,
+ mocSources, mocHeaders, skipUic);
+ }
+ makefile->AddDefinition("_cpp_files",
+ cmOutputConverter::EscapeForCMake(cmJoin(mocSources, ";")).c_str());
+ if (target->GetPropertyAsBool("AUTOMOC"))
+ {
+ cmQtAutoGeneratorInitializer::SetupAutoMocTarget(target, autogenTargetName,
+ skipMoc, mocHeaders,
+ configIncludes, configDefines);
+ }
+ if (target->GetPropertyAsBool("AUTOUIC"))
+ {
+ cmQtAutoGeneratorInitializer::SetupAutoUicTarget(target, skipUic,
+ configUicOptions);
+ }
+ if (target->GetPropertyAsBool("AUTORCC"))
+ {
+ cmQtAutoGeneratorInitializer::SetupAutoRccTarget(target);
+ }
+
+ const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
+ std::string inputFile = cmakeRoot;
+ inputFile += "/Modules/AutogenInfo.cmake.in";
+ std::string outputFile = targetDir;
+ outputFile += "/AutogenInfo.cmake";
+ makefile->AddDefinition("_qt_rcc_inputs",
+ makefile->GetDefinition("_qt_rcc_inputs_" + target->GetName()));
+ makefile->ConfigureFile(inputFile.c_str(), outputFile.c_str(),
+ false, true, false);
+
+ // Ensure we have write permission in case .in was read-only.
+ mode_t perm = 0;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ mode_t mode_write = S_IWRITE;
+#else
+ mode_t mode_write = S_IWUSR;
+#endif
+ cmSystemTools::GetPermissions(outputFile, perm);
+ if (!(perm & mode_write))
+ {
+ cmSystemTools::SetPermissions(outputFile, perm | mode_write);
+ }
+ if (!configDefines.empty()
+ || !configIncludes.empty()
+ || !configUicOptions.empty())
+ {
+ cmsys::ofstream infoFile(outputFile.c_str(), std::ios::app);
+ if ( !infoFile )
+ {
+ std::string error = "Internal CMake error when trying to open file: ";
+ error += outputFile.c_str();
+ error += " for writing.";
+ cmSystemTools::Error(error.c_str());
+ return;
+ }
+ if (!configDefines.empty())
+ {
+ for (std::map<std::string, std::string>::iterator
+ it = configDefines.begin(), end = configDefines.end();
+ it != end; ++it)
+ {
+ infoFile << "set(AM_MOC_COMPILE_DEFINITIONS_" << it->first <<
+ " " << it->second << ")\n";
+ }
+ }
+ if (!configIncludes.empty())
+ {
+ for (std::map<std::string, std::string>::iterator
+ it = configIncludes.begin(), end = configIncludes.end();
+ it != end; ++it)
+ {
+ infoFile << "set(AM_MOC_INCLUDES_" << it->first <<
+ " " << it->second << ")\n";
+ }
+ }
+ if (!configUicOptions.empty())
+ {
+ for (std::map<std::string, std::string>::iterator
+ it = configUicOptions.begin(), end = configUicOptions.end();
+ it != end; ++it)
+ {
+ infoFile << "set(AM_UIC_TARGET_OPTIONS_" << it->first <<
+ " " << it->second << ")\n";
+ }
+ }
+ }
+}
+
+void cmQtAutoGeneratorInitializer::SetupSourceFiles(cmTarget const* target,
+ std::vector<std::string>& skipMoc,
+ std::vector<std::string>& mocSources,
+ std::vector<std::string>& mocHeaders,
+ std::vector<std::string>& skipUic)
+{
+ cmMakefile* makefile = target->GetMakefile();
+
+ std::vector<cmSourceFile*> srcFiles;
+ cmGeneratorTarget *gtgt = target->GetMakefile()
+ ->GetGlobalGenerator()
+ ->GetGeneratorTarget(target);
+ gtgt->GetConfigCommonSourceFiles(srcFiles);
+
+ std::vector<std::string> newRccFiles;
+
+ for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
+ fileIt != srcFiles.end();
+ ++fileIt)
+ {
+ cmSourceFile* sf = *fileIt;
+ std::string absFile = cmsys::SystemTools::GetRealPath(
+ sf->GetFullPath());
+ bool skipFileForMoc =
+ cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
+ bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"));
+
+ if(cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC")))
+ {
+ skipUic.push_back(absFile);
+ }
+
+ std::string ext = sf->GetExtension();
+
+ if (target->GetPropertyAsBool("AUTORCC"))
+ {
+ if (ext == "qrc"
+ && !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")))
+ {
+ std::string basename = cmsys::SystemTools::
+ GetFilenameWithoutLastExtension(absFile);
+
+ std::string rcc_output_dir = target->GetSupportDirectory();
+ cmSystemTools::MakeDirectory(rcc_output_dir.c_str());
+ std::string rcc_output_file = rcc_output_dir;
+ rcc_output_file += "/qrc_" + basename + ".cpp";
+ makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
+ rcc_output_file.c_str(), false);
+ makefile->GetOrCreateSource(rcc_output_file, true);
+ newRccFiles.push_back(rcc_output_file);
+ }
+ }
+
+ if (!generated)
+ {
+ if (skipFileForMoc)
+ {
+ skipMoc.push_back(absFile);
+ }
+ else
+ {
+ cmSystemTools::FileFormat fileType = cmSystemTools::GetFileFormat(
+ ext.c_str());
+ if (fileType == cmSystemTools::CXX_FILE_FORMAT)
+ {
+ mocSources.push_back(absFile);
+ }
+ else if (fileType == cmSystemTools::HEADER_FILE_FORMAT)
+ {
+ mocHeaders.push_back(absFile);
+ }
+ }
+ }
+ }
+
+ for(std::vector<std::string>::const_iterator fileIt = newRccFiles.begin();
+ fileIt != newRccFiles.end();
+ ++fileIt)
+ {
+ const_cast<cmTarget*>(target)->AddSource(*fileIt);
+ }
+}
+
+void cmQtAutoGeneratorInitializer::SetupAutoMocTarget(cmTarget const* target,
+ const std::string &autogenTargetName,
+ std::vector<std::string> const& skipMoc,
+ std::vector<std::string> const& mocHeaders,
+ std::map<std::string, std::string> &configIncludes,
+ std::map<std::string, std::string> &configDefines)
+{
+ cmMakefile* makefile = target->GetMakefile();
+
+ const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
+ std::string _moc_options = (tmp!=0 ? tmp : "");
+ makefile->AddDefinition("_moc_options",
+ cmOutputConverter::EscapeForCMake(_moc_options).c_str());
+ makefile->AddDefinition("_skip_moc",
+ cmOutputConverter::EscapeForCMake(cmJoin(skipMoc, ";")).c_str());
+ makefile->AddDefinition("_moc_headers",
+ cmOutputConverter::EscapeForCMake(cmJoin(mocHeaders, ";")).c_str());
+ bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE");
+ makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE");
+
+ std::string _moc_incs;
+ std::string _moc_compile_defs;
+ std::vector<std::string> configs;
+ const std::string& config = makefile->GetConfigurations(configs);
+ GetCompileDefinitionsAndDirectories(target, config,
+ _moc_incs, _moc_compile_defs);
+
+ makefile->AddDefinition("_moc_incs",
+ cmOutputConverter::EscapeForCMake(_moc_incs).c_str());
+ makefile->AddDefinition("_moc_compile_defs",
+ cmOutputConverter::EscapeForCMake(_moc_compile_defs).c_str());
+
+ for (std::vector<std::string>::const_iterator li = configs.begin();
+ li != configs.end(); ++li)
+ {
+ std::string config_moc_incs;
+ std::string config_moc_compile_defs;
+ GetCompileDefinitionsAndDirectories(target, *li,
+ config_moc_incs,
+ config_moc_compile_defs);
+ if (config_moc_incs != _moc_incs)
+ {
+ configIncludes[*li] =
+ cmOutputConverter::EscapeForCMake(config_moc_incs);
+ if(_moc_incs.empty())
+ {
+ _moc_incs = config_moc_incs;
+ }
+ }
+ if (config_moc_compile_defs != _moc_compile_defs)
+ {
+ configDefines[*li] =
+ cmOutputConverter::EscapeForCMake(config_moc_compile_defs);
+ if(_moc_compile_defs.empty())
+ {
+ _moc_compile_defs = config_moc_compile_defs;
+ }
+ }
+ }
+
+ const char *qtVersion = makefile->GetDefinition("_target_qt_version");
+ if (strcmp(qtVersion, "5") == 0)
+ {
+ cmTarget *qt5Moc = makefile->FindTargetToUse("Qt5::moc");
+ if (!qt5Moc)
+ {
+ cmSystemTools::Error("Qt5::moc target not found ",
+ autogenTargetName.c_str());
+ return;
+ }
+ makefile->AddDefinition("_qt_moc_executable",
+ qt5Moc->ImportedGetLocation(""));
+ }
+ else if (strcmp(qtVersion, "4") == 0)
+ {
+ cmTarget *qt4Moc = makefile->FindTargetToUse("Qt4::moc");
+ if (!qt4Moc)
+ {
+ cmSystemTools::Error("Qt4::moc target not found ",
+ autogenTargetName.c_str());
+ return;
+ }
+ makefile->AddDefinition("_qt_moc_executable",
+ qt4Moc->ImportedGetLocation(""));
+ }
+ else
+ {
+ cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and "
+ "Qt 5 ", autogenTargetName.c_str());
+ }
+}
+
+static void GetUicOpts(cmTarget const* target, const std::string& config,
+ std::string &optString)
+{
+ cmGeneratorTarget *gtgt = target->GetMakefile()
+ ->GetGlobalGenerator()
+ ->GetGeneratorTarget(target);
+ std::vector<std::string> opts;
+ gtgt->GetAutoUicOptions(opts, config);
+ optString = cmJoin(opts, ";");
+}
+
+void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target,
+ std::vector<std::string> const& skipUic,
+ std::map<std::string, std::string> &configUicOptions)
+{
+ cmMakefile *makefile = target->GetMakefile();
+
+ std::set<std::string> skipped;
+ skipped.insert(skipUic.begin(), skipUic.end());
+
+ makefile->AddDefinition("_skip_uic",
+ cmOutputConverter::EscapeForCMake(cmJoin(skipUic, ";")).c_str());
+
+ std::vector<cmSourceFile*> uiFilesWithOptions
+ = makefile->GetQtUiFilesWithOptions();
+
+ const char *qtVersion = makefile->GetDefinition("_target_qt_version");
+
+ std::string _uic_opts;
+ std::vector<std::string> configs;
+ const std::string& config = makefile->GetConfigurations(configs);
+ GetUicOpts(target, config, _uic_opts);
+
+ if (!_uic_opts.empty())
+ {
+ _uic_opts = cmOutputConverter::EscapeForCMake(_uic_opts);
+ makefile->AddDefinition("_uic_target_options", _uic_opts.c_str());
+ }
+ for (std::vector<std::string>::const_iterator li = configs.begin();
+ li != configs.end(); ++li)
+ {
+ std::string config_uic_opts;
+ GetUicOpts(target, *li, config_uic_opts);
+ if (config_uic_opts != _uic_opts)
+ {
+ configUicOptions[*li] =
+ cmOutputConverter::EscapeForCMake(config_uic_opts);
+ if(_uic_opts.empty())
+ {
+ _uic_opts = config_uic_opts;
+ }
+ }
+ }
+
+ std::string uiFileFiles;
+ std::string uiFileOptions;
+ const char* sep = "";
+
+ for(std::vector<cmSourceFile*>::const_iterator fileIt =
+ uiFilesWithOptions.begin();
+ fileIt != uiFilesWithOptions.end();
+ ++fileIt)
+ {
+ cmSourceFile* sf = *fileIt;
+ std::string absFile = cmsys::SystemTools::GetRealPath(
+ sf->GetFullPath());
+
+ if (!skipped.insert(absFile).second)
+ {
+ continue;
+ }
+ uiFileFiles += sep;
+ uiFileFiles += absFile;
+ uiFileOptions += sep;
+ std::string opts = sf->GetProperty("AUTOUIC_OPTIONS");
+ cmSystemTools::ReplaceString(opts, ";", "@list_sep@");
+ uiFileOptions += opts;
+ sep = ";";
+ }
+
+ makefile->AddDefinition("_qt_uic_options_files",
+ cmOutputConverter::EscapeForCMake(uiFileFiles).c_str());
+ makefile->AddDefinition("_qt_uic_options_options",
+ cmOutputConverter::EscapeForCMake(uiFileOptions).c_str());
+
+ std::string targetName = target->GetName();
+ if (strcmp(qtVersion, "5") == 0)
+ {
+ cmTarget *qt5Uic = makefile->FindTargetToUse("Qt5::uic");
+ if (!qt5Uic)
+ {
+ // Project does not use Qt5Widgets, but has AUTOUIC ON anyway
+ }
+ else
+ {
+ makefile->AddDefinition("_qt_uic_executable",
+ qt5Uic->ImportedGetLocation(""));
+ }
+ }
+ else if (strcmp(qtVersion, "4") == 0)
+ {
+ cmTarget *qt4Uic = makefile->FindTargetToUse("Qt4::uic");
+ if (!qt4Uic)
+ {
+ cmSystemTools::Error("Qt4::uic target not found ",
+ targetName.c_str());
+ return;
+ }
+ makefile->AddDefinition("_qt_uic_executable",
+ qt4Uic->ImportedGetLocation(""));
+ }
+ else
+ {
+ cmSystemTools::Error("The CMAKE_AUTOUIC feature supports only Qt 4 and "
+ "Qt 5 ", targetName.c_str());
+ }
+}
+
+void cmQtAutoGeneratorInitializer::MergeRccOptions(
+ std::vector<std::string> &opts,
+ const std::vector<std::string> &fileOpts,
+ bool isQt5)
+{
+ static const char* valueOptions[] = {
+ "name",
+ "root",
+ "compress",
+ "threshold"
+ };
+ std::vector<std::string> extraOpts;
+ for(std::vector<std::string>::const_iterator it = fileOpts.begin();
+ it != fileOpts.end(); ++it)
+ {
+ std::vector<std::string>::iterator existingIt
+ = std::find(opts.begin(), opts.end(), *it);
+ if (existingIt != opts.end())
+ {
+ const char *o = it->c_str();
+ if (*o == '-')
+ {
+ ++o;
+ }
+ if (isQt5 && *o == '-')
+ {
+ ++o;
+ }
+ if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions),
+ cmStrCmp(*it)) != cmArrayEnd(valueOptions))
+ {
+ assert(existingIt + 1 != opts.end());
+ *(existingIt + 1) = *(it + 1);
+ ++it;
+ }
+ }
+ else
+ {
+ extraOpts.push_back(*it);
+ }
+ }
+ opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
+}
+
+void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target)
+{
+ std::string _rcc_files;
+ const char* sepRccFiles = "";
+ cmMakefile *makefile = target->GetMakefile();
+
+ std::vector<cmSourceFile*> srcFiles;
+ cmGeneratorTarget *gtgt = target->GetMakefile()
+ ->GetGlobalGenerator()
+ ->GetGeneratorTarget(target);
+ gtgt->GetConfigCommonSourceFiles(srcFiles);
+
+ std::string qrcInputs;
+ const char* qrcInputsSep = "";
+
+ std::string rccFileFiles;
+ std::string rccFileOptions;
+ const char *optionSep = "";
+
+ const char *qtVersion = makefile->GetDefinition("_target_qt_version");
+
+ std::vector<std::string> rccOptions;
+ if (const char* opts = target->GetProperty("AUTORCC_OPTIONS"))
+ {
+ cmSystemTools::ExpandListArgument(opts, rccOptions);
+ }
+ std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
+ if (qtMajorVersion == "")
+ {
+ qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
+ }
+
+ for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
+ fileIt != srcFiles.end();
+ ++fileIt)
+ {
+ cmSourceFile* sf = *fileIt;
+ std::string ext = sf->GetExtension();
+ if (ext == "qrc")
+ {
+ std::string absFile = cmsys::SystemTools::GetRealPath(
+ sf->GetFullPath());
+ bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"));
+
+ if (!skip)
+ {
+ _rcc_files += sepRccFiles;
+ _rcc_files += absFile;
+ sepRccFiles = ";";
+
+ if (const char *prop = sf->GetProperty("AUTORCC_OPTIONS"))
+ {
+ std::vector<std::string> optsVec;
+ cmSystemTools::ExpandListArgument(prop, optsVec);
+ cmQtAutoGeneratorInitializer::MergeRccOptions(rccOptions, optsVec,
+ strcmp(qtVersion, "5") == 0);
+ }
+
+ if (!rccOptions.empty())
+ {
+ rccFileFiles += optionSep;
+ rccFileFiles += absFile;
+ rccFileOptions += optionSep;
+ }
+ const char *listSep = "";
+ for(std::vector<std::string>::const_iterator it = rccOptions.begin();
+ it != rccOptions.end();
+ ++it)
+ {
+ rccFileOptions += listSep;
+ rccFileOptions += *it;
+ listSep = "@list_sep@";
+ }
+ optionSep = ";";
+
+ std::vector<std::string> depends;
+
+ std::string entriesList;
+ if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED")))
+ {
+ if (qtMajorVersion == "5")
+ {
+ entriesList = cmQtAutoGeneratorInitializer::ListQt5RccInputs(sf,
+ target,
+ depends);
+ }
+ else
+ {
+ entriesList =
+ cmQtAutoGeneratorInitializer::ListQt4RccInputs(sf, depends);
+ }
+ if (entriesList.empty())
+ {
+ return;
+ }
+ }
+ qrcInputs += qrcInputsSep;
+ qrcInputs += entriesList;
+ qrcInputsSep = ";";
+ }
+ }
+ }
+ makefile->AddDefinition("_qt_rcc_inputs_" + target->GetName(),
+ cmOutputConverter::EscapeForCMake(qrcInputs).c_str());
+
+ makefile->AddDefinition("_rcc_files",
+ cmOutputConverter::EscapeForCMake(_rcc_files).c_str());
+
+ makefile->AddDefinition("_qt_rcc_options_files",
+ cmOutputConverter::EscapeForCMake(rccFileFiles).c_str());
+ makefile->AddDefinition("_qt_rcc_options_options",
+ cmOutputConverter::EscapeForCMake(rccFileOptions).c_str());
+
+ makefile->AddDefinition("_qt_rcc_executable",
+ cmQtAutoGeneratorInitializer::GetRccExecutable(target).c_str());
+}
+
+std::string cmQtAutoGeneratorInitializer::GetRccExecutable(
+ cmTarget const* target)
+{
+ cmGeneratorTarget *gtgt = target->GetMakefile()
+ ->GetGlobalGenerator()
+ ->GetGeneratorTarget(target);
+ cmMakefile *makefile = target->GetMakefile();
+ const char *qtVersion = makefile->GetDefinition("_target_qt_version");
+ if (!qtVersion)
+ {
+ qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
+ if (!qtVersion)
+ {
+ qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
+ }
+ if (const char *targetQtVersion =
+ gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
+ {
+ qtVersion = targetQtVersion;
+ }
+ }
+
+ std::string targetName = target->GetName();
+ if (strcmp(qtVersion, "5") == 0)
+ {
+ cmTarget *qt5Rcc = makefile->FindTargetToUse("Qt5::rcc");
+ if (!qt5Rcc)
+ {
+ cmSystemTools::Error("Qt5::rcc target not found ",
+ targetName.c_str());
+ return std::string();
+ }
+ return qt5Rcc->ImportedGetLocation("");
+ }
+ else if (strcmp(qtVersion, "4") == 0)
+ {
+ cmTarget *qt4Rcc = makefile->FindTargetToUse("Qt4::rcc");
+ if (!qt4Rcc)
+ {
+ cmSystemTools::Error("Qt4::rcc target not found ",
+ targetName.c_str());
+ return std::string();
+ }
+ return qt4Rcc->ImportedGetLocation("");
+ }
+
+ cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and "
+ "Qt 5 ", targetName.c_str());
+ return std::string();
+}
diff --git a/Source/cmQtAutoGeneratorInitializer.h b/Source/cmQtAutoGeneratorInitializer.h
new file mode 100644
index 0000000..c22f172
--- /dev/null
+++ b/Source/cmQtAutoGeneratorInitializer.h
@@ -0,0 +1,67 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2004-2011 Kitware, Inc.
+ Copyright 2011 Alexander Neundorf (neundorf@kde.org)
+
+ 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 cmQtAutoGeneratorInitializer_h
+#define cmQtAutoGeneratorInitializer_h
+
+#include "cmStandardIncludes.h"
+
+#include <string>
+#include <vector>
+#include <map>
+
+class cmSourceFile;
+class cmTarget;
+class cmLocalGenerator;
+
+class cmQtAutoGeneratorInitializer
+{
+public:
+ static void InitializeAutogenSources(cmTarget* target);
+ static void InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target);
+ static void SetupAutoGenerateTarget(cmTarget const* target);
+
+ static std::string GetAutogenTargetName(cmTarget const* target);
+ static std::string GetAutogenTargetDir(cmTarget const* target);
+
+private:
+ static void SetupSourceFiles(cmTarget const* target,
+ std::vector<std::string>& skipMoc,
+ std::vector<std::string>& mocSources,
+ std::vector<std::string>& mocHeaders,
+ std::vector<std::string>& skipUic);
+
+ static void SetupAutoMocTarget(cmTarget const* target,
+ const std::string &autogenTargetName,
+ const std::vector<std::string>& skipMoc,
+ const std::vector<std::string>& mocHeaders,
+ std::map<std::string, std::string> &configIncludes,
+ std::map<std::string, std::string> &configDefines);
+ static void SetupAutoUicTarget(cmTarget const* target,
+ const std::vector<std::string>& skipUic,
+ std::map<std::string, std::string> &configUicOptions);
+ static void SetupAutoRccTarget(cmTarget const* target);
+
+ static void MergeRccOptions(std::vector<std::string> &opts,
+ const std::vector<std::string> &fileOpts, bool isQt5);
+
+ static std::string GetRccExecutable(cmTarget const* target);
+
+ static std::string ListQt5RccInputs(cmSourceFile* sf, cmTarget const* target,
+ std::vector<std::string>& depends);
+
+ static std::string ListQt4RccInputs(cmSourceFile* sf,
+ std::vector<std::string>& depends);
+};
+
+#endif
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index becfeba..bbeb3dc 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -12,17 +12,12 @@
============================================================================*/
#include "cmGlobalGenerator.h"
-#include "cmLocalGenerator.h"
+#include "cmOutputConverter.h"
#include "cmMakefile.h"
-#include "cmSourceFile.h"
#include "cmSystemTools.h"
#include "cmState.h"
#include "cmAlgorithms.h"
-#if defined(_WIN32) && !defined(__CYGWIN__)
-# include "cmGlobalVisualStudioGenerator.h"
-#endif
-
#include <sys/stat.h>
#include <cmsys/Terminal.h>
@@ -36,7 +31,6 @@
#include "cmQtAutoGenerators.h"
-
static bool requiresMocing(const std::string& text, std::string &macroName)
{
// this simple check is much much faster than the regexp
@@ -105,28 +99,6 @@ static std::string extractSubDir(const std::string& absPath,
return subDir;
}
-
-static void copyTargetProperty(cmTarget* destinationTarget,
- cmTarget* sourceTarget,
- const std::string& propertyName)
-{
- const char* propertyValue = sourceTarget->GetProperty(propertyName);
- if (propertyValue)
- {
- destinationTarget->SetProperty(propertyName, propertyValue);
- }
-}
-
-
-static std::string ReadAll(const std::string& filename)
-{
- cmsys::ifstream file(filename.c_str());
- std::stringstream stream;
- stream << file.rdbuf();
- file.close();
- return stream.str();
-}
-
cmQtAutoGenerators::cmQtAutoGenerators()
:Verbose(cmsys::SystemTools::GetEnv("VERBOSE") != 0)
,ColorOutput(true)
@@ -151,692 +123,6 @@ cmQtAutoGenerators::cmQtAutoGenerators()
}
}
-static std::string getAutogenTargetName(cmTarget const* target)
-{
- std::string autogenTargetName = target->GetName();
- autogenTargetName += "_automoc";
- return autogenTargetName;
-}
-
-static std::string getAutogenTargetDir(cmTarget const* target)
-{
- cmMakefile* makefile = target->GetMakefile();
- std::string targetDir = makefile->GetCurrentBinaryDirectory();
- targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory();
- targetDir += "/";
- targetDir += getAutogenTargetName(target);
- targetDir += ".dir/";
- return targetDir;
-}
-
-static std::string cmQtAutoGeneratorsStripCR(std::string const& line)
-{
- // Strip CR characters rcc may have printed (possibly more than one!).
- std::string::size_type cr = line.find('\r');
- if (cr != line.npos)
- {
- return line.substr(0, cr);
- }
- return line;
-}
-
-std::string cmQtAutoGenerators::ListQt5RccInputs(cmSourceFile* sf,
- cmTarget const* target,
- std::vector<std::string>& depends)
-{
- std::string rccCommand = this->GetRccExecutable(target);
- std::vector<std::string> qrcEntries;
-
- std::vector<std::string> command;
- command.push_back(rccCommand);
- command.push_back("-list");
-
- std::string absFile = cmsys::SystemTools::GetRealPath(
- sf->GetFullPath());
-
- command.push_back(absFile);
-
- std::string rccStdOut;
- std::string rccStdErr;
- int retVal = 0;
- bool result = cmSystemTools::RunSingleCommand(
- command, &rccStdOut, &rccStdErr,
- &retVal, 0, cmSystemTools::OUTPUT_NONE);
- if (!result || retVal)
- {
- std::cerr << "AUTOGEN: error: Rcc list process for " << sf->GetFullPath()
- << " failed:\n" << rccStdOut << "\n" << rccStdErr << std::endl;
- return std::string();
- }
-
- {
- std::istringstream ostr(rccStdOut);
- std::string oline;
- while(std::getline(ostr, oline))
- {
- oline = cmQtAutoGeneratorsStripCR(oline);
- if(!oline.empty())
- {
- qrcEntries.push_back(oline);
- }
- }
- }
-
- {
- std::istringstream estr(rccStdErr);
- std::string eline;
- while(std::getline(estr, eline))
- {
- eline = cmQtAutoGeneratorsStripCR(eline);
- if (cmHasLiteralPrefix(eline, "RCC: Error in"))
- {
- static std::string searchString = "Cannot find file '";
-
- std::string::size_type pos = eline.find(searchString);
- if (pos == std::string::npos)
- {
- std::cerr << "AUTOGEN: error: Rcc lists unparsable output "
- << eline << std::endl;
- return std::string();
- }
- pos += searchString.length();
- std::string::size_type sz = eline.size() - pos - 1;
- qrcEntries.push_back(eline.substr(pos, sz));
- }
- }
- }
-
- depends.insert(depends.end(), qrcEntries.begin(), qrcEntries.end());
- return cmJoin(qrcEntries, "@list_sep@");
-}
-
-std::string cmQtAutoGenerators::ListQt4RccInputs(cmSourceFile* sf,
- std::vector<std::string>& depends)
-{
- const std::string qrcContents = ReadAll(sf->GetFullPath());
-
- cmsys::RegularExpression fileMatchRegex("(<file[^<]+)");
-
- std::string entriesList;
- const char* sep = "";
-
- size_t offset = 0;
- while (fileMatchRegex.find(qrcContents.c_str() + offset))
- {
- std::string qrcEntry = fileMatchRegex.match(1);
-
- offset += qrcEntry.size();
-
- cmsys::RegularExpression fileReplaceRegex("(^<file[^>]*>)");
- fileReplaceRegex.find(qrcEntry);
- std::string tag = fileReplaceRegex.match(1);
-
- qrcEntry = qrcEntry.substr(tag.size());
-
- if (!cmSystemTools::FileIsFullPath(qrcEntry.c_str()))
- {
- qrcEntry = sf->GetLocation().GetDirectory() + "/" + qrcEntry;
- }
-
- entriesList += sep;
- entriesList += qrcEntry;
- sep = "@list_sep@";
- depends.push_back(qrcEntry);
- }
- return entriesList;
-}
-
-bool cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg,
- cmTarget* target)
-{
- cmMakefile* makefile = target->GetMakefile();
- // don't do anything if there is no Qt4 or Qt5Core (which contains moc):
- std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
- if (qtMajorVersion == "")
- {
- qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
- }
- if (qtMajorVersion != "4" && qtMajorVersion != "5")
- {
- return false;
- }
-
- if (target->GetPropertyAsBool("AUTOMOC"))
- {
- std::string automocTargetName = getAutogenTargetName(target);
- std::string mocCppFile = makefile->GetCurrentBinaryDirectory();
- mocCppFile += "/";
- mocCppFile += automocTargetName;
- mocCppFile += ".cpp";
- makefile->GetOrCreateSource(mocCppFile, true);
- makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
- mocCppFile.c_str(), false);
-
- target->AddSource(mocCppFile);
- }
- // create a custom target for running generators at buildtime:
- std::string autogenTargetName = getAutogenTargetName(target);
-
- std::string targetDir = getAutogenTargetDir(target);
-
- cmCustomCommandLine currentLine;
- currentLine.push_back(cmSystemTools::GetCMakeCommand());
- currentLine.push_back("-E");
- currentLine.push_back("cmake_autogen");
- currentLine.push_back(targetDir);
- currentLine.push_back("$<CONFIGURATION>");
-
- cmCustomCommandLines commandLines;
- commandLines.push_back(currentLine);
-
- std::string workingDirectory = cmSystemTools::CollapseFullPath(
- "", makefile->GetCurrentBinaryDirectory());
-
- std::vector<std::string> depends;
- if (const char *autogenDepends =
- target->GetProperty("AUTOGEN_TARGET_DEPENDS"))
- {
- cmSystemTools::ExpandListArgument(autogenDepends, depends);
- }
- std::vector<std::string> toolNames;
- if (target->GetPropertyAsBool("AUTOMOC"))
- {
- toolNames.push_back("moc");
- }
- if (target->GetPropertyAsBool("AUTOUIC"))
- {
- toolNames.push_back("uic");
- }
- if (target->GetPropertyAsBool("AUTORCC"))
- {
- toolNames.push_back("rcc");
- }
-
- std::string tools = toolNames[0];
- toolNames.erase(toolNames.begin());
- while (toolNames.size() > 1)
- {
- tools += ", " + toolNames[0];
- toolNames.erase(toolNames.begin());
- }
- if (toolNames.size() == 1)
- {
- tools += " and " + toolNames[0];
- }
- std::string autogenComment = "Automatic " + tools + " for target ";
- autogenComment += target->GetName();
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
- bool usePRE_BUILD = false;
- cmGlobalGenerator* gg = lg->GetGlobalGenerator();
- if(gg->GetName().find("Visual Studio") != std::string::npos)
- {
- cmGlobalVisualStudioGenerator* vsgg =
- static_cast<cmGlobalVisualStudioGenerator*>(gg);
- // Under VS >= 7 use a PRE_BUILD event instead of a separate target to
- // reduce the number of targets loaded into the IDE.
- // This also works around a VS 11 bug that may skip updating the target:
- // https://connect.microsoft.com/VisualStudio/feedback/details/769495
- usePRE_BUILD = vsgg->GetVersion() >= cmGlobalVisualStudioGenerator::VS7;
- if(usePRE_BUILD)
- {
- for (std::vector<std::string>::iterator it = depends.begin();
- it != depends.end(); ++it)
- {
- if(!makefile->FindTargetToUse(it->c_str()))
- {
- usePRE_BUILD = false;
- break;
- }
- }
- }
- }
-#endif
-
- std::vector<std::string> rcc_output;
- bool const isNinja =
- lg->GetGlobalGenerator()->GetName() == "Ninja";
- if(isNinja
-#if defined(_WIN32) && !defined(__CYGWIN__)
- || usePRE_BUILD
-#endif
- )
- {
- std::vector<cmSourceFile*> srcFiles;
- cmGeneratorTarget* gtgt =
- lg->GetGlobalGenerator()->GetGeneratorTarget(target);
- gtgt->GetConfigCommonSourceFiles(srcFiles);
- for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
- fileIt != srcFiles.end();
- ++fileIt)
- {
- cmSourceFile* sf = *fileIt;
- std::string absFile = cmsys::SystemTools::GetRealPath(
- sf->GetFullPath());
-
- std::string ext = sf->GetExtension();
-
- if (target->GetPropertyAsBool("AUTORCC"))
- {
- if (ext == "qrc"
- && !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")))
- {
- std::string basename = cmsys::SystemTools::
- GetFilenameWithoutLastExtension(absFile);
-
- std::string rcc_output_dir = target->GetSupportDirectory();
- cmSystemTools::MakeDirectory(rcc_output_dir.c_str());
- std::string rcc_output_file = rcc_output_dir;
- rcc_output_file += "/qrc_" + basename + ".cpp";
- rcc_output.push_back(rcc_output_file);
-
- if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED")))
- {
- if (qtMajorVersion == "5")
- {
- this->ListQt5RccInputs(sf, target, depends);
- }
- else
- {
- this->ListQt4RccInputs(sf, depends);
- }
-#if defined(_WIN32) && !defined(__CYGWIN__)
- // Cannot use PRE_BUILD because the resource files themselves
- // may not be sources within the target so VS may not know the
- // target needs to re-build at all.
- usePRE_BUILD = false;
-#endif
- }
- }
- }
- }
- }
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
- if(usePRE_BUILD)
- {
- // Add the pre-build command directly to bypass the OBJECT_LIBRARY
- // rejection in cmMakefile::AddCustomCommandToTarget because we know
- // PRE_BUILD will work for an OBJECT_LIBRARY in this specific case.
- std::vector<std::string> no_output;
- std::vector<std::string> no_byproducts;
- cmCustomCommand cc(makefile, no_output, no_byproducts, depends,
- commandLines, autogenComment.c_str(),
- workingDirectory.c_str());
- cc.SetEscapeOldStyle(false);
- cc.SetEscapeAllowMakeVars(true);
- target->AddPreBuildCommand(cc);
- }
- else
-#endif
- {
- cmTarget* autogenTarget = makefile->AddUtilityCommand(
- autogenTargetName, true,
- workingDirectory.c_str(),
- /*byproducts=*/rcc_output, depends,
- commandLines, false, autogenComment.c_str());
-
- cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
- makefile->AddGeneratorTarget(autogenTarget, gt);
-
- // Set target folder
- const char* autogenFolder = makefile->GetState()
- ->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER");
- if (!autogenFolder)
- {
- autogenFolder = makefile->GetState()
- ->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER");
- }
- if (autogenFolder && *autogenFolder)
- {
- autogenTarget->SetProperty("FOLDER", autogenFolder);
- }
- else
- {
- // inherit FOLDER property from target (#13688)
- copyTargetProperty(autogenTarget, target, "FOLDER");
- }
-
- target->AddUtility(autogenTargetName);
- }
-
- return true;
-}
-
-static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
- const std::string& config,
- std::string &incs,
- std::string &defs)
-{
- cmMakefile* makefile = target->GetMakefile();
- cmGlobalGenerator* globalGen = makefile->GetGlobalGenerator();
- std::vector<std::string> includeDirs;
- cmGeneratorTarget *gtgt = globalGen->GetGeneratorTarget(target);
- cmLocalGenerator *localGen = gtgt->GetLocalGenerator();
- // Get the include dirs for this target, without stripping the implicit
- // include dirs off, see http://public.kitware.com/Bug/view.php?id=13667
- localGen->GetIncludeDirectories(includeDirs, gtgt, "CXX", config, false);
-
- incs = cmJoin(includeDirs, ";");
-
- std::set<std::string> defines;
- localGen->AddCompileDefinitions(defines, target, config, "CXX");
-
- defs += cmJoin(defines, ";");
-}
-
-void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target)
-{
- cmMakefile* makefile = target->GetMakefile();
-
- // forget the variables added here afterwards again:
- cmMakefile::ScopePushPop varScope(makefile);
- static_cast<void>(varScope);
-
- // create a custom target for running generators at buildtime:
- std::string autogenTargetName = getAutogenTargetName(target);
-
- makefile->AddDefinition("_moc_target_name",
- cmOutputConverter::EscapeForCMake(autogenTargetName).c_str());
- makefile->AddDefinition("_origin_target_name",
- cmOutputConverter::EscapeForCMake(target->GetName()).c_str());
-
- std::string targetDir = getAutogenTargetDir(target);
-
- const char *qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
- if (!qtVersion)
- {
- qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
- }
- cmGeneratorTarget *gtgt = target->GetMakefile()
- ->GetGlobalGenerator()
- ->GetGeneratorTarget(target);
- if (const char *targetQtVersion =
- gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
- {
- qtVersion = targetQtVersion;
- }
- if (qtVersion)
- {
- makefile->AddDefinition("_target_qt_version", qtVersion);
- }
-
- std::map<std::string, std::string> configIncludes;
- std::map<std::string, std::string> configDefines;
- std::map<std::string, std::string> configUicOptions;
-
- if (target->GetPropertyAsBool("AUTOMOC")
- || target->GetPropertyAsBool("AUTOUIC")
- || target->GetPropertyAsBool("AUTORCC"))
- {
- this->SetupSourceFiles(target);
- }
- makefile->AddDefinition("_cpp_files",
- cmOutputConverter::EscapeForCMake(this->Sources).c_str());
- if (target->GetPropertyAsBool("AUTOMOC"))
- {
- this->SetupAutoMocTarget(target, autogenTargetName,
- configIncludes, configDefines);
- }
- if (target->GetPropertyAsBool("AUTOUIC"))
- {
- this->SetupAutoUicTarget(target, configUicOptions);
- }
- if (target->GetPropertyAsBool("AUTORCC"))
- {
- this->SetupAutoRccTarget(target);
- }
-
- const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
- std::string inputFile = cmakeRoot;
- inputFile += "/Modules/AutogenInfo.cmake.in";
- std::string outputFile = targetDir;
- outputFile += "/AutogenInfo.cmake";
- makefile->AddDefinition("_qt_rcc_inputs",
- makefile->GetDefinition("_qt_rcc_inputs_" + target->GetName()));
- makefile->ConfigureFile(inputFile.c_str(), outputFile.c_str(),
- false, true, false);
-
- // Ensure we have write permission in case .in was read-only.
- mode_t perm = 0;
-#if defined(_WIN32) && !defined(__CYGWIN__)
- mode_t mode_write = S_IWRITE;
-#else
- mode_t mode_write = S_IWUSR;
-#endif
- cmSystemTools::GetPermissions(outputFile, perm);
- if (!(perm & mode_write))
- {
- cmSystemTools::SetPermissions(outputFile, perm | mode_write);
- }
- if (!configDefines.empty()
- || !configIncludes.empty()
- || !configUicOptions.empty())
- {
- cmsys::ofstream infoFile(outputFile.c_str(), std::ios::app);
- if ( !infoFile )
- {
- std::string error = "Internal CMake error when trying to open file: ";
- error += outputFile.c_str();
- error += " for writing.";
- cmSystemTools::Error(error.c_str());
- return;
- }
- if (!configDefines.empty())
- {
- for (std::map<std::string, std::string>::iterator
- it = configDefines.begin(), end = configDefines.end();
- it != end; ++it)
- {
- infoFile << "set(AM_MOC_COMPILE_DEFINITIONS_" << it->first <<
- " " << it->second << ")\n";
- }
- }
- if (!configIncludes.empty())
- {
- for (std::map<std::string, std::string>::iterator
- it = configIncludes.begin(), end = configIncludes.end();
- it != end; ++it)
- {
- infoFile << "set(AM_MOC_INCLUDES_" << it->first <<
- " " << it->second << ")\n";
- }
- }
- if (!configUicOptions.empty())
- {
- for (std::map<std::string, std::string>::iterator
- it = configUicOptions.begin(), end = configUicOptions.end();
- it != end; ++it)
- {
- infoFile << "set(AM_UIC_TARGET_OPTIONS_" << it->first <<
- " " << it->second << ")\n";
- }
- }
- }
-}
-
-void cmQtAutoGenerators::SetupSourceFiles(cmTarget const* target)
-{
- cmMakefile* makefile = target->GetMakefile();
-
- const char* sepFiles = "";
- const char* sepHeaders = "";
-
- std::vector<cmSourceFile*> srcFiles;
- cmGeneratorTarget *gtgt = target->GetMakefile()
- ->GetGlobalGenerator()
- ->GetGeneratorTarget(target);
- gtgt->GetConfigCommonSourceFiles(srcFiles);
-
- const char *skipMocSep = "";
- const char *skipUicSep = "";
-
- std::vector<std::string> newRccFiles;
-
- for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
- fileIt != srcFiles.end();
- ++fileIt)
- {
- cmSourceFile* sf = *fileIt;
- std::string absFile = cmsys::SystemTools::GetRealPath(
- sf->GetFullPath());
- bool skipMoc = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
- bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"));
-
- if(cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC")))
- {
- this->SkipUic += skipUicSep;
- this->SkipUic += absFile;
- skipUicSep = ";";
- }
-
- std::string ext = sf->GetExtension();
-
- if (target->GetPropertyAsBool("AUTORCC"))
- {
- if (ext == "qrc"
- && !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")))
- {
- std::string basename = cmsys::SystemTools::
- GetFilenameWithoutLastExtension(absFile);
-
- std::string rcc_output_dir = target->GetSupportDirectory();
- cmSystemTools::MakeDirectory(rcc_output_dir.c_str());
- std::string rcc_output_file = rcc_output_dir;
- rcc_output_file += "/qrc_" + basename + ".cpp";
- makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
- rcc_output_file.c_str(), false);
- makefile->GetOrCreateSource(rcc_output_file, true);
- newRccFiles.push_back(rcc_output_file);
- }
- }
-
- if (!generated)
- {
- if (skipMoc)
- {
- this->SkipMoc += skipMocSep;
- this->SkipMoc += absFile;
- skipMocSep = ";";
- }
- else
- {
- cmSystemTools::FileFormat fileType = cmSystemTools::GetFileFormat(
- ext.c_str());
- if (fileType == cmSystemTools::CXX_FILE_FORMAT)
- {
- this->Sources += sepFiles;
- this->Sources += absFile;
- sepFiles = ";";
- }
- else if (fileType == cmSystemTools::HEADER_FILE_FORMAT)
- {
- this->Headers += sepHeaders;
- this->Headers += absFile;
- sepHeaders = ";";
- }
- }
- }
- }
-
- for(std::vector<std::string>::const_iterator fileIt = newRccFiles.begin();
- fileIt != newRccFiles.end();
- ++fileIt)
- {
- const_cast<cmTarget*>(target)->AddSource(*fileIt);
- }
-}
-
-void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
- const std::string &autogenTargetName,
- std::map<std::string, std::string> &configIncludes,
- std::map<std::string, std::string> &configDefines)
-{
- cmMakefile* makefile = target->GetMakefile();
-
- const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
- std::string _moc_options = (tmp!=0 ? tmp : "");
- makefile->AddDefinition("_moc_options",
- cmOutputConverter::EscapeForCMake(_moc_options).c_str());
- makefile->AddDefinition("_skip_moc",
- cmOutputConverter::EscapeForCMake(this->SkipMoc).c_str());
- makefile->AddDefinition("_moc_headers",
- cmOutputConverter::EscapeForCMake(this->Headers).c_str());
- bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE");
- makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE");
-
- std::string _moc_incs;
- std::string _moc_compile_defs;
- std::vector<std::string> configs;
- const std::string& config = makefile->GetConfigurations(configs);
- GetCompileDefinitionsAndDirectories(target, config,
- _moc_incs, _moc_compile_defs);
-
- makefile->AddDefinition("_moc_incs",
- cmOutputConverter::EscapeForCMake(_moc_incs).c_str());
- makefile->AddDefinition("_moc_compile_defs",
- cmOutputConverter::EscapeForCMake(_moc_compile_defs).c_str());
-
- for (std::vector<std::string>::const_iterator li = configs.begin();
- li != configs.end(); ++li)
- {
- std::string config_moc_incs;
- std::string config_moc_compile_defs;
- GetCompileDefinitionsAndDirectories(target, *li,
- config_moc_incs,
- config_moc_compile_defs);
- if (config_moc_incs != _moc_incs)
- {
- configIncludes[*li] =
- cmOutputConverter::EscapeForCMake(config_moc_incs);
- if(_moc_incs.empty())
- {
- _moc_incs = config_moc_incs;
- }
- }
- if (config_moc_compile_defs != _moc_compile_defs)
- {
- configDefines[*li] =
- cmOutputConverter::EscapeForCMake(config_moc_compile_defs);
- if(_moc_compile_defs.empty())
- {
- _moc_compile_defs = config_moc_compile_defs;
- }
- }
- }
-
- const char *qtVersion = makefile->GetDefinition("_target_qt_version");
- if (strcmp(qtVersion, "5") == 0)
- {
- cmTarget *qt5Moc = makefile->FindTargetToUse("Qt5::moc");
- if (!qt5Moc)
- {
- cmSystemTools::Error("Qt5::moc target not found ",
- autogenTargetName.c_str());
- return;
- }
- makefile->AddDefinition("_qt_moc_executable",
- qt5Moc->ImportedGetLocation(""));
- }
- else if (strcmp(qtVersion, "4") == 0)
- {
- cmTarget *qt4Moc = makefile->FindTargetToUse("Qt4::moc");
- if (!qt4Moc)
- {
- cmSystemTools::Error("Qt4::moc target not found ",
- autogenTargetName.c_str());
- return;
- }
- makefile->AddDefinition("_qt_moc_executable",
- qt4Moc->ImportedGetLocation(""));
- }
- else
- {
- cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and "
- "Qt 5 ", autogenTargetName.c_str());
- }
-}
-
void cmQtAutoGenerators::MergeUicOptions(std::vector<std::string> &opts,
const std::vector<std::string> &fileOpts,
bool isQt5)
@@ -882,332 +168,6 @@ void cmQtAutoGenerators::MergeUicOptions(std::vector<std::string> &opts,
opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
}
-static void GetUicOpts(cmTarget const* target, const std::string& config,
- std::string &optString)
-{
- cmGeneratorTarget *gtgt = target->GetMakefile()
- ->GetGlobalGenerator()
- ->GetGeneratorTarget(target);
- std::vector<std::string> opts;
- gtgt->GetAutoUicOptions(opts, config);
- optString = cmJoin(opts, ";");
-}
-
-void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
- std::map<std::string, std::string> &configUicOptions)
-{
- cmMakefile *makefile = target->GetMakefile();
-
- std::set<std::string> skipped;
- std::vector<std::string> skipVec;
- cmSystemTools::ExpandListArgument(this->SkipUic, skipVec);
- skipped.insert(skipVec.begin(), skipVec.end());
-
- makefile->AddDefinition("_skip_uic",
- cmOutputConverter::EscapeForCMake(this->SkipUic).c_str());
-
- std::vector<cmSourceFile*> uiFilesWithOptions
- = makefile->GetQtUiFilesWithOptions();
-
- const char *qtVersion = makefile->GetDefinition("_target_qt_version");
-
- std::string _uic_opts;
- std::vector<std::string> configs;
- const std::string& config = makefile->GetConfigurations(configs);
- GetUicOpts(target, config, _uic_opts);
-
- if (!_uic_opts.empty())
- {
- _uic_opts = cmOutputConverter::EscapeForCMake(_uic_opts);
- makefile->AddDefinition("_uic_target_options", _uic_opts.c_str());
- }
- for (std::vector<std::string>::const_iterator li = configs.begin();
- li != configs.end(); ++li)
- {
- std::string config_uic_opts;
- GetUicOpts(target, *li, config_uic_opts);
- if (config_uic_opts != _uic_opts)
- {
- configUicOptions[*li] =
- cmOutputConverter::EscapeForCMake(config_uic_opts);
- if(_uic_opts.empty())
- {
- _uic_opts = config_uic_opts;
- }
- }
- }
-
- std::string uiFileFiles;
- std::string uiFileOptions;
- const char* sep = "";
-
- for(std::vector<cmSourceFile*>::const_iterator fileIt =
- uiFilesWithOptions.begin();
- fileIt != uiFilesWithOptions.end();
- ++fileIt)
- {
- cmSourceFile* sf = *fileIt;
- std::string absFile = cmsys::SystemTools::GetRealPath(
- sf->GetFullPath());
-
- if (!skipped.insert(absFile).second)
- {
- continue;
- }
- uiFileFiles += sep;
- uiFileFiles += absFile;
- uiFileOptions += sep;
- std::string opts = sf->GetProperty("AUTOUIC_OPTIONS");
- cmSystemTools::ReplaceString(opts, ";", "@list_sep@");
- uiFileOptions += opts;
- sep = ";";
- }
-
- makefile->AddDefinition("_qt_uic_options_files",
- cmOutputConverter::EscapeForCMake(uiFileFiles).c_str());
- makefile->AddDefinition("_qt_uic_options_options",
- cmOutputConverter::EscapeForCMake(uiFileOptions).c_str());
-
- std::string targetName = target->GetName();
- if (strcmp(qtVersion, "5") == 0)
- {
- cmTarget *qt5Uic = makefile->FindTargetToUse("Qt5::uic");
- if (!qt5Uic)
- {
- // Project does not use Qt5Widgets, but has AUTOUIC ON anyway
- }
- else
- {
- makefile->AddDefinition("_qt_uic_executable",
- qt5Uic->ImportedGetLocation(""));
- }
- }
- else if (strcmp(qtVersion, "4") == 0)
- {
- cmTarget *qt4Uic = makefile->FindTargetToUse("Qt4::uic");
- if (!qt4Uic)
- {
- cmSystemTools::Error("Qt4::uic target not found ",
- targetName.c_str());
- return;
- }
- makefile->AddDefinition("_qt_uic_executable",
- qt4Uic->ImportedGetLocation(""));
- }
- else
- {
- cmSystemTools::Error("The CMAKE_AUTOUIC feature supports only Qt 4 and "
- "Qt 5 ", targetName.c_str());
- }
-}
-
-void cmQtAutoGenerators::MergeRccOptions(std::vector<std::string> &opts,
- const std::vector<std::string> &fileOpts,
- bool isQt5)
-{
- static const char* valueOptions[] = {
- "name",
- "root",
- "compress",
- "threshold"
- };
- std::vector<std::string> extraOpts;
- for(std::vector<std::string>::const_iterator it = fileOpts.begin();
- it != fileOpts.end(); ++it)
- {
- std::vector<std::string>::iterator existingIt
- = std::find(opts.begin(), opts.end(), *it);
- if (existingIt != opts.end())
- {
- const char *o = it->c_str();
- if (*o == '-')
- {
- ++o;
- }
- if (isQt5 && *o == '-')
- {
- ++o;
- }
- if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions),
- cmStrCmp(*it)) != cmArrayEnd(valueOptions))
- {
- assert(existingIt + 1 != opts.end());
- *(existingIt + 1) = *(it + 1);
- ++it;
- }
- }
- else
- {
- extraOpts.push_back(*it);
- }
- }
- opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
-}
-
-void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
-{
- std::string _rcc_files;
- const char* sepRccFiles = "";
- cmMakefile *makefile = target->GetMakefile();
-
- std::vector<cmSourceFile*> srcFiles;
- cmGeneratorTarget *gtgt = target->GetMakefile()
- ->GetGlobalGenerator()
- ->GetGeneratorTarget(target);
- gtgt->GetConfigCommonSourceFiles(srcFiles);
-
- std::string qrcInputs;
- const char* qrcInputsSep = "";
-
- std::string rccFileFiles;
- std::string rccFileOptions;
- const char *optionSep = "";
-
- const char *qtVersion = makefile->GetDefinition("_target_qt_version");
-
- std::vector<std::string> rccOptions;
- if (const char* opts = target->GetProperty("AUTORCC_OPTIONS"))
- {
- cmSystemTools::ExpandListArgument(opts, rccOptions);
- }
- std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
- if (qtMajorVersion == "")
- {
- qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
- }
-
- for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
- fileIt != srcFiles.end();
- ++fileIt)
- {
- cmSourceFile* sf = *fileIt;
- std::string ext = sf->GetExtension();
- if (ext == "qrc")
- {
- std::string absFile = cmsys::SystemTools::GetRealPath(
- sf->GetFullPath());
- bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"));
-
- if (!skip)
- {
- _rcc_files += sepRccFiles;
- _rcc_files += absFile;
- sepRccFiles = ";";
-
- if (const char *prop = sf->GetProperty("AUTORCC_OPTIONS"))
- {
- std::vector<std::string> optsVec;
- cmSystemTools::ExpandListArgument(prop, optsVec);
- this->MergeRccOptions(rccOptions, optsVec,
- strcmp(qtVersion, "5") == 0);
- }
-
- if (!rccOptions.empty())
- {
- rccFileFiles += optionSep;
- rccFileFiles += absFile;
- rccFileOptions += optionSep;
- }
- const char *listSep = "";
- for(std::vector<std::string>::const_iterator it = rccOptions.begin();
- it != rccOptions.end();
- ++it)
- {
- rccFileOptions += listSep;
- rccFileOptions += *it;
- listSep = "@list_sep@";
- }
- optionSep = ";";
-
- std::vector<std::string> depends;
-
- std::string entriesList;
- if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED")))
- {
- if (qtMajorVersion == "5")
- {
- entriesList = this->ListQt5RccInputs(sf, target, depends);
- }
- else
- {
- entriesList = this->ListQt4RccInputs(sf, depends);
- }
- if (entriesList.empty())
- {
- return;
- }
- }
- qrcInputs += qrcInputsSep;
- qrcInputs += entriesList;
- qrcInputsSep = ";";
- }
- }
- }
- makefile->AddDefinition("_qt_rcc_inputs_" + target->GetName(),
- cmOutputConverter::EscapeForCMake(qrcInputs).c_str());
-
- makefile->AddDefinition("_rcc_files",
- cmOutputConverter::EscapeForCMake(_rcc_files).c_str());
-
- makefile->AddDefinition("_qt_rcc_options_files",
- cmOutputConverter::EscapeForCMake(rccFileFiles).c_str());
- makefile->AddDefinition("_qt_rcc_options_options",
- cmOutputConverter::EscapeForCMake(rccFileOptions).c_str());
-
- makefile->AddDefinition("_qt_rcc_executable",
- this->GetRccExecutable(target).c_str());
-}
-
-std::string cmQtAutoGenerators::GetRccExecutable(cmTarget const* target)
-{
- cmGeneratorTarget *gtgt = target->GetMakefile()
- ->GetGlobalGenerator()
- ->GetGeneratorTarget(target);
- cmMakefile *makefile = target->GetMakefile();
- const char *qtVersion = makefile->GetDefinition("_target_qt_version");
- if (!qtVersion)
- {
- qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
- if (!qtVersion)
- {
- qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
- }
- if (const char *targetQtVersion =
- gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
- {
- qtVersion = targetQtVersion;
- }
- }
-
- std::string targetName = target->GetName();
- if (strcmp(qtVersion, "5") == 0)
- {
- cmTarget *qt5Rcc = makefile->FindTargetToUse("Qt5::rcc");
- if (!qt5Rcc)
- {
- cmSystemTools::Error("Qt5::rcc target not found ",
- targetName.c_str());
- return std::string();
- }
- return qt5Rcc->ImportedGetLocation("");
- }
- else if (strcmp(qtVersion, "4") == 0)
- {
- cmTarget *qt4Rcc = makefile->FindTargetToUse("Qt4::rcc");
- if (!qt4Rcc)
- {
- cmSystemTools::Error("Qt4::rcc target not found ",
- targetName.c_str());
- return std::string();
- }
- return qt4Rcc->ImportedGetLocation("");
- }
-
- cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and "
- "Qt 5 ", targetName.c_str());
- return std::string();
-}
-
bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
const std::string& config)
{
@@ -1219,19 +179,18 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
cmState::Snapshot snapshot = cm.GetCurrentSnapshot();
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, snapshot));
- cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator(mf.get()));
- lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory);
- lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory);
- gg.SetCurrentMakefile(lg->GetMakefile());
+ mf->SetCurrentBinaryDirectory(targetDirectory);
+ mf->SetCurrentSourceDirectory(targetDirectory);
+ gg.SetCurrentMakefile(mf.get());
- this->ReadAutogenInfoFile(lg->GetMakefile(), targetDirectory, config);
- this->ReadOldMocDefinitionsFile(lg->GetMakefile(), targetDirectory);
+ this->ReadAutogenInfoFile(mf.get(), targetDirectory, config);
+ this->ReadOldMocDefinitionsFile(mf.get(), targetDirectory);
this->Init();
if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5")
{
- success = this->RunAutogen(lg->GetMakefile());
+ success = this->RunAutogen(mf.get());
}
this->WriteOldMocDefinitionsFile(targetDirectory);
@@ -1533,6 +492,14 @@ void cmQtAutoGenerators::Init()
}
+static std::string ReadAll(const std::string& filename)
+{
+ cmsys::ifstream file(filename.c_str());
+ std::stringstream stream;
+ stream << file.rdbuf();
+ file.close();
+ return stream.str();
+}
bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
{
@@ -2251,7 +1218,8 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName,
{
std::vector<std::string> fileOpts;
cmSystemTools::ExpandListArgument(optionIt->second, fileOpts);
- this->MergeUicOptions(opts, fileOpts, this->QtMajorVersion == "5");
+ cmQtAutoGenerators::MergeUicOptions(opts, fileOpts,
+ this->QtMajorVersion == "5");
}
command.insert(command.end(), opts.begin(), opts.end());
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 4f03348..ab7b6ed 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -15,10 +15,11 @@
#define cmQtAutoGenerators_h
#include <list>
+#include <vector>
+#include <string>
+#include <map>
-class cmGlobalGenerator;
class cmMakefile;
-class cmLocalGenerator;
class cmQtAutoGenerators
{
@@ -26,18 +27,7 @@ public:
cmQtAutoGenerators();
bool Run(const std::string& targetDirectory, const std::string& config);
- bool InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target);
- void SetupAutoGenerateTarget(cmTarget const* target);
- void SetupSourceFiles(cmTarget const* target);
-
private:
- void SetupAutoMocTarget(cmTarget const* target,
- const std::string &autogenTargetName,
- std::map<std::string, std::string> &configIncludes,
- std::map<std::string, std::string> &configDefines);
- void SetupAutoUicTarget(cmTarget const* target,
- std::map<std::string, std::string> &configUicOptions);
- void SetupAutoRccTarget(cmTarget const* target);
bool ReadAutogenInfoFile(cmMakefile* makefile,
const std::string& targetDirectory,
@@ -83,20 +73,9 @@ private:
bool EndsWith(const std::string& str, const std::string& with);
bool StartsWith(const std::string& str, const std::string& with);
- void MergeUicOptions(std::vector<std::string> &opts,
- const std::vector<std::string> &fileOpts, bool isQt5);
-
- void MergeRccOptions(std::vector<std::string> &opts,
+ static void MergeUicOptions(std::vector<std::string> &opts,
const std::vector<std::string> &fileOpts, bool isQt5);
- std::string GetRccExecutable(cmTarget const* target);
-
- std::string ListQt5RccInputs(cmSourceFile* sf, cmTarget const* target,
- std::vector<std::string>& depends);
-
- std::string ListQt4RccInputs(cmSourceFile* sf,
- std::vector<std::string>& depends);
-
bool InputFilesNewerThanQrc(const std::string& qrcFile,
const std::string& rccOutput);
diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h
index 94161f8..410b370 100644
--- a/Source/cmRemoveCommand.h
+++ b/Source/cmRemoveCommand.h
@@ -47,12 +47,6 @@ public:
*/
virtual std::string GetName() const {return "remove";}
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
cmTypeMacro(cmRemoveCommand, cmCommand);
};
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 306276b..1d70ad6 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -48,7 +48,7 @@ bool cmSetCommand
return true;
}
- // if it will be cleared, then clear it if it isn;t already clear
+ // if it will be cleared, then clear it if it isn't already clear
if (currValue)
{
cmSystemTools::PutEnv(putEnvArg);
@@ -59,7 +59,7 @@ bool cmSetCommand
// SET (VAR) // Removes the definition of VAR.
if (args.size() == 1)
{
- this->Makefile->RemoveDefinition(args[0]);
+ this->Makefile->RemoveDefinition(variable);
return true;
}
// SET (VAR PARENT_SCOPE) // Removes the definition of VAR
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index b30c10b..ce9ff32 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -1067,7 +1067,8 @@ cmState::Snapshot cmState::Snapshot::GetBuildsystemDirectoryParent() const
PositionType parentPos = this->Position->DirectoryParent;
if (parentPos != this->State->SnapshotData.Root())
{
- snapshot = Snapshot(this->State, parentPos);
+ snapshot = Snapshot(this->State,
+ parentPos->BuildSystemDirectory->DirectoryEnd);
}
return snapshot;
@@ -1376,11 +1377,16 @@ cmBacktraceRange GetPropertyBacktraces(T const& content,
template <typename T, typename U, typename V>
void AppendEntry(T& content, U& backtraces, V& endContentPosition,
- const std::string& vec, const cmListFileBacktrace& lfbt)
+ const std::string& value, const cmListFileBacktrace& lfbt)
{
+ if (value.empty())
+ {
+ return;
+ }
+
assert(endContentPosition == content.size());
- content.push_back(vec);
+ content.push_back(value);
backtraces.push_back(lfbt);
endContentPosition = content.size();
diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h
index 6addd8f..bcefd2c 100644
--- a/Source/cmSubdirCommand.h
+++ b/Source/cmSubdirCommand.h
@@ -44,12 +44,6 @@ public:
*/
virtual std::string GetName() const { return "subdirs";}
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
cmTypeMacro(cmSubdirCommand, cmCommand);
};
diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h
index 75a5685..3f3507e 100644
--- a/Source/cmSubdirDependsCommand.h
+++ b/Source/cmSubdirDependsCommand.h
@@ -21,7 +21,6 @@ public:
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
virtual std::string GetName() const { return "subdir_depends";}
- virtual bool IsDiscouraged() const { return true; }
cmTypeMacro(cmSubdirDependsCommand, cmCommand);
};
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 65bfe79..2c5aa8a 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -68,6 +68,11 @@
# include "cmMachO.h"
#endif
+static bool cm_isspace(char c)
+{
+ return ((c & 0x80) == 0) && isspace(c);
+}
+
class cmSystemToolsFileTime
{
public:
@@ -228,13 +233,13 @@ std::string cmSystemTools::HelpFileName(std::string name)
std::string cmSystemTools::TrimWhitespace(const std::string& s)
{
std::string::const_iterator start = s.begin();
- while(start != s.end() && *start <= ' ')
+ while (start != s.end() && cm_isspace(*start))
++start;
if (start == s.end())
return "";
std::string::const_iterator stop = s.end()-1;
- while(*stop <= ' ')
+ while (cm_isspace(*stop))
--stop;
return std::string(start, stop+1);
}
@@ -496,7 +501,7 @@ void cmSystemTools::ParseWindowsCommandLine(const char* command,
{
arg.append(backslashes, '\\');
backslashes = 0;
- if(((*c & 0x80) == 0 ) && isspace(*c))
+ if (cm_isspace(*c))
{
if(in_quotes)
{
@@ -1018,7 +1023,7 @@ std::string cmSystemTools::ComputeCertificateThumbprint(
{
std::string thumbprint;
-#ifdef _WIN32
+#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32)
BYTE* certData = NULL;
CRYPT_INTEGER_BLOB cryptBlob;
HCERTSTORE certStore = NULL;
@@ -2040,10 +2045,11 @@ bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile)
cmSystemToolsWindowsHandle hFrom =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fromFile).c_str(),
GENERIC_READ, FILE_SHARE_READ, 0,
- OPEN_EXISTING, 0, 0);
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
cmSystemToolsWindowsHandle hTo =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(toFile).c_str(),
- GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
+ FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, 0);
if(!hFrom || !hTo)
{
return false;
@@ -2095,7 +2101,8 @@ bool cmSystemTools::FileTimeGet(const char* fname, cmSystemToolsFileTime* t)
#if defined(_WIN32) && !defined(__CYGWIN__)
cmSystemToolsWindowsHandle h =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(),
- GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
+ GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, 0);
if(!h)
{
return false;
@@ -2122,7 +2129,8 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t)
#if defined(_WIN32) && !defined(__CYGWIN__)
cmSystemToolsWindowsHandle h =
CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(),
- GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
+ FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, 0);
if(!h)
{
return false;
@@ -2211,6 +2219,7 @@ static std::string cmSystemToolsCTestCommand;
static std::string cmSystemToolsCPackCommand;
static std::string cmSystemToolsCMakeCursesCommand;
static std::string cmSystemToolsCMakeGUICommand;
+static std::string cmSystemToolsCMClDepsCommand;
static std::string cmSystemToolsCMakeRoot;
void cmSystemTools::FindCMakeResources(const char* argv0)
{
@@ -2303,6 +2312,13 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
{
cmSystemToolsCMakeCursesCommand = "";
}
+ cmSystemToolsCMClDepsCommand = exe_dir;
+ cmSystemToolsCMClDepsCommand += "/cmcldeps";
+ cmSystemToolsCMClDepsCommand += cmSystemTools::GetExecutableExtension();
+ if(!cmSystemTools::FileExists(cmSystemToolsCMClDepsCommand.c_str()))
+ {
+ cmSystemToolsCMClDepsCommand = "";
+ }
#ifdef CMAKE_BUILD_WITH_CMAKE
// Install tree has "<prefix>/bin/cmake" and "<prefix><CMAKE_DATA_DIR>".
@@ -2370,6 +2386,12 @@ std::string const& cmSystemTools::GetCMakeGUICommand()
}
//----------------------------------------------------------------------------
+std::string const& cmSystemTools::GetCMClDepsCommand()
+{
+ return cmSystemToolsCMClDepsCommand;
+}
+
+//----------------------------------------------------------------------------
std::string const& cmSystemTools::GetCMakeRoot()
{
return cmSystemToolsCMakeRoot;
@@ -2755,6 +2777,14 @@ bool cmSystemTools::VersionCompare(cmSystemTools::CompareOp op,
}
//----------------------------------------------------------------------------
+bool cmSystemTools::VersionCompareGreater(std::string const& lhs,
+ std::string const& rhs)
+{
+ return cmSystemTools::VersionCompare(
+ cmSystemTools::OP_GREATER, lhs.c_str(), rhs.c_str());
+}
+
+//----------------------------------------------------------------------------
bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
bool* removed)
{
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index d14897f..b6b0978 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -294,6 +294,8 @@ public:
* Compare versions
*/
static bool VersionCompare(CompareOp op, const char* lhs, const char* rhs);
+ static bool VersionCompareGreater(std::string const& lhs,
+ std::string const& rhs);
/**
* Determine the file type based on the extension
@@ -426,6 +428,7 @@ public:
static std::string const& GetCMakeCommand();
static std::string const& GetCMakeGUICommand();
static std::string const& GetCMakeCursesCommand();
+ static std::string const& GetCMClDepsCommand();
static std::string const& GetCMakeRoot();
/** Echo a message in color using KWSys's Terminal cprintf. */
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 590654d..bb44956 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -347,6 +347,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
{
this->SetPropertyDefault("ANDROID_GUI", 0);
this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", 0);
+ this->SetPropertyDefault("ENABLE_EXPORTS", 0);
}
if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY
|| this->TargetTypeValue == cmTarget::MODULE_LIBRARY)
@@ -636,7 +637,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
{
assert(this->GetType() != INTERFACE_LIBRARY);
- if (!this->Makefile->IsConfigured())
+ if (!this->GetMakefile()->GetGlobalGenerator()->GetConfigureDoneCMP0026())
{
// At configure-time, this method can be called as part of getting the
// LOCATION property or to export() a file to be include()d. However
@@ -682,7 +683,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
"SOURCES")
!= debugProperties.end();
- if (this->Makefile->IsConfigured())
+ if (this->GetMakefile()->GetGlobalGenerator()->GetConfigureDoneCMP0026())
{
this->DebugSourcesDone = true;
}
@@ -1601,33 +1602,45 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
{
this->Internal->IncludeDirectoriesEntries.clear();
this->Internal->IncludeDirectoriesBacktraces.clear();
- this->Internal->IncludeDirectoriesEntries.push_back(value);
- cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->IncludeDirectoriesBacktraces.push_back(lfbt);
+ if (value)
+ {
+ this->Internal->IncludeDirectoriesEntries.push_back(value);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ this->Internal->IncludeDirectoriesBacktraces.push_back(lfbt);
+ }
}
else if(prop == "COMPILE_OPTIONS")
{
this->Internal->CompileOptionsEntries.clear();
this->Internal->CompileOptionsBacktraces.clear();
- this->Internal->CompileOptionsEntries.push_back(value);
- cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->CompileOptionsBacktraces.push_back(lfbt);
+ if (value)
+ {
+ this->Internal->CompileOptionsEntries.push_back(value);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ this->Internal->CompileOptionsBacktraces.push_back(lfbt);
+ }
}
else if(prop == "COMPILE_FEATURES")
{
this->Internal->CompileFeaturesEntries.clear();
this->Internal->CompileFeaturesBacktraces.clear();
- this->Internal->CompileFeaturesEntries.push_back(value);
- cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->CompileFeaturesBacktraces.push_back(lfbt);
+ if (value)
+ {
+ this->Internal->CompileFeaturesEntries.push_back(value);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ this->Internal->CompileFeaturesBacktraces.push_back(lfbt);
+ }
}
else if(prop == "COMPILE_DEFINITIONS")
{
this->Internal->CompileDefinitionsEntries.clear();
this->Internal->CompileDefinitionsBacktraces.clear();
- this->Internal->CompileDefinitionsEntries.push_back(value);
- cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
+ if (value)
+ {
+ this->Internal->CompileDefinitionsEntries.push_back(value);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
+ }
}
else if(prop == "EXPORT_NAME" && this->IsImported())
{
@@ -1659,6 +1672,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
this->Internal->SourceFilesMap.clear();
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt);
+ cmDeleteAll(this->Internal->SourceEntries);
this->Internal->SourceEntries.clear();
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->SourceEntries.push_back(
@@ -1693,27 +1707,39 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if(prop == "INCLUDE_DIRECTORIES")
{
- this->Internal->IncludeDirectoriesEntries.push_back(value);
- cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->IncludeDirectoriesBacktraces.push_back(lfbt);
+ if (value && *value)
+ {
+ this->Internal->IncludeDirectoriesEntries.push_back(value);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ this->Internal->IncludeDirectoriesBacktraces.push_back(lfbt);
+ }
}
else if(prop == "COMPILE_OPTIONS")
{
- this->Internal->CompileOptionsEntries.push_back(value);
- cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->CompileOptionsBacktraces.push_back(lfbt);
+ if (value && *value)
+ {
+ this->Internal->CompileOptionsEntries.push_back(value);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ this->Internal->CompileOptionsBacktraces.push_back(lfbt);
+ }
}
else if(prop == "COMPILE_FEATURES")
{
- this->Internal->CompileFeaturesEntries.push_back(value);
- cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->CompileFeaturesBacktraces.push_back(lfbt);
+ if (value && *value)
+ {
+ this->Internal->CompileFeaturesEntries.push_back(value);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ this->Internal->CompileFeaturesBacktraces.push_back(lfbt);
+ }
}
else if(prop == "COMPILE_DEFINITIONS")
{
- this->Internal->CompileDefinitionsEntries.push_back(value);
- cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
+ if (value && *value)
+ {
+ this->Internal->CompileDefinitionsEntries.push_back(value);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
+ }
}
else if(prop == "EXPORT_NAME" && this->IsImported())
{
@@ -1724,7 +1750,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if (prop == "LINK_LIBRARIES")
{
- if (value)
+ if (value && *value)
{
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmValueWithOrigin entry(value, lfbt);
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index c86ec24..3e71dbd 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -41,7 +41,8 @@
F(CMP0046) \
F(CMP0052) \
F(CMP0060) \
- F(CMP0063)
+ F(CMP0063) \
+ F(CMP0065)
class cmake;
class cmMakefile;
diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h
index da927c7..1af2bfe 100644
--- a/Source/cmUseMangledMesaCommand.h
+++ b/Source/cmUseMangledMesaCommand.h
@@ -23,7 +23,6 @@ public:
cmExecutionStatus &status);
virtual std::string GetName() const { return "use_mangled_mesa";}
virtual bool IsScriptable() const { return true; }
- virtual bool IsDiscouraged() const { return true; }
protected:
void CopyAndFullPathMesaHeader(const char* source,
const char* outdir);
diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h
index 23afdbe..8863ff5 100644
--- a/Source/cmUtilitySourceCommand.h
+++ b/Source/cmUtilitySourceCommand.h
@@ -22,7 +22,6 @@ public:
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
virtual std::string GetName() const { return "utility_source";}
- virtual bool IsDiscouraged() const { return true; }
};
#endif
diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h
index 7e68de1..5b0477f 100644
--- a/Source/cmVariableRequiresCommand.h
+++ b/Source/cmVariableRequiresCommand.h
@@ -22,7 +22,6 @@ public:
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
virtual std::string GetName() const { return "variable_requires";}
- virtual bool IsDiscouraged() const { return true; }
};
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 4c380f7..1de2847 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -9,6 +9,7 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
+#include "windows.h"
#include "cmVisualStudio10TargetGenerator.h"
#include "cmGlobalVisualStudio10Generator.h"
#include "cmGeneratorTarget.h"
@@ -462,6 +463,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString("<Import Project=\"" VS10_USER_PROPS "\""
" Condition=\"exists('" VS10_USER_PROPS "')\""
" Label=\"LocalAppDataPlatform\" />\n", 2);
+ this->WritePlatformExtensions();
this->WriteString("</ImportGroup>\n", 1);
this->WriteString("<PropertyGroup Label=\"UserMacros\" />\n", 1);
this->WriteWinRTPackageCertificateKeyFile();
@@ -474,6 +476,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteXamlFilesGroup();
this->WriteWinRTReferences();
this->WriteProjectReferences();
+ this->WriteSDKReferences();
this->WriteString(
"<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\""
" />\n", 1);
@@ -871,6 +874,9 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile const* source,
fout << "# generated from CMake\n";
fout.flush();
fout.close();
+ // Force given file to have a very old timestamp, thus
+ // preventing dependent rebuilds.
+ this->ForceOld(sourcePath);
}
else
{
@@ -1299,10 +1305,15 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
{
tool = "Image";
}
+ else if(ext == "resw")
+ {
+ tool = "PRIResource";
+ }
else if(ext == "xml")
{
tool = "XML";
}
+
if(this->NsightTegra)
{
// Nsight Tegra needs specific file types to check up-to-dateness.
@@ -2203,6 +2214,33 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
}
}
+void cmVisualStudio10TargetGenerator::WriteManifestOptions(
+ std::string const& config)
+{
+ if (this->Target->GetType() != cmTarget::EXECUTABLE &&
+ this->Target->GetType() != cmTarget::SHARED_LIBRARY &&
+ this->Target->GetType() != cmTarget::MODULE_LIBRARY)
+ {
+ return;
+ }
+
+ std::vector<cmSourceFile const*> manifest_srcs;
+ this->GeneratorTarget->GetManifests(manifest_srcs, config);
+ if (!manifest_srcs.empty())
+ {
+ this->WriteString("<Manifest>\n", 2);
+ this->WriteString("<AdditionalManifestFiles>", 3);
+ for (std::vector<cmSourceFile const*>::const_iterator
+ mi = manifest_srcs.begin(); mi != manifest_srcs.end(); ++mi)
+ {
+ std::string m = this->ConvertPath((*mi)->GetFullPath(), false);
+ this->ConvertToWindowsSlash(m);
+ (*this->BuildFileStream) << m << ";";
+ }
+ (*this->BuildFileStream) << "</AdditionalManifestFiles>\n";
+ this->WriteString("</Manifest>\n", 2);
+ }
+}
//----------------------------------------------------------------------------
void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
@@ -2559,7 +2597,8 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
// A Windows Runtime component uses internal .NET metadata,
// so does not have an import library.
- if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT"))
+ if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") &&
+ this->Target->GetType() != cmTarget::EXECUTABLE)
{
linkOptions.AddFlag("GenerateWindowsMetadata", "true");
}
@@ -2630,7 +2669,7 @@ cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config)
{
this->WriteString("<ProjectReference>\n", 2);
this->WriteString(
- " <LinkLibraryDependencies>false</LinkLibraryDependencies>\n", 2);
+ "<LinkLibraryDependencies>false</LinkLibraryDependencies>\n", 3);
this->WriteString("</ProjectReference>\n", 2);
}
}
@@ -2740,6 +2779,8 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
this->WriteLinkOptions(*i);
// output lib flags <Lib></Lib>
this->WriteLibOptions(*i);
+ // output manifest flags <Manifest></Manifest>
+ this->WriteManifestOptions(*i);
if(this->NsightTegra &&
this->Target->GetType() == cmTarget::EXECUTABLE &&
this->Target->GetPropertyAsBool("ANDROID_GUI"))
@@ -2820,7 +2861,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
= this->GlobalGenerator->GetTargetDirectDepends(this->GeneratorTarget);
typedef cmGlobalVisualStudioGenerator::OrderedTargetDependSet
OrderedTargetDependSet;
- OrderedTargetDependSet depends(unordered);
+ OrderedTargetDependSet depends(unordered, CMAKE_CHECK_BUILD_SYSTEM_TARGET);
this->WriteString("<ItemGroup>\n", 1);
for( OrderedTargetDependSet::const_iterator i = depends.begin();
i != depends.end(); ++i)
@@ -2863,6 +2904,101 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
this->WriteString("</ItemGroup>\n", 1);
}
+void cmVisualStudio10TargetGenerator::WritePlatformExtensions()
+{
+ // This only applies to Windows 10 apps
+ if (this->GlobalGenerator->TargetsWindowsStore() &&
+ cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0"))
+ {
+ const char* desktopExtensionsVersion =
+ this->Target->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION");
+ if (desktopExtensionsVersion)
+ {
+ this->WriteSinglePlatformExtension("WindowsDesktop",
+ desktopExtensionsVersion);
+ }
+ const char* mobileExtensionsVersion =
+ this->Target->GetProperty("VS_MOBILE_EXTENSIONS_VERSION");
+ if (mobileExtensionsVersion)
+ {
+ this->WriteSinglePlatformExtension("WindowsMobile",
+ mobileExtensionsVersion);
+ }
+ }
+}
+
+void cmVisualStudio10TargetGenerator::WriteSinglePlatformExtension(
+ std::string const& extension,
+ std::string const& version
+ )
+{
+ this->WriteString("<Import Project=", 2);
+ (*this->BuildFileStream)
+ << "\"$([Microsoft.Build.Utilities.ToolLocationHelper]"
+ << "::GetPlatformExtensionSDKLocation(`"
+ << extension <<", Version=" << version
+ << "`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), null, "
+ << "$(ExtensionSDKDirectoryRoot), null))"
+ << "\\DesignTime\\CommonConfiguration\\Neutral\\"
+ << extension << ".props\" "
+ << "Condition=\"exists('$("
+ << "[Microsoft.Build.Utilities.ToolLocationHelper]"
+ << "::GetPlatformExtensionSDKLocation(`"
+ << extension << ", Version=" << version
+ << "`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), null, "
+ << "$(ExtensionSDKDirectoryRoot), null))"
+ << "\\DesignTime\\CommonConfiguration\\Neutral\\"
+ << extension << ".props')\" />\n";
+}
+
+void cmVisualStudio10TargetGenerator::WriteSDKReferences()
+{
+ // This only applies to Windows 10 apps
+ if (this->GlobalGenerator->TargetsWindowsStore() &&
+ cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0"))
+ {
+ const char* desktopExtensionsVersion =
+ this->Target->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION");
+ const char* mobileExtensionsVersion =
+ this->Target->GetProperty("VS_MOBILE_EXTENSIONS_VERSION");
+ const char* iotExtensionsVersion =
+ this->Target->GetProperty("VS_IOT_EXTENSIONS_VERSION");
+
+ if(desktopExtensionsVersion || mobileExtensionsVersion ||
+ iotExtensionsVersion)
+ {
+ this->WriteString("<ItemGroup>\n", 1);
+ if(desktopExtensionsVersion)
+ {
+ this->WriteSingleSDKReference("WindowsDesktop",
+ desktopExtensionsVersion);
+ }
+ if(mobileExtensionsVersion)
+ {
+ this->WriteSingleSDKReference("WindowsMobile",
+ mobileExtensionsVersion);
+ }
+ if(iotExtensionsVersion)
+ {
+ this->WriteSingleSDKReference("WindowsIoT",
+ iotExtensionsVersion);
+ }
+ this->WriteString("</ItemGroup>\n", 1);
+ }
+ }
+}
+
+void cmVisualStudio10TargetGenerator::WriteSingleSDKReference(
+ std::string const& extension,
+ std::string const& version
+ )
+{
+ this->WriteString("<SDKReference Include=\"", 2);
+ (*this->BuildFileStream) << extension
+ << ", Version=" << version << "\" />\n";
+}
+
+
void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile()
{
if((this->GlobalGenerator->TargetsWindowsStore() ||
@@ -2973,6 +3109,8 @@ IsXamlSource(const std::string& sourceFile)
void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
{
+ cmGlobalVisualStudio10Generator* gg =
+ static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator);
bool isAppContainer = false;
bool const isWindowsPhone = this->GlobalGenerator->TargetsWindowsPhone();
bool const isWindowsStore = this->GlobalGenerator->TargetsWindowsStore();
@@ -2983,13 +3121,27 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
(*this->BuildFileStream) << (isWindowsPhone ?
"Windows Phone" : "Windows Store")
<< "</ApplicationType>\n";
- this->WriteString("<ApplicationTypeRevision>", 2);
- (*this->BuildFileStream) << cmVS10EscapeXML(v)
- << "</ApplicationTypeRevision>\n";
this->WriteString("<DefaultLanguage>en-US"
"</DefaultLanguage>\n", 2);
- if(v == "8.1")
+ if (cmHasLiteralPrefix(v, "10.0"))
{
+ this->WriteString("<ApplicationTypeRevision>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML("10.0")
+ << "</ApplicationTypeRevision>\n";
+ // Visual Studio 14.0 is necessary for building 10.0 apps
+ this->WriteString("<MinimumVisualStudioVersion>14.0"
+ "</MinimumVisualStudioVersion>\n", 2);
+
+ if(this->Target->GetType() < cmTarget::UTILITY)
+ {
+ isAppContainer = true;
+ }
+ }
+ else if(v == "8.1")
+ {
+ this->WriteString("<ApplicationTypeRevision>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(v)
+ << "</ApplicationTypeRevision>\n";
// Visual Studio 12.0 is necessary for building 8.1 apps
this->WriteString("<MinimumVisualStudioVersion>12.0"
"</MinimumVisualStudioVersion>\n", 2);
@@ -3001,6 +3153,9 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
}
else if (v == "8.0")
{
+ this->WriteString("<ApplicationTypeRevision>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(v)
+ << "</ApplicationTypeRevision>\n";
// Visual Studio 11.0 is necessary for building 8.0 apps
this->WriteString("<MinimumVisualStudioVersion>11.0"
"</MinimumVisualStudioVersion>\n", 2);
@@ -3029,6 +3184,38 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
this->WriteString("<WindowsSDKDesktopARMSupport>true"
"</WindowsSDKDesktopARMSupport>\n", 2);
}
+ std::string const& targetPlatformVersion =
+ gg->GetWindowsTargetPlatformVersion();
+ if (!targetPlatformVersion.empty())
+ {
+ this->WriteString("<WindowsTargetPlatformVersion>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(targetPlatformVersion) <<
+ "</WindowsTargetPlatformVersion>\n";
+ }
+ const char* targetPlatformMinVersion =
+ this->Target->GetProperty("VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION");
+ if(targetPlatformMinVersion)
+ {
+ this->WriteString("<WindowsTargetPlatformMinVersion>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(targetPlatformMinVersion) <<
+ "</WindowsTargetPlatformMinVersion>\n";
+ }
+ else if (isWindowsStore && cmHasLiteralPrefix(v, "10.0"))
+ {
+ // If the min version is not set, then use the TargetPlatformVersion
+ if (!targetPlatformVersion.empty())
+ {
+ this->WriteString("<WindowsTargetPlatformMinVersion>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(targetPlatformVersion) <<
+ "</WindowsTargetPlatformMinVersion>\n";
+ }
+ }
+
+ // Added IoT Startup Task support
+ if(this->Target->GetPropertyAsBool("VS_IOT_STARTUP_TASK"))
+ {
+ this->WriteString("<ContainsStartupTask>true</ContainsStartupTask>\n", 2);
+ }
}
void cmVisualStudio10TargetGenerator::VerifyNecessaryFiles()
@@ -3081,7 +3268,7 @@ void cmVisualStudio10TargetGenerator::VerifyNecessaryFiles()
{
this->IsMissingFiles = true;
}
- else if (v == "8.1")
+ else if (v == "8.1" || cmHasLiteralPrefix(v, "10.0"))
{
this->IsMissingFiles = true;
}
@@ -3115,6 +3302,10 @@ void cmVisualStudio10TargetGenerator::WriteMissingFiles()
{
this->WriteMissingFilesWS81();
}
+ else if (cmHasLiteralPrefix(v, "10.0"))
+ {
+ this->WriteMissingFilesWS10_0();
+ }
}
}
@@ -3376,6 +3567,64 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWS81()
this->WriteCommonMissingFiles(manifestFile);
}
+void cmVisualStudio10TargetGenerator::WriteMissingFilesWS10_0()
+{
+ std::string manifestFile =
+ this->DefaultArtifactDir + "/package.appxManifest";
+ std::string artifactDir =
+ this->LocalGenerator->GetTargetDirectory(*this->Target);
+ this->ConvertToWindowsSlash(artifactDir);
+ std::string artifactDirXML = cmVS10EscapeXML(artifactDir);
+ std::string targetNameXML = cmVS10EscapeXML(this->Target->GetName());
+
+ cmGeneratedFileStream fout(manifestFile.c_str());
+ fout.SetCopyIfDifferent(true);
+
+ fout <<
+ "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
+ "<Package\n\t"
+ "xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\""
+ "\txmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\"\n"
+ "\txmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\""
+ "\n\tIgnorableNamespaces=\"uap mp\">\n\n"
+ "\t<Identity Name=\"" << this->GUID << "\" Publisher=\"CN=CMake\""
+ " Version=\"1.0.0.0\" />\n"
+ "\t<mp:PhoneIdentity PhoneProductId=\"" << this->GUID <<
+ "\" PhonePublisherId=\"00000000-0000-0000-0000-000000000000\"/>\n"
+ "\t<Properties>\n"
+ "\t\t<DisplayName>" << targetNameXML << "</DisplayName>\n"
+ "\t\t<PublisherDisplayName>CMake</PublisherDisplayName>\n"
+ "\t\t<Logo>" << artifactDirXML << "\\StoreLogo.png</Logo>\n"
+ "\t</Properties>\n"
+ "\t<Dependencies>\n"
+ "\t\t<TargetDeviceFamily Name=\"Windows.Universal\" "
+ "MinVersion=\"10.0.0.0\" MaxVersionTested=\"10.0.0.0\" />\n"
+ "\t</Dependencies>\n"
+
+ "\t<Resources>\n"
+ "\t\t<Resource Language=\"x-generate\" />\n"
+ "\t</Resources>\n"
+ "\t<Applications>\n"
+ "\t\t<Application Id=\"App\""
+ " Executable=\"" << targetNameXML << ".exe\""
+ " EntryPoint=\"" << targetNameXML << ".App\">\n"
+ "\t\t\t<uap:VisualElements\n"
+ "\t\t\t\tDisplayName=\"" << targetNameXML << "\"\n"
+ "\t\t\t\tDescription=\"" << targetNameXML << "\"\n"
+ "\t\t\t\tBackgroundColor=\"#336699\"\n"
+ "\t\t\t\tSquare150x150Logo=\"" << artifactDirXML << "\\Logo.png\"\n"
+ "\t\t\t\tSquare44x44Logo=\"" << artifactDirXML <<
+ "\\SmallLogo44x44.png\">\n"
+ "\t\t\t\t<uap:SplashScreen"
+ " Image=\"" << artifactDirXML << "\\SplashScreen.png\" />\n"
+ "\t\t\t</uap:VisualElements>\n"
+ "\t\t</Application>\n"
+ "\t</Applications>\n"
+ "</Package>\n";
+
+ this->WriteCommonMissingFiles(manifestFile);
+}
+
void
cmVisualStudio10TargetGenerator
::WriteCommonMissingFiles(const std::string& manifestFile)
@@ -3399,6 +3648,14 @@ cmVisualStudio10TargetGenerator
(*this->BuildFileStream) << cmVS10EscapeXML(smallLogo) << "\" />\n";
this->AddedFiles.push_back(smallLogo);
+ std::string smallLogo44 = this->DefaultArtifactDir + "/SmallLogo44x44.png";
+ cmSystemTools::CopyAFile(templateFolder + "/SmallLogo44x44.png",
+ smallLogo44, false);
+ this->ConvertToWindowsSlash(smallLogo44);
+ this->WriteString("<Image Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(smallLogo44) << "\" />\n";
+ this->AddedFiles.push_back(smallLogo44);
+
std::string logo = this->DefaultArtifactDir + "/Logo.png";
cmSystemTools::CopyAFile(templateFolder + "/Logo.png",
logo, false);
@@ -3429,3 +3686,26 @@ cmVisualStudio10TargetGenerator
this->WriteString("<None Include=\"", 2);
(*this->BuildFileStream) << cmVS10EscapeXML(keyFile) << "\" />\n";
}
+
+bool cmVisualStudio10TargetGenerator::ForceOld(const std::string& source) const
+{
+ HANDLE h = CreateFileW(
+ cmSystemTools::ConvertToWindowsExtendedPath(source).c_str(),
+ FILE_WRITE_ATTRIBUTES,
+ FILE_SHARE_WRITE, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, 0);
+ if (!h)
+ {
+ return false;
+ }
+
+ FILETIME const ftime_20010101 = { 3365781504u, 29389701u };
+ if (!SetFileTime(h, &ftime_20010101, &ftime_20010101, &ftime_20010101))
+ {
+ CloseHandle(h);
+ return false;
+ }
+
+ CloseHandle(h);
+ return true;
+}
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 451f8b2..15ed9f2 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -78,6 +78,13 @@ private:
void WriteMissingFilesWP81();
void WriteMissingFilesWS80();
void WriteMissingFilesWS81();
+ void WriteMissingFilesWS10_0();
+ void WritePlatformExtensions();
+ void WriteSinglePlatformExtension(std::string const& extension,
+ std::string const& version);
+ void WriteSDKReferences();
+ void WriteSingleSDKReference(std::string const& extension,
+ std::string const& version);
void WriteCommonMissingFiles(const std::string& manifestFile);
void WriteTargetSpecificReferences();
@@ -111,6 +118,7 @@ private:
void AddLibraries(cmComputeLinkInformation& cli,
std::vector<std::string>& libVec);
void WriteLibOptions(std::string const& config);
+ void WriteManifestOptions(std::string const& config);
void WriteEvents(std::string const& configName);
void WriteEvent(const char* name,
std::vector<cmCustomCommand> const& commands,
@@ -129,6 +137,8 @@ private:
cmIDEFlagTable const* GetLinkFlagTable() const;
cmIDEFlagTable const* GetMasmFlagTable() const;
+ bool ForceOld(const std::string& source) const;
+
private:
typedef cmVisualStudioGeneratorOptions Options;
typedef std::map<std::string, Options*> OptionsMap;
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index 012c580..4b7afd8 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -49,7 +49,20 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
mf.ExpandArguments(this->Args, expandedArguments);
cmake::MessageType messageType;
- cmConditionEvaluator conditionEvaluator(mf);
+ cmListFileContext execContext = this->GetStartingContext();
+
+ cmCommandContext commandContext;
+ commandContext.Line = execContext.Line;
+ commandContext.Name = execContext.Name;
+
+ cmListFileContext conditionContext =
+ cmConditionEvaluator::GetConditionContext(
+ &mf, commandContext,
+ this->GetStartingContext().FilePath);
+
+ cmConditionEvaluator conditionEvaluator(
+ mf, conditionContext,
+ mf.GetBacktrace(commandContext));
bool isTrue = conditionEvaluator.IsTrue(
expandedArguments, errorString, messageType);
diff --git a/Source/cmWriteFileCommand.h b/Source/cmWriteFileCommand.h
index 0d06878..89dc9ff 100644
--- a/Source/cmWriteFileCommand.h
+++ b/Source/cmWriteFileCommand.h
@@ -46,12 +46,6 @@ public:
*/
virtual std::string GetName() const { return "write_file";}
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
cmTypeMacro(cmWriteFileCommand, cmCommand);
};
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index f069481..386f6a5 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -128,6 +128,8 @@ cmake::cmake()
this->WarnUnused = false;
this->WarnUnusedCli = true;
this->CheckSystemVars = false;
+ this->SuppressDevWarnings = false;
+ this->DoSuppressDevWarnings = false;
this->DebugOutput = false;
this->DebugTryCompile = false;
this->ClearBuildSystem = false;
@@ -250,70 +252,15 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
return false;
}
}
- else if(cmHasLiteralPrefix(arg, "-W"))
+ else if(arg.find("-Wno-dev",0) == 0)
{
- std::string entry = arg.substr(2);
- if (entry.empty())
- {
- ++i;
- if (i < args.size())
- {
- entry = args[i];
- }
- else
- {
- cmSystemTools::Error(
- "-W must be followed with [no-][error=]<name>.");
- return false;
- }
+ this->SuppressDevWarnings = true;
+ this->DoSuppressDevWarnings = true;
}
-
- std::string name;
- bool foundNo = false;
- bool foundError = false;
- unsigned int nameStartPosition = 0;
-
- if (entry.find("no-", nameStartPosition) == 0)
- {
- foundNo = true;
- nameStartPosition += 3;
- }
-
- if (entry.find("error=", nameStartPosition) == 0)
- {
- foundError = true;
- nameStartPosition += 6;
- }
-
- name = entry.substr(nameStartPosition);
- if (name.empty())
- {
- cmSystemTools::Error("No warning name provided.");
- return false;
- }
-
- if (!foundNo && !foundError)
- {
- // -W<name>
- this->WarningLevels[name] = std::max(this->WarningLevels[name],
- WARNING_LEVEL);
- }
- else if (foundNo && !foundError)
- {
- // -Wno<name>
- this->WarningLevels[name] = IGNORE_LEVEL;
- }
- else if (!foundNo && foundError)
- {
- // -Werror=<name>
- this->WarningLevels[name] = ERROR_LEVEL;
- }
- else
- {
- // -Wno-error=<name>
- this->WarningLevels[name] = std::min(this->WarningLevels[name],
- WARNING_LEVEL);
- }
+ else if(arg.find("-Wdev",0) == 0)
+ {
+ this->SuppressDevWarnings = false;
+ this->DoSuppressDevWarnings = true;
}
else if(arg.find("-U",0) == 0)
{
@@ -645,7 +592,11 @@ void cmake::SetArgs(const std::vector<std::string>& args,
// skip for now
i++;
}
- else if(arg.find("-W",0) == 0)
+ else if(arg.find("-Wno-dev",0) == 0)
+ {
+ // skip for now
+ }
+ else if(arg.find("-Wdev",0) == 0)
{
// skip for now
}
@@ -1232,121 +1183,25 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
int cmake::Configure()
{
- WarningLevel warningLevel;
-
- if (this->WarningLevels.count("deprecated") == 1)
+ if(this->DoSuppressDevWarnings)
{
- warningLevel = this->WarningLevels["deprecated"];
- if (warningLevel == IGNORE_LEVEL)
- {
- this->CacheManager->
- AddCacheEntry("CMAKE_WARN_DEPRECATED", "FALSE",
- "Whether to issue deprecation warnings for"
- " macros and functions.",
- cmState::BOOL);
- this->CacheManager->
- AddCacheEntry("CMAKE_ERROR_DEPRECATED", "FALSE",
- "Whether to issue deprecation errors for macros"
- " and functions.",
- cmState::BOOL);
- }
- if (warningLevel == WARNING_LEVEL)
- {
- this->CacheManager->
- AddCacheEntry("CMAKE_WARN_DEPRECATED", "TRUE",
- "Whether to issue deprecation warnings for"
- " macros and functions.",
- cmState::BOOL);
- }
- else if (warningLevel == ERROR_LEVEL)
- {
- this->CacheManager->
- AddCacheEntry("CMAKE_ERROR_DEPRECATED", "TRUE",
- "Whether to issue deprecation errors for macros"
- " and functions.",
- cmState::BOOL);
- }
- }
-
- if (this->WarningLevels.count("dev") == 1)
- {
- bool setDeprecatedVariables = false;
-
- const char* cachedWarnDeprecated =
- this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED");
- const char* cachedErrorDeprecated =
- this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED");
-
- // don't overwrite deprecated warning setting from a previous invocation
- if (!cachedWarnDeprecated && !cachedErrorDeprecated)
- {
- setDeprecatedVariables = true;
- }
-
- warningLevel = this->WarningLevels["dev"];
- if (warningLevel == IGNORE_LEVEL)
+ if(this->SuppressDevWarnings)
{
this->CacheManager->
AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE",
"Suppress Warnings that are meant for"
" the author of the CMakeLists.txt files.",
cmState::INTERNAL);
- this->CacheManager->
- AddCacheEntry("CMAKE_ERROR_DEVELOPER_WARNINGS", "FALSE",
- "Suppress errors that are meant for"
- " the author of the CMakeLists.txt files.",
- cmState::INTERNAL);
-
- if (setDeprecatedVariables)
- {
- this->CacheManager->
- AddCacheEntry("CMAKE_WARN_DEPRECATED", "FALSE",
- "Whether to issue deprecation warnings for"
- " macros and functions.",
- cmState::BOOL);
- this->CacheManager->
- AddCacheEntry("CMAKE_ERROR_DEPRECATED", "FALSE",
- "Whether to issue deprecation errors for macros"
- " and functions.",
- cmState::BOOL);
- }
}
- else if (warningLevel == WARNING_LEVEL)
+ else
{
this->CacheManager->
AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE",
"Suppress Warnings that are meant for"
" the author of the CMakeLists.txt files.",
cmState::INTERNAL);
-
- if (setDeprecatedVariables)
- {
- this->CacheManager->
- AddCacheEntry("CMAKE_WARN_DEPRECATED", "TRUE",
- "Whether to issue deprecation warnings for"
- " macros and functions.",
- cmState::BOOL);
- }
- }
- else if (warningLevel == ERROR_LEVEL)
- {
- this->CacheManager->
- AddCacheEntry("CMAKE_ERROR_DEVELOPER_WARNINGS", "TRUE",
- "Suppress errors that are meant for"
- " the author of the CMakeLists.txt files.",
- cmState::INTERNAL);
-
- if (setDeprecatedVariables)
- {
- this->CacheManager->
- AddCacheEntry("CMAKE_ERROR_DEPRECATED", "TRUE",
- "Whether to issue deprecation errors for macros"
- " and functions.",
- cmState::BOOL);
- }
}
}
-
int ret = this->ActualConfigure();
const char* delCacheVars = this->State
->GetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_");
@@ -1677,18 +1532,6 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
{
this->AddCMakePaths();
}
-
- // don't turn dev warnings into errors by default, if no value has been
- // specified for the flag, disable it
- if (!this->State->GetCacheEntryValue("CMAKE_ERROR_DEVELOPER_WARNINGS"))
- {
- this->CacheManager->
- AddCacheEntry("CMAKE_ERROR_DEVELOPER_WARNINGS", "FALSE",
- "Suppress errors that are meant for"
- " the author of the CMakeLists.txt files.",
- cmState::INTERNAL);
- }
-
// Add any cache args
if ( !this->SetCacheArgs(args) )
{
@@ -2596,17 +2439,20 @@ bool cmake::PrintMessagePreamble(cmake::MessageType t, std::ostream& msg)
{
msg << "CMake Deprecation Warning";
}
- else if (t == cmake::AUTHOR_WARNING)
- {
- msg << "CMake Warning (dev)";
- }
- else if (t == cmake::AUTHOR_ERROR)
- {
- msg << "CMake Error (dev)";
- }
else
{
msg << "CMake Warning";
+ if(t == cmake::AUTHOR_WARNING)
+ {
+ // Allow suppression of these warnings.
+ const char* suppress = this->State->GetCacheEntryValue(
+ "CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
+ if(suppress && cmSystemTools::IsOn(suppress))
+ {
+ return false;
+ }
+ msg << " (dev)";
+ }
}
return true;
}
@@ -2628,12 +2474,6 @@ void displayMessage(cmake::MessageType t, std::ostringstream& msg)
msg <<
"This warning is for project developers. Use -Wno-dev to suppress it.";
}
- else if (t == cmake::AUTHOR_ERROR)
- {
- msg <<
- "This error is for project developers. Use -Wno-error=dev to suppress "
- "it.";
- }
// Add a terminating blank line.
msg << "\n";
@@ -2657,8 +2497,7 @@ void displayMessage(cmake::MessageType t, std::ostringstream& msg)
// Output the message.
if(t == cmake::FATAL_ERROR
|| t == cmake::INTERNAL_ERROR
- || t == cmake::DEPRECATION_ERROR
- || t == cmake::AUTHOR_ERROR)
+ || t == cmake::DEPRECATION_ERROR)
{
cmSystemTools::SetErrorOccured();
cmSystemTools::Message(msg.str().c_str(), "Error");
@@ -2855,18 +2694,3 @@ void cmake::RunCheckForUnusedVariables()
}
#endif
}
-
-void cmake::SetSuppressDevWarnings(bool b)
-{
- // equivalent to -Wno-dev
- if (b)
- {
- this->WarningLevels["dev"] = IGNORE_LEVEL;
- }
- // equivalent to -Wdev
- else
- {
- this->WarningLevels["dev"] = std::max(this->WarningLevels["dev"],
- WARNING_LEVEL);
- }
-}
diff --git a/Source/cmake.h b/Source/cmake.h
index 8ac8897..9d28cba 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -59,7 +59,6 @@ class cmake
public:
enum MessageType
{ AUTHOR_WARNING,
- AUTHOR_ERROR,
FATAL_ERROR,
INTERNAL_ERROR,
MESSAGE,
@@ -69,12 +68,6 @@ class cmake
DEPRECATION_WARNING
};
- enum WarningLevel
- {
- IGNORE_LEVEL,
- WARNING_LEVEL,
- ERROR_LEVEL
- };
/** \brief Describes the working modes of cmake */
enum WorkingMode
@@ -278,7 +271,6 @@ class cmake
void SetTrace(bool b) { this->Trace = b;}
bool GetTraceExpand() { return this->TraceExpand;}
void SetTraceExpand(bool b) { this->TraceExpand = b;}
- void SetSuppressDevWarnings(bool b);
bool GetWarnUninitialized() { return this->WarnUninitialized;}
void SetWarnUninitialized(bool b) { this->WarnUninitialized = b;}
bool GetWarnUnused() { return this->WarnUnused;}
@@ -299,6 +291,12 @@ class cmake
std::string const& GetCMakeEditCommand() const
{ return this->CMakeEditCommand; }
+ void SetSuppressDevWarnings(bool v)
+ {
+ this->SuppressDevWarnings = v;
+ this->DoSuppressDevWarnings = true;
+ }
+
/** Display a message to the user. */
void IssueMessage(cmake::MessageType t, std::string const& text,
cmListFileBacktrace const& backtrace = cmListFileBacktrace());
@@ -341,7 +339,8 @@ protected:
cmGlobalGenerator *GlobalGenerator;
cmCacheManager *CacheManager;
- std::map<std::string, WarningLevel> WarningLevels;
+ bool SuppressDevWarnings;
+ bool DoSuppressDevWarnings;
std::string GeneratorPlatform;
std::string GeneratorToolset;
@@ -417,15 +416,7 @@ private:
{"-T <toolset-name>", "Specify toolset name if supported by generator."}, \
{"-A <platform-name>", "Specify platform name if supported by generator."}, \
{"-Wno-dev", "Suppress developer warnings."},\
- {"-Wdev", "Enable developer warnings."},\
- {"-Werror=dev", "Make developer warnings errors."},\
- {"-Wno-error=dev", "Make developer warnings not errors."},\
- {"-Wdeprecated", "Enable deprecated macro and function warnings."},\
- {"-Wno-deprecated", "Suppress deprecated macro and function warnings."},\
- {"-Werror=deprecated", "Make deprecated macro and function warnings " \
- "errors."},\
- {"-Wno-error=deprecated", "Make deprecated macro and function warnings " \
- "not errors."}
+ {"-Wdev", "Enable developer warnings."}
#define FOR_EACH_C_FEATURE(F) \
F(c_function_prototypes) \
diff --git a/Source/cmake.version.manifest b/Source/cmake.version.manifest
new file mode 100644
index 0000000..e7010c9
--- /dev/null
+++ b/Source/cmake.version.manifest
@@ -0,0 +1,18 @@
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
+ manifestVersion="1.0"
+ xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!-- Windows Vista -->
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+ <!-- Windows 7 -->
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+ <!-- Windows 8 -->
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+ <!-- Windows 8.1 -->
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+ <!-- Windows 10 -->
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+ </application>
+ </compatibility>
+</assembly>
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index aa70aa0..f44c77d 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1355,6 +1355,35 @@ int cmcmd::WindowsCEEnvironment(const char* version, const std::string& name)
return -1;
}
+class cmVSLink
+{
+ int Type;
+ bool Verbose;
+ bool Incremental;
+ bool LinkGeneratesManifest;
+ std::vector<std::string> LinkCommand;
+ std::vector<std::string> UserManifests;
+ std::string LinkerManifestFile;
+ std::string ManifestFile;
+ std::string ManifestFileRC;
+ std::string ManifestFileRes;
+ std::string TargetFile;
+public:
+ cmVSLink(int type, bool verbose)
+ : Type(type)
+ , Verbose(verbose)
+ , Incremental(false)
+ , LinkGeneratesManifest(true)
+ {}
+ bool Parse(std::vector<std::string>::const_iterator argBeg,
+ std::vector<std::string>::const_iterator argEnd);
+ int Link();
+private:
+ int LinkIncremental();
+ int LinkNonIncremental();
+ int RunMT(std::string const& out, bool notify);
+};
+
// For visual studio 2005 and newer manifest files need to be embedded into
// exe and dll's. This code does that in such a way that incremental linking
// still works.
@@ -1364,11 +1393,7 @@ int cmcmd::VisualStudioLink(std::vector<std::string>& args, int type)
{
return -1;
}
- bool verbose = false;
- if(cmSystemTools::GetEnv("VERBOSE"))
- {
- verbose = true;
- }
+ bool verbose = cmSystemTools::GetEnv("VERBOSE")? true:false;
std::vector<std::string> expandedArgs;
for(std::vector<std::string>::iterator i = args.begin();
i != args.end(); ++i)
@@ -1389,79 +1414,19 @@ int cmcmd::VisualStudioLink(std::vector<std::string>& args, int type)
expandedArgs.push_back(*i);
}
}
- bool hasIncremental = false;
- bool hasManifest = true;
- for(std::vector<std::string>::iterator i = expandedArgs.begin();
- i != expandedArgs.end(); ++i)
- {
- if(cmSystemTools::Strucmp(i->c_str(), "/INCREMENTAL:YES") == 0)
- {
- hasIncremental = true;
- }
- if(cmSystemTools::Strucmp(i->c_str(), "/INCREMENTAL") == 0)
- {
- hasIncremental = true;
- }
- if(cmSystemTools::Strucmp(i->c_str(), "/MANIFEST:NO") == 0)
- {
- hasManifest = false;
- }
- }
- if(hasIncremental && hasManifest)
- {
- if(verbose)
- {
- std::cout << "Visual Studio Incremental Link with embedded manifests\n";
- }
- return cmcmd::VisualStudioLinkIncremental(expandedArgs, type, verbose);
- }
- if(verbose)
- {
- if(!hasIncremental)
- {
- std::cout << "Visual Studio Non-Incremental Link\n";
- }
- else
- {
- std::cout << "Visual Studio Incremental Link without manifests\n";
- }
- }
- return cmcmd::VisualStudioLinkNonIncremental(expandedArgs,
- type, hasManifest, verbose);
-}
-int cmcmd::ParseVisualStudioLinkCommand(std::vector<std::string>& args,
- std::vector<std::string>& command,
- std::string& targetName)
-{
- std::vector<std::string>::iterator i = args.begin();
- i++; // skip -E
- i++; // skip vs_link_dll or vs_link_exe
- command.push_back(*i);
- i++; // move past link command
- for(; i != args.end(); ++i)
- {
- command.push_back(*i);
- if(i->find("/Fe") == 0)
- {
- targetName = i->substr(3);
- }
- if(i->find("/out:") == 0)
- {
- targetName = i->substr(5);
- }
- }
- if(targetName.empty() || command.empty())
+ cmVSLink vsLink(type, verbose);
+ if (!vsLink.Parse(expandedArgs.begin()+2, expandedArgs.end()))
{
return -1;
}
- return 0;
+ return vsLink.Link();
}
-bool cmcmd::RunCommand(const char* comment,
+static bool RunCommand(const char* comment,
std::vector<std::string>& command,
bool verbose,
- int* retCodeOut)
+ int* retCodeOut = 0)
{
if(verbose)
{
@@ -1503,8 +1468,134 @@ bool cmcmd::RunCommand(const char* comment,
return retCode == 0;
}
-int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
- int type, bool verbose)
+bool cmVSLink::Parse(std::vector<std::string>::const_iterator argBeg,
+ std::vector<std::string>::const_iterator argEnd)
+{
+ // Parse our own arguments.
+ std::string intDir;
+ std::vector<std::string>::const_iterator arg = argBeg;
+ while (arg != argEnd && cmHasLiteralPrefix(*arg, "-"))
+ {
+ if (*arg == "--")
+ {
+ ++arg;
+ break;
+ }
+ else if (*arg == "--manifests")
+ {
+ for (++arg; arg != argEnd && !cmHasLiteralPrefix(*arg, "-"); ++arg)
+ {
+ this->UserManifests.push_back(*arg);
+ }
+ }
+ else if (cmHasLiteralPrefix(*arg, "--intdir="))
+ {
+ intDir = arg->substr(9);
+ ++arg;
+ }
+ else
+ {
+ std::cerr << "unknown argument '" << *arg << "'\n";
+ return false;
+ }
+ }
+ if (intDir.empty())
+ {
+ return false;
+ }
+
+ // The rest of the arguments form the link command.
+ if (arg == argEnd)
+ {
+ return false;
+ }
+ this->LinkCommand.insert(this->LinkCommand.begin(), arg, argEnd);
+
+ // Parse the link command to extract information we need.
+ for (; arg != argEnd; ++arg)
+ {
+ if (cmSystemTools::Strucmp(arg->c_str(), "/INCREMENTAL:YES") == 0)
+ {
+ this->Incremental = true;
+ }
+ else if (cmSystemTools::Strucmp(arg->c_str(), "/INCREMENTAL") == 0)
+ {
+ this->Incremental = true;
+ }
+ else if (cmSystemTools::Strucmp(arg->c_str(), "/MANIFEST:NO") == 0)
+ {
+ this->LinkGeneratesManifest = false;
+ }
+ else if (cmHasLiteralPrefix(*arg, "/Fe"))
+ {
+ this->TargetFile = arg->substr(3);
+ }
+ else if (cmHasLiteralPrefix(*arg, "/out:"))
+ {
+ this->TargetFile = arg->substr(5);
+ }
+ }
+
+ if (this->TargetFile.empty())
+ {
+ return false;
+ }
+
+ this->ManifestFile = intDir + "/embed.manifest";
+ this->LinkerManifestFile = intDir + "/intermediate.manifest";
+
+ if (this->Incremental)
+ {
+ // We will compile a resource containing the manifest and
+ // pass it to the link command.
+ this->ManifestFileRC = intDir + "/manifest.rc";
+ this->ManifestFileRes = intDir + "/manifest.res";
+ this->LinkCommand.push_back(this->ManifestFileRes);
+ }
+ else if (this->UserManifests.empty())
+ {
+ // Prior to support for user-specified manifests CMake placed the
+ // linker-generated manifest next to the binary (as if it were not to be
+ // embedded) when not linking incrementally. Preserve this behavior.
+ this->ManifestFile = this->TargetFile + ".manifest";
+ this->LinkerManifestFile = this->ManifestFile;
+ }
+
+ if (this->LinkGeneratesManifest)
+ {
+ this->LinkCommand.push_back("/MANIFEST");
+ this->LinkCommand.push_back("/MANIFESTFILE:" + this->LinkerManifestFile);
+ }
+
+ return true;
+}
+
+int cmVSLink::Link()
+{
+ if (this->Incremental &&
+ (this->LinkGeneratesManifest || !this->UserManifests.empty()))
+ {
+ if (this->Verbose)
+ {
+ std::cout << "Visual Studio Incremental Link with embedded manifests\n";
+ }
+ return LinkIncremental();
+ }
+ if (this->Verbose)
+ {
+ if (!this->Incremental)
+ {
+ std::cout << "Visual Studio Non-Incremental Link\n";
+ }
+ else
+ {
+ std::cout << "Visual Studio Incremental Link without manifests\n";
+ }
+ }
+ return LinkNonIncremental();
+}
+
+int cmVSLink::LinkIncremental()
{
// This follows the steps listed here:
// http://blogs.msdn.com/zakramer/archive/2006/05/22/603558.aspx
@@ -1528,161 +1619,118 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
// 7. Finally, the Linker does another incremental link, but since the
// only thing that has changed is the *.res file that contains the
// manifest it is a short link.
- std::vector<std::string> linkCommand;
- std::string targetName;
- if(cmcmd::ParseVisualStudioLinkCommand(args, linkCommand, targetName) == -1)
- {
- return -1;
- }
- std::string manifestArg = "/MANIFESTFILE:";
- std::vector<std::string> rcCommand;
- rcCommand.push_back(cmSystemTools::FindProgram("rc.exe"));
- std::vector<std::string> mtCommand;
- mtCommand.push_back(cmSystemTools::FindProgram("mt.exe"));
- std::string tempManifest;
- tempManifest = targetName;
- tempManifest += ".intermediate.manifest";
- std::string resourceInputFile = targetName;
- resourceInputFile += ".resource.txt";
- if(verbose)
+
+ // Create a resource file referencing the manifest.
+ std::string absManifestFile =
+ cmSystemTools::CollapseFullPath(this->ManifestFile);
+ if (this->Verbose)
{
- std::cout << "Create " << resourceInputFile << "\n";
+ std::cout << "Create " << this->ManifestFileRC << "\n";
}
- // Create input file for rc command
- cmsys::ofstream fout(resourceInputFile.c_str());
- if(!fout)
+ {
+ cmsys::ofstream fout(this->ManifestFileRC.c_str());
+ if (!fout)
{
return -1;
}
- std::string manifestFile = targetName;
- manifestFile += ".embed.manifest";
- std::string fullPath= cmSystemTools::CollapseFullPath(manifestFile);
- fout << type << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID "
- "*/ 24 /* RT_MANIFEST */ " << "\"" << fullPath << "\"";
- fout.close();
- manifestArg += tempManifest;
- // add the manifest arg to the linkCommand
- linkCommand.push_back("/MANIFEST");
- linkCommand.push_back(manifestArg);
- // if manifestFile is not yet created, create an
- // empty one
- if(!cmSystemTools::FileExists(manifestFile.c_str()))
+ fout << this->Type << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ "
+ "24 /* RT_MANIFEST */ \"" << absManifestFile << "\"";
+ }
+
+ // If we have not previously generated a manifest file,
+ // generate an empty one so the resource compiler succeeds.
+ if (!cmSystemTools::FileExists(this->ManifestFile))
{
- if(verbose)
+ if (this->Verbose)
{
- std::cout << "Create empty: " << manifestFile << "\n";
+ std::cout << "Create empty: " << this->ManifestFile << "\n";
}
- cmsys::ofstream foutTmp(manifestFile.c_str());
+ cmsys::ofstream foutTmp(this->ManifestFile.c_str());
}
- std::string resourceFile = manifestFile;
- resourceFile += ".res";
- // add the resource file to the end of the link command
- linkCommand.push_back(resourceFile);
- std::string outputOpt = "/fo";
- outputOpt += resourceFile;
- rcCommand.push_back(outputOpt);
- rcCommand.push_back(resourceInputFile);
- // Run rc command to create resource
- if(!cmcmd::RunCommand("RC Pass 1", rcCommand, verbose))
- {
- return -1;
- }
- // Now run the link command to link and create manifest
- if(!cmcmd::RunCommand("LINK Pass 1", linkCommand, verbose))
+
+ // Compile the resource file.
+ std::vector<std::string> rcCommand;
+ rcCommand.push_back(cmSystemTools::FindProgram("rc.exe"));
+ rcCommand.push_back("/fo" + this->ManifestFileRes);
+ rcCommand.push_back(this->ManifestFileRC);
+ if (!RunCommand("RC Pass 1", rcCommand, this->Verbose))
{
return -1;
}
- // create mt command
- std::string outArg("/out:");
- outArg+= manifestFile;
- mtCommand.push_back("/nologo");
- mtCommand.push_back(outArg);
- mtCommand.push_back("/notify_update");
- mtCommand.push_back("/manifest");
- mtCommand.push_back(tempManifest);
- // now run mt.exe to create the final manifest file
- int mtRet =0;
- if(!cmcmd::RunCommand("MT", mtCommand, verbose, &mtRet))
+
+ // Run the link command (possibly generates intermediate manifest).
+ if (!RunCommand("LINK Pass 1", this->LinkCommand, this->Verbose))
{
return -1;
}
- // if mt returns 0, then the manifest was not changed and
- // we do not need to do another link step
- if(mtRet == 0)
- {
- return 0;
- }
- // check for magic mt return value if mt returns the magic number
- // 1090650113 then it means that it updated the manifest file and we need
- // to do the final link. If mt has any value other than 0 or 1090650113
- // then there was some problem with the command itself and there was an
- // error so return the error code back out of cmake so make can report it.
- // (when hosted on a posix system the value is 187)
- if(mtRet != 1090650113 && mtRet != 187)
+
+ // Run the manifest tool to create the final manifest.
+ int mtRet = this->RunMT("/out:" + this->ManifestFile, true);
+
+ // If mt returns 1090650113 (or 187 on a posix host) then it updated the
+ // manifest file so we need to embed it again. Otherwise we are done.
+ if (mtRet != 1090650113 && mtRet != 187)
{
return mtRet;
}
- // update the resource file with the new manifest from the mt command.
- if(!cmcmd::RunCommand("RC Pass 2", rcCommand, verbose))
+
+ // Compile the resource file again.
+ if (!RunCommand("RC Pass 2", rcCommand, this->Verbose))
{
return -1;
}
- // Run the final incremental link that will put the new manifest resource
- // into the file incrementally.
- if(!cmcmd::RunCommand("FINAL LINK", linkCommand, verbose))
+
+ // Link incrementally again to use the updated resource.
+ if (!RunCommand("FINAL LINK", this->LinkCommand, this->Verbose))
{
return -1;
}
return 0;
}
-int cmcmd::VisualStudioLinkNonIncremental(std::vector<std::string>& args,
- int type,
- bool hasManifest,
- bool verbose)
+int cmVSLink::LinkNonIncremental()
{
- std::vector<std::string> linkCommand;
- std::string targetName;
- if(cmcmd::ParseVisualStudioLinkCommand(args, linkCommand, targetName) == -1)
- {
- return -1;
- }
- // Run the link command as given
- if (hasManifest)
- {
- linkCommand.push_back("/MANIFEST");
- }
- if(!cmcmd::RunCommand("LINK", linkCommand, verbose))
+ // Run the link command (possibly generates intermediate manifest).
+ if (!RunCommand("LINK", this->LinkCommand, this->Verbose))
{
return -1;
}
- if(!hasManifest)
+
+ // If we have no manifest files we are done.
+ if (!this->LinkGeneratesManifest && this->UserManifests.empty())
{
return 0;
}
+
+ // Run the manifest tool to embed the final manifest in the binary.
+ std::string mtOut =
+ "/outputresource:" + this->TargetFile + (this->Type == 1? ";#1" : ";#2");
+ return this->RunMT(mtOut, false);
+}
+
+int cmVSLink::RunMT(std::string const& out, bool notify)
+{
std::vector<std::string> mtCommand;
mtCommand.push_back(cmSystemTools::FindProgram("mt.exe"));
mtCommand.push_back("/nologo");
mtCommand.push_back("/manifest");
- std::string manifestFile = targetName;
- manifestFile += ".manifest";
- mtCommand.push_back(manifestFile);
- std::string outresource = "/outputresource:";
- outresource += targetName;
- outresource += ";#";
- if(type == 1)
+ if (this->LinkGeneratesManifest)
{
- outresource += "1";
+ mtCommand.push_back(this->LinkerManifestFile);
}
- else if(type == 2)
+ mtCommand.insert(mtCommand.end(),
+ this->UserManifests.begin(), this->UserManifests.end());
+ mtCommand.push_back(out);
+ if (notify)
{
- outresource += "2";
+ // Add an undocumented option that enables a special return
+ // code to notify us when the manifest is modified.
+ mtCommand.push_back("/notify_update");
}
- mtCommand.push_back(outresource);
- // Now use the mt tool to embed the manifest into the exe or dll
- if(!cmcmd::RunCommand("MT", mtCommand, verbose))
+ int mtRet = 0;
+ if (!RunCommand("MT", mtCommand, this->Verbose, &mtRet))
{
return -1;
}
- return 0;
+ return mtRet;
}
diff --git a/Source/cmcmd.h b/Source/cmcmd.h
index 2bfbae7..64b2406 100644
--- a/Source/cmcmd.h
+++ b/Source/cmcmd.h
@@ -35,20 +35,6 @@ protected:
static int WindowsCEEnvironment(const char* version,
const std::string& name);
static int VisualStudioLink(std::vector<std::string>& args, int type);
- static int VisualStudioLinkIncremental(std::vector<std::string>& args,
- int type,
- bool verbose);
- static int VisualStudioLinkNonIncremental(std::vector<std::string>& args,
- int type,
- bool hasManifest,
- bool verbose);
- static int ParseVisualStudioLinkCommand(std::vector<std::string>& args,
- std::vector<std::string>& command,
- std::string& targetName);
- static bool RunCommand(const char* comment,
- std::vector<std::string>& command,
- bool verbose,
- int* retCodeOut = 0);
};
#endif
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index afcbd61..7fa6aed 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -46,6 +46,10 @@ static const char * cmDocumentationOptions[][2] =
{"--debug", "Displaying more verbose internals of CTest."},
{"--output-on-failure", "Output anything outputted by the test program "
"if the test should fail."},
+ {"--test-output-size-passed <size>", "Limit the output for passed tests "
+ "to <size> bytes"},
+ {"--test-output-size-failed <size>", "Limit the output for failed tests "
+ "to <size> bytes"},
{"-F", "Enable failover."},
{"-j <jobs>, --parallel <jobs>", "Run the tests in parallel using the "
"given number of jobs."},
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index c1229ff..84010d8 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -35,15 +35,6 @@
# SET(KWSYS_HEADER_ROOT ${PROJECT_BINARY_DIR})
# INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
#
-# KWSYS_IOS_FORCE_OLD = Force use of old non-ANSI C++ streams even if
-# new streams are available. This may be used
-# by projects that cannot configure their
-# streams library.
-# Example:
-#
-# SET(KWSYS_IOS_FORCE_OLD 1)
-#
-#
# Optional settings to setup install rules are as follows:
#
# KWSYS_INSTALL_BIN_DIR = The installation target directories into
@@ -351,105 +342,6 @@ ENDIF()
# capabilities and parent project's request. Enforce 0/1 as only
# possible values for configuration into Configure.hxx.
-KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAVE_STD
- "Checking whether STL classes are in std namespace" DIRECT)
-
-IF(KWSYS_IOS_FORCE_OLD)
- SET(KWSYS_IOS_USE_ANSI 0)
-ELSE()
- KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_USE_ANSI
- "Checking whether ANSI stream headers are available" DIRECT)
-ENDIF()
-
-IF(KWSYS_IOS_USE_ANSI)
- KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAVE_STD
- "Checking whether ANSI streams are in std namespace" DIRECT)
- KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_USE_SSTREAM
- "Checking whether ANSI string stream is available" DIRECT)
-ELSE()
- SET(KWSYS_IOS_HAVE_STD 0)
- SET(KWSYS_IOS_USE_SSTREAM 0)
-ENDIF()
-
-IF(KWSYS_IOS_USE_SSTREAM)
- SET(KWSYS_IOS_USE_STRSTREAM_H 0)
- SET(KWSYS_IOS_USE_STRSTREA_H 0)
-ELSE()
- KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_USE_STRSTREAM_H
- "Checking whether strstream.h is available" DIRECT)
- IF(KWSYS_IOS_USE_STRSTREAM_H)
- SET(KWSYS_IOS_USE_STRSTREA_H 0)
- ELSE()
- KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_USE_STRSTREA_H
- "Checking whether strstrea.h is available" DIRECT)
- ENDIF()
-ENDIF()
-
-KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_CSTDDEF
- "Checking whether header cstddef is available" DIRECT)
-
-SET(KWSYS_PLATFORM_CXX_TEST_DEFINES
- -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD})
-KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_NEQ_CHAR
- "Checking whether stl string has operator!= for char*" DIRECT)
-KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ITERATOR_TRAITS
- "Checking whether stl has iterator_traits" DIRECT)
-IF(KWSYS_STL_HAS_ITERATOR_TRAITS)
- SET(KWSYS_STL_HAS_ITERATOR_CATEGORY 0)
- SET(KWSYS_STL_HAS___ITERATOR_CATEGORY 0)
-ELSE()
- KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ITERATOR_CATEGORY
- "Checking whether stl has old iterator_category" DIRECT)
- IF(KWSYS_STL_HAS_ITERATOR_CATEGORY)
- SET(KWSYS_STL_HAS___ITERATOR_CATEGORY 0)
- ELSE()
- KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS___ITERATOR_CATEGORY
- "Checking whether stl has internal __iterator_category" DIRECT)
- ENDIF()
-ENDIF()
-KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
- "Checking whether stl has standard template allocator" DIRECT)
-IF(KWSYS_STL_HAS_ALLOCATOR_TEMPLATE)
- SET(KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE 0)
- KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ALLOCATOR_REBIND
- "Checking for rebind member of stl allocator" DIRECT)
- KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
- "Checking for non-standard argument to stl allocator<>::max_size" DIRECT)
-ELSE()
- KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
- "Checking whether stl has old non-template allocator" DIRECT)
- SET(KWSYS_STL_HAS_ALLOCATOR_REBIND 0)
- SET(KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT 0)
-ENDIF()
-KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ALLOCATOR_OBJECTS
- "Checking whether stl containers support allocator objects." DIRECT)
-IF(KWSYS_IOS_USE_ANSI AND NOT WATCOM)
- # ANSI streams always have string operators.
- SET(KWSYS_STL_STRING_HAVE_OSTREAM 1)
- SET(KWSYS_STL_STRING_HAVE_ISTREAM 1)
-ELSE()
- # There may not be string operators for old streams.
- KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_OSTREAM
- "Checking whether stl string has ostream operator<<" DIRECT)
- KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_ISTREAM
- "Checking whether stl string has istream operator>>" DIRECT)
-ENDIF()
-SET(KWSYS_PLATFORM_CXX_TEST_DEFINES
- -DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI}
- -DKWSYS_IOS_HAVE_STD=${KWSYS_IOS_HAVE_STD})
-KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAVE_BINARY
- "Checking whether ios has binary openmode" DIRECT)
-SET(KWSYS_PLATFORM_CXX_TEST_DEFINES)
-
-KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
- "Checking whether \"<>\" is needed for template friends" INVERT)
-KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_MEMBER_TEMPLATES
- "Checking for member template support" DIRECT)
-KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_FULL_SPECIALIZATION
- "Checking for standard template specialization syntax" DIRECT)
-KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
- "Checking whether argument dependent lookup is supported" DIRECT)
-
IF(UNIX)
KWSYS_PLATFORM_CXX_TEST(KWSYS_STAT_HAS_ST_MTIM
"Checking whether struct stat has st_mtim member" DIRECT)
@@ -558,9 +450,6 @@ ENDIF()
IF(KWSYS_USE_IOStream)
# Determine whether iostreams support long long.
- SET(KWSYS_PLATFORM_CXX_TEST_DEFINES
- -DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI}
- -DKWSYS_IOS_HAVE_STD=${KWSYS_IOS_HAVE_STD})
IF(KWSYS_CXX_HAS_LONG_LONG)
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAS_ISTREAM_LONG_LONG
"Checking if istream supports long long" DIRECT)
@@ -579,7 +468,6 @@ IF(KWSYS_USE_IOStream)
SET(KWSYS_IOS_HAS_ISTREAM___INT64 0)
SET(KWSYS_IOS_HAS_OSTREAM___INT64 0)
ENDIF()
- SET(KWSYS_PLATFORM_CXX_TEST_DEFINES)
ENDIF()
IF(KWSYS_NAMESPACE MATCHES "^kwsys$")
@@ -832,84 +720,6 @@ IF(KWSYS_INSTALL_DOC_DIR)
ENDIF()
#-----------------------------------------------------------------------------
-# Create STL header wrappers to block warnings in the STL headers and
-# give standard names by which they may be included.
-SET(KWSYS_STL_HEADER_EXTRA_string 1)
-FOREACH(header
- algorithm
- deque
- exception
- functional
- iterator
- list
- map
- memory
- new
- numeric
- queue
- set
- stack
- stdexcept
- string
- utility
- vector
- )
- # Configure the header wrapper.
- SET(KWSYS_STL_HEADER "${header}")
- IF(KWSYS_STL_HEADER_EXTRA_${header})
- SET(KWSYS_STL_HEADER_EXTRA
- "#define ${KWSYS_NAMESPACE}_stl_${header}_including_hxx\n# include <${KWSYS_NAMESPACE}/stl/${header}.hxx>\n#undef ${KWSYS_NAMESPACE}_stl_${header}_including_hxx\n")
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_stl_${header}.hxx.in
- ${KWSYS_HEADER_DIR}/stl/${header}.hxx
- @ONLY IMMEDIATE)
- IF(KWSYS_INSTALL_INCLUDE_DIR)
- INSTALL(FILES ${KWSYS_HEADER_DIR}/stl/${header}.hxx
- DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/stl
- ${KWSYS_INSTALL_INCLUDE_OPTIONS})
- ENDIF()
- ELSE()
- SET(KWSYS_STL_HEADER_EXTRA "")
- ENDIF()
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_stl.hxx.in
- ${KWSYS_HEADER_DIR}/stl/${header}
- @ONLY IMMEDIATE)
-
- # Create an install target for the header wrapper.
- IF(KWSYS_INSTALL_INCLUDE_DIR)
- INSTALL(FILES ${KWSYS_HEADER_DIR}/stl/${header}
- DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/stl
- ${KWSYS_INSTALL_INCLUDE_OPTIONS})
- ENDIF()
-ENDFOREACH()
-
-# Provide cstddef header.
-CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_cstddef.hxx.in
- ${KWSYS_HEADER_DIR}/cstddef
- @ONLY IMMEDIATE)
-IF(KWSYS_INSTALL_INCLUDE_DIR)
- INSTALL(FILES ${KWSYS_HEADER_DIR}/cstddef
- DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}
- ${KWSYS_INSTALL_INCLUDE_OPTIONS})
-ENDIF()
-
-#-----------------------------------------------------------------------------
-# Create streams header wrappers to give standard names by which they
-# may be included.
-FOREACH(header iostream fstream sstream iosfwd)
- # Configure the header wrapper.
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_ios_${header}.h.in
- ${KWSYS_HEADER_DIR}/ios/${header}
- @ONLY IMMEDIATE)
-
- # Create an install target for the header wrapper.
- IF(KWSYS_INSTALL_INCLUDE_DIR)
- INSTALL(FILES ${KWSYS_HEADER_DIR}/ios/${header}
- DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/ios
- ${KWSYS_INSTALL_INCLUDE_OPTIONS})
- ENDIF()
-ENDFOREACH()
-
-#-----------------------------------------------------------------------------
# Build a list of classes and headers we need to implement the
# selected components. Initialize with required components.
SET(KWSYS_CLASSES)
diff --git a/Source/kwsys/CTestCustom.cmake.in b/Source/kwsys/CTestCustom.cmake.in
index d6f802e..760221b 100644
--- a/Source/kwsys/CTestCustom.cmake.in
+++ b/Source/kwsys/CTestCustom.cmake.in
@@ -9,7 +9,6 @@
# resulting memory leaks are not logged by valgrind anyway. Therefore, we
# don't have to exclude it.
-set(CTEST_CUSTOM_MEMCHECK_IGNORE
- ${CTEST_CUSTOM_MEMCHECK_IGNORE}
+list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
kwsys.testProcess-10
)
diff --git a/Source/kwsys/CommandLineArguments.cxx b/Source/kwsys/CommandLineArguments.cxx
index 9fa9802..3636836 100644
--- a/Source/kwsys/CommandLineArguments.cxx
+++ b/Source/kwsys/CommandLineArguments.cxx
@@ -15,22 +15,19 @@
#include KWSYS_HEADER(Configure.hxx)
#include KWSYS_HEADER(String.hxx)
-#include KWSYS_HEADER(stl/vector)
-#include KWSYS_HEADER(stl/map)
-#include KWSYS_HEADER(stl/set)
-#include KWSYS_HEADER(ios/sstream)
-#include KWSYS_HEADER(ios/iostream)
-
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "CommandLineArguments.hxx.in"
# include "Configure.hxx.in"
-# include "kwsys_stl.hxx.in"
-# include "kwsys_ios_sstream.h.in"
-# include "kwsys_ios_iostream.h.in"
#endif
+#include <vector>
+#include <map>
+#include <set>
+#include <sstream>
+#include <iostream>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -45,7 +42,7 @@
#if 0
# define CommandLineArguments_DEBUG(x) \
- kwsys_ios::cout << __LINE__ << " CLA: " << x << kwsys_ios::endl
+ std::cout << __LINE__ << " CLA: " << x << std::endl
#else
# define CommandLineArguments_DEBUG(x)
#endif
@@ -67,11 +64,11 @@ struct CommandLineArgumentsCallbackStructure
};
class CommandLineArgumentsVectorOfStrings :
- public kwsys_stl::vector<kwsys::String> {};
+ public std::vector<kwsys::String> {};
class CommandLineArgumentsSetOfStrings :
- public kwsys_stl::set<kwsys::String> {};
+ public std::set<kwsys::String> {};
class CommandLineArgumentsMapOfStrucs :
- public kwsys_stl::map<kwsys::String,
+ public std::map<kwsys::String,
CommandLineArgumentsCallbackStructure> {};
class CommandLineArgumentsInternal
@@ -152,8 +149,8 @@ void CommandLineArguments::ProcessArgument(const char* arg)
//----------------------------------------------------------------------------
bool CommandLineArguments::GetMatchedArguments(
- kwsys_stl::vector<kwsys_stl::string>* matches,
- const kwsys_stl::string& arg)
+ std::vector<std::string>* matches,
+ const std::string& arg)
{
matches->clear();
CommandLineArguments::Internal::CallbacksMap::iterator it;
@@ -184,15 +181,15 @@ bool CommandLineArguments::GetMatchedArguments(
//----------------------------------------------------------------------------
int CommandLineArguments::Parse()
{
- kwsys_stl::vector<kwsys_stl::string>::size_type cc;
- kwsys_stl::vector<kwsys_stl::string> matches;
+ std::vector<std::string>::size_type cc;
+ std::vector<std::string> matches;
if ( this->StoreUnusedArgumentsFlag )
{
this->Internals->UnusedArguments.clear();
}
for ( cc = 0; cc < this->Internals->Argv.size(); cc ++ )
{
- const kwsys_stl::string& arg = this->Internals->Argv[cc];
+ const std::string& arg = this->Internals->Argv[cc];
CommandLineArguments_DEBUG("Process argument: " << arg);
this->Internals->LastArgument = cc;
if ( this->GetMatchedArguments(&matches, arg) )
@@ -214,7 +211,7 @@ int CommandLineArguments::Parse()
// additional value
CommandLineArgumentsCallbackStructure *cs
= &this->Internals->Callbacks[matches[maxidx]];
- const kwsys_stl::string& sarg = matches[maxidx];
+ const std::string& sarg = matches[maxidx];
if ( cs->Argument != sarg )
{
abort();
@@ -267,7 +264,7 @@ int CommandLineArguments::Parse()
CommandLineArguments_DEBUG("This is a multi argument: " << arg);
for (cc++; cc < this->Internals->Argv.size(); ++ cc )
{
- const kwsys_stl::string& marg = this->Internals->Argv[cc];
+ const std::string& marg = this->Internals->Argv[cc];
CommandLineArguments_DEBUG(" check multi argument value: " << marg);
if ( this->GetMatchedArguments(&matches, marg) )
{
@@ -288,7 +285,7 @@ int CommandLineArguments::Parse()
}
break;
default:
- kwsys_ios::cerr << "Got unknown argument type: \"" << cs->ArgumentType << "\"" << kwsys_ios::endl;
+ std::cerr << "Got unknown argument type: \"" << cs->ArgumentType << "\"" << std::endl;
this->Internals->LastArgument --;
return 0;
}
@@ -313,7 +310,7 @@ int CommandLineArguments::Parse()
}
else
{
- kwsys_ios::cerr << "Got unknown argument: \"" << arg << "\"" << kwsys_ios::endl;
+ std::cerr << "Got unknown argument: \"" << arg << "\"" << std::endl;
this->Internals->LastArgument --;
return 0;
}
@@ -430,13 +427,13 @@ CommandLineArgumentsAddArgumentMacro(BOOL, bool)
CommandLineArgumentsAddArgumentMacro(INT, int)
CommandLineArgumentsAddArgumentMacro(DOUBLE, double)
CommandLineArgumentsAddArgumentMacro(STRING, char*)
-CommandLineArgumentsAddArgumentMacro(STL_STRING, kwsys_stl::string)
+CommandLineArgumentsAddArgumentMacro(STL_STRING, std::string)
-CommandLineArgumentsAddArgumentMacro(VECTOR_BOOL, kwsys_stl::vector<bool>)
-CommandLineArgumentsAddArgumentMacro(VECTOR_INT, kwsys_stl::vector<int>)
-CommandLineArgumentsAddArgumentMacro(VECTOR_DOUBLE, kwsys_stl::vector<double>)
-CommandLineArgumentsAddArgumentMacro(VECTOR_STRING, kwsys_stl::vector<char*>)
-CommandLineArgumentsAddArgumentMacro(VECTOR_STL_STRING, kwsys_stl::vector<kwsys_stl::string>)
+CommandLineArgumentsAddArgumentMacro(VECTOR_BOOL, std::vector<bool>)
+CommandLineArgumentsAddArgumentMacro(VECTOR_INT, std::vector<int>)
+CommandLineArgumentsAddArgumentMacro(VECTOR_DOUBLE, std::vector<double>)
+CommandLineArgumentsAddArgumentMacro(VECTOR_STRING, std::vector<char*>)
+CommandLineArgumentsAddArgumentMacro(VECTOR_STL_STRING, std::vector<std::string>)
//----------------------------------------------------------------------------
#define CommandLineArgumentsAddBooleanArgumentMacro(type, ctype) \
@@ -451,7 +448,7 @@ CommandLineArgumentsAddBooleanArgumentMacro(BOOL, bool)
CommandLineArgumentsAddBooleanArgumentMacro(INT, int)
CommandLineArgumentsAddBooleanArgumentMacro(DOUBLE, double)
CommandLineArgumentsAddBooleanArgumentMacro(STRING, char*)
-CommandLineArgumentsAddBooleanArgumentMacro(STL_STRING, kwsys_stl::string)
+CommandLineArgumentsAddBooleanArgumentMacro(STL_STRING, std::string)
//----------------------------------------------------------------------------
void CommandLineArguments::SetClientData(void* client_data)
@@ -518,12 +515,12 @@ unsigned int CommandLineArguments::GetLastArgument()
//----------------------------------------------------------------------------
void CommandLineArguments::GenerateHelp()
{
- kwsys_ios::ostringstream str;
+ std::ostringstream str;
// Collapse all arguments into the map of vectors of all arguments that do
// the same thing.
CommandLineArguments::Internal::CallbacksMap::iterator it;
- typedef kwsys_stl::map<CommandLineArguments::Internal::String,
+ typedef std::map<CommandLineArguments::Internal::String,
CommandLineArguments::Internal::SetOfStrings > MapArgs;
MapArgs mp;
MapArgs::iterator mpit, smpit;
@@ -604,7 +601,7 @@ void CommandLineArguments::GenerateHelp()
CommandLineArguments::Internal::SetOfStrings::iterator sit;
for ( sit = mpit->second.begin(); sit != mpit->second.end(); sit++ )
{
- str << kwsys_ios::endl;
+ str << std::endl;
char argument[100];
sprintf(argument, "%s", sit->c_str());
switch ( this->Internals->Callbacks[*sit].ArgumentType )
@@ -658,8 +655,8 @@ void CommandLineArguments::GenerateHelp()
skip = cc;
}
}
- str.write(ptr, static_cast<kwsys_ios::streamsize>(skip));
- str << kwsys_ios::endl;
+ str.write(ptr, static_cast<std::streamsize>(skip));
+ str << std::endl;
ptr += skip;
len -= skip;
cnt ++;
@@ -680,7 +677,7 @@ void CommandLineArguments::GenerateHelp()
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
- bool* variable, const kwsys_stl::string& value)
+ bool* variable, const std::string& value)
{
if ( value == "1" || value == "ON" || value == "on" || value == "On" ||
value == "TRUE" || value == "true" || value == "True" ||
@@ -696,7 +693,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
- int* variable, const kwsys_stl::string& value)
+ int* variable, const std::string& value)
{
char* res = 0;
*variable = static_cast<int>(strtol(value.c_str(), &res, 10));
@@ -708,7 +705,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
- double* variable, const kwsys_stl::string& value)
+ double* variable, const std::string& value)
{
char* res = 0;
*variable = strtod(value.c_str(), &res);
@@ -720,7 +717,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
- char** variable, const kwsys_stl::string& value)
+ char** variable, const std::string& value)
{
if ( *variable )
{
@@ -733,14 +730,14 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
- kwsys_stl::string* variable, const kwsys_stl::string& value)
+ std::string* variable, const std::string& value)
{
*variable = value;
}
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
- kwsys_stl::vector<bool>* variable, const kwsys_stl::string& value)
+ std::vector<bool>* variable, const std::string& value)
{
bool val = false;
if ( value == "1" || value == "ON" || value == "on" || value == "On" ||
@@ -754,7 +751,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
- kwsys_stl::vector<int>* variable, const kwsys_stl::string& value)
+ std::vector<int>* variable, const std::string& value)
{
char* res = 0;
variable->push_back(static_cast<int>(strtol(value.c_str(), &res, 10)));
@@ -766,7 +763,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
- kwsys_stl::vector<double>* variable, const kwsys_stl::string& value)
+ std::vector<double>* variable, const std::string& value)
{
char* res = 0;
variable->push_back(strtod(value.c_str(), &res));
@@ -778,7 +775,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
- kwsys_stl::vector<char*>* variable, const kwsys_stl::string& value)
+ std::vector<char*>* variable, const std::string& value)
{
char* var = new char[ value.size() + 1 ];
strcpy(var, value.c_str());
@@ -787,8 +784,8 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
- kwsys_stl::vector<kwsys_stl::string>* variable,
- const kwsys_stl::string& value)
+ std::vector<std::string>* variable,
+ const std::string& value)
{
variable->push_back(value);
}
@@ -809,7 +806,7 @@ bool CommandLineArguments::PopulateVariable(CommandLineArgumentsCallbackStructur
CommandLineArguments_DEBUG("Set argument: " << cs->Argument << " to " << value);
if ( cs->Variable )
{
- kwsys_stl::string var = "1";
+ std::string var = "1";
if ( value )
{
var = value;
@@ -826,28 +823,28 @@ bool CommandLineArguments::PopulateVariable(CommandLineArgumentsCallbackStructur
this->PopulateVariable(static_cast<char**>(cs->Variable), var);
break;
case CommandLineArguments::STL_STRING_TYPE:
- this->PopulateVariable(static_cast<kwsys_stl::string*>(cs->Variable), var);
+ this->PopulateVariable(static_cast<std::string*>(cs->Variable), var);
break;
case CommandLineArguments::BOOL_TYPE:
this->PopulateVariable(static_cast<bool*>(cs->Variable), var);
break;
case CommandLineArguments::VECTOR_BOOL_TYPE:
- this->PopulateVariable(static_cast<kwsys_stl::vector<bool>*>(cs->Variable), var);
+ this->PopulateVariable(static_cast<std::vector<bool>*>(cs->Variable), var);
break;
case CommandLineArguments::VECTOR_INT_TYPE:
- this->PopulateVariable(static_cast<kwsys_stl::vector<int>*>(cs->Variable), var);
+ this->PopulateVariable(static_cast<std::vector<int>*>(cs->Variable), var);
break;
case CommandLineArguments::VECTOR_DOUBLE_TYPE:
- this->PopulateVariable(static_cast<kwsys_stl::vector<double>*>(cs->Variable), var);
+ this->PopulateVariable(static_cast<std::vector<double>*>(cs->Variable), var);
break;
case CommandLineArguments::VECTOR_STRING_TYPE:
- this->PopulateVariable(static_cast<kwsys_stl::vector<char*>*>(cs->Variable), var);
+ this->PopulateVariable(static_cast<std::vector<char*>*>(cs->Variable), var);
break;
case CommandLineArguments::VECTOR_STL_STRING_TYPE:
- this->PopulateVariable(static_cast<kwsys_stl::vector<kwsys_stl::string>*>(cs->Variable), var);
+ this->PopulateVariable(static_cast<std::vector<std::string>*>(cs->Variable), var);
break;
default:
- kwsys_ios::cerr << "Got unknown variable type: \"" << cs->VariableType << "\"" << kwsys_ios::endl;
+ std::cerr << "Got unknown variable type: \"" << cs->VariableType << "\"" << std::endl;
this->Internals->LastArgument --;
return 0;
}
diff --git a/Source/kwsys/CommandLineArguments.hxx.in b/Source/kwsys/CommandLineArguments.hxx.in
index cbf6ee3..e4f6d02 100644
--- a/Source/kwsys/CommandLineArguments.hxx.in
+++ b/Source/kwsys/CommandLineArguments.hxx.in
@@ -15,13 +15,8 @@
#include <@KWSYS_NAMESPACE@/Configure.h>
#include <@KWSYS_NAMESPACE@/Configure.hxx>
-#include <@KWSYS_NAMESPACE@/stl/string>
-#include <@KWSYS_NAMESPACE@/stl/vector>
-
-/* Define this macro temporarily to keep the code readable. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# define kwsys_stl @KWSYS_NAMESPACE@_stl
-#endif
+#include <string>
+#include <vector>
namespace @KWSYS_NAMESPACE@
{
@@ -64,7 +59,7 @@ struct CommandLineArgumentsCallbackStructure;
* "This is help string for --something");
* if ( !arg.Parse() )
* {
- * kwsys_ios::cerr << "Problem parsing arguments" << kwsys_ios::endl;
+ * std::cerr << "Problem parsing arguments" << std::endl;
* res = 1;
* }
*
@@ -155,7 +150,7 @@ public:
void AddArgument(const char* argument, ArgumentTypeEnum type,
char** variable, const char* help);
void AddArgument(const char* argument, ArgumentTypeEnum type,
- kwsys_stl::string* variable, const char* help);
+ std::string* variable, const char* help);
/**
* Add handler for argument which is going to set the variable to the
@@ -163,15 +158,15 @@ public:
* appropriate type. This will handle the multi argument values.
*/
void AddArgument(const char* argument, ArgumentTypeEnum type,
- kwsys_stl::vector<bool>* variable, const char* help);
+ std::vector<bool>* variable, const char* help);
void AddArgument(const char* argument, ArgumentTypeEnum type,
- kwsys_stl::vector<int>* variable, const char* help);
+ std::vector<int>* variable, const char* help);
void AddArgument(const char* argument, ArgumentTypeEnum type,
- kwsys_stl::vector<double>* variable, const char* help);
+ std::vector<double>* variable, const char* help);
void AddArgument(const char* argument, ArgumentTypeEnum type,
- kwsys_stl::vector<char*>* variable, const char* help);
+ std::vector<char*>* variable, const char* help);
void AddArgument(const char* argument, ArgumentTypeEnum type,
- kwsys_stl::vector<kwsys_stl::string>* variable, const char* help);
+ std::vector<std::string>* variable, const char* help);
/**
* Add handler for boolean argument. The argument does not take any option
@@ -187,7 +182,7 @@ public:
void AddBooleanArgument(const char* argument,
char** variable, const char* help);
void AddBooleanArgument(const char* argument,
- kwsys_stl::string* variable, const char* help);
+ std::string* variable, const char* help);
/**
* Set the callbacks for error handling.
@@ -243,28 +238,28 @@ protected:
void AddArgument(const char* argument, ArgumentTypeEnum type,
VariableTypeEnum vtype, void* variable, const char* help);
- bool GetMatchedArguments(kwsys_stl::vector<kwsys_stl::string>* matches,
- const kwsys_stl::string& arg);
+ bool GetMatchedArguments(std::vector<std::string>* matches,
+ const std::string& arg);
//! Populate individual variables
bool PopulateVariable(CommandLineArgumentsCallbackStructure* cs,
const char* value);
//! Populate individual variables of type ...
- void PopulateVariable(bool* variable, const kwsys_stl::string& value);
- void PopulateVariable(int* variable, const kwsys_stl::string& value);
- void PopulateVariable(double* variable, const kwsys_stl::string& value);
- void PopulateVariable(char** variable, const kwsys_stl::string& value);
- void PopulateVariable(kwsys_stl::string* variable, const kwsys_stl::string& value);
- void PopulateVariable(kwsys_stl::vector<bool>* variable, const kwsys_stl::string& value);
- void PopulateVariable(kwsys_stl::vector<int>* variable, const kwsys_stl::string& value);
- void PopulateVariable(kwsys_stl::vector<double>* variable, const kwsys_stl::string& value);
- void PopulateVariable(kwsys_stl::vector<char*>* variable, const kwsys_stl::string& value);
- void PopulateVariable(kwsys_stl::vector<kwsys_stl::string>* variable, const kwsys_stl::string& value);
+ void PopulateVariable(bool* variable, const std::string& value);
+ void PopulateVariable(int* variable, const std::string& value);
+ void PopulateVariable(double* variable, const std::string& value);
+ void PopulateVariable(char** variable, const std::string& value);
+ void PopulateVariable(std::string* variable, const std::string& value);
+ void PopulateVariable(std::vector<bool>* variable, const std::string& value);
+ void PopulateVariable(std::vector<int>* variable, const std::string& value);
+ void PopulateVariable(std::vector<double>* variable, const std::string& value);
+ void PopulateVariable(std::vector<char*>* variable, const std::string& value);
+ void PopulateVariable(std::vector<std::string>* variable, const std::string& value);
typedef CommandLineArgumentsInternal Internal;
Internal* Internals;
- kwsys_stl::string Help;
+ std::string Help;
unsigned int LineLength;
@@ -273,11 +268,6 @@ protected:
} // namespace @KWSYS_NAMESPACE@
-/* Undefine temporary macro. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# undef kwsys_stl
-#endif
-
#endif
diff --git a/Source/kwsys/Configure.hxx.in b/Source/kwsys/Configure.hxx.in
index 8f5ace2..3faf862 100644
--- a/Source/kwsys/Configure.hxx.in
+++ b/Source/kwsys/Configure.hxx.in
@@ -15,125 +15,9 @@
/* Include C configuration. */
#include <@KWSYS_NAMESPACE@/Configure.h>
-/* Whether ANSI C++ stream headers are to be used. */
-#define @KWSYS_NAMESPACE@_IOS_USE_ANSI @KWSYS_IOS_USE_ANSI@
-
-/* Whether ANSI C++ streams are in std namespace. */
-#define @KWSYS_NAMESPACE@_IOS_HAVE_STD @KWSYS_IOS_HAVE_STD@
-
-/* Whether ANSI C++ <sstream> header is to be used. */
-#define @KWSYS_NAMESPACE@_IOS_USE_SSTREAM @KWSYS_IOS_USE_SSTREAM@
-
-/* Whether old C++ <strstream.h> header is to be used. */
-#define @KWSYS_NAMESPACE@_IOS_USE_STRSTREAM_H @KWSYS_IOS_USE_STRSTREAM_H@
-
-/* Whether old C++ <strstrea.h> header is to be used. */
-#define @KWSYS_NAMESPACE@_IOS_USE_STRSTREA_H @KWSYS_IOS_USE_STRSTREA_H@
-
-/* Whether C++ streams support the ios::binary openmode. */
-#define @KWSYS_NAMESPACE@_IOS_HAVE_BINARY @KWSYS_IOS_HAVE_BINARY@
-
-/* Whether STL is in std namespace. */
-#define @KWSYS_NAMESPACE@_STL_HAVE_STD @KWSYS_STL_HAVE_STD@
-
/* Whether wstring is available. */
#define @KWSYS_NAMESPACE@_STL_HAS_WSTRING @KWSYS_STL_HAS_WSTRING@
-/* Whether the STL string has operator<< for ostream. */
-#define @KWSYS_NAMESPACE@_STL_STRING_HAVE_OSTREAM @KWSYS_STL_STRING_HAVE_OSTREAM@
-
-/* Whether the STL string has operator>> for istream. */
-#define @KWSYS_NAMESPACE@_STL_STRING_HAVE_ISTREAM @KWSYS_STL_STRING_HAVE_ISTREAM@
-
-/* Whether the STL string has operator!= for char*. */
-#define @KWSYS_NAMESPACE@_STL_STRING_HAVE_NEQ_CHAR @KWSYS_STL_STRING_HAVE_NEQ_CHAR@
-
-/* Define the stl namespace macro. */
-#if @KWSYS_NAMESPACE@_STL_HAVE_STD
-# define @KWSYS_NAMESPACE@_stl std
-#else
-# define @KWSYS_NAMESPACE@_stl
-#endif
-
-/* Define the ios namespace macro. */
-#if @KWSYS_NAMESPACE@_IOS_HAVE_STD
-# define @KWSYS_NAMESPACE@_ios_namespace std
-#else
-# define @KWSYS_NAMESPACE@_ios_namespace
-#endif
-#if @KWSYS_NAMESPACE@_IOS_USE_SSTREAM
-# define @KWSYS_NAMESPACE@_ios @KWSYS_NAMESPACE@_ios_namespace
-#else
-# define @KWSYS_NAMESPACE@_ios @KWSYS_NAMESPACE@_ios
-#endif
-
-/* Define the ios::binary openmode macro. */
-#if @KWSYS_NAMESPACE@_IOS_HAVE_BINARY
-# define @KWSYS_NAMESPACE@_ios_binary @KWSYS_NAMESPACE@_ios::ios::binary
-#else
-# define @KWSYS_NAMESPACE@_ios_binary 0
-#endif
-
-/* Whether the cstddef header is available. */
-#define @KWSYS_NAMESPACE@_CXX_HAS_CSTDDEF @KWSYS_CXX_HAS_CSTDDEF@
-
-/* Whether the compiler supports null template arguments. */
-#define @KWSYS_NAMESPACE@_CXX_HAS_NULL_TEMPLATE_ARGS @KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS@
-
-/* Define the null template arguments macro. */
-#if @KWSYS_NAMESPACE@_CXX_HAS_NULL_TEMPLATE_ARGS
-# define @KWSYS_NAMESPACE@_CXX_NULL_TEMPLATE_ARGS <>
-#else
-# define @KWSYS_NAMESPACE@_CXX_NULL_TEMPLATE_ARGS
-#endif
-
-/* Whether the compiler supports member templates. */
-#define @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES @KWSYS_CXX_HAS_MEMBER_TEMPLATES@
-
-/* Whether the compiler supports argument dependent lookup. */
-#define @KWSYS_NAMESPACE@_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP @KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP@
-
-/* Whether the compiler supports standard full specialization syntax. */
-#define @KWSYS_NAMESPACE@_CXX_HAS_FULL_SPECIALIZATION @KWSYS_CXX_HAS_FULL_SPECIALIZATION@
-
-/* Define the specialization definition macro. */
-#if @KWSYS_NAMESPACE@_CXX_HAS_FULL_SPECIALIZATION
-# define @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION template <>
-#else
-# define @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
-#endif
-
-/* Define typename keyword macro for use in declarations. */
-#if defined(_MSC_VER) && _MSC_VER < 1300
-# define @KWSYS_NAMESPACE@_CXX_DECL_TYPENAME
-#else
-# define @KWSYS_NAMESPACE@_CXX_DECL_TYPENAME typename
-#endif
-
-/* Whether the stl has iterator_traits. */
-#define @KWSYS_NAMESPACE@_STL_HAS_ITERATOR_TRAITS @KWSYS_STL_HAS_ITERATOR_TRAITS@
-
-/* Whether the stl has iterator_category. */
-#define @KWSYS_NAMESPACE@_STL_HAS_ITERATOR_CATEGORY @KWSYS_STL_HAS_ITERATOR_CATEGORY@
-
-/* Whether the stl has __iterator_category. */
-#define @KWSYS_NAMESPACE@_STL_HAS___ITERATOR_CATEGORY @KWSYS_STL_HAS___ITERATOR_CATEGORY@
-
-/* Whether the stl allocator is the standard template. */
-#define @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_TEMPLATE @KWSYS_STL_HAS_ALLOCATOR_TEMPLATE@
-
-/* Whether the stl allocator is not a template. */
-#define @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_NONTEMPLATE @KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE@
-
-/* Whether the stl allocator has rebind. */
-#define @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_REBIND @KWSYS_STL_HAS_ALLOCATOR_REBIND@
-
-/* Whether the stl allocator has a size argument for max_size. */
-#define @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT @KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT@
-
-/* Whether the stl containers support allocator objects. */
-#define @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_OBJECTS @KWSYS_STL_HAS_ALLOCATOR_OBJECTS@
-
/* Whether struct stat has the st_mtim member for high resolution times. */
#define @KWSYS_NAMESPACE@_STAT_HAS_ST_MTIM @KWSYS_STAT_HAS_ST_MTIM@
@@ -141,38 +25,10 @@
access to the macros without a configured namespace. */
#if defined(KWSYS_NAMESPACE)
# if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# define kwsys_stl @KWSYS_NAMESPACE@_stl
-# define kwsys_ios @KWSYS_NAMESPACE@_ios
# define kwsys @KWSYS_NAMESPACE@
-# define kwsys_ios_binary @KWSYS_NAMESPACE@_ios_binary
# endif
# define KWSYS_NAME_IS_KWSYS @KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# define KWSYS_STL_HAVE_STD @KWSYS_NAMESPACE@_STL_HAVE_STD
-# define KWSYS_IOS_HAVE_STD @KWSYS_NAMESPACE@_IOS_HAVE_STD
-# define KWSYS_IOS_USE_ANSI @KWSYS_NAMESPACE@_IOS_USE_ANSI
-# define KWSYS_IOS_USE_SSTREAM @KWSYS_NAMESPACE@_IOS_USE_SSTREAM
-# define KWSYS_IOS_USE_STRSTREAM_H @KWSYS_NAMESPACE@_IOS_USE_STRSTREAM_H
-# define KWSYS_IOS_USE_STRSTREA_H @KWSYS_NAMESPACE@_IOS_USE_STRSTREA_H
-# define KWSYS_IOS_HAVE_BINARY @KWSYS_NAMESPACE@_IOS_HAVE_BINARY
# define KWSYS_STAT_HAS_ST_MTIM @KWSYS_NAMESPACE@_STAT_HAS_ST_MTIM
-# define KWSYS_CXX_HAS_CSTDDEF @KWSYS_NAMESPACE@_CXX_HAS_CSTDDEF
-# define KWSYS_STL_STRING_HAVE_OSTREAM @KWSYS_NAMESPACE@_STL_STRING_HAVE_OSTREAM
-# define KWSYS_STL_STRING_HAVE_ISTREAM @KWSYS_NAMESPACE@_STL_STRING_HAVE_ISTREAM
-# define KWSYS_STL_STRING_HAVE_NEQ_CHAR @KWSYS_NAMESPACE@_STL_STRING_HAVE_NEQ_CHAR
-# define KWSYS_CXX_NULL_TEMPLATE_ARGS @KWSYS_NAMESPACE@_CXX_NULL_TEMPLATE_ARGS
-# define KWSYS_CXX_HAS_MEMBER_TEMPLATES @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES
-# define KWSYS_CXX_HAS_FULL_SPECIALIZATION @KWSYS_NAMESPACE@_CXX_HAS_FULL_SPECIALIZATION
-# define KWSYS_CXX_DEFINE_SPECIALIZATION @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
-# define KWSYS_CXX_DECL_TYPENAME @KWSYS_NAMESPACE@_CXX_DECL_TYPENAME
-# define KWSYS_STL_HAS_ALLOCATOR_REBIND @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_REBIND
-# define KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
-# define KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP @KWSYS_NAMESPACE@_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
-# define KWSYS_STL_HAS_ITERATOR_TRAITS @KWSYS_NAMESPACE@_STL_HAS_ITERATOR_TRAITS
-# define KWSYS_STL_HAS_ITERATOR_CATEGORY @KWSYS_NAMESPACE@_STL_HAS_ITERATOR_CATEGORY
-# define KWSYS_STL_HAS___ITERATOR_CATEGORY @KWSYS_NAMESPACE@_STL_HAS___ITERATOR_CATEGORY
-# define KWSYS_STL_HAS_ALLOCATOR_TEMPLATE @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_TEMPLATE
-# define KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_NONTEMPLATE
-# define KWSYS_STL_HAS_ALLOCATOR_OBJECTS @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_OBJECTS
# define KWSYS_STL_HAS_WSTRING @KWSYS_NAMESPACE@_STL_HAS_WSTRING
#endif
diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx
index 58cea63..c549792 100644
--- a/Source/kwsys/Directory.cxx
+++ b/Source/kwsys/Directory.cxx
@@ -16,20 +16,17 @@
#include KWSYS_HEADER(Encoding.hxx)
-#include KWSYS_HEADER(stl/string)
-#include KWSYS_HEADER(stl/vector)
-
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "Directory.hxx.in"
# include "Configure.hxx.in"
# include "Encoding.hxx.in"
-# include "kwsys_stl.hxx.in"
-# include "kwsys_stl_string.hxx.in"
-# include "kwsys_stl_vector.hxx.in"
#endif
+#include <string>
+#include <vector>
+
namespace KWSYS_NAMESPACE
{
@@ -38,10 +35,10 @@ class DirectoryInternals
{
public:
// Array of Files
- kwsys_stl::vector<kwsys_stl::string> Files;
+ std::vector<std::string> Files;
// Path to Open'ed directory
- kwsys_stl::string Path;
+ std::string Path;
};
//----------------------------------------------------------------------------
@@ -103,7 +100,7 @@ void Directory::Clear()
namespace KWSYS_NAMESPACE
{
-bool Directory::Load(const kwsys_stl::string& name)
+bool Directory::Load(const std::string& name)
{
this->Clear();
#if _MSC_VER < 1300
@@ -153,7 +150,7 @@ bool Directory::Load(const kwsys_stl::string& name)
return _findclose(srchHandle) != -1;
}
-unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& name)
+unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name)
{
#if _MSC_VER < 1300
long srchHandle;
@@ -220,7 +217,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na
namespace KWSYS_NAMESPACE
{
-bool Directory::Load(const kwsys_stl::string& name)
+bool Directory::Load(const std::string& name)
{
this->Clear();
@@ -240,7 +237,7 @@ bool Directory::Load(const kwsys_stl::string& name)
return 1;
}
-unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& name)
+unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name)
{
DIR* dir = opendir(name.c_str());
diff --git a/Source/kwsys/Directory.hxx.in b/Source/kwsys/Directory.hxx.in
index 1bcf90e..e68f337 100644
--- a/Source/kwsys/Directory.hxx.in
+++ b/Source/kwsys/Directory.hxx.in
@@ -13,12 +13,7 @@
#define @KWSYS_NAMESPACE@_Directory_hxx
#include <@KWSYS_NAMESPACE@/Configure.h>
-#include <@KWSYS_NAMESPACE@/stl/string>
-
-/* Define these macros temporarily to keep the code readable. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# define kwsys_stl @KWSYS_NAMESPACE@_stl
-#endif
+#include <string>
namespace @KWSYS_NAMESPACE@
{
@@ -44,7 +39,7 @@ public:
* in that directory. 0 is returned if the directory can not be
* opened, 1 if it is opened.
*/
- bool Load(const kwsys_stl::string&);
+ bool Load(const std::string&);
/**
* Return the number of files in the current directory.
@@ -55,7 +50,7 @@ public:
* Return the number of files in the specified directory.
* A higher performance static method.
*/
- static unsigned long GetNumberOfFilesInDirectory(const kwsys_stl::string&);
+ static unsigned long GetNumberOfFilesInDirectory(const std::string&);
/**
* Return the file at the given index, the indexing is 0 based
@@ -83,9 +78,4 @@ private:
} // namespace @KWSYS_NAMESPACE@
-/* Undefine temporary macros. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# undef kwsys_stl
-#endif
-
#endif
diff --git a/Source/kwsys/DynamicLoader.cxx b/Source/kwsys/DynamicLoader.cxx
index a776f97..1941d96 100644
--- a/Source/kwsys/DynamicLoader.cxx
+++ b/Source/kwsys/DynamicLoader.cxx
@@ -40,7 +40,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
-DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
return shl_load(libname.c_str(), BIND_DEFERRED | DYNAMIC_PATH, 0L);
}
@@ -57,7 +57,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer
-DynamicLoader::GetSymbolAddress(DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
+DynamicLoader::GetSymbolAddress(DynamicLoader::LibraryHandle lib, const std::string& sym)
{
void* addr;
int status;
@@ -115,7 +115,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
-DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
NSObjectFileImageReturnCode rc;
NSObjectFileImage image = 0;
@@ -146,7 +146,7 @@ int DynamicLoader::CloseLibrary( DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
- DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
{
void *result=0;
// Need to prepend symbols with '_' on Apple-gcc compilers
@@ -187,7 +187,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
-DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname)
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname)
{
DynamicLoader::LibraryHandle lh;
int length = MultiByteToWideChar(CP_UTF8, 0, libname.c_str(), -1, NULL, 0);
@@ -207,7 +207,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
- DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
{
// TODO: The calling convention affects the name of the symbol. We
// should have a tool to help get the symbol with the desired
@@ -302,7 +302,7 @@ namespace KWSYS_NAMESPACE
static image_id last_dynamic_err = B_OK;
//----------------------------------------------------------------------------
-DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
// image_id's are integers, errors are negative. Add one just in case we
// get a valid image_id of zero (is that even possible?).
@@ -340,7 +340,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
- DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
{
// Hack to cast pointer-to-data to pointer-to-function.
union
@@ -393,7 +393,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
-DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
return 0;
}
@@ -411,7 +411,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
- DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
{
return 0;
}
@@ -437,7 +437,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
-DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
char *name = (char *)calloc(1, libname.size() + 1);
dld_init(program_invocation_name);
@@ -456,7 +456,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
- DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
{
// Hack to cast pointer-to-data to pointer-to-function.
union
@@ -489,7 +489,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
-DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
return dlopen(libname.c_str(), RTLD_LAZY);
}
@@ -508,7 +508,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
- DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
{
// Hack to cast pointer-to-data to pointer-to-function.
union
diff --git a/Source/kwsys/DynamicLoader.hxx.in b/Source/kwsys/DynamicLoader.hxx.in
index 75811ab..1e4a912 100644
--- a/Source/kwsys/DynamicLoader.hxx.in
+++ b/Source/kwsys/DynamicLoader.hxx.in
@@ -12,8 +12,8 @@
#ifndef @KWSYS_NAMESPACE@_DynamicLoader_hxx
#define @KWSYS_NAMESPACE@_DynamicLoader_hxx
-#include <@KWSYS_NAMESPACE@/Configure.h>
-#include <@KWSYS_NAMESPACE@/stl/string>
+#include <@KWSYS_NAMESPACE@/Configure.hxx>
+#include <string>
#if defined(__hpux)
#include <dl.h>
@@ -28,11 +28,6 @@
#include <be/kernel/image.h>
#endif
-/* Define these macros temporarily to keep the code readable. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# define kwsys_stl @KWSYS_NAMESPACE@_stl
-#endif
-
namespace @KWSYS_NAMESPACE@
{
/** \class DynamicLoader
@@ -83,14 +78,14 @@ public:
/** Load a dynamic library into the current process.
* The returned LibraryHandle can be used to access the symbols in the
* library. */
- static LibraryHandle OpenLibrary(const kwsys_stl::string&);
+ static LibraryHandle OpenLibrary(const std::string&);
/** Attempt to detach a dynamic library from the
* process. A value of true is returned if it is sucessful. */
static int CloseLibrary(LibraryHandle);
/** Find the address of the symbol in the given library. */
- static SymbolPointer GetSymbolAddress(LibraryHandle, const kwsys_stl::string&);
+ static SymbolPointer GetSymbolAddress(LibraryHandle, const std::string&);
/** Return the default module prefix for the current platform. */
static const char* LibPrefix() { return "@KWSYS_DynamicLoader_PREFIX@"; }
@@ -104,9 +99,4 @@ public:
} // namespace @KWSYS_NAMESPACE@
-/* Undefine temporary macros. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# undef kwsys_stl
-#endif
-
#endif
diff --git a/Source/kwsys/Encoding.hxx.in b/Source/kwsys/Encoding.hxx.in
index aba4175..87b1c21 100644
--- a/Source/kwsys/Encoding.hxx.in
+++ b/Source/kwsys/Encoding.hxx.in
@@ -13,13 +13,8 @@
#define @KWSYS_NAMESPACE@_Encoding_hxx
#include <@KWSYS_NAMESPACE@/Configure.hxx>
-#include <@KWSYS_NAMESPACE@/stl/string>
-#include <@KWSYS_NAMESPACE@/stl/vector>
-
-/* Define these macros temporarily to keep the code readable. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# define kwsys_stl @KWSYS_NAMESPACE@_stl
-#endif
+#include <string>
+#include <vector>
namespace @KWSYS_NAMESPACE@
{
@@ -65,23 +60,18 @@ public:
// Convert a narrow string to a wide string.
// On Windows, UTF-8 is assumed, and on other platforms,
// the current locale is assumed.
- static kwsys_stl::wstring ToWide(const kwsys_stl::string& str);
- static kwsys_stl::wstring ToWide(const char* str);
+ static std::wstring ToWide(const std::string& str);
+ static std::wstring ToWide(const char* str);
// Convert a wide string to a narrow string.
// On Windows, UTF-8 is assumed, and on other platforms,
// the current locale is assumed.
- static kwsys_stl::string ToNarrow(const kwsys_stl::wstring& str);
- static kwsys_stl::string ToNarrow(const wchar_t* str);
+ static std::string ToNarrow(const std::wstring& str);
+ static std::string ToNarrow(const wchar_t* str);
#endif // @KWSYS_NAMESPACE@_STL_HAS_WSTRING
}; // class Encoding
} // namespace @KWSYS_NAMESPACE@
-/* Undefine temporary macros. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# undef kwsys_stl
-#endif
-
#endif
diff --git a/Source/kwsys/EncodingCXX.cxx b/Source/kwsys/EncodingCXX.cxx
index 251a56d..7d9b3e4 100644
--- a/Source/kwsys/EncodingCXX.cxx
+++ b/Source/kwsys/EncodingCXX.cxx
@@ -19,7 +19,6 @@
#include "kwsysPrivate.h"
#include KWSYS_HEADER(Encoding.hxx)
#include KWSYS_HEADER(Encoding.h)
-#include KWSYS_HEADER(stl/vector)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
@@ -28,6 +27,7 @@
# include "Encoding.h.in"
#endif
+#include <vector>
#include <stdlib.h>
#include <string.h>
@@ -140,23 +140,23 @@ char const* const* Encoding::CommandLineArguments::argv() const
#if KWSYS_STL_HAS_WSTRING
-kwsys_stl::wstring Encoding::ToWide(const kwsys_stl::string& str)
+std::wstring Encoding::ToWide(const std::string& str)
{
return ToWide(str.c_str());
}
-kwsys_stl::string Encoding::ToNarrow(const kwsys_stl::wstring& str)
+std::string Encoding::ToNarrow(const std::wstring& str)
{
return ToNarrow(str.c_str());
}
-kwsys_stl::wstring Encoding::ToWide(const char* cstr)
+std::wstring Encoding::ToWide(const char* cstr)
{
- kwsys_stl::wstring wstr;
+ std::wstring wstr;
size_t length = kwsysEncoding_mbstowcs(0, cstr, 0) + 1;
if(length > 0)
{
- kwsys_stl::vector<wchar_t> wchars(length);
+ std::vector<wchar_t> wchars(length);
if(kwsysEncoding_mbstowcs(&wchars[0], cstr, length) > 0)
{
wstr = &wchars[0];
@@ -165,9 +165,9 @@ kwsys_stl::wstring Encoding::ToWide(const char* cstr)
return wstr;
}
-kwsys_stl::string Encoding::ToNarrow(const wchar_t* wcstr)
+std::string Encoding::ToNarrow(const wchar_t* wcstr)
{
- kwsys_stl::string str;
+ std::string str;
size_t length = kwsysEncoding_wcstombs(0, wcstr, 0) + 1;
if(length > 0)
{
diff --git a/Source/kwsys/FStream.hxx.in b/Source/kwsys/FStream.hxx.in
index 37055d6..681e4d8 100644
--- a/Source/kwsys/FStream.hxx.in
+++ b/Source/kwsys/FStream.hxx.in
@@ -12,8 +12,8 @@
#ifndef @KWSYS_NAMESPACE@_FStream_hxx
#define @KWSYS_NAMESPACE@_FStream_hxx
-#include <@KWSYS_NAMESPACE@/ios/fstream>
#include <@KWSYS_NAMESPACE@/Encoding.hxx>
+#include <fstream>
namespace @KWSYS_NAMESPACE@
{
@@ -167,8 +167,8 @@ class basic_ofstream : public std::basic_ostream<CharType,Traits>
# undef @KWSYS_NAMESPACE@_FStream_NOEXCEPT
#else
- using @KWSYS_NAMESPACE@_ios_namespace::ofstream;
- using @KWSYS_NAMESPACE@_ios_namespace::ifstream;
+ using std::ofstream;
+ using std::ifstream;
#endif
namespace FStream
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx
index 11bfd16..9d63459 100644
--- a/Source/kwsys/Glob.cxx
+++ b/Source/kwsys/Glob.cxx
@@ -17,9 +17,6 @@
#include KWSYS_HEADER(RegularExpression.hxx)
#include KWSYS_HEADER(SystemTools.hxx)
#include KWSYS_HEADER(Directory.hxx)
-#include KWSYS_HEADER(stl/string)
-#include KWSYS_HEADER(stl/vector)
-#include KWSYS_HEADER(stl/algorithm)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
@@ -29,12 +26,12 @@
# include "Configure.hxx.in"
# include "RegularExpression.hxx.in"
# include "SystemTools.hxx.in"
-# include "kwsys_stl.hxx.in"
-# include "kwsys_stl_string.hxx.in"
-# include "kwsys_stl_vector.hxx.in"
-# include "kwsys_stl_algorithm.hxx.in"
#endif
+#include <string>
+#include <vector>
+#include <algorithm>
+
#include <ctype.h>
#include <stdio.h>
#include <string.h>
@@ -54,8 +51,8 @@ namespace KWSYS_NAMESPACE
class GlobInternals
{
public:
- kwsys_stl::vector<kwsys_stl::string> Files;
- kwsys_stl::vector<kwsys::RegularExpression> Expressions;
+ std::vector<std::string> Files;
+ std::vector<kwsys::RegularExpression> Expressions;
};
//----------------------------------------------------------------------------
@@ -82,21 +79,21 @@ Glob::~Glob()
}
//----------------------------------------------------------------------------
-kwsys_stl::vector<kwsys_stl::string>& Glob::GetFiles()
+std::vector<std::string>& Glob::GetFiles()
{
return this->Internals->Files;
}
//----------------------------------------------------------------------------
-kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
+std::string Glob::PatternToRegex(const std::string& pattern,
bool require_whole_string,
bool preserve_case)
{
// Incrementally build the regular expression from the pattern.
- kwsys_stl::string regex = require_whole_string? "^" : "";
- kwsys_stl::string::const_iterator pattern_first = pattern.begin();
- kwsys_stl::string::const_iterator pattern_last = pattern.end();
- for(kwsys_stl::string::const_iterator i = pattern_first;
+ std::string regex = require_whole_string? "^" : "";
+ std::string::const_iterator pattern_first = pattern.begin();
+ std::string::const_iterator pattern_last = pattern.end();
+ for(std::string::const_iterator i = pattern_first;
i != pattern_last; ++i)
{
int c = *i;
@@ -120,8 +117,8 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
{
// Parse out the bracket expression. It begins just after the
// opening character.
- kwsys_stl::string::const_iterator bracket_first = i+1;
- kwsys_stl::string::const_iterator bracket_last = bracket_first;
+ std::string::const_iterator bracket_first = i+1;
+ std::string::const_iterator bracket_last = bracket_first;
// The first character may be complementation '!' or '^'.
if(bracket_last != pattern_last &&
@@ -153,7 +150,7 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
else
{
// Convert the bracket string to its regex equivalent.
- kwsys_stl::string::const_iterator k = bracket_first;
+ std::string::const_iterator k = bracket_first;
// Open the regex block.
regex += "[";
@@ -221,8 +218,8 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
}
//----------------------------------------------------------------------------
-bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, GlobMessages* messages)
+bool Glob::RecurseDirectory(std::string::size_type start,
+ const std::string& dir, GlobMessages* messages)
{
kwsys::Directory d;
if ( !d.Load(dir) )
@@ -230,8 +227,8 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
return true;
}
unsigned long cc;
- kwsys_stl::string realname;
- kwsys_stl::string fname;
+ std::string realname;
+ std::string fname;
for ( cc = 0; cc < d.GetNumberOfFiles(); cc ++ )
{
fname = d.GetFile(cc);
@@ -262,8 +259,8 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
if (isSymLink)
{
++this->FollowedSymlinkCount;
- kwsys_stl::string realPathErrorMessage;
- kwsys_stl::string canonicalPath(SystemTools::GetRealPath(dir,
+ std::string realPathErrorMessage;
+ std::string canonicalPath(SystemTools::GetRealPath(dir,
&realPathErrorMessage));
if(!realPathErrorMessage.empty())
@@ -277,7 +274,7 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
return false;
}
- if(kwsys_stl::find(this->VisitedSymlinks.begin(),
+ if(std::find(this->VisitedSymlinks.begin(),
this->VisitedSymlinks.end(),
canonicalPath) == this->VisitedSymlinks.end())
{
@@ -299,9 +296,9 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
// else we have already visited this symlink - prevent cyclic recursion
else if(messages)
{
- kwsys_stl::string message;
- for(kwsys_stl::vector<kwsys_stl::string>::const_iterator
- pathIt = kwsys_stl::find(this->VisitedSymlinks.begin(),
+ std::string message;
+ for(std::vector<std::string>::const_iterator
+ pathIt = std::find(this->VisitedSymlinks.begin(),
this->VisitedSymlinks.end(),
canonicalPath);
pathIt != this->VisitedSymlinks.end(); ++pathIt)
@@ -338,10 +335,10 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
}
//----------------------------------------------------------------------------
-void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, GlobMessages* messages)
+void Glob::ProcessDirectory(std::string::size_type start,
+ const std::string& dir, GlobMessages* messages)
{
- //kwsys_ios::cout << "ProcessDirectory: " << dir << kwsys_ios::endl;
+ //std::cout << "ProcessDirectory: " << dir << std::endl;
bool last = ( start == this->Internals->Expressions.size()-1 );
if ( last && this->Recurse )
{
@@ -360,8 +357,8 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
return;
}
unsigned long cc;
- kwsys_stl::string realname;
- kwsys_stl::string fname;
+ std::string realname;
+ std::string fname;
for ( cc = 0; cc < d.GetNumberOfFiles(); cc ++ )
{
fname = d.GetFile(cc);
@@ -384,10 +381,10 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
fname = kwsys::SystemTools::LowerCase(fname);
#endif
- //kwsys_ios::cout << "Look at file: " << fname << kwsys_ios::endl;
- //kwsys_ios::cout << "Match: "
- // << this->Internals->TextExpressions[start].c_str() << kwsys_ios::endl;
- //kwsys_ios::cout << "Real name: " << realname << kwsys_ios::endl;
+ //std::cout << "Look at file: " << fname << std::endl;
+ //std::cout << "Match: "
+ // << this->Internals->TextExpressions[start].c_str() << std::endl;
+ //std::cout << "Real name: " << realname << std::endl;
if( (!last && !kwsys::SystemTools::FileIsDirectory(realname))
|| (!this->ListDirs && last &&
@@ -411,11 +408,11 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
}
//----------------------------------------------------------------------------
-bool Glob::FindFiles(const kwsys_stl::string& inexpr, GlobMessages* messages)
+bool Glob::FindFiles(const std::string& inexpr, GlobMessages* messages)
{
- kwsys_stl::string cexpr;
- kwsys_stl::string::size_type cc;
- kwsys_stl::string expr = inexpr;
+ std::string cexpr;
+ std::string::size_type cc;
+ std::string expr = inexpr;
this->Internals->Expressions.clear();
this->Internals->Files.clear();
@@ -425,10 +422,10 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr, GlobMessages* messages)
expr = kwsys::SystemTools::GetCurrentWorkingDirectory();
expr += "/" + inexpr;
}
- kwsys_stl::string fexpr = expr;
+ std::string fexpr = expr;
- kwsys_stl::string::size_type skip = 0;
- kwsys_stl::string::size_type last_slash = 0;
+ std::string::size_type skip = 0;
+ std::string::size_type last_slash = 0;
for ( cc = 0; cc < expr.size(); cc ++ )
{
if ( cc > 0 && expr[cc] == '/' && expr[cc-1] != '\\' )
@@ -444,8 +441,8 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr, GlobMessages* messages)
}
if ( last_slash > 0 )
{
- //kwsys_ios::cout << "I can skip: " << fexpr.substr(0, last_slash)
- // << kwsys_ios::endl;
+ //std::cout << "I can skip: " << fexpr.substr(0, last_slash)
+ // << std::endl;
skip = last_slash;
}
if ( skip == 0 )
@@ -517,7 +514,7 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr, GlobMessages* messages)
}
//----------------------------------------------------------------------------
-void Glob::AddExpression(const kwsys_stl::string& expr)
+void Glob::AddExpression(const std::string& expr)
{
this->Internals->Expressions.push_back(
kwsys::RegularExpression(
@@ -546,7 +543,7 @@ const char* Glob::GetRelative()
}
//----------------------------------------------------------------------------
-void Glob::AddFile(kwsys_stl::vector<kwsys_stl::string>& files, const kwsys_stl::string& file)
+void Glob::AddFile(std::vector<std::string>& files, const std::string& file)
{
if ( !this->Relative.empty() )
{
diff --git a/Source/kwsys/Glob.hxx.in b/Source/kwsys/Glob.hxx.in
index 5239ccd..ffee9ca 100644
--- a/Source/kwsys/Glob.hxx.in
+++ b/Source/kwsys/Glob.hxx.in
@@ -15,13 +15,8 @@
#include <@KWSYS_NAMESPACE@/Configure.h>
#include <@KWSYS_NAMESPACE@/Configure.hxx>
-#include <@KWSYS_NAMESPACE@/stl/string>
-#include <@KWSYS_NAMESPACE@/stl/vector>
-
-/* Define this macro temporarily to keep the code readable. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# define kwsys_stl @KWSYS_NAMESPACE@_stl
-#endif
+#include <string>
+#include <vector>
namespace @KWSYS_NAMESPACE@
{
@@ -49,9 +44,9 @@ public:
struct Message
{
MessageType type;
- kwsys_stl::string content;
+ std::string content;
- Message(MessageType t, const kwsys_stl::string& c) :
+ Message(MessageType t, const std::string& c) :
type(t),
content(c)
{}
@@ -67,18 +62,18 @@ public:
}
};
- typedef kwsys_stl::vector<Message> GlobMessages;
- typedef kwsys_stl::vector<Message>::iterator GlobMessagesIterator;
+ typedef std::vector<Message> GlobMessages;
+ typedef std::vector<Message>::iterator GlobMessagesIterator;
public:
Glob();
~Glob();
//! Find all files that match the pattern.
- bool FindFiles(const kwsys_stl::string& inexpr,
+ bool FindFiles(const std::string& inexpr,
GlobMessages* messages = 0);
//! Return the list of files that matched.
- kwsys_stl::vector<kwsys_stl::string>& GetFiles();
+ std::vector<std::string>& GetFiles();
//! Set recurse to true to match subdirectories.
void RecurseOn() { this->SetRecurse(true); }
@@ -107,7 +102,7 @@ public:
string. This is on by default because patterns always match
whole strings, but may be disabled to support concatenating
expressions more easily (regex1|regex2|etc). */
- static kwsys_stl::string PatternToRegex(const kwsys_stl::string& pattern,
+ static std::string PatternToRegex(const std::string& pattern,
bool require_whole_string = true,
bool preserve_case = false);
@@ -122,28 +117,28 @@ public:
protected:
//! Process directory
- void ProcessDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir,
+ void ProcessDirectory(std::string::size_type start,
+ const std::string& dir,
GlobMessages* messages);
//! Process last directory, but only when recurse flags is on. That is
// effectively like saying: /path/to/file/**/file
- bool RecurseDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir,
+ bool RecurseDirectory(std::string::size_type start,
+ const std::string& dir,
GlobMessages* messages);
//! Add regular expression
- void AddExpression(const kwsys_stl::string& expr);
+ void AddExpression(const std::string& expr);
//! Add a file to the list
- void AddFile(kwsys_stl::vector<kwsys_stl::string>& files, const kwsys_stl::string& file);
+ void AddFile(std::vector<std::string>& files, const std::string& file);
GlobInternals* Internals;
bool Recurse;
- kwsys_stl::string Relative;
+ std::string Relative;
bool RecurseThroughSymlinks;
unsigned int FollowedSymlinkCount;
- kwsys_stl::vector<kwsys_stl::string> VisitedSymlinks;
+ std::vector<std::string> VisitedSymlinks;
bool ListDirs;
bool RecurseListDirs;
@@ -154,9 +149,4 @@ private:
} // namespace @KWSYS_NAMESPACE@
-/* Undefine temporary macro. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# undef kwsys_stl
-#endif
-
#endif
diff --git a/Source/kwsys/IOStream.cxx b/Source/kwsys/IOStream.cxx
index a31f8c8..81c6a73 100644
--- a/Source/kwsys/IOStream.cxx
+++ b/Source/kwsys/IOStream.cxx
@@ -12,25 +12,14 @@
#include "kwsysPrivate.h"
#include KWSYS_HEADER(Configure.hxx)
-// Configure the implementation for the current streams library.
-#if !KWSYS_IOS_USE_ANSI
-# define ios_base ios
-# if defined(__HP_aCC)
-# define protected public
-# include <iostream.h> // Hack access to some private stream methods.
-# undef protected
-# endif
-#endif
-
// Include the streams library.
-#include KWSYS_HEADER(ios/iostream)
+#include <iostream>
#include KWSYS_HEADER(IOStream.hxx)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "Configure.hxx.in"
-# include "kwsys_ios_iostream.hxx.in"
# include "IOStream.hxx.in"
#endif
@@ -50,7 +39,7 @@ namespace KWSYS_NAMESPACE
{
// Scan an input stream for an integer value.
-static int IOStreamScanStream(kwsys_ios::istream& is, char* buffer)
+static int IOStreamScanStream(std::istream& is, char* buffer)
{
// Prepare to write to buffer.
char* out = buffer;
@@ -64,10 +53,10 @@ static int IOStreamScanStream(kwsys_ios::istream& is, char* buffer)
// detect it from the input. A leading 0x means hex, and a leading
// 0 alone means octal.
int base = 0;
- int flags = is.flags() & kwsys_ios::ios_base::basefield;
- if(flags == kwsys_ios::ios_base::oct) { base = 8; }
- else if(flags == kwsys_ios::ios_base::dec) { base = 10; }
- else if(flags == kwsys_ios::ios_base::hex) { base = 16; }
+ int flags = is.flags() & std::ios_base::basefield;
+ if(flags == std::ios_base::oct) { base = 8; }
+ else if(flags == std::ios_base::dec) { base = 10; }
+ else if(flags == std::ios_base::hex) { base = 16; }
bool foundDigit = false;
bool foundNonZero = false;
if(is.peek() == '0')
@@ -134,24 +123,17 @@ static int IOStreamScanStream(kwsys_ios::istream& is, char* buffer)
// Read an integer value from an input stream.
template <class T>
-kwsys_ios::istream&
-IOStreamScanTemplate(kwsys_ios::istream& is, T& value, char type)
+std::istream&
+IOStreamScanTemplate(std::istream& is, T& value, char type)
{
- int state = kwsys_ios::ios_base::goodbit;
+ int state = std::ios_base::goodbit;
// Skip leading whitespace.
-# if KWSYS_IOS_USE_ANSI
- kwsys_ios::istream::sentry okay(is);
-# else
- is.eatwhite();
- kwsys_ios::istream& okay = is;
-# endif
+ std::istream::sentry okay(is);
if(okay)
{
-# if KWSYS_IOS_USE_ANSI
try {
-# endif
// Copy the string to a buffer and construct the format string.
char buffer[KWSYS_IOS_INT64_MAX_DIG];
# if defined(_MSC_VER)
@@ -174,52 +156,40 @@ IOStreamScanTemplate(kwsys_ios::istream& is, T& value, char type)
int success = (sscanf(buffer, format, &result) == 1)?1:0;
// Set flags for resulting state.
- if(is.peek() == EOF) { state |= kwsys_ios::ios_base::eofbit; }
- if(!success) { state |= kwsys_ios::ios_base::failbit; }
+ if(is.peek() == EOF) { state |= std::ios_base::eofbit; }
+ if(!success) { state |= std::ios_base::failbit; }
else { value = result; }
-# if KWSYS_IOS_USE_ANSI
- } catch(...) { state |= kwsys_ios::ios_base::badbit; }
-# endif
+ } catch(...) { state |= std::ios_base::badbit; }
}
-# if KWSYS_IOS_USE_ANSI
- is.setstate(kwsys_ios::ios_base::iostate(state));
-# else
- is.clear(state);
-# endif
+ is.setstate(std::ios_base::iostate(state));
return is;
}
// Print an integer value to an output stream.
template <class T>
-kwsys_ios::ostream&
-IOStreamPrintTemplate(kwsys_ios::ostream& os, T value, char type)
+std::ostream&
+IOStreamPrintTemplate(std::ostream& os, T value, char type)
{
-# if KWSYS_IOS_USE_ANSI
- kwsys_ios::ostream::sentry okay(os);
-# else
- kwsys_ios::ostream& okay = os;
-# endif
+ std::ostream::sentry okay(os);
if(okay)
{
-# if KWSYS_IOS_USE_ANSI
try {
-# endif
// Construct the format string.
char format[8];
char* f = format;
*f++ = '%';
- if(os.flags() & kwsys_ios::ios_base::showpos) { *f++ = '+'; }
- if(os.flags() & kwsys_ios::ios_base::showbase) { *f++ = '#'; }
+ if(os.flags() & std::ios_base::showpos) { *f++ = '+'; }
+ if(os.flags() & std::ios_base::showbase) { *f++ = '#'; }
# if defined(_MSC_VER)
*f++ = 'I'; *f++ = '6'; *f++ = '4';
# else
*f++ = 'l'; *f++ = 'l';
# endif
- long bflags = os.flags() & kwsys_ios::ios_base::basefield;
- if(bflags == kwsys_ios::ios_base::oct) { *f++ = 'o'; }
- else if(bflags != kwsys_ios::ios_base::hex) { *f++ = type; }
- else if(os.flags() & kwsys_ios::ios_base::uppercase) { *f++ = 'X'; }
+ long bflags = os.flags() & std::ios_base::basefield;
+ if(bflags == std::ios_base::oct) { *f++ = 'o'; }
+ else if(bflags != std::ios_base::hex) { *f++ = type; }
+ else if(os.flags() & std::ios_base::uppercase) { *f++ = 'X'; }
else { *f++ = 'x'; }
*f = '\0';
@@ -228,22 +198,20 @@ IOStreamPrintTemplate(kwsys_ios::ostream& os, T value, char type)
char buffer[2*KWSYS_IOS_INT64_MAX_DIG];
sprintf(buffer, format, value);
os << buffer;
-# if KWSYS_IOS_USE_ANSI
- } catch(...) { os.clear(os.rdstate() | kwsys_ios::ios_base::badbit); }
-# endif
+ } catch(...) { os.clear(os.rdstate() | std::ios_base::badbit); }
}
return os;
}
# if !KWSYS_IOS_HAS_ISTREAM_LONG_LONG
// Implement input stream operator for IOStreamSLL.
-kwsys_ios::istream& IOStreamScan(kwsys_ios::istream& is, IOStreamSLL& value)
+std::istream& IOStreamScan(std::istream& is, IOStreamSLL& value)
{
return IOStreamScanTemplate(is, value, 'd');
}
// Implement input stream operator for IOStreamULL.
-kwsys_ios::istream& IOStreamScan(kwsys_ios::istream& is, IOStreamULL& value)
+std::istream& IOStreamScan(std::istream& is, IOStreamULL& value)
{
return IOStreamScanTemplate(is, value, 'u');
}
@@ -251,13 +219,13 @@ kwsys_ios::istream& IOStreamScan(kwsys_ios::istream& is, IOStreamULL& value)
# if !KWSYS_IOS_HAS_OSTREAM_LONG_LONG
// Implement output stream operator for IOStreamSLL.
-kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream& os, IOStreamSLL value)
+std::ostream& IOStreamPrint(std::ostream& os, IOStreamSLL value)
{
return IOStreamPrintTemplate(os, value, 'd');
}
// Implement output stream operator for IOStreamULL.
-kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream& os, IOStreamULL value)
+std::ostream& IOStreamPrint(std::ostream& os, IOStreamULL value)
{
return IOStreamPrintTemplate(os, value, 'u');
}
diff --git a/Source/kwsys/IOStream.hxx.in b/Source/kwsys/IOStream.hxx.in
index 2eeedf2..c101909 100644
--- a/Source/kwsys/IOStream.hxx.in
+++ b/Source/kwsys/IOStream.hxx.in
@@ -12,12 +12,11 @@
#ifndef @KWSYS_NAMESPACE@_IOStream_hxx
#define @KWSYS_NAMESPACE@_IOStream_hxx
-#include <@KWSYS_NAMESPACE@/ios/iosfwd>
+#include <iosfwd>
/* Define these macros temporarily to keep the code readable. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
-# define kwsys_ios @KWSYS_NAMESPACE@_ios
#endif
/* Whether istream supports long long. */
@@ -56,10 +55,8 @@
/* Input stream operator implementation functions. */
namespace @KWSYS_NAMESPACE@
{
-kwsysEXPORT kwsys_ios::istream& IOStreamScan(kwsys_ios::istream&,
- IOStreamSLL&);
-kwsysEXPORT kwsys_ios::istream& IOStreamScan(kwsys_ios::istream&,
- IOStreamULL&);
+kwsysEXPORT std::istream& IOStreamScan(std::istream&, IOStreamSLL&);
+kwsysEXPORT std::istream& IOStreamScan(std::istream&, IOStreamULL&);
}
/* Provide input stream operator for long long. */
@@ -67,8 +64,8 @@ kwsysEXPORT kwsys_ios::istream& IOStreamScan(kwsys_ios::istream&,
!defined(KWSYS_IOS_ISTREAM_LONG_LONG_DEFINED)
# define KWSYS_IOS_ISTREAM_LONG_LONG_DEFINED
# define @KWSYS_NAMESPACE@_IOS_ISTREAM_LONG_LONG_DEFINED
-inline kwsys_ios::istream&
-operator>>(kwsys_ios::istream& is, @KWSYS_NAMESPACE@::IOStreamSLL& value)
+inline std::istream&
+operator>>(std::istream& is, @KWSYS_NAMESPACE@::IOStreamSLL& value)
{
return @KWSYS_NAMESPACE@::IOStreamScan(is, value);
}
@@ -79,8 +76,8 @@ operator>>(kwsys_ios::istream& is, @KWSYS_NAMESPACE@::IOStreamSLL& value)
!defined(KWSYS_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED)
# define KWSYS_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED
# define @KWSYS_NAMESPACE@_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED
-inline kwsys_ios::istream&
-operator>>(kwsys_ios::istream& is, @KWSYS_NAMESPACE@::IOStreamULL& value)
+inline std::istream&
+operator>>(std::istream& is, @KWSYS_NAMESPACE@::IOStreamULL& value)
{
return @KWSYS_NAMESPACE@::IOStreamScan(is, value);
}
@@ -92,10 +89,8 @@ operator>>(kwsys_ios::istream& is, @KWSYS_NAMESPACE@::IOStreamULL& value)
/* Output stream operator implementation functions. */
namespace @KWSYS_NAMESPACE@
{
-kwsysEXPORT kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream&,
- IOStreamSLL);
-kwsysEXPORT kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream&,
- IOStreamULL);
+kwsysEXPORT std::ostream& IOStreamPrint(std::ostream&, IOStreamSLL);
+kwsysEXPORT std::ostream& IOStreamPrint(std::ostream&, IOStreamULL);
}
/* Provide output stream operator for long long. */
@@ -103,8 +98,8 @@ kwsysEXPORT kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream&,
!defined(KWSYS_IOS_OSTREAM_LONG_LONG_DEFINED)
# define KWSYS_IOS_OSTREAM_LONG_LONG_DEFINED
# define @KWSYS_NAMESPACE@_IOS_OSTREAM_LONG_LONG_DEFINED
-inline kwsys_ios::ostream&
-operator<<(kwsys_ios::ostream& os, @KWSYS_NAMESPACE@::IOStreamSLL value)
+inline std::ostream&
+operator<<(std::ostream& os, @KWSYS_NAMESPACE@::IOStreamSLL value)
{
return @KWSYS_NAMESPACE@::IOStreamPrint(os, value);
}
@@ -115,8 +110,8 @@ operator<<(kwsys_ios::ostream& os, @KWSYS_NAMESPACE@::IOStreamSLL value)
!defined(KWSYS_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED)
# define KWSYS_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED
# define @KWSYS_NAMESPACE@_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED
-inline kwsys_ios::ostream&
-operator<<(kwsys_ios::ostream& os, @KWSYS_NAMESPACE@::IOStreamULL value)
+inline std::ostream&
+operator<<(std::ostream& os, @KWSYS_NAMESPACE@::IOStreamULL value)
{
return @KWSYS_NAMESPACE@::IOStreamPrint(os, value);
}
@@ -127,7 +122,6 @@ operator<<(kwsys_ios::ostream& os, @KWSYS_NAMESPACE@::IOStreamULL value)
/* Undefine temporary macros. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# undef kwsysEXPORT
-# undef kwsys_ios
#endif
/* If building a C++ file in kwsys itself, give the source file
diff --git a/Source/kwsys/RegularExpression.hxx.in b/Source/kwsys/RegularExpression.hxx.in
index 502fbe2..d0235d8 100644
--- a/Source/kwsys/RegularExpression.hxx.in
+++ b/Source/kwsys/RegularExpression.hxx.in
@@ -33,12 +33,7 @@
#include <@KWSYS_NAMESPACE@/Configure.h>
#include <@KWSYS_NAMESPACE@/Configure.hxx>
-#include <@KWSYS_NAMESPACE@/stl/string>
-
-/* Define this macro temporarily to keep the code readable. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# define kwsys_stl @KWSYS_NAMESPACE@_stl
-#endif
+#include <string>
/* Disable useless Borland warnings. KWSys tries not to force things
on its includers, but there is no choice here. */
@@ -207,7 +202,7 @@ public:
/**
* Instantiate RegularExpression with compiled string.
*/
- inline RegularExpression (kwsys_stl::string const&);
+ inline RegularExpression (std::string const&);
/**
* Destructor.
@@ -224,7 +219,7 @@ public:
* Compile a regular expression into internal code
* for later pattern matching.
*/
- inline bool compile (kwsys_stl::string const&);
+ inline bool compile (std::string const&);
/**
* Matches the regular expression to the given string.
@@ -236,17 +231,17 @@ public:
* Matches the regular expression to the given std string.
* Returns true if found, and sets start and end indexes accordingly.
*/
- inline bool find (kwsys_stl::string const&);
+ inline bool find (std::string const&);
/**
* Index to start of first find.
*/
- inline kwsys_stl::string::size_type start() const;
+ inline std::string::size_type start() const;
/**
* Index to end of first find.
*/
- inline kwsys_stl::string::size_type end() const;
+ inline std::string::size_type end() const;
/**
* Copy the given regular expression.
@@ -285,9 +280,9 @@ public:
* Destructor.
*/
// awf added
- kwsys_stl::string::size_type start(int n) const;
- kwsys_stl::string::size_type end(int n) const;
- kwsys_stl::string match(int n) const;
+ std::string::size_type start(int n) const;
+ std::string::size_type end(int n) const;
+ std::string match(int n) const;
enum { NSUBEXP = 10 };
private:
@@ -296,7 +291,7 @@ private:
char regstart; // Internal use only
char reganch; // Internal use only
const char* regmust; // Internal use only
- kwsys_stl::string::size_type regmlen; // Internal use only
+ std::string::size_type regmlen; // Internal use only
char* program;
int progsize;
const char* searchstring;
@@ -327,7 +322,7 @@ inline RegularExpression::RegularExpression (const char* s)
* Creates a regular expression from string s, and
* compiles s.
*/
-inline RegularExpression::RegularExpression (const kwsys_stl::string& s)
+inline RegularExpression::RegularExpression (const std::string& s)
{
this->program = 0;
this->compile(s);
@@ -347,7 +342,7 @@ inline RegularExpression::~RegularExpression ()
* Compile a regular expression into internal code
* for later pattern matching.
*/
-inline bool RegularExpression::compile (kwsys_stl::string const& s)
+inline bool RegularExpression::compile (std::string const& s)
{
return this->compile(s.c_str());
}
@@ -356,7 +351,7 @@ inline bool RegularExpression::compile (kwsys_stl::string const& s)
* Matches the regular expression to the given std string.
* Returns true if found, and sets start and end indexes accordingly.
*/
-inline bool RegularExpression::find (kwsys_stl::string const& s)
+inline bool RegularExpression::find (std::string const& s)
{
return this->find(s.c_str());
}
@@ -364,9 +359,9 @@ inline bool RegularExpression::find (kwsys_stl::string const& s)
/**
* Set the start position for the regular expression.
*/
-inline kwsys_stl::string::size_type RegularExpression::start () const
+inline std::string::size_type RegularExpression::start () const
{
- return static_cast<kwsys_stl::string::size_type>(
+ return static_cast<std::string::size_type>(
this->startp[0] - searchstring);
}
@@ -374,9 +369,9 @@ inline kwsys_stl::string::size_type RegularExpression::start () const
/**
* Returns the start/end index of the last item found.
*/
-inline kwsys_stl::string::size_type RegularExpression::end () const
+inline std::string::size_type RegularExpression::end () const
{
- return static_cast<kwsys_stl::string::size_type>(
+ return static_cast<std::string::size_type>(
this->endp[0] - searchstring);
}
@@ -410,9 +405,9 @@ inline void RegularExpression::set_invalid ()
/**
* Return start index of nth submatch. start(0) is the start of the full match.
*/
-inline kwsys_stl::string::size_type RegularExpression::start(int n) const
+inline std::string::size_type RegularExpression::start(int n) const
{
- return static_cast<kwsys_stl::string::size_type>(
+ return static_cast<std::string::size_type>(
this->startp[n] - searchstring);
}
@@ -420,34 +415,29 @@ inline kwsys_stl::string::size_type RegularExpression::start(int n) const
/**
* Return end index of nth submatch. end(0) is the end of the full match.
*/
-inline kwsys_stl::string::size_type RegularExpression::end(int n) const
+inline std::string::size_type RegularExpression::end(int n) const
{
- return static_cast<kwsys_stl::string::size_type>(
+ return static_cast<std::string::size_type>(
this->endp[n] - searchstring);
}
/**
* Return nth submatch as a string.
*/
-inline kwsys_stl::string RegularExpression::match(int n) const
+inline std::string RegularExpression::match(int n) const
{
if (this->startp[n]==0)
{
- return kwsys_stl::string("");
+ return std::string("");
}
else
{
- return kwsys_stl::string(this->startp[n],
- static_cast<kwsys_stl::string::size_type>(
+ return std::string(this->startp[n],
+ static_cast<std::string::size_type>(
this->endp[n] - this->startp[n]));
}
}
} // namespace @KWSYS_NAMESPACE@
-/* Undefine temporary macro. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# undef kwsys_stl
-#endif
-
#endif
diff --git a/Source/kwsys/String.hxx.in b/Source/kwsys/String.hxx.in
index 4386c9e..2e9aedb 100644
--- a/Source/kwsys/String.hxx.in
+++ b/Source/kwsys/String.hxx.in
@@ -12,7 +12,7 @@
#ifndef @KWSYS_NAMESPACE@_String_hxx
#define @KWSYS_NAMESPACE@_String_hxx
-#include <@KWSYS_NAMESPACE@/stl/string>
+#include <string>
namespace @KWSYS_NAMESPACE@
{
@@ -25,10 +25,10 @@ namespace @KWSYS_NAMESPACE@
* simply a subclass of this type with the same interface so that the
* name is shorter in debugging symbols and error messages.
*/
-class String: public @KWSYS_NAMESPACE@_stl::string
+class String: public std::string
{
/** The original string type. */
- typedef @KWSYS_NAMESPACE@_stl::string stl_string;
+ typedef std::string stl_string;
public:
@@ -55,8 +55,8 @@ public:
#if defined(__WATCOMC__)
inline bool operator<(String const& l, String const& r)
{
- return (static_cast<@KWSYS_NAMESPACE@_stl::string const&>(l) <
- static_cast<@KWSYS_NAMESPACE@_stl::string const&>(r));
+ return (static_cast<std::string const&>(l) <
+ static_cast<std::string const&>(r));
}
#endif
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 6e81b0b..cddcc8d 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -35,14 +35,8 @@
// http://msdn.microsoft.com/en-us/library/ms683219(VS.85).aspx
#include "kwsysPrivate.h"
-#include KWSYS_HEADER(stl/string)
-#include KWSYS_HEADER(stl/vector)
-#include KWSYS_HEADER(ios/iosfwd)
#include KWSYS_HEADER(SystemInformation.hxx)
#include KWSYS_HEADER(Process.h)
-#include KWSYS_HEADER(ios/iostream)
-#include KWSYS_HEADER(ios/sstream)
-#include KWSYS_HEADER(ios/fstream)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
@@ -50,14 +44,14 @@
# include "SystemInformation.hxx.in"
# include "Process.h.in"
# include "Configure.hxx.in"
-# include "kwsys_stl.hxx.in"
-# include "kwsys_stl_vector.in"
-# include "kwsys_stl_iosfwd.in"
-# include "kwsys_ios_sstream.h.in"
-# include "kwsys_ios_iostream.h.in"
-# include "kwsys_ios_fstream.h.in"
#endif
+#include <iostream>
+#include <sstream>
+#include <fstream>
+#include <string>
+#include <vector>
+
#if defined(_WIN32)
# include <windows.h>
# if defined(_MSC_VER) && _MSC_VER >= 1800
@@ -325,11 +319,11 @@ public:
const char * GetVendorString();
const char * GetVendorID();
- kwsys_stl::string GetTypeID();
- kwsys_stl::string GetFamilyID();
- kwsys_stl::string GetModelID();
- kwsys_stl::string GetModelName();
- kwsys_stl::string GetSteppingCode();
+ std::string GetTypeID();
+ std::string GetFamilyID();
+ std::string GetModelID();
+ std::string GetModelName();
+ std::string GetSteppingCode();
const char * GetExtendedProcessorName();
const char * GetProcessorSerialNumber();
int GetProcessorCacheSize();
@@ -341,7 +335,7 @@ public:
const char * GetOSName();
const char * GetHostname();
- int GetFullyQualifiedDomainName(kwsys_stl::string &fqdn);
+ int GetFullyQualifiedDomainName(std::string &fqdn);
const char * GetOSRelease();
const char * GetOSVersion();
const char * GetOSPlatform();
@@ -379,7 +373,7 @@ public:
// get current stack
static
- kwsys_stl::string GetProgramStack(int firstFrame, int wholePath);
+ std::string GetProgramStack(int firstFrame, int wholePath);
/** Run the different checks */
void RunCPUCheck();
@@ -395,10 +389,10 @@ public:
int Revision;
int ExtendedFamily;
int ExtendedModel;
- kwsys_stl::string ProcessorName;
- kwsys_stl::string Vendor;
- kwsys_stl::string SerialNumber;
- kwsys_stl::string ModelName;
+ std::string ProcessorName;
+ std::string Vendor;
+ std::string SerialNumber;
+ std::string ModelName;
} ID;
typedef struct tagCPUPowerManagement
@@ -480,7 +474,7 @@ protected:
// For Linux and Cygwin, /proc/cpuinfo formats are slightly different
bool RetreiveInformationFromCpuInfoFile();
- kwsys_stl::string ExtractValueFromCpuInfoFile(kwsys_stl::string buffer,
+ std::string ExtractValueFromCpuInfoFile(std::string buffer,
const char* word, size_t init=0);
bool QueryLinuxMemory();
@@ -489,20 +483,20 @@ protected:
static void Delay (unsigned int);
static void DelayOverhead (unsigned int);
- void FindManufacturer(const kwsys_stl::string &family = "");
+ void FindManufacturer(const std::string &family = "");
// For Mac
bool ParseSysCtl();
- int CallSwVers(const char *arg, kwsys_stl::string &ver);
- void TrimNewline(kwsys_stl::string&);
- kwsys_stl::string ExtractValueFromSysCtl(const char* word);
- kwsys_stl::string SysCtlBuffer;
+ int CallSwVers(const char *arg, std::string &ver);
+ void TrimNewline(std::string&);
+ std::string ExtractValueFromSysCtl(const char* word);
+ std::string SysCtlBuffer;
// For Solaris
bool QuerySolarisMemory();
bool QuerySolarisProcessor();
- kwsys_stl::string ParseValueFromKStat(const char* arguments);
- kwsys_stl::string RunProcess(kwsys_stl::vector<const char*> args);
+ std::string ParseValueFromKStat(const char* arguments);
+ std::string RunProcess(std::vector<const char*> args);
//For Haiku OS
bool QueryHaikuInfo();
@@ -540,11 +534,11 @@ protected:
// Operating System information
bool QueryOSInformation();
- kwsys_stl::string OSName;
- kwsys_stl::string Hostname;
- kwsys_stl::string OSRelease;
- kwsys_stl::string OSVersion;
- kwsys_stl::string OSPlatform;
+ std::string OSName;
+ std::string Hostname;
+ std::string OSRelease;
+ std::string OSVersion;
+ std::string OSPlatform;
};
@@ -568,27 +562,27 @@ const char * SystemInformation::GetVendorID()
return this->Implementation->GetVendorID();
}
-kwsys_stl::string SystemInformation::GetTypeID()
+std::string SystemInformation::GetTypeID()
{
return this->Implementation->GetTypeID();
}
-kwsys_stl::string SystemInformation::GetFamilyID()
+std::string SystemInformation::GetFamilyID()
{
return this->Implementation->GetFamilyID();
}
-kwsys_stl::string SystemInformation::GetModelID()
+std::string SystemInformation::GetModelID()
{
return this->Implementation->GetModelID();
}
-kwsys_stl::string SystemInformation::GetModelName()
+std::string SystemInformation::GetModelName()
{
return this->Implementation->GetModelName();
}
-kwsys_stl::string SystemInformation::GetSteppingCode()
+std::string SystemInformation::GetSteppingCode()
{
return this->Implementation->GetSteppingCode();
}
@@ -633,9 +627,9 @@ bool SystemInformation::DoesCPUSupportFeature(long int i)
return this->Implementation->DoesCPUSupportFeature(i);
}
-kwsys_stl::string SystemInformation::GetCPUDescription()
+std::string SystemInformation::GetCPUDescription()
{
- kwsys_ios::ostringstream oss;
+ std::ostringstream oss;
oss
<< this->GetNumberOfPhysicalCPU()
<< " core ";
@@ -654,9 +648,9 @@ kwsys_stl::string SystemInformation::GetCPUDescription()
}
// remove extra spaces
- kwsys_stl::string tmp=oss.str();
+ std::string tmp=oss.str();
size_t pos;
- while( (pos=tmp.find(" "))!=kwsys_stl::string::npos)
+ while( (pos=tmp.find(" "))!=std::string::npos)
{
tmp.replace(pos,2," ");
}
@@ -674,9 +668,9 @@ const char * SystemInformation::GetHostname()
return this->Implementation->GetHostname();
}
-kwsys_stl::string SystemInformation::GetFullyQualifiedDomainName()
+std::string SystemInformation::GetFullyQualifiedDomainName()
{
- kwsys_stl::string fqdn;
+ std::string fqdn;
this->Implementation->GetFullyQualifiedDomainName(fqdn);
return fqdn;
}
@@ -723,9 +717,9 @@ int SystemInformation::GetOSIsApple()
#endif
}
-kwsys_stl::string SystemInformation::GetOSDescription()
+std::string SystemInformation::GetOSDescription()
{
- kwsys_ios::ostringstream oss;
+ std::ostringstream oss;
oss
<< this->GetOSName()
<< " "
@@ -777,11 +771,11 @@ size_t SystemInformation::GetAvailablePhysicalMemory()
return this->Implementation->GetAvailablePhysicalMemory();
}
-kwsys_stl::string SystemInformation::GetMemoryDescription(
+std::string SystemInformation::GetMemoryDescription(
const char *hostLimitEnvVarName,
const char *procLimitEnvVarName)
{
- kwsys_ios::ostringstream oss;
+ std::ostringstream oss;
oss
<< "Host Total: "
<< iostreamLongLong(this->GetHostMemoryTotal())
@@ -842,7 +836,7 @@ void SystemInformation::SetStackTraceOnError(int enable)
SystemInformationImplementation::SetStackTraceOnError(enable);
}
-kwsys_stl::string SystemInformation::GetProgramStack(int firstFrame, int wholePath)
+std::string SystemInformation::GetProgramStack(int firstFrame, int wholePath)
{
return SystemInformationImplementation::GetProgramStack(firstFrame, wholePath);
}
@@ -926,7 +920,7 @@ namespace {
#if defined(__linux) || defined(__APPLE__)
int LoadLines(
FILE *file,
- kwsys_stl::vector<kwsys_stl::string> &lines)
+ std::vector<std::string> &lines)
{
// Load each line in the given file into a the vector.
int nRead=0;
@@ -963,7 +957,7 @@ int LoadLines(
// *****************************************************************************
int LoadLines(
const char *fileName,
- kwsys_stl::vector<kwsys_stl::string> &lines)
+ std::vector<std::string> &lines)
{
FILE *file=fopen(fileName,"r");
if (file==0)
@@ -979,18 +973,18 @@ int LoadLines(
// ****************************************************************************
template<typename T>
int NameValue(
- kwsys_stl::vector<kwsys_stl::string> &lines,
- kwsys_stl::string name, T &value)
+ std::vector<std::string> &lines,
+ std::string name, T &value)
{
size_t nLines=lines.size();
for (size_t i=0; i<nLines; ++i)
{
size_t at=lines[i].find(name);
- if (at==kwsys_stl::string::npos)
+ if (at==std::string::npos)
{
continue;
}
- kwsys_ios::istringstream is(lines[i].substr(at+name.size()));
+ std::istringstream is(lines[i].substr(at+name.size()));
is >> value;
return 0;
}
@@ -1006,7 +1000,7 @@ int GetFieldsFromFile(
const char **fieldNames,
T *values)
{
- kwsys_stl::vector<kwsys_stl::string> fields;
+ std::vector<std::string> fields;
if (!LoadLines(fileName,fields))
{
return -1;
@@ -1056,7 +1050,7 @@ int GetFieldsFromCommand(
{
return -1;
}
- kwsys_stl::vector<kwsys_stl::string> fields;
+ std::vector<std::string> fields;
int nl=LoadLines(file,fields);
pclose(file);
if (nl==0)
@@ -1085,10 +1079,10 @@ void StacktraceSignalHandler(
void * /*sigContext*/)
{
#if defined(__linux) || defined(__APPLE__)
- kwsys_ios::ostringstream oss;
+ std::ostringstream oss;
oss
- << kwsys_ios::endl
- << "=========================================================" << kwsys_ios::endl
+ << std::endl
+ << "=========================================================" << std::endl
<< "Process id " << getpid() << " ";
switch (sigNo)
{
@@ -1281,11 +1275,11 @@ void StacktraceSignalHandler(
break;
}
oss
- << kwsys_ios::endl
- << "Program Stack:" << kwsys_ios::endl
+ << std::endl
+ << "Program Stack:" << std::endl
<< SystemInformationImplementation::GetProgramStack(2,0)
- << "=========================================================" << kwsys_ios::endl;
- kwsys_ios::cerr << oss.str() << kwsys_ios::endl;
+ << "=========================================================" << std::endl;
+ std::cerr << oss.str() << std::endl;
// restore the previously registered handlers
// and abort
@@ -1330,7 +1324,7 @@ public:
void SetBinary(const char *binary)
{ this->Binary=safes(binary); }
- kwsys_stl::string GetBinary() const;
+ std::string GetBinary() const;
// Description:
// Set the name of the function that the symbol is found in.
@@ -1338,7 +1332,7 @@ public:
void SetFunction(const char *function)
{ this->Function=this->Demangle(function); }
- kwsys_stl::string GetFunction() const
+ std::string GetFunction() const
{ return this->Function; }
// Description:
@@ -1347,7 +1341,7 @@ public:
void SetSourceFile(const char *sourcefile)
{ this->SourceFile=safes(sourcefile); }
- kwsys_stl::string GetSourceFile() const
+ std::string GetSourceFile() const
{ return this->GetFileName(this->SourceFile); }
// Description:
@@ -1365,31 +1359,31 @@ private:
void *GetRealAddress() const
{ return (void*)((char*)this->Address-(char*)this->BinaryBaseAddress); }
- kwsys_stl::string GetFileName(const kwsys_stl::string &path) const;
- kwsys_stl::string Demangle(const char *symbol) const;
+ std::string GetFileName(const std::string &path) const;
+ std::string Demangle(const char *symbol) const;
private:
- kwsys_stl::string Binary;
+ std::string Binary;
void *BinaryBaseAddress;
void *Address;
- kwsys_stl::string SourceFile;
- kwsys_stl::string Function;
+ std::string SourceFile;
+ std::string Function;
long LineNumber;
int ReportPath;
};
// --------------------------------------------------------------------------
-kwsys_ios::ostream &operator<<(
- kwsys_ios::ostream &os,
+std::ostream &operator<<(
+ std::ostream &os,
const SymbolProperties &sp)
{
#if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP)
os
- << kwsys_ios::hex << sp.GetAddress() << " : "
+ << std::hex << sp.GetAddress() << " : "
<< sp.GetFunction()
<< " [(" << sp.GetBinary() << ") "
<< sp.GetSourceFile() << ":"
- << kwsys_ios::dec << sp.GetLineNumber() << "]";
+ << std::dec << sp.GetLineNumber() << "]";
#elif defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE)
void *addr = sp.GetAddress();
char **syminfo = backtrace_symbols(&addr,1);
@@ -1422,28 +1416,28 @@ SymbolProperties::SymbolProperties()
}
// --------------------------------------------------------------------------
-kwsys_stl::string SymbolProperties::GetFileName(const kwsys_stl::string &path) const
+std::string SymbolProperties::GetFileName(const std::string &path) const
{
- kwsys_stl::string file(path);
+ std::string file(path);
if (!this->ReportPath)
{
size_t at = file.rfind("/");
- if (at!=kwsys_stl::string::npos)
+ if (at!=std::string::npos)
{
- file = file.substr(at+1,kwsys_stl::string::npos);
+ file = file.substr(at+1,std::string::npos);
}
}
return file;
}
// --------------------------------------------------------------------------
-kwsys_stl::string SymbolProperties::GetBinary() const
+std::string SymbolProperties::GetBinary() const
{
// only linux has proc fs
#if defined(__linux__)
if (this->Binary=="/proc/self/exe")
{
- kwsys_stl::string binary;
+ std::string binary;
char buf[1024]={'\0'};
ssize_t ll=0;
if ((ll=readlink("/proc/self/exe",buf,1024))>0)
@@ -1462,9 +1456,9 @@ kwsys_stl::string SymbolProperties::GetBinary() const
}
// --------------------------------------------------------------------------
-kwsys_stl::string SymbolProperties::Demangle(const char *symbol) const
+std::string SymbolProperties::Demangle(const char *symbol) const
{
- kwsys_stl::string result = safes(symbol);
+ std::string result = safes(symbol);
#if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE)
int status = 0;
size_t bufferLen = 1024;
@@ -1729,7 +1723,7 @@ const char* SystemInformationImplementation::GetHostname()
/** Get the FQDN */
int SystemInformationImplementation::GetFullyQualifiedDomainName(
- kwsys_stl::string &fqdn)
+ std::string &fqdn)
{
// in the event of absolute failure return localhost.
fqdn="localhost";
@@ -1820,8 +1814,8 @@ int SystemInformationImplementation::GetFullyQualifiedDomainName(
continue;
}
- kwsys_stl::string candidate=host;
- if ((candidate.find(base)!=kwsys_stl::string::npos) && baseSize<candidate.size())
+ std::string candidate=host;
+ if ((candidate.find(base)!=std::string::npos) && baseSize<candidate.size())
{
// success, stop now.
ierr=0;
@@ -1897,39 +1891,39 @@ const char * SystemInformationImplementation::GetVendorID()
}
/** Return the type ID of the CPU */
-kwsys_stl::string SystemInformationImplementation::GetTypeID()
+std::string SystemInformationImplementation::GetTypeID()
{
- kwsys_ios::ostringstream str;
+ std::ostringstream str;
str << this->ChipID.Type;
return str.str();
}
/** Return the family of the CPU present */
-kwsys_stl::string SystemInformationImplementation::GetFamilyID()
+std::string SystemInformationImplementation::GetFamilyID()
{
- kwsys_ios::ostringstream str;
+ std::ostringstream str;
str << this->ChipID.Family;
return str.str();
}
// Return the model of CPU present */
-kwsys_stl::string SystemInformationImplementation::GetModelID()
+std::string SystemInformationImplementation::GetModelID()
{
- kwsys_ios::ostringstream str;
+ std::ostringstream str;
str << this->ChipID.Model;
return str.str();
}
// Return the model name of CPU present */
-kwsys_stl::string SystemInformationImplementation::GetModelName()
+std::string SystemInformationImplementation::GetModelName()
{
return this->ChipID.ModelName;
}
/** Return the stepping code of the CPU present. */
-kwsys_stl::string SystemInformationImplementation::GetSteppingCode()
+std::string SystemInformationImplementation::GetSteppingCode()
{
- kwsys_ios::ostringstream str;
+ std::ostringstream str;
str << this->ChipID.Revision;
return str.str();
}
@@ -2180,7 +2174,7 @@ bool SystemInformationImplementation::RetrieveCPUFeatures()
/** Find the manufacturer given the vendor id */
-void SystemInformationImplementation::FindManufacturer(const kwsys_stl::string& family)
+void SystemInformationImplementation::FindManufacturer(const std::string& family)
{
if (this->ChipID.Vendor == "GenuineIntel") this->ChipManufacturer = Intel; // Intel Corp.
else if (this->ChipID.Vendor == "UMC UMC UMC ") this->ChipManufacturer = UMC; // United Microelectronics Corp.
@@ -2799,11 +2793,11 @@ bool SystemInformationImplementation::RetrieveCPUPowerManagement()
#if USE_CPUID
// Used only in USE_CPUID implementation below.
-static void SystemInformationStripLeadingSpace(kwsys_stl::string& str)
+static void SystemInformationStripLeadingSpace(std::string& str)
{
// Because some manufacturers have leading white space - we have to post-process the name.
- kwsys_stl::string::size_type pos = str.find_first_not_of(" ");
- if(pos != kwsys_stl::string::npos)
+ std::string::size_type pos = str.find_first_not_of(" ");
+ if(pos != std::string::npos)
{
str = str.substr(pos);
}
@@ -3148,7 +3142,7 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
/** Extract a value from the CPUInfo file */
-kwsys_stl::string SystemInformationImplementation::ExtractValueFromCpuInfoFile(kwsys_stl::string buffer,const char* word,size_t init)
+std::string SystemInformationImplementation::ExtractValueFromCpuInfoFile(std::string buffer,const char* word,size_t init)
{
size_t pos = buffer.find(word,init);
if(pos != buffer.npos)
@@ -3180,12 +3174,12 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
{
this->NumberOfLogicalCPU = 0;
this->NumberOfPhysicalCPU = 0;
- kwsys_stl::string buffer;
+ std::string buffer;
FILE *fd = fopen("/proc/cpuinfo", "r" );
if ( !fd )
{
- kwsys_ios::cout << "Problem opening /proc/cpuinfo" << kwsys_ios::endl;
+ std::cout << "Problem opening /proc/cpuinfo" << std::endl;
return false;
}
@@ -3209,7 +3203,7 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
#ifdef __linux
// Find the largest physical id.
int maxId = -1;
- kwsys_stl::string idc =
+ std::string idc =
this->ExtractValueFromCpuInfoFile(buffer,"physical id");
while(this->CurrentPositionInFile != buffer.npos)
{
@@ -3224,7 +3218,7 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
// Physical ids returned by Linux don't distinguish cores.
// We want to record the total number of cores in this->NumberOfPhysicalCPU
// (checking only the first proc)
- kwsys_stl::string cores =
+ std::string cores =
this->ExtractValueFromCpuInfoFile(buffer,"cpu cores");
int numberOfCoresPerCPU=atoi(cores.c_str());
if (maxId > 0)
@@ -3242,7 +3236,7 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
#else // __CYGWIN__
// does not have "physical id" entries, neither "cpu cores"
// this has to be fixed for hyper-threading.
- kwsys_stl::string cpucount =
+ std::string cpucount =
this->ExtractValueFromCpuInfoFile(buffer,"cpu count");
this->NumberOfPhysicalCPU=
this->NumberOfLogicalCPU = atoi(cpucount.c_str());
@@ -3258,7 +3252,7 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
this->NumberOfLogicalCPU/this->NumberOfPhysicalCPU;
// CPU speed (checking only the first processor)
- kwsys_stl::string CPUSpeed = this->ExtractValueFromCpuInfoFile(buffer,"cpu MHz");
+ std::string CPUSpeed = this->ExtractValueFromCpuInfoFile(buffer,"cpu MHz");
if(!CPUSpeed.empty())
{
this->CPUSpeedInMHz = static_cast<float>(atof(CPUSpeed.c_str()));
@@ -3274,7 +3268,7 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
#endif
// Chip family
- kwsys_stl::string familyStr =
+ std::string familyStr =
this->ExtractValueFromCpuInfoFile(buffer,"cpu family");
if(familyStr.empty())
{
@@ -3304,7 +3298,7 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
{
// Some platforms (e.g. PA-RISC) tell us their CPU name here.
// Note: x86 does not.
- kwsys_stl::string cpuname = this->ExtractValueFromCpuInfoFile(buffer,"cpu");
+ std::string cpuname = this->ExtractValueFromCpuInfoFile(buffer,"cpu");
if(!cpuname.empty())
{
this->ChipID.ProcessorName = cpuname;
@@ -3312,7 +3306,7 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
}
// Chip revision
- kwsys_stl::string cpurev = this->ExtractValueFromCpuInfoFile(buffer,"stepping");
+ std::string cpurev = this->ExtractValueFromCpuInfoFile(buffer,"stepping");
if(cpurev.empty())
{
cpurev = this->ExtractValueFromCpuInfoFile(buffer,"CPU revision");
@@ -3325,7 +3319,7 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
// L1 Cache size
// Different architectures may show different names for the caches.
// Sum up everything we find.
- kwsys_stl::vector<const char*> cachename;
+ std::vector<const char*> cachename;
cachename.clear();
cachename.push_back("cache size"); // e.g. x86
@@ -3335,7 +3329,7 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
this->Features.L1CacheSize = 0;
for (size_t index = 0; index < cachename.size(); index ++)
{
- kwsys_stl::string cacheSize = this->ExtractValueFromCpuInfoFile(buffer,cachename[index]);
+ std::string cacheSize = this->ExtractValueFromCpuInfoFile(buffer,cachename[index]);
if (!cacheSize.empty())
{
pos = cacheSize.find(" KB");
@@ -3348,48 +3342,48 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
}
// processor feature flags (probably x86 specific)
- kwsys_stl::string cpuflags = this->ExtractValueFromCpuInfoFile(buffer,"flags");
+ std::string cpuflags = this->ExtractValueFromCpuInfoFile(buffer,"flags");
if(!cpurev.empty())
{
// now we can match every flags as space + flag + space
cpuflags = " " + cpuflags + " ";
- if ((cpuflags.find(" fpu ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" fpu ")!=std::string::npos))
{
this->Features.HasFPU = true;
}
- if ((cpuflags.find(" tsc ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" tsc ")!=std::string::npos))
{
this->Features.HasTSC = true;
}
- if ((cpuflags.find(" mmx ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" mmx ")!=std::string::npos))
{
this->Features.HasMMX = true;
}
- if ((cpuflags.find(" sse ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" sse ")!=std::string::npos))
{
this->Features.HasSSE = true;
}
- if ((cpuflags.find(" sse2 ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" sse2 ")!=std::string::npos))
{
this->Features.HasSSE2 = true;
}
- if ((cpuflags.find(" apic ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" apic ")!=std::string::npos))
{
this->Features.HasAPIC = true;
}
- if ((cpuflags.find(" cmov ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" cmov ")!=std::string::npos))
{
this->Features.HasCMOV = true;
}
- if ((cpuflags.find(" mtrr ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" mtrr ")!=std::string::npos))
{
this->Features.HasMTRR = true;
}
- if ((cpuflags.find(" acpi ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" acpi ")!=std::string::npos))
{
this->Features.HasACPI = true;
}
- if ((cpuflags.find(" 3dnow ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" 3dnow ")!=std::string::npos))
{
this->Features.ExtendedFeatures.Has3DNow = true;
}
@@ -3645,7 +3639,7 @@ SystemInformationImplementation::GetProcMemoryUsed()
#elif defined(__APPLE__)
SystemInformation::LongLong memUsed=0;
pid_t pid=getpid();
- kwsys_ios::ostringstream oss;
+ std::ostringstream oss;
oss << "ps -o rss= -p " << pid;
FILE *file=popen(oss.str().c_str(),"r");
if (file==0)
@@ -3670,7 +3664,7 @@ SystemInformationImplementation::GetProcMemoryUsed()
{
return -2;
}
- kwsys_ios::istringstream iss(oss.str());
+ std::istringstream iss(oss.str());
iss >> memUsed;
return memUsed;
#else
@@ -3729,11 +3723,11 @@ SystemInformationImplementation::GetProcessId()
return current program stack in a string
demangle cxx symbols if possible.
*/
-kwsys_stl::string SystemInformationImplementation::GetProgramStack(
+std::string SystemInformationImplementation::GetProgramStack(
int firstFrame,
int wholePath)
{
- kwsys_stl::string programStack = ""
+ std::string programStack = ""
#if !defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE)
"WARNING: The stack could not be examined "
"because backtrace is not supported.\n"
@@ -3752,7 +3746,7 @@ kwsys_stl::string SystemInformationImplementation::GetProgramStack(
#endif
;
- kwsys_ios::ostringstream oss;
+ std::ostringstream oss;
#if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE)
void *stackSymbols[256];
int nFrames=backtrace(stackSymbols,256);
@@ -3761,7 +3755,7 @@ kwsys_stl::string SystemInformationImplementation::GetProgramStack(
SymbolProperties symProps;
symProps.SetReportPath(wholePath);
symProps.Initialize(stackSymbols[i]);
- oss << symProps << kwsys_ios::endl;
+ oss << symProps << std::endl;
}
#else
(void)firstFrame;
@@ -3892,7 +3886,7 @@ bool SystemInformationImplementation::QueryLinuxMemory()
int errorFlag = uname(&unameInfo);
if( errorFlag!=0 )
{
- kwsys_ios::cout << "Problem calling uname(): " << strerror(errno) << kwsys_ios::endl;
+ std::cout << "Problem calling uname(): " << strerror(errno) << std::endl;
return false;
}
@@ -3916,7 +3910,7 @@ bool SystemInformationImplementation::QueryLinuxMemory()
FILE *fd = fopen("/proc/meminfo", "r" );
if ( !fd )
{
- kwsys_ios::cout << "Problem opening /proc/meminfo" << kwsys_ios::endl;
+ std::cout << "Problem opening /proc/meminfo" << std::endl;
return false;
}
@@ -3954,7 +3948,7 @@ bool SystemInformationImplementation::QueryLinuxMemory()
}
else
{
- kwsys_ios::cout << "Problem parsing /proc/meminfo" << kwsys_ios::endl;
+ std::cout << "Problem parsing /proc/meminfo" << std::endl;
fclose(fd);
return false;
}
@@ -3987,7 +3981,7 @@ bool SystemInformationImplementation::QueryLinuxMemory()
}
else
{
- kwsys_ios::cout << "Problem parsing /proc/meminfo" << kwsys_ios::endl;
+ std::cout << "Problem parsing /proc/meminfo" << std::endl;
fclose(fd);
return false;
}
@@ -4464,8 +4458,8 @@ bool SystemInformationImplementation::ParseSysCtl()
::memset(retBuf, 0, 128);
len = 32;
err = sysctlbyname("hw.machine", &retBuf, &len, NULL, 0);
- kwsys_stl::string machineBuf(retBuf);
- if (machineBuf.find_first_of("Power") != kwsys_stl::string::npos)
+ std::string machineBuf(retBuf);
+ if (machineBuf.find_first_of("Power") != std::string::npos)
{
this->ChipID.Vendor = "IBM";
len = sizeof(this->ChipID.Family);
@@ -4527,41 +4521,41 @@ bool SystemInformationImplementation::ParseSysCtl()
{
// now we can match every flags as space + flag + space
buf[len + 1] = ' ';
- kwsys_stl::string cpuflags(buf, len + 2);
+ std::string cpuflags(buf, len + 2);
- if ((cpuflags.find(" FPU ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" FPU ")!=std::string::npos))
{
this->Features.HasFPU = true;
}
- if ((cpuflags.find(" TSC ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" TSC ")!=std::string::npos))
{
this->Features.HasTSC = true;
}
- if ((cpuflags.find(" MMX ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" MMX ")!=std::string::npos))
{
this->Features.HasMMX = true;
}
- if ((cpuflags.find(" SSE ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" SSE ")!=std::string::npos))
{
this->Features.HasSSE = true;
}
- if ((cpuflags.find(" SSE2 ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" SSE2 ")!=std::string::npos))
{
this->Features.HasSSE2 = true;
}
- if ((cpuflags.find(" APIC ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" APIC ")!=std::string::npos))
{
this->Features.HasAPIC = true;
}
- if ((cpuflags.find(" CMOV ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" CMOV ")!=std::string::npos))
{
this->Features.HasCMOV = true;
}
- if ((cpuflags.find(" MTRR ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" MTRR ")!=std::string::npos))
{
this->Features.HasMTRR = true;
}
- if ((cpuflags.find(" ACPI ")!=kwsys_stl::string::npos))
+ if ((cpuflags.find(" ACPI ")!=std::string::npos))
{
this->Features.HasACPI = true;
}
@@ -4595,7 +4589,7 @@ bool SystemInformationImplementation::ParseSysCtl()
/** Extract a value from sysctl command */
-kwsys_stl::string SystemInformationImplementation::ExtractValueFromSysCtl(const char* word)
+std::string SystemInformationImplementation::ExtractValueFromSysCtl(const char* word)
{
size_t pos = this->SysCtlBuffer.find(word);
if(pos != this->SysCtlBuffer.npos)
@@ -4612,9 +4606,9 @@ kwsys_stl::string SystemInformationImplementation::ExtractValueFromSysCtl(const
/** Run a given process */
-kwsys_stl::string SystemInformationImplementation::RunProcess(kwsys_stl::vector<const char*> args)
+std::string SystemInformationImplementation::RunProcess(std::vector<const char*> args)
{
- kwsys_stl::string buffer = "";
+ std::string buffer = "";
// Run the application
kwsysProcess* gp = kwsysProcess_New();
@@ -4644,12 +4638,12 @@ kwsys_stl::string SystemInformationImplementation::RunProcess(kwsys_stl::vector<
} break;
case kwsysProcess_State_Error:
{
- kwsys_ios::cerr << "Error: Could not run " << args[0] << ":\n";
- kwsys_ios::cerr << kwsysProcess_GetErrorString(gp) << "\n";
+ std::cerr << "Error: Could not run " << args[0] << ":\n";
+ std::cerr << kwsysProcess_GetErrorString(gp) << "\n";
} break;
case kwsysProcess_State_Exception:
{
- kwsys_ios::cerr << "Error: " << args[0]
+ std::cerr << "Error: " << args[0]
<< " terminated with an exception: "
<< kwsysProcess_GetExceptionString(gp) << "\n";
} break;
@@ -4659,27 +4653,27 @@ kwsys_stl::string SystemInformationImplementation::RunProcess(kwsys_stl::vector<
case kwsysProcess_State_Killed:
{
// Should not get here.
- kwsys_ios::cerr << "Unexpected ending state after running " << args[0]
- << kwsys_ios::endl;
+ std::cerr << "Unexpected ending state after running " << args[0]
+ << std::endl;
} break;
}
kwsysProcess_Delete(gp);
if(result)
{
- kwsys_ios::cerr << "Error " << args[0] << " returned :" << result << "\n";
+ std::cerr << "Error " << args[0] << " returned :" << result << "\n";
}
return buffer;
}
-kwsys_stl::string SystemInformationImplementation::ParseValueFromKStat(const char* arguments)
+std::string SystemInformationImplementation::ParseValueFromKStat(const char* arguments)
{
- kwsys_stl::vector<const char*> args;
+ std::vector<const char*> args;
args.clear();
args.push_back("kstat");
args.push_back("-p");
- kwsys_stl::string command = arguments;
+ std::string command = arguments;
size_t start = command.npos;
size_t pos = command.find(' ',0);
while(pos!=command.npos)
@@ -4701,7 +4695,7 @@ kwsys_stl::string SystemInformationImplementation::ParseValueFromKStat(const cha
if(!inQuotes)
{
- kwsys_stl::string arg = command.substr(start+1,pos-start-1);
+ std::string arg = command.substr(start+1,pos-start-1);
// Remove the quotes if any
size_t quotes = arg.find('"');
@@ -4715,14 +4709,14 @@ kwsys_stl::string SystemInformationImplementation::ParseValueFromKStat(const cha
}
pos = command.find(' ',pos+1);
}
- kwsys_stl::string lastArg = command.substr(start+1,command.size()-start-1);
+ std::string lastArg = command.substr(start+1,command.size()-start-1);
args.push_back(lastArg.c_str());
args.push_back(0);
- kwsys_stl::string buffer = this->RunProcess(args);
+ std::string buffer = this->RunProcess(args);
- kwsys_stl::string value = "";
+ std::string value = "";
for(size_t i=buffer.size()-1;i>0;i--)
{
if(buffer[i] == ' ' || buffer[i] == '\t')
@@ -4731,7 +4725,7 @@ kwsys_stl::string SystemInformationImplementation::ParseValueFromKStat(const cha
}
if(buffer[i] != '\n' && buffer[i] != '\r')
{
- kwsys_stl::string val = value;
+ std::string val = value;
value = buffer[i];
value += val;
}
@@ -4885,8 +4879,8 @@ bool SystemInformationImplementation::QueryHaikuInfo()
bool SystemInformationImplementation::QueryQNXMemory()
{
#if defined(__QNX__)
- kwsys_stl::string buffer;
- kwsys_stl::vector<const char*> args;
+ std::string buffer;
+ std::vector<const char*> args;
args.clear();
args.push_back("showmem");
@@ -4943,8 +4937,8 @@ bool SystemInformationImplementation::QueryQNXProcessor()
#if defined(__QNX__)
// the output on my QNX 6.4.1 looks like this:
// Processor1: 686 Pentium II Stepping 3 2175MHz FPU
- kwsys_stl::string buffer;
- kwsys_stl::vector<const char*> args;
+ std::string buffer;
+ std::vector<const char*> args;
args.clear();
args.push_back("pidin");
@@ -5440,10 +5434,10 @@ bool SystemInformationImplementation::QueryOSInformation()
int SystemInformationImplementation::CallSwVers(
const char *arg,
- kwsys_stl::string &ver)
+ std::string &ver)
{
#ifdef __APPLE__
- kwsys_stl::vector<const char*> args;
+ std::vector<const char*> args;
args.push_back("sw_vers");
args.push_back(arg);
args.push_back(0);
@@ -5457,18 +5451,18 @@ int SystemInformationImplementation::CallSwVers(
return 0;
}
-void SystemInformationImplementation::TrimNewline(kwsys_stl::string& output)
+void SystemInformationImplementation::TrimNewline(std::string& output)
{
// remove \r
- kwsys_stl::string::size_type pos=0;
- while((pos = output.find("\r", pos)) != kwsys_stl::string::npos)
+ std::string::size_type pos=0;
+ while((pos = output.find("\r", pos)) != std::string::npos)
{
output.erase(pos);
}
// remove \n
pos = 0;
- while((pos = output.find("\n", pos)) != kwsys_stl::string::npos)
+ while((pos = output.find("\n", pos)) != std::string::npos)
{
output.erase(pos);
}
diff --git a/Source/kwsys/SystemInformation.hxx.in b/Source/kwsys/SystemInformation.hxx.in
index 4acdc4f..7c45388 100644
--- a/Source/kwsys/SystemInformation.hxx.in
+++ b/Source/kwsys/SystemInformation.hxx.in
@@ -12,14 +12,9 @@
#ifndef @KWSYS_NAMESPACE@_SystemInformation_h
#define @KWSYS_NAMESPACE@_SystemInformation_h
-
-/* Define these macros temporarily to keep the code readable. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# define kwsys_stl @KWSYS_NAMESPACE@_stl
-# define kwsys_ios @KWSYS_NAMESPACE@_ios
-#endif
-#include <@KWSYS_NAMESPACE@/stl/string>
+#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <stddef.h> /* size_t */
+#include <string>
namespace @KWSYS_NAMESPACE@
{
@@ -45,11 +40,11 @@ public:
const char * GetVendorString();
const char * GetVendorID();
- kwsys_stl::string GetTypeID();
- kwsys_stl::string GetFamilyID();
- kwsys_stl::string GetModelID();
- kwsys_stl::string GetModelName();
- kwsys_stl::string GetSteppingCode();
+ std::string GetTypeID();
+ std::string GetFamilyID();
+ std::string GetModelID();
+ std::string GetModelName();
+ std::string GetSteppingCode();
const char * GetExtendedProcessorName();
const char * GetProcessorSerialNumber();
int GetProcessorCacheSize();
@@ -61,10 +56,10 @@ public:
// returns an informative general description of the cpu
// on this system.
- kwsys_stl::string GetCPUDescription();
+ std::string GetCPUDescription();
const char * GetHostname();
- kwsys_stl::string GetFullyQualifiedDomainName();
+ std::string GetFullyQualifiedDomainName();
const char * GetOSName();
const char * GetOSRelease();
@@ -77,7 +72,7 @@ public:
// returns an informative general description of the os
// on this system.
- kwsys_stl::string GetOSDescription();
+ std::string GetOSDescription();
bool Is64Bits();
@@ -98,7 +93,7 @@ public:
// returns an informative general description if the installed and
// available ram on this system. See the GetHostMmeoryTotal, and
// Get{Host,Proc}MemoryAvailable methods for more information.
- kwsys_stl::string GetMemoryDescription(
+ std::string GetMemoryDescription(
const char *hostLimitEnvVarName=NULL,
const char *procLimitEnvVarName=NULL);
@@ -144,7 +139,7 @@ public:
// order to produce an informative stack trace the application
// should be dynamically linked and compiled with debug symbols.
static
- kwsys_stl::string GetProgramStack(int firstFrame, int wholePath);
+ std::string GetProgramStack(int firstFrame, int wholePath);
/** Run the different checks */
void RunCPUCheck();
@@ -154,10 +149,4 @@ public:
} // namespace @KWSYS_NAMESPACE@
-/* Undefine temporary macros. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# undef kwsys_stl
-# undef kwsys_ios
-#endif
-
#endif
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index f12a06c..262af27 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -31,11 +31,10 @@
#include KWSYS_HEADER(FStream.hxx)
#include KWSYS_HEADER(Encoding.hxx)
-#include KWSYS_HEADER(ios/iostream)
-#include KWSYS_HEADER(ios/fstream)
-#include KWSYS_HEADER(ios/sstream)
-
-#include KWSYS_HEADER(stl/set)
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <set>
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
@@ -44,9 +43,6 @@
# include "Directory.hxx.in"
# include "FStream.hxx.in"
# include "Encoding.hxx.in"
-# include "kwsys_ios_iostream.h.in"
-# include "kwsys_ios_fstream.h.in"
-# include "kwsys_ios_sstream.h.in"
#endif
#ifdef _MSC_VER
@@ -220,12 +216,12 @@ static time_t windows_filetime_to_posix_time(const FILETIME& ft)
#ifdef KWSYS_WINDOWS_DIRS
#include <wctype.h>
-inline int Mkdir(const kwsys_stl::string& dir)
+inline int Mkdir(const std::string& dir)
{
return _wmkdir(
KWSYS_NAMESPACE::SystemTools::ConvertToWindowsExtendedPath(dir).c_str());
}
-inline int Rmdir(const kwsys_stl::string& dir)
+inline int Rmdir(const std::string& dir)
{
return _wrmdir(
KWSYS_NAMESPACE::SystemTools::ConvertToWindowsExtendedPath(dir).c_str());
@@ -246,7 +242,7 @@ inline const char* Getcwd(char* buf, unsigned int len)
}
return 0;
}
-inline int Chdir(const kwsys_stl::string& dir)
+inline int Chdir(const std::string& dir)
{
#if defined(__BORLANDC__)
return chdir(dir.c_str());
@@ -254,11 +250,11 @@ inline int Chdir(const kwsys_stl::string& dir)
return _wchdir(KWSYS_NAMESPACE::Encoding::ToWide(dir).c_str());
#endif
}
-inline void Realpath(const kwsys_stl::string& path,
- kwsys_stl::string& resolved_path,
- kwsys_stl::string* errorMessage = 0)
+inline void Realpath(const std::string& path,
+ std::string& resolved_path,
+ std::string* errorMessage = 0)
{
- kwsys_stl::wstring tmp = KWSYS_NAMESPACE::Encoding::ToWide(path);
+ std::wstring tmp = KWSYS_NAMESPACE::Encoding::ToWide(path);
wchar_t *ptemp;
wchar_t fullpath[MAX_PATH];
DWORD bufferLen = GetFullPathNameW(tmp.c_str(),
@@ -303,11 +299,11 @@ inline void Realpath(const kwsys_stl::string& path,
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
-inline int Mkdir(const kwsys_stl::string& dir)
+inline int Mkdir(const std::string& dir)
{
return mkdir(dir.c_str(), 00777);
}
-inline int Rmdir(const kwsys_stl::string& dir)
+inline int Rmdir(const std::string& dir)
{
return rmdir(dir.c_str());
}
@@ -316,13 +312,13 @@ inline const char* Getcwd(char* buf, unsigned int len)
return getcwd(buf, len);
}
-inline int Chdir(const kwsys_stl::string& dir)
+inline int Chdir(const std::string& dir)
{
return chdir(dir.c_str());
}
-inline void Realpath(const kwsys_stl::string& path,
- kwsys_stl::string& resolved_path,
- kwsys_stl::string* errorMessage = 0)
+inline void Realpath(const std::string& path,
+ std::string& resolved_path,
+ std::string* errorMessage = 0)
{
char resolved_name[KWSYS_SYSTEMTOOLS_MAXPATH];
@@ -385,14 +381,14 @@ double SystemTools::GetTime(void)
}
class SystemToolsTranslationMap :
- public kwsys_stl::map<kwsys_stl::string,kwsys_stl::string>
+ public std::map<std::string,std::string>
{
};
#ifdef _WIN32
struct SystemToolsPathCaseCmp
{
- bool operator()(kwsys_stl::string const& l, kwsys_stl::string const& r) const
+ bool operator()(std::string const& l, std::string const& r) const
{
# ifdef _MSC_VER
return _stricmp(l.c_str(), r.c_str()) < 0;
@@ -405,13 +401,14 @@ struct SystemToolsPathCaseCmp
};
class SystemToolsPathCaseMap:
- public kwsys_stl::map<kwsys_stl::string, kwsys_stl::string,
+ public std::map<std::string, std::string,
SystemToolsPathCaseCmp> {};
#endif
// adds the elements of the env variable path to the arg passed in
-void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char* env)
+void SystemTools::GetPath(std::vector<std::string>& path, const char* env)
{
+ size_t const old_size = path.size();
#if defined(_WIN32) && !defined(__CYGWIN__)
const char pathSep = ';';
#else
@@ -427,19 +424,19 @@ void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char
return;
}
- kwsys_stl::string pathEnv = cpathEnv;
+ std::string pathEnv = cpathEnv;
// A hack to make the below algorithm work.
if(!pathEnv.empty() && *pathEnv.rbegin() != pathSep)
{
pathEnv += pathSep;
}
- kwsys_stl::string::size_type start =0;
+ std::string::size_type start =0;
bool done = false;
while(!done)
{
- kwsys_stl::string::size_type endpos = pathEnv.find(pathSep, start);
- if(endpos != kwsys_stl::string::npos)
+ std::string::size_type endpos = pathEnv.find(pathSep, start);
+ if(endpos != std::string::npos)
{
path.push_back(pathEnv.substr(start, endpos-start));
start = endpos+1;
@@ -449,7 +446,7 @@ void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char
done = true;
}
}
- for(kwsys_stl::vector<kwsys_stl::string>::iterator i = path.begin();
+ for(std::vector<std::string>::iterator i = path.begin() + old_size;
i != path.end(); ++i)
{
SystemTools::ConvertToUnixSlashes(*i);
@@ -461,12 +458,12 @@ const char* SystemTools::GetEnv(const char* key)
return getenv(key);
}
-const char* SystemTools::GetEnv(const kwsys_stl::string& key)
+const char* SystemTools::GetEnv(const std::string& key)
{
return SystemTools::GetEnv(key.c_str());
}
-bool SystemTools::GetEnv(const char* key, kwsys_stl::string& result)
+bool SystemTools::GetEnv(const char* key, std::string& result)
{
const char* v = getenv(key);
if(v)
@@ -480,7 +477,7 @@ bool SystemTools::GetEnv(const char* key, kwsys_stl::string& result)
}
}
-bool SystemTools::GetEnv(const kwsys_stl::string& key, kwsys_stl::string& result)
+bool SystemTools::GetEnv(const std::string& key, std::string& result)
{
return SystemTools::GetEnv(key.c_str(), result);
}
@@ -496,7 +493,7 @@ bool SystemTools::GetEnv(const kwsys_stl::string& key, kwsys_stl::string& result
#if KWSYS_CXX_HAS_UNSETENV
/* unsetenv("A") removes A from the environment.
On older platforms it returns void instead of int. */
-static int kwsysUnPutEnv(const kwsys_stl::string& env)
+static int kwsysUnPutEnv(const std::string& env)
{
size_t pos = env.find('=');
if(pos != env.npos)
@@ -513,7 +510,7 @@ static int kwsysUnPutEnv(const kwsys_stl::string& env)
#elif defined(KWSYS_PUTENV_EMPTY) || defined(KWSYS_PUTENV_NAME)
/* putenv("A=") or putenv("A") removes A from the environment. */
-static int kwsysUnPutEnv(const kwsys_stl::string& env)
+static int kwsysUnPutEnv(const std::string& env)
{
int err = 0;
size_t pos = env.find('=');
@@ -558,7 +555,7 @@ static int kwsysUnPutEnv(const kwsys_stl::string& env)
#else
/* Manipulate the "environ" global directly. */
-static int kwsysUnPutEnv(const kwsys_stl::string& env)
+static int kwsysUnPutEnv(const std::string& env)
{
size_t pos = env.find('=');
size_t const len = pos == env.npos ? env.size() : pos;
@@ -591,7 +588,7 @@ static int kwsysUnPutEnv(const kwsys_stl::string& env)
/* setenv("A", "B", 1) will set A=B in the environment and makes its
own copies of the strings. */
-bool SystemTools::PutEnv(const kwsys_stl::string& env)
+bool SystemTools::PutEnv(const std::string& env)
{
size_t pos = env.find('=');
if(pos != env.npos)
@@ -605,7 +602,7 @@ bool SystemTools::PutEnv(const kwsys_stl::string& env)
}
}
-bool SystemTools::UnPutEnv(const kwsys_stl::string& env)
+bool SystemTools::UnPutEnv(const std::string& env)
{
return kwsysUnPutEnv(env) == 0;
}
@@ -643,7 +640,7 @@ struct kwsysEnvCompare
}
};
-class kwsysEnv: public kwsys_stl::set<const char*, kwsysEnvCompare>
+class kwsysEnv: public std::set<const char*, kwsysEnvCompare>
{
class Free
{
@@ -653,7 +650,7 @@ class kwsysEnv: public kwsys_stl::set<const char*, kwsysEnvCompare>
~Free() { free(const_cast<char*>(this->Env)); }
};
public:
- typedef kwsys_stl::set<const char*, kwsysEnvCompare> derived;
+ typedef std::set<const char*, kwsysEnvCompare> derived;
~kwsysEnv()
{
for(derived::iterator i = this->begin(); i != this->end(); ++i)
@@ -691,12 +688,12 @@ public:
static kwsysEnv kwsysEnvInstance;
-bool SystemTools::PutEnv(const kwsys_stl::string& env)
+bool SystemTools::PutEnv(const std::string& env)
{
return kwsysEnvInstance.Put(env.c_str());
}
-bool SystemTools::UnPutEnv(const kwsys_stl::string& env)
+bool SystemTools::UnPutEnv(const std::string& env)
{
return kwsysEnvInstance.UnPut(env.c_str());
}
@@ -714,7 +711,7 @@ const char* SystemTools::GetExecutableExtension()
#endif
}
-FILE* SystemTools::Fopen(const kwsys_stl::string& file, const char* mode)
+FILE* SystemTools::Fopen(const std::string& file, const char* mode)
{
#ifdef _WIN32
return _wfopen(SystemTools::ConvertToWindowsExtendedPath(file).c_str(),
@@ -730,10 +727,10 @@ bool SystemTools::MakeDirectory(const char* path)
{
return false;
}
- return SystemTools::MakeDirectory(kwsys_stl::string(path));
+ return SystemTools::MakeDirectory(std::string(path));
}
-bool SystemTools::MakeDirectory(const kwsys_stl::string& path)
+bool SystemTools::MakeDirectory(const std::string& path)
{
if(SystemTools::FileExists(path))
{
@@ -743,12 +740,12 @@ bool SystemTools::MakeDirectory(const kwsys_stl::string& path)
{
return false;
}
- kwsys_stl::string dir = path;
+ std::string dir = path;
SystemTools::ConvertToUnixSlashes(dir);
- kwsys_stl::string::size_type pos = 0;
- kwsys_stl::string topdir;
- while((pos = dir.find('/', pos)) != kwsys_stl::string::npos)
+ std::string::size_type pos = 0;
+ std::string topdir;
+ while((pos = dir.find('/', pos)) != std::string::npos)
{
topdir = dir.substr(0, pos);
Mkdir(topdir);
@@ -776,9 +773,9 @@ bool SystemTools::MakeDirectory(const kwsys_stl::string& path)
// replace replace with with as many times as it shows up in source.
// write the result into source.
-void SystemTools::ReplaceString(kwsys_stl::string& source,
- const kwsys_stl::string& replace,
- const kwsys_stl::string& with)
+void SystemTools::ReplaceString(std::string& source,
+ const std::string& replace,
+ const std::string& with)
{
// do while hangs if replaceSize is 0
if (replace.empty())
@@ -789,7 +786,7 @@ void SystemTools::ReplaceString(kwsys_stl::string& source,
SystemTools::ReplaceString(source, replace.c_str(), replace.size(), with);
}
-void SystemTools::ReplaceString(kwsys_stl::string& source,
+void SystemTools::ReplaceString(std::string& source,
const char* replace,
const char* with)
{
@@ -802,10 +799,10 @@ void SystemTools::ReplaceString(kwsys_stl::string& source,
SystemTools::ReplaceString(source, replace, strlen(replace), with ? with : "");
}
-void SystemTools::ReplaceString(kwsys_stl::string& source,
+void SystemTools::ReplaceString(std::string& source,
const char* replace,
size_t replaceSize,
- const kwsys_stl::string& with)
+ const std::string& with)
{
const char *src = source.c_str();
char *searchPos = const_cast<char *>(strstr(src,replace));
@@ -848,21 +845,21 @@ void SystemTools::ReplaceString(kwsys_stl::string& source,
#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
-static bool SystemToolsParseRegistryKey(const kwsys_stl::string& key,
+static bool SystemToolsParseRegistryKey(const std::string& key,
HKEY& primaryKey,
- kwsys_stl::string& second,
- kwsys_stl::string& valuename)
+ std::string& second,
+ std::string& valuename)
{
- kwsys_stl::string primary = key;
+ std::string primary = key;
size_t start = primary.find('\\');
- if (start == kwsys_stl::string::npos)
+ if (start == std::string::npos)
{
return false;
}
size_t valuenamepos = primary.find(';');
- if (valuenamepos != kwsys_stl::string::npos)
+ if (valuenamepos != std::string::npos)
{
valuename = primary.substr(valuenamepos+1);
}
@@ -919,13 +916,13 @@ static DWORD SystemToolsMakeRegistryMode(DWORD mode,
#if defined(_WIN32) && !defined(__CYGWIN__)
bool
-SystemTools::GetRegistrySubKeys(const kwsys_stl::string& key,
- kwsys_stl::vector<kwsys_stl::string>& subkeys,
+SystemTools::GetRegistrySubKeys(const std::string& key,
+ std::vector<std::string>& subkeys,
KeyWOW64 view)
{
HKEY primaryKey = HKEY_CURRENT_USER;
- kwsys_stl::string second;
- kwsys_stl::string valuename;
+ std::string second;
+ std::string valuename;
if (!SystemToolsParseRegistryKey(key, primaryKey, second, valuename))
{
return false;
@@ -958,8 +955,8 @@ SystemTools::GetRegistrySubKeys(const kwsys_stl::string& key,
return true;
}
#else
-bool SystemTools::GetRegistrySubKeys(const kwsys_stl::string&,
- kwsys_stl::vector<kwsys_stl::string>&,
+bool SystemTools::GetRegistrySubKeys(const std::string&,
+ std::vector<std::string>&,
KeyWOW64)
{
return false;
@@ -974,13 +971,13 @@ bool SystemTools::GetRegistrySubKeys(const kwsys_stl::string&,
// => will return the data of the "Root" value of the key
#if defined(_WIN32) && !defined(__CYGWIN__)
-bool SystemTools::ReadRegistryValue(const kwsys_stl::string& key, kwsys_stl::string &value,
+bool SystemTools::ReadRegistryValue(const std::string& key, std::string &value,
KeyWOW64 view)
{
bool valueset = false;
HKEY primaryKey = HKEY_CURRENT_USER;
- kwsys_stl::string second;
- kwsys_stl::string valuename;
+ std::string second;
+ std::string valuename;
if (!SystemToolsParseRegistryKey(key, primaryKey, second, valuename))
{
return false;
@@ -1031,7 +1028,7 @@ bool SystemTools::ReadRegistryValue(const kwsys_stl::string& key, kwsys_stl::str
return valueset;
}
#else
-bool SystemTools::ReadRegistryValue(const kwsys_stl::string&, kwsys_stl::string &,
+bool SystemTools::ReadRegistryValue(const std::string&, std::string &,
KeyWOW64)
{
return false;
@@ -1047,13 +1044,13 @@ bool SystemTools::ReadRegistryValue(const kwsys_stl::string&, kwsys_stl::string
// => will set the data of the "Root" value of the key
#if defined(_WIN32) && !defined(__CYGWIN__)
-bool SystemTools::WriteRegistryValue(const kwsys_stl::string& key,
- const kwsys_stl::string& value,
+bool SystemTools::WriteRegistryValue(const std::string& key,
+ const std::string& value,
KeyWOW64 view)
{
HKEY primaryKey = HKEY_CURRENT_USER;
- kwsys_stl::string second;
- kwsys_stl::string valuename;
+ std::string second;
+ std::string valuename;
if (!SystemToolsParseRegistryKey(key, primaryKey, second, valuename))
{
return false;
@@ -1088,7 +1085,7 @@ bool SystemTools::WriteRegistryValue(const kwsys_stl::string& key,
return false;
}
#else
-bool SystemTools::WriteRegistryValue(const kwsys_stl::string&, const kwsys_stl::string&, KeyWOW64)
+bool SystemTools::WriteRegistryValue(const std::string&, const std::string&, KeyWOW64)
{
return false;
}
@@ -1102,11 +1099,11 @@ bool SystemTools::WriteRegistryValue(const kwsys_stl::string&, const kwsys_stl::
// => will delete the data of the "Root" value of the key
#if defined(_WIN32) && !defined(__CYGWIN__)
-bool SystemTools::DeleteRegistryValue(const kwsys_stl::string& key, KeyWOW64 view)
+bool SystemTools::DeleteRegistryValue(const std::string& key, KeyWOW64 view)
{
HKEY primaryKey = HKEY_CURRENT_USER;
- kwsys_stl::string second;
- kwsys_stl::string valuename;
+ std::string second;
+ std::string valuename;
if (!SystemToolsParseRegistryKey(key, primaryKey, second, valuename))
{
return false;
@@ -1133,13 +1130,13 @@ bool SystemTools::DeleteRegistryValue(const kwsys_stl::string& key, KeyWOW64 vie
return false;
}
#else
-bool SystemTools::DeleteRegistryValue(const kwsys_stl::string&, KeyWOW64)
+bool SystemTools::DeleteRegistryValue(const std::string&, KeyWOW64)
{
return false;
}
#endif
-bool SystemTools::SameFile(const kwsys_stl::string& file1, const kwsys_stl::string& file2)
+bool SystemTools::SameFile(const std::string& file1, const std::string& file2)
{
#ifdef _WIN32
HANDLE hFile1, hFile2;
@@ -1207,11 +1204,11 @@ bool SystemTools::FileExists(const char* filename)
{
return false;
}
- return SystemTools::FileExists(kwsys_stl::string(filename));
+ return SystemTools::FileExists(std::string(filename));
}
//----------------------------------------------------------------------------
-bool SystemTools::FileExists(const kwsys_stl::string& filename)
+bool SystemTools::FileExists(const std::string& filename)
{
if(filename.empty())
{
@@ -1241,11 +1238,11 @@ bool SystemTools::FileExists(const char* filename, bool isFile)
{
return false;
}
- return SystemTools::FileExists(kwsys_stl::string(filename), isFile);
+ return SystemTools::FileExists(std::string(filename), isFile);
}
//----------------------------------------------------------------------------
-bool SystemTools::FileExists(const kwsys_stl::string& filename, bool isFile)
+bool SystemTools::FileExists(const std::string& filename, bool isFile)
{
if(SystemTools::FileExists(filename))
{
@@ -1264,12 +1261,12 @@ bool SystemTools::TestFileAccess(const char* filename,
{
return false;
}
- return SystemTools::TestFileAccess(kwsys_stl::string(filename),
+ return SystemTools::TestFileAccess(std::string(filename),
permissions);
}
//----------------------------------------------------------------------------
-bool SystemTools::TestFileAccess(const kwsys_stl::string& filename,
+bool SystemTools::TestFileAccess(const std::string& filename,
TestFilePermissions permissions)
{
if(filename.empty())
@@ -1317,7 +1314,7 @@ bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path)
}
#endif
-bool SystemTools::Touch(const kwsys_stl::string& filename, bool create)
+bool SystemTools::Touch(const std::string& filename, bool create)
{
if (!SystemTools::FileExists(filename))
{
@@ -1393,8 +1390,8 @@ bool SystemTools::Touch(const kwsys_stl::string& filename, bool create)
return true;
}
-bool SystemTools::FileTimeCompare(const kwsys_stl::string& f1,
- const kwsys_stl::string& f2,
+bool SystemTools::FileTimeCompare(const std::string& f1,
+ const std::string& f2,
int* result)
{
// Default to same time.
@@ -1466,26 +1463,26 @@ bool SystemTools::FileTimeCompare(const kwsys_stl::string& f1,
// Return a capitalized string (i.e the first letter is uppercased, all other
// are lowercased)
-kwsys_stl::string SystemTools::Capitalized(const kwsys_stl::string& s)
+std::string SystemTools::Capitalized(const std::string& s)
{
- kwsys_stl::string n;
+ std::string n;
if(s.empty())
{
return n;
}
n.resize(s.size());
- n[0] = static_cast<kwsys_stl::string::value_type>(toupper(s[0]));
+ n[0] = static_cast<std::string::value_type>(toupper(s[0]));
for (size_t i = 1; i < s.size(); i++)
{
- n[i] = static_cast<kwsys_stl::string::value_type>(tolower(s[i]));
+ n[i] = static_cast<std::string::value_type>(tolower(s[i]));
}
return n;
}
// Return capitalized words
-kwsys_stl::string SystemTools::CapitalizedWords(const kwsys_stl::string& s)
+std::string SystemTools::CapitalizedWords(const std::string& s)
{
- kwsys_stl::string n(s);
+ std::string n(s);
for (size_t i = 0; i < s.size(); i++)
{
#if defined(_MSC_VER) && defined (_MT) && defined (_DEBUG)
@@ -1497,16 +1494,16 @@ kwsys_stl::string SystemTools::CapitalizedWords(const kwsys_stl::string& s)
if (isalpha(s[i]) && (i == 0 || isspace(s[i - 1])))
#endif
{
- n[i] = static_cast<kwsys_stl::string::value_type>(toupper(s[i]));
+ n[i] = static_cast<std::string::value_type>(toupper(s[i]));
}
}
return n;
}
// Return uncapitalized words
-kwsys_stl::string SystemTools::UnCapitalizedWords(const kwsys_stl::string& s)
+std::string SystemTools::UnCapitalizedWords(const std::string& s)
{
- kwsys_stl::string n(s);
+ std::string n(s);
for (size_t i = 0; i < s.size(); i++)
{
#if defined(_MSC_VER) && defined (_MT) && defined (_DEBUG)
@@ -1518,17 +1515,17 @@ kwsys_stl::string SystemTools::UnCapitalizedWords(const kwsys_stl::string& s)
if (isalpha(s[i]) && (i == 0 || isspace(s[i - 1])))
#endif
{
- n[i] = static_cast<kwsys_stl::string::value_type>(tolower(s[i]));
+ n[i] = static_cast<std::string::value_type>(tolower(s[i]));
}
}
return n;
}
// only works for words with at least two letters
-kwsys_stl::string SystemTools::AddSpaceBetweenCapitalizedWords(
- const kwsys_stl::string& s)
+std::string SystemTools::AddSpaceBetweenCapitalizedWords(
+ const std::string& s)
{
- kwsys_stl::string n;
+ std::string n;
if (!s.empty())
{
n.reserve(s.size());
@@ -1595,25 +1592,25 @@ char* SystemTools::AppendStrings(
}
// Return a lower case string
-kwsys_stl::string SystemTools::LowerCase(const kwsys_stl::string& s)
+std::string SystemTools::LowerCase(const std::string& s)
{
- kwsys_stl::string n;
+ std::string n;
n.resize(s.size());
for (size_t i = 0; i < s.size(); i++)
{
- n[i] = static_cast<kwsys_stl::string::value_type>(tolower(s[i]));
+ n[i] = static_cast<std::string::value_type>(tolower(s[i]));
}
return n;
}
// Return a lower case string
-kwsys_stl::string SystemTools::UpperCase(const kwsys_stl::string& s)
+std::string SystemTools::UpperCase(const std::string& s)
{
- kwsys_stl::string n;
+ std::string n;
n.resize(s.size());
for (size_t i = 0; i < s.size(); i++)
{
- n[i] = static_cast<kwsys_stl::string::value_type>(toupper(s[i]));
+ n[i] = static_cast<std::string::value_type>(toupper(s[i]));
}
return n;
}
@@ -1719,7 +1716,7 @@ bool SystemTools::StringStartsWith(const char* str1, const char* str2)
}
// Returns if string starts with another string
-bool SystemTools::StringStartsWith(const kwsys_stl::string& str1, const char* str2)
+bool SystemTools::StringStartsWith(const std::string& str1, const char* str2)
{
if (!str2)
{
@@ -1741,7 +1738,7 @@ bool SystemTools::StringEndsWith(const char* str1, const char* str2)
}
// Returns if string ends with another string
-bool SystemTools::StringEndsWith(const kwsys_stl::string& str1, const char* str2)
+bool SystemTools::StringEndsWith(const std::string& str1, const char* str2)
{
if (!str2)
{
@@ -1787,7 +1784,7 @@ char* SystemTools::DuplicateString(const char* str)
}
// Return a cropped string
-kwsys_stl::string SystemTools::CropString(const kwsys_stl::string& s,
+std::string SystemTools::CropString(const std::string& s,
size_t max_len)
{
if (!s.size() || max_len == 0 || max_len >= s.size())
@@ -1795,13 +1792,13 @@ kwsys_stl::string SystemTools::CropString(const kwsys_stl::string& s,
return s;
}
- kwsys_stl::string n;
+ std::string n;
n.reserve(max_len);
size_t middle = max_len / 2;
n += s.substr(0, middle);
- n += s.substr(s.size() - (max_len - middle), kwsys_stl::string::npos);
+ n += s.substr(s.size() - (max_len - middle), std::string::npos);
if (max_len > 2)
{
@@ -1820,10 +1817,10 @@ kwsys_stl::string SystemTools::CropString(const kwsys_stl::string& s,
}
//----------------------------------------------------------------------------
-kwsys_stl::vector<kwsys::String> SystemTools::SplitString(const kwsys_stl::string& p, char sep, bool isPath)
+std::vector<kwsys::String> SystemTools::SplitString(const std::string& p, char sep, bool isPath)
{
- kwsys_stl::string path = p;
- kwsys_stl::vector<kwsys::String> paths;
+ std::string path = p;
+ std::vector<kwsys::String> paths;
if(path.empty())
{
return paths;
@@ -1833,9 +1830,9 @@ kwsys_stl::vector<kwsys::String> SystemTools::SplitString(const kwsys_stl::strin
path.erase(path.begin());
paths.push_back("/");
}
- kwsys_stl::string::size_type pos1 = 0;
- kwsys_stl::string::size_type pos2 = path.find(sep, pos1+1);
- while(pos2 != kwsys_stl::string::npos)
+ std::string::size_type pos1 = 0;
+ std::string::size_type pos2 = path.find(sep, pos1+1);
+ while(pos2 != std::string::npos)
{
paths.push_back(path.substr(pos1, pos2-pos1));
pos1 = pos2+1;
@@ -1915,12 +1912,12 @@ int SystemTools::EstimateFormatLength(const char *format, va_list ap)
return static_cast<int>(length);
}
-kwsys_stl::string SystemTools::EscapeChars(
+std::string SystemTools::EscapeChars(
const char *str,
const char *chars_to_escape,
char escape_char)
{
- kwsys_stl::string n;
+ std::string n;
if (str)
{
if (!chars_to_escape || !*chars_to_escape)
@@ -1951,17 +1948,17 @@ kwsys_stl::string SystemTools::EscapeChars(
}
#ifdef __VMS
-static void ConvertVMSToUnix(kwsys_stl::string& path)
+static void ConvertVMSToUnix(std::string& path)
{
- kwsys_stl::string::size_type rootEnd = path.find(":[");
- kwsys_stl::string::size_type pathEnd = path.find("]");
+ std::string::size_type rootEnd = path.find(":[");
+ std::string::size_type pathEnd = path.find("]");
if(rootEnd != path.npos)
{
- kwsys_stl::string root = path.substr(0, rootEnd);
- kwsys_stl::string pathPart = path.substr(rootEnd+2, pathEnd - rootEnd-2);
+ std::string root = path.substr(0, rootEnd);
+ std::string pathPart = path.substr(rootEnd+2, pathEnd - rootEnd-2);
const char* pathCString = pathPart.c_str();
const char* pos0 = pathCString;
- for (kwsys_stl::string::size_type pos = 0; *pos0; ++ pos )
+ for (std::string::size_type pos = 0; *pos0; ++ pos )
{
if ( *pos0 == '.' )
{
@@ -1975,7 +1972,7 @@ static void ConvertVMSToUnix(kwsys_stl::string& path)
#endif
// convert windows slashes to unix slashes
-void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
+void SystemTools::ConvertToUnixSlashes(std::string& path)
{
const char* pathCString = path.c_str();
bool hasDoubleSlash = false;
@@ -1984,7 +1981,7 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
#else
const char* pos0 = pathCString;
const char* pos1 = pathCString+1;
- for (kwsys_stl::string::size_type pos = 0; *pos0; ++ pos )
+ for (std::string::size_type pos = 0; *pos0; ++ pos )
{
// make sure we don't convert an escaped space to a unix slash
if ( *pos0 == '\\' && *pos1 != ' ' )
@@ -2032,8 +2029,8 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
#ifdef HAVE_GETPWNAM
else if(pathCString[0] == '~')
{
- kwsys_stl::string::size_type idx = path.find_first_of("/\0");
- kwsys_stl::string user = path.substr(1, idx-1);
+ std::string::size_type idx = path.find_first_of("/\0");
+ std::string user = path.substr(1, idx-1);
passwd* pw = getpwnam(user.c_str());
if(pw)
{
@@ -2058,10 +2055,10 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
#ifdef _WIN32
// Convert local paths to UNC style paths
-kwsys_stl::wstring
-SystemTools::ConvertToWindowsExtendedPath(const kwsys_stl::string &source)
+std::wstring
+SystemTools::ConvertToWindowsExtendedPath(const std::string &source)
{
- kwsys_stl::wstring wsource = Encoding::ToWide(source);
+ std::wstring wsource = Encoding::ToWide(source);
// Resolve any relative paths
DWORD wfull_len;
@@ -2069,7 +2066,7 @@ SystemTools::ConvertToWindowsExtendedPath(const kwsys_stl::string &source)
/* The +3 is a workaround for a bug in some versions of GetFullPathNameW that
* won't return a large enough buffer size if the input is too small */
wfull_len = GetFullPathNameW(wsource.c_str(), 0, NULL, NULL) + 3;
- kwsys_stl::vector<wchar_t> wfull(wfull_len);
+ std::vector<wchar_t> wfull(wfull_len);
GetFullPathNameW(wsource.c_str(), wfull_len, &wfull[0], NULL);
/* This should get the correct size without any extra padding from the
@@ -2078,7 +2075,7 @@ SystemTools::ConvertToWindowsExtendedPath(const kwsys_stl::string &source)
if(wfull_len >= 2 && isalpha(wfull[0]) && wfull[1] == L':')
{ /* C:\Foo\bar\FooBar.txt */
- return L"\\\\?\\" + kwsys_stl::wstring(&wfull[0]);
+ return L"\\\\?\\" + std::wstring(&wfull[0]);
}
else if(wfull_len >= 2 && wfull[0] == L'\\' && wfull[1] == L'\\')
{ /* Starts with \\ */
@@ -2087,31 +2084,31 @@ SystemTools::ConvertToWindowsExtendedPath(const kwsys_stl::string &source)
if(wfull_len >= 8 && wfull[4] == L'U' && wfull[5] == L'N' &&
wfull[6] == L'C' && wfull[7] == L'\\')
{ /* \\?\UNC\Foo\bar\FooBar.txt */
- return kwsys_stl::wstring(&wfull[0]);
+ return std::wstring(&wfull[0]);
}
else if(wfull_len >= 6 && isalpha(wfull[4]) && wfull[5] == L':')
{ /* \\?\C:\Foo\bar\FooBar.txt */
- return kwsys_stl::wstring(&wfull[0]);
+ return std::wstring(&wfull[0]);
}
else if(wfull_len >= 5)
{ /* \\?\Foo\bar\FooBar.txt */
- return L"\\\\?\\UNC\\" + kwsys_stl::wstring(&wfull[4]);
+ return L"\\\\?\\UNC\\" + std::wstring(&wfull[4]);
}
}
else if(wfull_len >= 4 && wfull[2] == L'.' && wfull[3] == L'\\')
{ /* Starts with \\.\ a device name */
if(wfull_len >= 6 && isalpha(wfull[4]) && wfull[5] == L':')
{ /* \\.\C:\Foo\bar\FooBar.txt */
- return L"\\\\?\\" + kwsys_stl::wstring(&wfull[4]);
+ return L"\\\\?\\" + std::wstring(&wfull[4]);
}
else if(wfull_len >= 5)
{ /* \\.\Foo\bar\ Device name is left unchanged */
- return kwsys_stl::wstring(&wfull[0]);
+ return std::wstring(&wfull[0]);
}
}
else if(wfull_len >= 3)
{ /* \\Foo\bar\FooBar.txt */
- return L"\\\\?\\UNC\\" + kwsys_stl::wstring(&wfull[2]);
+ return L"\\\\?\\UNC\\" + std::wstring(&wfull[2]);
}
}
@@ -2122,20 +2119,20 @@ SystemTools::ConvertToWindowsExtendedPath(const kwsys_stl::string &source)
#endif
// change // to /, and escape any spaces in the path
-kwsys_stl::string SystemTools::ConvertToUnixOutputPath(const kwsys_stl::string& path)
+std::string SystemTools::ConvertToUnixOutputPath(const std::string& path)
{
- kwsys_stl::string ret = path;
+ std::string ret = path;
// remove // except at the beginning might be a cygwin drive
- kwsys_stl::string::size_type pos=1;
- while((pos = ret.find("//", pos)) != kwsys_stl::string::npos)
+ std::string::size_type pos=1;
+ while((pos = ret.find("//", pos)) != std::string::npos)
{
ret.erase(pos, 1);
}
// escape spaces and () in the path
- if(ret.find_first_of(" ") != kwsys_stl::string::npos)
+ if(ret.find_first_of(" ") != std::string::npos)
{
- kwsys_stl::string result = "";
+ std::string result = "";
char lastch = 1;
for(const char* ch = ret.c_str(); *ch != '\0'; ++ch)
{
@@ -2152,7 +2149,7 @@ kwsys_stl::string SystemTools::ConvertToUnixOutputPath(const kwsys_stl::string&
return ret;
}
-kwsys_stl::string SystemTools::ConvertToOutputPath(const kwsys_stl::string& path)
+std::string SystemTools::ConvertToOutputPath(const std::string& path)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
return SystemTools::ConvertToWindowsOutputPath(path);
@@ -2162,16 +2159,16 @@ kwsys_stl::string SystemTools::ConvertToOutputPath(const kwsys_stl::string& path
}
// remove double slashes not at the start
-kwsys_stl::string SystemTools::ConvertToWindowsOutputPath(const kwsys_stl::string& path)
+std::string SystemTools::ConvertToWindowsOutputPath(const std::string& path)
{
- kwsys_stl::string ret;
+ std::string ret;
// make it big enough for all of path and double quotes
ret.reserve(path.size()+3);
// put path into the string
ret = path;
- kwsys_stl::string::size_type pos = 0;
+ std::string::size_type pos = 0;
// first convert all of the slashes
- while((pos = ret.find('/', pos)) != kwsys_stl::string::npos)
+ while((pos = ret.find('/', pos)) != std::string::npos)
{
ret[pos] = '\\';
pos++;
@@ -2193,33 +2190,33 @@ kwsys_stl::string SystemTools::ConvertToWindowsOutputPath(const kwsys_stl::strin
return ret;
}
}
- while((pos = ret.find("\\\\", pos)) != kwsys_stl::string::npos)
+ while((pos = ret.find("\\\\", pos)) != std::string::npos)
{
ret.erase(pos, 1);
}
// now double quote the path if it has spaces in it
// and is not already double quoted
- if(ret.find(' ') != kwsys_stl::string::npos
+ if(ret.find(' ') != std::string::npos
&& ret[0] != '\"')
{
- ret.insert(static_cast<kwsys_stl::string::size_type>(0),
- static_cast<kwsys_stl::string::size_type>(1), '\"');
+ ret.insert(static_cast<std::string::size_type>(0),
+ static_cast<std::string::size_type>(1), '\"');
ret.append(1, '\"');
}
return ret;
}
-bool SystemTools::CopyFileIfDifferent(const kwsys_stl::string& source,
- const kwsys_stl::string& destination)
+bool SystemTools::CopyFileIfDifferent(const std::string& source,
+ const std::string& destination)
{
// special check for a destination that is a directory
// FilesDiffer does not handle file to directory compare
if(SystemTools::FileIsDirectory(destination))
{
- kwsys_stl::string new_destination = destination;
+ std::string new_destination = destination;
SystemTools::ConvertToUnixSlashes(new_destination);
new_destination += '/';
- kwsys_stl::string source_name = source;
+ std::string source_name = source;
new_destination += SystemTools::GetFilenameName(source_name);
if(SystemTools::FilesDiffer(source, new_destination))
{
@@ -2244,8 +2241,8 @@ bool SystemTools::CopyFileIfDifferent(const kwsys_stl::string& source,
#define KWSYS_ST_BUFFER 4096
-bool SystemTools::FilesDiffer(const kwsys_stl::string& source,
- const kwsys_stl::string& destination)
+bool SystemTools::FilesDiffer(const std::string& source,
+ const std::string& destination)
{
#if defined(_WIN32)
@@ -2308,11 +2305,11 @@ bool SystemTools::FilesDiffer(const kwsys_stl::string& source,
#if defined(_WIN32)
kwsys::ifstream finSource(source.c_str(),
- (kwsys_ios::ios::binary |
- kwsys_ios::ios::in));
+ (std::ios::binary |
+ std::ios::in));
kwsys::ifstream finDestination(destination.c_str(),
- (kwsys_ios::ios::binary |
- kwsys_ios::ios::in));
+ (std::ios::binary |
+ std::ios::in));
#else
kwsys::ifstream finSource(source.c_str());
kwsys::ifstream finDestination(destination.c_str());
@@ -2328,13 +2325,13 @@ bool SystemTools::FilesDiffer(const kwsys_stl::string& source,
while(nleft > 0)
{
// Read a block from each file.
- kwsys_ios::streamsize nnext = (nleft > KWSYS_ST_BUFFER)? KWSYS_ST_BUFFER : static_cast<kwsys_ios::streamsize>(nleft);
+ std::streamsize nnext = (nleft > KWSYS_ST_BUFFER)? KWSYS_ST_BUFFER : static_cast<std::streamsize>(nleft);
finSource.read(source_buf, nnext);
finDestination.read(dest_buf, nnext);
// If either failed to read assume they are different.
- if(static_cast<kwsys_ios::streamsize>(finSource.gcount()) != nnext ||
- static_cast<kwsys_ios::streamsize>(finDestination.gcount()) != nnext)
+ if(static_cast<std::streamsize>(finSource.gcount()) != nnext ||
+ static_cast<std::streamsize>(finDestination.gcount()) != nnext)
{
return true;
}
@@ -2360,7 +2357,7 @@ bool SystemTools::FilesDiffer(const kwsys_stl::string& source,
/**
* Copy a file named by "source" to the file named by "destination".
*/
-bool SystemTools::CopyFileAlways(const kwsys_stl::string& source, const kwsys_stl::string& destination)
+bool SystemTools::CopyFileAlways(const std::string& source, const std::string& destination)
{
// If files are the same do not copy
if ( SystemTools::SameFile(source, destination) )
@@ -2369,95 +2366,102 @@ bool SystemTools::CopyFileAlways(const kwsys_stl::string& source, const kwsys_st
}
mode_t perm = 0;
bool perms = SystemTools::GetPermissions(source, perm);
+ std::string real_destination = destination;
- const int bufferSize = 4096;
- char buffer[bufferSize];
-
- // If destination is a directory, try to create a file with the same
- // name as the source in that directory.
-
- kwsys_stl::string real_destination = destination;
- kwsys_stl::string destination_dir;
- if(SystemTools::FileExists(destination) &&
- SystemTools::FileIsDirectory(destination))
+ if(SystemTools::FileIsDirectory(source))
{
- destination_dir = real_destination;
- SystemTools::ConvertToUnixSlashes(real_destination);
- real_destination += '/';
- kwsys_stl::string source_name = source;
- real_destination += SystemTools::GetFilenameName(source_name);
+ SystemTools::MakeDirectory(destination);
}
else
{
- destination_dir = SystemTools::GetFilenamePath(destination);
- }
+ const int bufferSize = 4096;
+ char buffer[bufferSize];
+
+ // If destination is a directory, try to create a file with the same
+ // name as the source in that directory.
+
+ std::string destination_dir;
+ if(SystemTools::FileExists(destination) &&
+ SystemTools::FileIsDirectory(destination))
+ {
+ destination_dir = real_destination;
+ SystemTools::ConvertToUnixSlashes(real_destination);
+ real_destination += '/';
+ std::string source_name = source;
+ real_destination += SystemTools::GetFilenameName(source_name);
+ }
+ else
+ {
+ destination_dir = SystemTools::GetFilenamePath(destination);
+ }
- // Create destination directory
+ // Create destination directory
- SystemTools::MakeDirectory(destination_dir);
+ SystemTools::MakeDirectory(destination_dir);
- // Open files
+ // Open files
#if defined(_WIN32)
- kwsys::ifstream fin(Encoding::ToNarrow(
- SystemTools::ConvertToWindowsExtendedPath(source)).c_str(),
- kwsys_ios::ios::in | kwsys_ios_binary);
+ kwsys::ifstream fin(Encoding::ToNarrow(
+ SystemTools::ConvertToWindowsExtendedPath(source)).c_str(),
+ std::ios::in | std::ios::binary);
#else
- kwsys::ifstream fin(source.c_str(),
- kwsys_ios::ios::in | kwsys_ios_binary);
+ kwsys::ifstream fin(source.c_str(),
+ std::ios::in | std::ios::binary);
#endif
- if(!fin)
- {
- return false;
- }
+ if(!fin)
+ {
+ return false;
+ }
- // try and remove the destination file so that read only destination files
- // can be written to.
- // If the remove fails continue so that files in read only directories
- // that do not allow file removal can be modified.
- SystemTools::RemoveFile(real_destination);
+ // try and remove the destination file so that read only destination files
+ // can be written to.
+ // If the remove fails continue so that files in read only directories
+ // that do not allow file removal can be modified.
+ SystemTools::RemoveFile(real_destination);
#if defined(_WIN32)
- kwsys::ofstream fout(Encoding::ToNarrow(
- SystemTools::ConvertToWindowsExtendedPath(real_destination)).c_str(),
- kwsys_ios::ios::out | kwsys_ios::ios::trunc | kwsys_ios_binary);
+ kwsys::ofstream fout(Encoding::ToNarrow(
+ SystemTools::ConvertToWindowsExtendedPath(real_destination)).c_str(),
+ std::ios::out | std::ios::trunc | std::ios::binary);
#else
- kwsys::ofstream fout(real_destination.c_str(),
- kwsys_ios::ios::out | kwsys_ios::ios::trunc | kwsys_ios_binary);
+ kwsys::ofstream fout(real_destination.c_str(),
+ std::ios::out | std::ios::trunc | std::ios::binary);
#endif
- if(!fout)
- {
- return false;
- }
-
- // This copy loop is very sensitive on certain platforms with
- // slightly broken stream libraries (like HPUX). Normally, it is
- // incorrect to not check the error condition on the fin.read()
- // before using the data, but the fin.gcount() will be zero if an
- // error occurred. Therefore, the loop should be safe everywhere.
- while(fin)
- {
- fin.read(buffer, bufferSize);
- if(fin.gcount())
+ if(!fout)
{
- fout.write(buffer, fin.gcount());
+ return false;
}
- else
+
+ // This copy loop is very sensitive on certain platforms with
+ // slightly broken stream libraries (like HPUX). Normally, it is
+ // incorrect to not check the error condition on the fin.read()
+ // before using the data, but the fin.gcount() will be zero if an
+ // error occurred. Therefore, the loop should be safe everywhere.
+ while(fin)
{
- break;
+ fin.read(buffer, bufferSize);
+ if(fin.gcount())
+ {
+ fout.write(buffer, fin.gcount());
+ }
+ else
+ {
+ break;
+ }
}
- }
- // Make sure the operating system has finished writing the file
- // before closing it. This will ensure the file is finished before
- // the check below.
- fout.flush();
+ // Make sure the operating system has finished writing the file
+ // before closing it. This will ensure the file is finished before
+ // the check below.
+ fout.flush();
- fin.close();
- fout.close();
+ fin.close();
+ fout.close();
- if(!fout)
- {
- return false;
+ if(!fout)
+ {
+ return false;
+ }
}
if ( perms )
{
@@ -2470,7 +2474,7 @@ bool SystemTools::CopyFileAlways(const kwsys_stl::string& source, const kwsys_st
}
//----------------------------------------------------------------------------
-bool SystemTools::CopyAFile(const kwsys_stl::string& source, const kwsys_stl::string& destination,
+bool SystemTools::CopyAFile(const std::string& source, const std::string& destination,
bool always)
{
if(always)
@@ -2487,7 +2491,7 @@ bool SystemTools::CopyAFile(const kwsys_stl::string& source, const kwsys_stl::st
* Copy a directory content from "source" directory to the directory named by
* "destination".
*/
-bool SystemTools::CopyADirectory(const kwsys_stl::string& source, const kwsys_stl::string& destination,
+bool SystemTools::CopyADirectory(const std::string& source, const std::string& destination,
bool always)
{
Directory dir;
@@ -2507,12 +2511,12 @@ bool SystemTools::CopyADirectory(const kwsys_stl::string& source, const kwsys_st
if (strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)),".") &&
strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)),".."))
{
- kwsys_stl::string fullPath = source;
+ std::string fullPath = source;
fullPath += "/";
fullPath += dir.GetFile(static_cast<unsigned long>(fileNum));
if(SystemTools::FileIsDirectory(fullPath))
{
- kwsys_stl::string fullDestPath = destination;
+ std::string fullDestPath = destination;
fullDestPath += "/";
fullDestPath += dir.GetFile(static_cast<unsigned long>(fileNum));
if (!SystemTools::CopyADirectory(fullPath,
@@ -2537,7 +2541,7 @@ bool SystemTools::CopyADirectory(const kwsys_stl::string& source, const kwsys_st
// return size of file; also returns zero if no file exists
-unsigned long SystemTools::FileLength(const kwsys_stl::string& filename)
+unsigned long SystemTools::FileLength(const std::string& filename)
{
unsigned long length = 0;
#ifdef _WIN32
@@ -2577,7 +2581,7 @@ int SystemTools::Strucmp(const char *s1, const char *s2)
}
// return file's modified time
-long int SystemTools::ModifiedTime(const kwsys_stl::string& filename)
+long int SystemTools::ModifiedTime(const std::string& filename)
{
long int mt = 0;
#ifdef _WIN32
@@ -2600,7 +2604,7 @@ long int SystemTools::ModifiedTime(const kwsys_stl::string& filename)
}
// return file's creation time
-long int SystemTools::CreationTime(const kwsys_stl::string& filename)
+long int SystemTools::CreationTime(const std::string& filename)
{
long int ct = 0;
#ifdef _WIN32
@@ -2724,16 +2728,16 @@ bool SystemTools::ConvertTimeStampMacroString(const char *str, time_t *tmt)
return true;
}
-kwsys_stl::string SystemTools::GetLastSystemError()
+std::string SystemTools::GetLastSystemError()
{
int e = errno;
return strerror(e);
}
-bool SystemTools::RemoveFile(const kwsys_stl::string& source)
+bool SystemTools::RemoveFile(const std::string& source)
{
#ifdef _WIN32
- kwsys_stl::wstring const& ws =
+ std::wstring const& ws =
SystemTools::ConvertToWindowsExtendedPath(source);
if (DeleteFileW(ws.c_str()))
{
@@ -2772,7 +2776,7 @@ bool SystemTools::RemoveFile(const kwsys_stl::string& source)
#endif
}
-bool SystemTools::RemoveADirectory(const kwsys_stl::string& source)
+bool SystemTools::RemoveADirectory(const std::string& source)
{
// Add write permission to the directory so we can modify its
// content to remove files and directories from it.
@@ -2800,7 +2804,7 @@ bool SystemTools::RemoveADirectory(const kwsys_stl::string& source)
if (strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)),".") &&
strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)),".."))
{
- kwsys_stl::string fullPath = source;
+ std::string fullPath = source;
fullPath += "/";
fullPath += dir.GetFile(static_cast<unsigned long>(fileNum));
if(SystemTools::FileIsDirectory(fullPath) &&
@@ -2836,13 +2840,13 @@ size_t SystemTools::GetMaximumFilePathLength()
* the system search path. Returns the full path to the file if it is
* found. Otherwise, the empty string is returned.
*/
-kwsys_stl::string SystemTools
-::FindName(const kwsys_stl::string& name,
- const kwsys_stl::vector<kwsys_stl::string>& userPaths,
+std::string SystemTools
+::FindName(const std::string& name,
+ const std::vector<std::string>& userPaths,
bool no_system_path)
{
// Add the system search path to our path first
- kwsys_stl::vector<kwsys_stl::string> path;
+ std::vector<std::string> path;
if (!no_system_path)
{
SystemTools::GetPath(path, "CMAKE_FILE_PATH");
@@ -2850,7 +2854,7 @@ kwsys_stl::string SystemTools
}
// now add the additional paths
{
- for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i = userPaths.begin();
+ for(std::vector<std::string>::const_iterator i = userPaths.begin();
i != userPaths.end(); ++i)
{
path.push_back(*i);
@@ -2858,10 +2862,10 @@ kwsys_stl::string SystemTools
}
// Add a trailing slash to all paths to aid the search process.
{
- for(kwsys_stl::vector<kwsys_stl::string>::iterator i = path.begin();
+ for(std::vector<std::string>::iterator i = path.begin();
i != path.end(); ++i)
{
- kwsys_stl::string& p = *i;
+ std::string& p = *i;
if(p.empty() || *p.rbegin() != '/')
{
p += "/";
@@ -2869,8 +2873,8 @@ kwsys_stl::string SystemTools
}
}
// now look for the file
- kwsys_stl::string tryPath;
- for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin();
+ std::string tryPath;
+ for(std::vector<std::string>::const_iterator p = path.begin();
p != path.end(); ++p)
{
tryPath = *p;
@@ -2889,12 +2893,12 @@ kwsys_stl::string SystemTools
* the system search path. Returns the full path to the file if it is
* found. Otherwise, the empty string is returned.
*/
-kwsys_stl::string SystemTools
-::FindFile(const kwsys_stl::string& name,
- const kwsys_stl::vector<kwsys_stl::string>& userPaths,
+std::string SystemTools
+::FindFile(const std::string& name,
+ const std::vector<std::string>& userPaths,
bool no_system_path)
{
- kwsys_stl::string tryPath = SystemTools::FindName(name, userPaths, no_system_path);
+ std::string tryPath = SystemTools::FindName(name, userPaths, no_system_path);
if(!tryPath.empty() && !SystemTools::FileIsDirectory(tryPath))
{
return SystemTools::CollapseFullPath(tryPath);
@@ -2908,12 +2912,12 @@ kwsys_stl::string SystemTools
* the system search path. Returns the full path to the directory if it is
* found. Otherwise, the empty string is returned.
*/
-kwsys_stl::string SystemTools
-::FindDirectory(const kwsys_stl::string& name,
- const kwsys_stl::vector<kwsys_stl::string>& userPaths,
+std::string SystemTools
+::FindDirectory(const std::string& name,
+ const std::vector<std::string>& userPaths,
bool no_system_path)
{
- kwsys_stl::string tryPath = SystemTools::FindName(name, userPaths, no_system_path);
+ std::string tryPath = SystemTools::FindName(name, userPaths, no_system_path);
if(!tryPath.empty() && SystemTools::FileIsDirectory(tryPath))
{
return SystemTools::CollapseFullPath(tryPath);
@@ -2927,24 +2931,24 @@ kwsys_stl::string SystemTools
* the system search path. Returns the full path to the executable if it is
* found. Otherwise, the empty string is returned.
*/
-kwsys_stl::string SystemTools::FindProgram(
+std::string SystemTools::FindProgram(
const char* nameIn,
- const kwsys_stl::vector<kwsys_stl::string>& userPaths,
+ const std::vector<std::string>& userPaths,
bool no_system_path)
{
if(!nameIn || !*nameIn)
{
return "";
}
- return SystemTools::FindProgram(kwsys_stl::string(nameIn), userPaths, no_system_path);
+ return SystemTools::FindProgram(std::string(nameIn), userPaths, no_system_path);
}
-kwsys_stl::string SystemTools::FindProgram(
- const kwsys_stl::string& name,
- const kwsys_stl::vector<kwsys_stl::string>& userPaths,
+std::string SystemTools::FindProgram(
+ const std::string& name,
+ const std::vector<std::string>& userPaths,
bool no_system_path)
{
- kwsys_stl::vector<kwsys_stl::string> extensions;
+ std::vector<std::string> extensions;
#if defined (_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
bool hasExtension = false;
// check to see if the name already has a .xxx at
@@ -2960,10 +2964,10 @@ kwsys_stl::string SystemTools::FindProgram(
extensions.push_back(".exe");
}
#endif
- kwsys_stl::string tryPath;
+ std::string tryPath;
// first try with extensions if the os supports them
- for(kwsys_stl::vector<kwsys_stl::string>::iterator i =
+ for(std::vector<std::string>::iterator i =
extensions.begin(); i != extensions.end(); ++i)
{
tryPath = name;
@@ -2982,7 +2986,7 @@ kwsys_stl::string SystemTools::FindProgram(
return SystemTools::CollapseFullPath(tryPath);
}
// now construct the path
- kwsys_stl::vector<kwsys_stl::string> path;
+ std::vector<std::string> path;
// Add the system search path to our path.
if (!no_system_path)
{
@@ -2990,7 +2994,7 @@ kwsys_stl::string SystemTools::FindProgram(
}
// now add the additional paths
{
- for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i =
+ for(std::vector<std::string>::const_iterator i =
userPaths.begin(); i != userPaths.end(); ++i)
{
path.push_back(*i);
@@ -2998,10 +3002,10 @@ kwsys_stl::string SystemTools::FindProgram(
}
// Add a trailing slash to all paths to aid the search process.
{
- for(kwsys_stl::vector<kwsys_stl::string>::iterator i = path.begin();
+ for(std::vector<std::string>::iterator i = path.begin();
i != path.end(); ++i)
{
- kwsys_stl::string& p = *i;
+ std::string& p = *i;
if(p.empty() || *p.rbegin() != '/')
{
p += "/";
@@ -3009,7 +3013,7 @@ kwsys_stl::string SystemTools::FindProgram(
}
}
// Try each path
- for(kwsys_stl::vector<kwsys_stl::string>::iterator p = path.begin();
+ for(std::vector<std::string>::iterator p = path.begin();
p != path.end(); ++p)
{
#ifdef _WIN32
@@ -3017,7 +3021,7 @@ kwsys_stl::string SystemTools::FindProgram(
SystemTools::ReplaceString(*p, "\"", "");
#endif
// first try with extensions
- for(kwsys_stl::vector<kwsys_stl::string>::iterator ext
+ for(std::vector<std::string>::iterator ext
= extensions.begin(); ext != extensions.end(); ++ext)
{
tryPath = *p;
@@ -3042,16 +3046,16 @@ kwsys_stl::string SystemTools::FindProgram(
return "";
}
-kwsys_stl::string SystemTools::FindProgram(
- const kwsys_stl::vector<kwsys_stl::string>& names,
- const kwsys_stl::vector<kwsys_stl::string>& path,
+std::string SystemTools::FindProgram(
+ const std::vector<std::string>& names,
+ const std::vector<std::string>& path,
bool noSystemPath)
{
- for(kwsys_stl::vector<kwsys_stl::string>::const_iterator it = names.begin();
+ for(std::vector<std::string>::const_iterator it = names.begin();
it != names.end() ; ++it)
{
// Try to find the program.
- kwsys_stl::string result = SystemTools::FindProgram(*it,
+ std::string result = SystemTools::FindProgram(*it,
path,
noSystemPath);
if ( !result.empty() )
@@ -3067,9 +3071,9 @@ kwsys_stl::string SystemTools::FindProgram(
* the system search path. Returns the full path to the library if it is
* found. Otherwise, the empty string is returned.
*/
-kwsys_stl::string SystemTools
-::FindLibrary(const kwsys_stl::string& name,
- const kwsys_stl::vector<kwsys_stl::string>& userPaths)
+std::string SystemTools
+::FindLibrary(const std::string& name,
+ const std::vector<std::string>& userPaths)
{
// See if the executable exists as written.
if(SystemTools::FileExists(name) &&
@@ -3079,11 +3083,11 @@ kwsys_stl::string SystemTools
}
// Add the system search path to our path.
- kwsys_stl::vector<kwsys_stl::string> path;
+ std::vector<std::string> path;
SystemTools::GetPath(path);
// now add the additional paths
{
- for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i = userPaths.begin();
+ for(std::vector<std::string>::const_iterator i = userPaths.begin();
i != userPaths.end(); ++i)
{
path.push_back(*i);
@@ -3091,18 +3095,18 @@ kwsys_stl::string SystemTools
}
// Add a trailing slash to all paths to aid the search process.
{
- for(kwsys_stl::vector<kwsys_stl::string>::iterator i = path.begin();
+ for(std::vector<std::string>::iterator i = path.begin();
i != path.end(); ++i)
{
- kwsys_stl::string& p = *i;
+ std::string& p = *i;
if(p.empty() || *p.rbegin() != '/')
{
p += "/";
}
}
}
- kwsys_stl::string tryPath;
- for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin();
+ std::string tryPath;
+ for(std::vector<std::string>::const_iterator p = path.begin();
p != path.end(); ++p)
{
#if defined(__APPLE__)
@@ -3177,15 +3181,15 @@ kwsys_stl::string SystemTools
return "";
}
-kwsys_stl::string SystemTools::GetRealPath(const kwsys_stl::string& path,
- kwsys_stl::string* errorMessage)
+std::string SystemTools::GetRealPath(const std::string& path,
+ std::string* errorMessage)
{
- kwsys_stl::string ret;
+ std::string ret;
Realpath(path, ret, errorMessage);
return ret;
}
-bool SystemTools::FileIsDirectory(const kwsys_stl::string& inName)
+bool SystemTools::FileIsDirectory(const std::string& inName)
{
if (inName.empty())
{
@@ -3234,7 +3238,7 @@ bool SystemTools::FileIsDirectory(const kwsys_stl::string& inName)
}
}
-bool SystemTools::FileIsSymlink(const kwsys_stl::string& name)
+bool SystemTools::FileIsSymlink(const std::string& name)
{
#if defined( _WIN32 )
DWORD attr = GetFileAttributesW(
@@ -3261,25 +3265,25 @@ bool SystemTools::FileIsSymlink(const kwsys_stl::string& name)
}
#if defined(_WIN32) && !defined(__CYGWIN__)
-bool SystemTools::CreateSymlink(const kwsys_stl::string&, const kwsys_stl::string&)
+bool SystemTools::CreateSymlink(const std::string&, const std::string&)
{
return false;
}
#else
-bool SystemTools::CreateSymlink(const kwsys_stl::string& origName, const kwsys_stl::string& newName)
+bool SystemTools::CreateSymlink(const std::string& origName, const std::string& newName)
{
return symlink(origName.c_str(), newName.c_str()) >= 0;
}
#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
-bool SystemTools::ReadSymlink(const kwsys_stl::string&, kwsys_stl::string&)
+bool SystemTools::ReadSymlink(const std::string&, std::string&)
{
return false;
}
#else
-bool SystemTools::ReadSymlink(const kwsys_stl::string& newName,
- kwsys_stl::string& origName)
+bool SystemTools::ReadSymlink(const std::string& newName,
+ std::string& origName)
{
char buf[KWSYS_SYSTEMTOOLS_MAXPATH+1];
int count =
@@ -3298,16 +3302,16 @@ bool SystemTools::ReadSymlink(const kwsys_stl::string& newName,
}
#endif
-int SystemTools::ChangeDirectory(const kwsys_stl::string& dir)
+int SystemTools::ChangeDirectory(const std::string& dir)
{
return Chdir(dir);
}
-kwsys_stl::string SystemTools::GetCurrentWorkingDirectory(bool collapse)
+std::string SystemTools::GetCurrentWorkingDirectory(bool collapse)
{
char buf[2048];
const char* cwd = Getcwd(buf, 2048);
- kwsys_stl::string path;
+ std::string path;
if ( cwd )
{
path = cwd;
@@ -3319,16 +3323,16 @@ kwsys_stl::string SystemTools::GetCurrentWorkingDirectory(bool collapse)
return path;
}
-kwsys_stl::string SystemTools::GetProgramPath(const kwsys_stl::string& in_name)
+std::string SystemTools::GetProgramPath(const std::string& in_name)
{
- kwsys_stl::string dir, file;
+ std::string dir, file;
SystemTools::SplitProgramPath(in_name, dir, file);
return dir;
}
-bool SystemTools::SplitProgramPath(const kwsys_stl::string& in_name,
- kwsys_stl::string& dir,
- kwsys_stl::string& file,
+bool SystemTools::SplitProgramPath(const std::string& in_name,
+ std::string& dir,
+ std::string& file,
bool)
{
dir = in_name;
@@ -3337,8 +3341,8 @@ bool SystemTools::SplitProgramPath(const kwsys_stl::string& in_name,
if(!SystemTools::FileIsDirectory(dir))
{
- kwsys_stl::string::size_type slashPos = dir.rfind("/");
- if(slashPos != kwsys_stl::string::npos)
+ std::string::size_type slashPos = dir.rfind("/");
+ if(slashPos != std::string::npos)
{
file = dir.substr(slashPos+1);
dir = dir.substr(0, slashPos);
@@ -3351,7 +3355,7 @@ bool SystemTools::SplitProgramPath(const kwsys_stl::string& in_name,
}
if(!(dir.empty()) && !SystemTools::FileIsDirectory(dir))
{
- kwsys_stl::string oldDir = in_name;
+ std::string oldDir = in_name;
SystemTools::ConvertToUnixSlashes(oldDir);
dir = in_name;
return false;
@@ -3360,14 +3364,14 @@ bool SystemTools::SplitProgramPath(const kwsys_stl::string& in_name,
}
bool SystemTools::FindProgramPath(const char* argv0,
- kwsys_stl::string& pathOut,
- kwsys_stl::string& errorMsg,
+ std::string& pathOut,
+ std::string& errorMsg,
const char* exeName,
const char* buildDir,
const char* installPrefix )
{
- kwsys_stl::vector<kwsys_stl::string> failures;
- kwsys_stl::string self = argv0 ? argv0 : "";
+ std::vector<std::string> failures;
+ std::string self = argv0 ? argv0 : "";
failures.push_back(self);
SystemTools::ConvertToUnixSlashes(self);
self = SystemTools::FindProgram(self);
@@ -3375,7 +3379,7 @@ bool SystemTools::FindProgramPath(const char* argv0,
{
if(buildDir)
{
- kwsys_stl::string intdir = ".";
+ std::string intdir = ".";
#ifdef CMAKE_INTDIR
intdir = CMAKE_INTDIR;
#endif
@@ -3400,7 +3404,7 @@ bool SystemTools::FindProgramPath(const char* argv0,
if(!SystemTools::FileExists(self))
{
failures.push_back(self);
- kwsys_ios::ostringstream msg;
+ std::ostringstream msg;
msg << "Can not find the command line program ";
if (exeName)
{
@@ -3412,7 +3416,7 @@ bool SystemTools::FindProgramPath(const char* argv0,
msg << " argv[0] = \"" << argv0 << "\"\n";
}
msg << " Attempted paths:\n";
- kwsys_stl::vector<kwsys_stl::string>::iterator i;
+ std::vector<std::string>::iterator i;
for(i=failures.begin(); i != failures.end(); ++i)
{
msg << " \"" << *i << "\"\n";
@@ -3425,15 +3429,15 @@ bool SystemTools::FindProgramPath(const char* argv0,
}
-kwsys_stl::string SystemTools::CollapseFullPath(const kwsys_stl::string& in_relative)
+std::string SystemTools::CollapseFullPath(const std::string& in_relative)
{
return SystemTools::CollapseFullPath(in_relative, 0);
}
-void SystemTools::AddTranslationPath(const kwsys_stl::string& a, const kwsys_stl::string& b)
+void SystemTools::AddTranslationPath(const std::string& a, const std::string& b)
{
- kwsys_stl::string path_a = a;
- kwsys_stl::string path_b = b;
+ std::string path_a = a;
+ std::string path_b = b;
SystemTools::ConvertToUnixSlashes(path_a);
SystemTools::ConvertToUnixSlashes(path_b);
// First check this is a directory path, since we don't want the table to
@@ -3444,7 +3448,7 @@ void SystemTools::AddTranslationPath(const kwsys_stl::string& a, const kwsys_stl
// Ken--the following code is incorrect. .. can be in a valid path
// for example /home/martink/MyHubba...Hubba/Src
if( SystemTools::FileIsFullPath(path_b) && path_b.find("..")
- == kwsys_stl::string::npos )
+ == std::string::npos )
{
// Before inserting make sure path ends with '/'
if(!path_a.empty() && *path_a.rbegin() != '/')
@@ -3464,14 +3468,14 @@ void SystemTools::AddTranslationPath(const kwsys_stl::string& a, const kwsys_stl
}
}
-void SystemTools::AddKeepPath(const kwsys_stl::string& dir)
+void SystemTools::AddKeepPath(const std::string& dir)
{
- kwsys_stl::string cdir;
+ std::string cdir;
Realpath(SystemTools::CollapseFullPath(dir).c_str(), cdir);
SystemTools::AddTranslationPath(cdir, dir);
}
-void SystemTools::CheckTranslationPath(kwsys_stl::string & path)
+void SystemTools::CheckTranslationPath(std::string & path)
{
// Do not translate paths that are too short to have meaningful
// translations.
@@ -3487,7 +3491,7 @@ void SystemTools::CheckTranslationPath(kwsys_stl::string & path)
// In case a file was specified we still have to go through this:
// Now convert any path found in the table back to the one desired:
- kwsys_stl::map<kwsys_stl::string,kwsys_stl::string>::const_iterator it;
+ std::map<std::string,std::string>::const_iterator it;
for(it = SystemTools::TranslationMap->begin();
it != SystemTools::TranslationMap->end();
++it )
@@ -3505,13 +3509,13 @@ void SystemTools::CheckTranslationPath(kwsys_stl::string & path)
static void
SystemToolsAppendComponents(
- kwsys_stl::vector<kwsys_stl::string>& out_components,
- kwsys_stl::vector<kwsys_stl::string>::const_iterator first,
- kwsys_stl::vector<kwsys_stl::string>::const_iterator last)
+ std::vector<std::string>& out_components,
+ std::vector<std::string>::const_iterator first,
+ std::vector<std::string>::const_iterator last)
{
- static const kwsys_stl::string up = "..";
- static const kwsys_stl::string cur = ".";
- for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i = first;
+ static const std::string up = "..";
+ static const std::string cur = ".";
+ for(std::vector<std::string>::const_iterator i = first;
i != last; ++i)
{
if(*i == up)
@@ -3528,20 +3532,20 @@ SystemToolsAppendComponents(
}
}
-kwsys_stl::string SystemTools::CollapseFullPath(const kwsys_stl::string& in_path,
+std::string SystemTools::CollapseFullPath(const std::string& in_path,
const char* in_base)
{
// Collect the output path components.
- kwsys_stl::vector<kwsys_stl::string> out_components;
+ std::vector<std::string> out_components;
// Split the input path components.
- kwsys_stl::vector<kwsys_stl::string> path_components;
+ std::vector<std::string> path_components;
SystemTools::SplitPath(in_path, path_components);
// If the input path is relative, start with a base path.
if(path_components[0].length() == 0)
{
- kwsys_stl::vector<kwsys_stl::string> base_components;
+ std::vector<std::string> base_components;
if(in_base)
{
// Use the given base path.
@@ -3574,7 +3578,7 @@ kwsys_stl::string SystemTools::CollapseFullPath(const kwsys_stl::string& in_path
path_components.end());
// Transform the path back to a string.
- kwsys_stl::string newPath = SystemTools::JoinPath(out_components);
+ std::string newPath = SystemTools::JoinPath(out_components);
// Update the translation table with this potentially new path. I am not
// sure why this line is here, it seems really questionable, but yet I
@@ -3599,20 +3603,20 @@ kwsys_stl::string SystemTools::CollapseFullPath(const kwsys_stl::string& in_path
return newPath;
}
-kwsys_stl::string SystemTools::CollapseFullPath(const kwsys_stl::string& in_path,
- const kwsys_stl::string& in_base)
+std::string SystemTools::CollapseFullPath(const std::string& in_path,
+ const std::string& in_base)
{
// Collect the output path components.
- kwsys_stl::vector<kwsys_stl::string> out_components;
+ std::vector<std::string> out_components;
// Split the input path components.
- kwsys_stl::vector<kwsys_stl::string> path_components;
+ std::vector<std::string> path_components;
SystemTools::SplitPath(in_path, path_components);
// If the input path is relative, start with a base path.
if(path_components[0].length() == 0)
{
- kwsys_stl::vector<kwsys_stl::string> base_components;
+ std::vector<std::string> base_components;
// Use the given base path.
SystemTools::SplitPath(in_base, base_components);
@@ -3629,7 +3633,7 @@ kwsys_stl::string SystemTools::CollapseFullPath(const kwsys_stl::string& in_path
path_components.end());
// Transform the path back to a string.
- kwsys_stl::string newPath = SystemTools::JoinPath(out_components);
+ std::string newPath = SystemTools::JoinPath(out_components);
// Update the translation table with this potentially new path. I am not
// sure why this line is here, it seems really questionable, but yet I
@@ -3655,7 +3659,7 @@ kwsys_stl::string SystemTools::CollapseFullPath(const kwsys_stl::string& in_path
}
// compute the relative path from here to there
-kwsys_stl::string SystemTools::RelativePath(const kwsys_stl::string& local, const kwsys_stl::string& remote)
+std::string SystemTools::RelativePath(const std::string& local, const std::string& remote)
{
if(!SystemTools::FileIsFullPath(local))
{
@@ -3666,14 +3670,14 @@ kwsys_stl::string SystemTools::RelativePath(const kwsys_stl::string& local, cons
return "";
}
- kwsys_stl::string l = SystemTools::CollapseFullPath(local);
- kwsys_stl::string r = SystemTools::CollapseFullPath(remote);
+ std::string l = SystemTools::CollapseFullPath(local);
+ std::string r = SystemTools::CollapseFullPath(remote);
// split up both paths into arrays of strings using / as a separator
- kwsys_stl::vector<kwsys::String> localSplit = SystemTools::SplitString(l, '/', true);
- kwsys_stl::vector<kwsys::String> remoteSplit = SystemTools::SplitString(r, '/', true);
- kwsys_stl::vector<kwsys::String> commonPath; // store shared parts of path in this array
- kwsys_stl::vector<kwsys::String> finalPath; // store the final relative path here
+ std::vector<kwsys::String> localSplit = SystemTools::SplitString(l, '/', true);
+ std::vector<kwsys::String> remoteSplit = SystemTools::SplitString(r, '/', true);
+ std::vector<kwsys::String> commonPath; // store shared parts of path in this array
+ std::vector<kwsys::String> finalPath; // store the final relative path here
// count up how many matching directory names there are from the start
unsigned int sameCount = 0;
while(
@@ -3718,7 +3722,7 @@ kwsys_stl::string SystemTools::RelativePath(const kwsys_stl::string& local, cons
}
// for each entry that is not common in the remote path add it
// to the final path.
- for(kwsys_stl::vector<String>::iterator vit = remoteSplit.begin();
+ for(std::vector<String>::iterator vit = remoteSplit.begin();
vit != remoteSplit.end(); ++vit)
{
if(!vit->empty())
@@ -3726,10 +3730,10 @@ kwsys_stl::string SystemTools::RelativePath(const kwsys_stl::string& local, cons
finalPath.push_back(*vit);
}
}
- kwsys_stl::string relativePath; // result string
+ std::string relativePath; // result string
// now turn the array of directories into a unix path by puttint /
// between each entry that does not already have one
- for(kwsys_stl::vector<String>::iterator vit1 = finalPath.begin();
+ for(std::vector<String>::iterator vit1 = finalPath.begin();
vit1 != finalPath.end(); ++vit1)
{
if(!relativePath.empty() && *relativePath.rbegin() != '/')
@@ -3742,10 +3746,10 @@ kwsys_stl::string SystemTools::RelativePath(const kwsys_stl::string& local, cons
}
#ifdef _WIN32
-static int GetCasePathName(const kwsys_stl::string & pathIn,
- kwsys_stl::string & casePath)
+static int GetCasePathName(const std::string & pathIn,
+ std::string & casePath)
{
- kwsys_stl::vector<kwsys_stl::string> path_components;
+ std::vector<std::string> path_components;
SystemTools::SplitPath(pathIn, path_components);
if(path_components[0].empty()) // First component always exists.
{
@@ -3755,7 +3759,7 @@ static int GetCasePathName(const kwsys_stl::string & pathIn,
}
// Start with root component.
- kwsys_stl::vector<kwsys_stl::string>::size_type idx = 0;
+ std::vector<std::string>::size_type idx = 0;
casePath = path_components[idx++];
// make sure drive letter is always upper case
if(casePath.size() > 1 && casePath[1] == ':')
@@ -3779,14 +3783,14 @@ static int GetCasePathName(const kwsys_stl::string & pathIn,
{
casePath += sep;
sep = "/";
- kwsys_stl::string test_str = casePath;
+ std::string test_str = casePath;
test_str += path_components[idx];
// If path component contains wildcards, we skip matching
// because these filenames are not allowed on windows,
// and we do not want to match a different file.
- if(path_components[idx].find('*') != kwsys_stl::string::npos ||
- path_components[idx].find('?') != kwsys_stl::string::npos)
+ if(path_components[idx].find('*') != std::string::npos ||
+ path_components[idx].find('?') != std::string::npos)
{
casePath = "";
return 0;
@@ -3812,7 +3816,7 @@ static int GetCasePathName(const kwsys_stl::string & pathIn,
//----------------------------------------------------------------------------
-kwsys_stl::string SystemTools::GetActualCaseForPath(const kwsys_stl::string& p)
+std::string SystemTools::GetActualCaseForPath(const std::string& p)
{
#ifndef _WIN32
return p;
@@ -3825,7 +3829,7 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const kwsys_stl::string& p)
{
return i->second;
}
- kwsys_stl::string casePath;
+ std::string casePath;
int len = GetCasePathName(p, casePath);
if(len == 0 || len > MAX_PATH+1)
{
@@ -3838,7 +3842,7 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const kwsys_stl::string& p)
//----------------------------------------------------------------------------
const char* SystemTools::SplitPathRootComponent(const std::string& p,
- kwsys_stl::string* root)
+ std::string* root)
{
// Identify the root component.
const char* c = p.c_str();
@@ -3924,7 +3928,7 @@ const char* SystemTools::SplitPathRootComponent(const std::string& p,
//----------------------------------------------------------------------------
void SystemTools::SplitPath(const std::string& p,
- kwsys_stl::vector<kwsys_stl::string>& components,
+ std::vector<std::string>& components,
bool expand_home_dir)
{
const char* c;
@@ -3932,13 +3936,13 @@ void SystemTools::SplitPath(const std::string& p,
// Identify the root component.
{
- kwsys_stl::string root;
+ std::string root;
c = SystemTools::SplitPathRootComponent(p, &root);
// Expand home directory references if requested.
if(expand_home_dir && !root.empty() && root[0] == '~')
{
- kwsys_stl::string homedir;
+ std::string homedir;
root = root.substr(0, root.size()-1);
if(root.size() == 1)
{
@@ -3984,7 +3988,7 @@ void SystemTools::SplitPath(const std::string& p,
if(*last == '/' || *last == '\\')
{
// End of a component. Save it.
- components.push_back(kwsys_stl::string(first, last));
+ components.push_back(std::string(first, last));
first = last+1;
}
}
@@ -3992,27 +3996,27 @@ void SystemTools::SplitPath(const std::string& p,
// Save the last component unless there were no components.
if(last != c)
{
- components.push_back(kwsys_stl::string(first, last));
+ components.push_back(std::string(first, last));
}
}
//----------------------------------------------------------------------------
-kwsys_stl::string
-SystemTools::JoinPath(const kwsys_stl::vector<kwsys_stl::string>& components)
+std::string
+SystemTools::JoinPath(const std::vector<std::string>& components)
{
return SystemTools::JoinPath(components.begin(), components.end());
}
//----------------------------------------------------------------------------
-kwsys_stl::string
+std::string
SystemTools
-::JoinPath(kwsys_stl::vector<kwsys_stl::string>::const_iterator first,
- kwsys_stl::vector<kwsys_stl::string>::const_iterator last)
+::JoinPath(std::vector<std::string>::const_iterator first,
+ std::vector<std::string>::const_iterator last)
{
// Construct result in a single string.
- kwsys_stl::string result;
+ std::string result;
size_t len = 0;
- kwsys_stl::vector<kwsys_stl::string>::const_iterator i;
+ std::vector<std::string>::const_iterator i;
for(i = first; i != last; ++i)
{
len += 1 + i->size();
@@ -4041,7 +4045,7 @@ SystemTools
}
//----------------------------------------------------------------------------
-bool SystemTools::ComparePath(const kwsys_stl::string& c1, const kwsys_stl::string& c2)
+bool SystemTools::ComparePath(const std::string& c1, const std::string& c2)
{
#if defined(_WIN32) || defined(__APPLE__)
# ifdef _MSC_VER
@@ -4057,14 +4061,14 @@ bool SystemTools::ComparePath(const kwsys_stl::string& c1, const kwsys_stl::stri
}
//----------------------------------------------------------------------------
-bool SystemTools::Split(const kwsys_stl::string& str, kwsys_stl::vector<kwsys_stl::string>& lines, char separator)
+bool SystemTools::Split(const std::string& str, std::vector<std::string>& lines, char separator)
{
- kwsys_stl::string data(str);
- kwsys_stl::string::size_type lpos = 0;
+ std::string data(str);
+ std::string::size_type lpos = 0;
while(lpos < data.length())
{
- kwsys_stl::string::size_type rpos = data.find_first_of(separator, lpos);
- if(rpos == kwsys_stl::string::npos)
+ std::string::size_type rpos = data.find_first_of(separator, lpos);
+ if(rpos == std::string::npos)
{
// Line ends at end of string without a newline.
lines.push_back(data.substr(lpos));
@@ -4081,14 +4085,14 @@ bool SystemTools::Split(const kwsys_stl::string& str, kwsys_stl::vector<kwsys_st
}
//----------------------------------------------------------------------------
-bool SystemTools::Split(const kwsys_stl::string& str, kwsys_stl::vector<kwsys_stl::string>& lines)
+bool SystemTools::Split(const std::string& str, std::vector<std::string>& lines)
{
- kwsys_stl::string data(str);
- kwsys_stl::string::size_type lpos = 0;
+ std::string data(str);
+ std::string::size_type lpos = 0;
while(lpos < data.length())
{
- kwsys_stl::string::size_type rpos = data.find_first_of("\n", lpos);
- if(rpos == kwsys_stl::string::npos)
+ std::string::size_type rpos = data.find_first_of("\n", lpos);
+ if(rpos == std::string::npos)
{
// Line ends at end of string without a newline.
lines.push_back(data.substr(lpos));
@@ -4113,15 +4117,15 @@ bool SystemTools::Split(const kwsys_stl::string& str, kwsys_stl::vector<kwsys_st
* Return path of a full filename (no trailing slashes).
* Warning: returned path is converted to Unix slashes format.
*/
-kwsys_stl::string SystemTools::GetFilenamePath(const kwsys_stl::string& filename)
+std::string SystemTools::GetFilenamePath(const std::string& filename)
{
- kwsys_stl::string fn = filename;
+ std::string fn = filename;
SystemTools::ConvertToUnixSlashes(fn);
- kwsys_stl::string::size_type slash_pos = fn.rfind("/");
- if(slash_pos != kwsys_stl::string::npos)
+ std::string::size_type slash_pos = fn.rfind("/");
+ if(slash_pos != std::string::npos)
{
- kwsys_stl::string ret = fn.substr(0, slash_pos);
+ std::string ret = fn.substr(0, slash_pos);
if(ret.size() == 2 && ret[1] == ':')
{
return ret + '/';
@@ -4142,14 +4146,14 @@ kwsys_stl::string SystemTools::GetFilenamePath(const kwsys_stl::string& filename
/**
* Return file name of a full filename (i.e. file name without path).
*/
-kwsys_stl::string SystemTools::GetFilenameName(const kwsys_stl::string& filename)
+std::string SystemTools::GetFilenameName(const std::string& filename)
{
#if defined(_WIN32)
- kwsys_stl::string::size_type slash_pos = filename.find_last_of("/\\");
+ std::string::size_type slash_pos = filename.find_last_of("/\\");
#else
- kwsys_stl::string::size_type slash_pos = filename.rfind('/');
+ std::string::size_type slash_pos = filename.rfind('/');
#endif
- if(slash_pos != kwsys_stl::string::npos)
+ if(slash_pos != std::string::npos)
{
return filename.substr(slash_pos + 1);
}
@@ -4164,11 +4168,11 @@ kwsys_stl::string SystemTools::GetFilenameName(const kwsys_stl::string& filename
* Return file extension of a full filename (dot included).
* Warning: this is the longest extension (for example: .tar.gz)
*/
-kwsys_stl::string SystemTools::GetFilenameExtension(const kwsys_stl::string& filename)
+std::string SystemTools::GetFilenameExtension(const std::string& filename)
{
- kwsys_stl::string name = SystemTools::GetFilenameName(filename);
- kwsys_stl::string::size_type dot_pos = name.find('.');
- if(dot_pos != kwsys_stl::string::npos)
+ std::string name = SystemTools::GetFilenameName(filename);
+ std::string::size_type dot_pos = name.find('.');
+ if(dot_pos != std::string::npos)
{
return name.substr(dot_pos);
}
@@ -4182,11 +4186,11 @@ kwsys_stl::string SystemTools::GetFilenameExtension(const kwsys_stl::string& fil
* Return file extension of a full filename (dot included).
* Warning: this is the shortest extension (for example: .gz of .tar.gz)
*/
-kwsys_stl::string SystemTools::GetFilenameLastExtension(const kwsys_stl::string& filename)
+std::string SystemTools::GetFilenameLastExtension(const std::string& filename)
{
- kwsys_stl::string name = SystemTools::GetFilenameName(filename);
- kwsys_stl::string::size_type dot_pos = name.rfind('.');
- if(dot_pos != kwsys_stl::string::npos)
+ std::string name = SystemTools::GetFilenameName(filename);
+ std::string::size_type dot_pos = name.rfind('.');
+ if(dot_pos != std::string::npos)
{
return name.substr(dot_pos);
}
@@ -4200,11 +4204,11 @@ kwsys_stl::string SystemTools::GetFilenameLastExtension(const kwsys_stl::string&
* Return file name without extension of a full filename (i.e. without path).
* Warning: it considers the longest extension (for example: .tar.gz)
*/
-kwsys_stl::string SystemTools::GetFilenameWithoutExtension(const kwsys_stl::string& filename)
+std::string SystemTools::GetFilenameWithoutExtension(const std::string& filename)
{
- kwsys_stl::string name = SystemTools::GetFilenameName(filename);
- kwsys_stl::string::size_type dot_pos = name.find('.');
- if(dot_pos != kwsys_stl::string::npos)
+ std::string name = SystemTools::GetFilenameName(filename);
+ std::string::size_type dot_pos = name.find('.');
+ if(dot_pos != std::string::npos)
{
return name.substr(0, dot_pos);
}
@@ -4220,12 +4224,12 @@ kwsys_stl::string SystemTools::GetFilenameWithoutExtension(const kwsys_stl::stri
* Warning: it considers the last extension (for example: removes .gz
* from .tar.gz)
*/
-kwsys_stl::string
-SystemTools::GetFilenameWithoutLastExtension(const kwsys_stl::string& filename)
+std::string
+SystemTools::GetFilenameWithoutLastExtension(const std::string& filename)
{
- kwsys_stl::string name = SystemTools::GetFilenameName(filename);
- kwsys_stl::string::size_type dot_pos = name.rfind('.');
- if(dot_pos != kwsys_stl::string::npos)
+ std::string name = SystemTools::GetFilenameName(filename);
+ std::string::size_type dot_pos = name.rfind('.');
+ if(dot_pos != std::string::npos)
{
return name.substr(0, dot_pos);
}
@@ -4334,7 +4338,7 @@ SystemTools::DetectFileType(const char *filename,
bool SystemTools::LocateFileInDir(const char *filename,
const char *dir,
- kwsys_stl::string& filename_found,
+ std::string& filename_found,
int try_filename_dirs)
{
if (!filename || !dir)
@@ -4344,12 +4348,12 @@ bool SystemTools::LocateFileInDir(const char *filename,
// Get the basename of 'filename'
- kwsys_stl::string filename_base = SystemTools::GetFilenameName(filename);
+ std::string filename_base = SystemTools::GetFilenameName(filename);
// Check if 'dir' is really a directory
// If win32 and matches something like C:, accept it as a dir
- kwsys_stl::string real_dir;
+ std::string real_dir;
if (!SystemTools::FileIsDirectory(dir))
{
#if defined( _WIN32 )
@@ -4373,7 +4377,7 @@ bool SystemTools::LocateFileInDir(const char *filename,
int need_slash =
(dir_len && dir[dir_len - 1] != '/' && dir[dir_len - 1] != '\\');
- kwsys_stl::string temp = dir;
+ std::string temp = dir;
if (need_slash)
{
temp += "/";
@@ -4393,9 +4397,9 @@ bool SystemTools::LocateFileInDir(const char *filename,
else if (try_filename_dirs)
{
- kwsys_stl::string filename_dir(filename);
- kwsys_stl::string filename_dir_base;
- kwsys_stl::string filename_dir_bases;
+ std::string filename_dir(filename);
+ std::string filename_dir_base;
+ std::string filename_dir_bases;
do
{
filename_dir = SystemTools::GetFilenamePath(filename_dir);
@@ -4429,7 +4433,7 @@ bool SystemTools::LocateFileInDir(const char *filename,
return res;
}
-bool SystemTools::FileIsFullPath(const kwsys_stl::string& in_name)
+bool SystemTools::FileIsFullPath(const std::string& in_name)
{
return SystemTools::FileIsFullPath(in_name.c_str(), in_name.size());
}
@@ -4478,7 +4482,7 @@ bool SystemTools::FileIsFullPath(const char* in_name, size_t len)
return false;
}
-bool SystemTools::GetShortPath(const kwsys_stl::string& path, kwsys_stl::string& shortPath)
+bool SystemTools::GetShortPath(const std::string& path, std::string& shortPath)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
const int size = int(path.size()) +1; // size of return
@@ -4496,8 +4500,8 @@ bool SystemTools::GetShortPath(const kwsys_stl::string& path, kwsys_stl::string&
strcpy(tempPath,path.c_str());
}
- kwsys_stl::wstring wtempPath = Encoding::ToWide(tempPath);
- kwsys_stl::vector<wchar_t> buffer(wtempPath.size()+1);
+ std::wstring wtempPath = Encoding::ToWide(tempPath);
+ std::vector<wchar_t> buffer(wtempPath.size()+1);
buffer[0] = 0;
ret = GetShortPathNameW(wtempPath.c_str(),
&buffer[0], static_cast<DWORD>(wtempPath.size()));
@@ -4519,8 +4523,8 @@ bool SystemTools::GetShortPath(const kwsys_stl::string& path, kwsys_stl::string&
#endif
}
-void SystemTools::SplitProgramFromArgs(const kwsys_stl::string& path,
- kwsys_stl::string& program, kwsys_stl::string& args)
+void SystemTools::SplitProgramFromArgs(const std::string& path,
+ std::string& program, std::string& args)
{
// see if this is a full path to a program
// if so then set program to path and args to nothing
@@ -4532,8 +4536,8 @@ void SystemTools::SplitProgramFromArgs(const kwsys_stl::string& path,
}
// Try to find the program in the path, note the program
// may have spaces in its name so we have to look for it
- kwsys_stl::vector<kwsys_stl::string> e;
- kwsys_stl::string findProg = SystemTools::FindProgram(path, e);
+ std::vector<std::string> e;
+ std::string findProg = SystemTools::FindProgram(path, e);
if(!findProg.empty())
{
program = findProg;
@@ -4543,17 +4547,17 @@ void SystemTools::SplitProgramFromArgs(const kwsys_stl::string& path,
// Now try and peel off space separated chunks from the end of the string
// so the largest path possible is found allowing for spaces in the path
- kwsys_stl::string dir = path;
- kwsys_stl::string::size_type spacePos = dir.rfind(' ');
- while(spacePos != kwsys_stl::string::npos)
+ std::string dir = path;
+ std::string::size_type spacePos = dir.rfind(' ');
+ while(spacePos != std::string::npos)
{
- kwsys_stl::string tryProg = dir.substr(0, spacePos);
+ std::string tryProg = dir.substr(0, spacePos);
// See if the file exists
if(SystemTools::FileExists(tryProg))
{
program = tryProg;
// remove trailing spaces from program
- kwsys_stl::string::size_type pos = program.size()-1;
+ std::string::size_type pos = program.size()-1;
while(program[pos] == ' ')
{
program.erase(pos);
@@ -4568,7 +4572,7 @@ void SystemTools::SplitProgramFromArgs(const kwsys_stl::string& path,
{
program = findProg;
// remove trailing spaces from program
- kwsys_stl::string::size_type pos = program.size()-1;
+ std::string::size_type pos = program.size()-1;
while(program[pos] == ' ')
{
program.erase(pos);
@@ -4586,29 +4590,29 @@ void SystemTools::SplitProgramFromArgs(const kwsys_stl::string& path,
args = "";
}
-kwsys_stl::string SystemTools::GetCurrentDateTime(const char* format)
+std::string SystemTools::GetCurrentDateTime(const char* format)
{
char buf[1024];
time_t t;
time(&t);
strftime(buf, sizeof(buf), format, localtime(&t));
- return kwsys_stl::string(buf);
+ return std::string(buf);
}
-kwsys_stl::string SystemTools::MakeCidentifier(const kwsys_stl::string& s)
+std::string SystemTools::MakeCidentifier(const std::string& s)
{
- kwsys_stl::string str(s);
+ std::string str(s);
if (str.find_first_of("0123456789") == 0)
{
str = "_" + str;
}
- kwsys_stl::string permited_chars("_"
+ std::string permited_chars("_"
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789");
- kwsys_stl::string::size_type pos = 0;
- while ((pos = str.find_first_not_of(permited_chars, pos)) != kwsys_stl::string::npos)
+ std::string::size_type pos = 0;
+ while ((pos = str.find_first_not_of(permited_chars, pos)) != std::string::npos)
{
str[pos] = '_';
}
@@ -4618,8 +4622,8 @@ kwsys_stl::string SystemTools::MakeCidentifier(const kwsys_stl::string& s)
// Due to a buggy stream library on the HP and another on Mac OS X, we
// need this very carefully written version of getline. Returns true
// if any data were read before the end-of-file was reached.
-bool SystemTools::GetLineFromStream(kwsys_ios::istream& is,
- kwsys_stl::string& line,
+bool SystemTools::GetLineFromStream(std::istream& is,
+ std::string& line,
bool* has_newline /* = 0 */,
long sizeLimit /* = -1 */)
{
@@ -4650,7 +4654,7 @@ bool SystemTools::GetLineFromStream(kwsys_ios::istream& is,
// been reached. Clear the fail bit just before reading.
while(!haveNewline &&
leftToRead != 0 &&
- (is.clear(is.rdstate() & ~kwsys_ios::ios::failbit),
+ (is.clear(is.rdstate() & ~std::ios::failbit),
is.getline(buffer, bufferSize), is.gcount() > 0))
{
// We have read at least one byte.
@@ -4735,10 +4739,10 @@ bool SystemTools::GetPermissions(const char* file, mode_t& mode)
{
return false;
}
- return SystemTools::GetPermissions(kwsys_stl::string(file), mode);
+ return SystemTools::GetPermissions(std::string(file), mode);
}
-bool SystemTools::GetPermissions(const kwsys_stl::string& file, mode_t& mode)
+bool SystemTools::GetPermissions(const std::string& file, mode_t& mode)
{
#if defined(_WIN32)
DWORD attr = GetFileAttributesW(
@@ -4793,10 +4797,10 @@ bool SystemTools::SetPermissions(const char* file,
return false;
}
return SystemTools::SetPermissions(
- kwsys_stl::string(file), mode, honor_umask);
+ std::string(file), mode, honor_umask);
}
-bool SystemTools::SetPermissions(const kwsys_stl::string& file,
+bool SystemTools::SetPermissions(const std::string& file,
mode_t mode,
bool honor_umask)
{
@@ -4826,19 +4830,19 @@ bool SystemTools::SetPermissions(const kwsys_stl::string& file,
return true;
}
-kwsys_stl::string SystemTools::GetParentDirectory(const kwsys_stl::string& fileOrDir)
+std::string SystemTools::GetParentDirectory(const std::string& fileOrDir)
{
return SystemTools::GetFilenamePath(fileOrDir);
}
-bool SystemTools::IsSubDirectory(const kwsys_stl::string& cSubdir, const kwsys_stl::string& cDir)
+bool SystemTools::IsSubDirectory(const std::string& cSubdir, const std::string& cDir)
{
if(cDir.empty())
{
return false;
}
- kwsys_stl::string subdir = cSubdir;
- kwsys_stl::string dir = cDir;
+ std::string subdir = cSubdir;
+ std::string dir = cDir;
SystemTools::ConvertToUnixSlashes(subdir);
SystemTools::ConvertToUnixSlashes(dir);
if(subdir.size() > dir.size() && subdir[dir.size()] == '/')
@@ -4873,9 +4877,9 @@ void SystemTools::Delay(unsigned int msec)
#endif
}
-kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
+std::string SystemTools::GetOperatingSystemNameAndVersion()
{
- kwsys_stl::string res;
+ std::string res;
#ifdef _WIN32
char buffer[256];
@@ -4883,11 +4887,8 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
OSVERSIONINFOEXA osvi;
BOOL bOsVersionInfoEx;
- // Try calling GetVersionEx using the OSVERSIONINFOEX structure.
- // If that fails, try using the OSVERSIONINFO structure.
-
- ZeroMemory(&osvi, sizeof(OSVERSIONINFOEXA));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
+ ZeroMemory(&osvi, sizeof(osvi));
+ osvi.dwOSVersionInfoSize = sizeof(osvi);
#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
# pragma warning (push)
@@ -4897,14 +4898,10 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
# pragma warning (disable:4996)
# endif
#endif
- bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osvi);
+ bOsVersionInfoEx = GetVersionExA((OSVERSIONINFOA *)&osvi);
if (!bOsVersionInfoEx)
{
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if (!GetVersionEx((OSVERSIONINFO *)&osvi))
- {
- return 0;
- }
+ return 0;
}
#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
# pragma warning (pop)
@@ -4917,10 +4914,56 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
case VER_PLATFORM_WIN32_NT:
// Test for the specific product family.
+ if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0)
+ {
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ {
+ res += "Microsoft Windows 10";
+ }
+ else
+ {
+ res += "Microsoft Windows Server 2016 family";
+ }
+ }
+
+ if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3)
+ {
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ {
+ res += "Microsoft Windows 8.1";
+ }
+ else
+ {
+ res += "Microsoft Windows Server 2012 R2 family";
+ }
+ }
+
+ if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2)
+ {
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ {
+ res += "Microsoft Windows 8";
+ }
+ else
+ {
+ res += "Microsoft Windows Server 2012 family";
+ }
+ }
+
+ if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1)
+ {
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ {
+ res += "Microsoft Windows 7";
+ }
+ else
+ {
+ res += "Microsoft Windows Server 2008 R2 family";
+ }
+ }
if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)
{
-#if (_MSC_VER >= 1300)
if (osvi.wProductType == VER_NT_WORKSTATION)
{
res += "Microsoft Windows Vista";
@@ -4929,9 +4972,6 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
{
res += "Microsoft Windows Server 2008 family";
}
-#else
- res += "Microsoft Windows Vista or Windows Server 2008";
-#endif
}
if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2)
@@ -4960,7 +5000,6 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
{
// Test for the workstation type.
-#if (_MSC_VER >= 1300)
if (osvi.wProductType == VER_NT_WORKSTATION)
{
if (osvi.dwMajorVersion == 4)
@@ -5032,7 +5071,6 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
}
}
}
-#endif // Visual Studio 7 and up
}
// Test for specific product on Windows NT 4.0 SP5 and earlier
@@ -5170,9 +5208,9 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
}
// ----------------------------------------------------------------------
-bool SystemTools::ParseURLProtocol( const kwsys_stl::string& URL,
- kwsys_stl::string& protocol,
- kwsys_stl::string& dataglom )
+bool SystemTools::ParseURLProtocol( const std::string& URL,
+ std::string& protocol,
+ std::string& dataglom )
{
// match 0 entire url
// match 1 protocol
@@ -5188,13 +5226,13 @@ bool SystemTools::ParseURLProtocol( const kwsys_stl::string& URL,
}
// ----------------------------------------------------------------------
-bool SystemTools::ParseURL( const kwsys_stl::string& URL,
- kwsys_stl::string& protocol,
- kwsys_stl::string& username,
- kwsys_stl::string& password,
- kwsys_stl::string& hostname,
- kwsys_stl::string& dataport,
- kwsys_stl::string& database )
+bool SystemTools::ParseURL( const std::string& URL,
+ std::string& protocol,
+ std::string& username,
+ std::string& password,
+ std::string& hostname,
+ std::string& dataport,
+ std::string& database )
{
kwsys::RegularExpression urlRe( VTK_URL_REGEX );
if ( ! urlRe.find( URL ) ) return false;
@@ -5299,13 +5337,13 @@ void SystemTools::ClassInitialize()
// The current working directory may be a logical path. Find
// the shortest logical path that still produces the correct
// physical path.
- kwsys_stl::string cwd_changed;
- kwsys_stl::string pwd_changed;
+ std::string cwd_changed;
+ std::string pwd_changed;
// Test progressively shorter logical-to-physical mappings.
- kwsys_stl::string pwd_str = pwd;
- kwsys_stl::string cwd_str = cwd;
- kwsys_stl::string pwd_path;
+ std::string pwd_str = pwd;
+ std::string cwd_str = cwd;
+ std::string pwd_path;
Realpath(pwd, pwd_path);
while(cwd_str == pwd_path && cwd_str != pwd_str)
{
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index 164c5e0..d2d1d40 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -12,12 +12,13 @@
#ifndef @KWSYS_NAMESPACE@_SystemTools_hxx
#define @KWSYS_NAMESPACE@_SystemTools_hxx
-#include <@KWSYS_NAMESPACE@/ios/iosfwd>
-#include <@KWSYS_NAMESPACE@/stl/string>
-#include <@KWSYS_NAMESPACE@/stl/vector>
-#include <@KWSYS_NAMESPACE@/stl/map>
+#include <@KWSYS_NAMESPACE@/Configure.hxx>
+
+#include <iosfwd>
+#include <string>
+#include <vector>
+#include <map>
-#include <@KWSYS_NAMESPACE@/Configure.h>
#include <@KWSYS_NAMESPACE@/String.hxx>
#include <sys/types.h>
@@ -29,7 +30,7 @@
#include <stdarg.h>
// Required for FILE*
#include <stdio.h>
-#if @KWSYS_NAMESPACE@_STL_HAVE_STD && !defined(va_list)
+#if !defined(va_list)
// Some compilers move va_list into the std namespace and there is no way to
// tell that this has been done. Playing with things being included before or
// after stdarg.h does not solve things because we do not have control over
@@ -47,12 +48,6 @@ namespace @KWSYS_NAMESPACE@
}
#endif // va_list
-/* Define these macros temporarily to keep the code readable. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# define kwsys_stl @KWSYS_NAMESPACE@_stl
-# define kwsys_ios @KWSYS_NAMESPACE@_ios
-#endif
-
namespace @KWSYS_NAMESPACE@
{
@@ -112,9 +107,9 @@ public:
* then an underscore is prepended. Note that this can produce
* identifiers that the standard reserves (_[A-Z].* and __.*).
*/
- static kwsys_stl::string MakeCidentifier(const kwsys_stl::string& s);
+ static std::string MakeCidentifier(const std::string& s);
- static kwsys_stl::string MakeCindentifier(const kwsys_stl::string& s)
+ static std::string MakeCindentifier(const std::string& s)
{
return MakeCidentifier(s);
}
@@ -122,40 +117,40 @@ public:
/**
* Replace replace all occurences of the string in the source string.
*/
- static void ReplaceString(kwsys_stl::string& source,
+ static void ReplaceString(std::string& source,
const char* replace,
const char* with);
- static void ReplaceString(kwsys_stl::string& source,
- const kwsys_stl::string& replace,
- const kwsys_stl::string& with);
+ static void ReplaceString(std::string& source,
+ const std::string& replace,
+ const std::string& with);
/**
* Return a capitalized string (i.e the first letter is uppercased,
* all other are lowercased).
*/
- static kwsys_stl::string Capitalized(const kwsys_stl::string&);
+ static std::string Capitalized(const std::string&);
/**
* Return a 'capitalized words' string (i.e the first letter of each word
* is uppercased all other are left untouched though).
*/
- static kwsys_stl::string CapitalizedWords(const kwsys_stl::string&);
+ static std::string CapitalizedWords(const std::string&);
/**
* Return a 'uncapitalized words' string (i.e the first letter of each word
* is lowercased all other are left untouched though).
*/
- static kwsys_stl::string UnCapitalizedWords(const kwsys_stl::string&);
+ static std::string UnCapitalizedWords(const std::string&);
/**
* Return a lower case string
*/
- static kwsys_stl::string LowerCase(const kwsys_stl::string&);
+ static std::string LowerCase(const std::string&);
/**
* Return a lower case string
*/
- static kwsys_stl::string UpperCase(const kwsys_stl::string&);
+ static std::string UpperCase(const std::string&);
/**
* Count char in string
@@ -184,9 +179,9 @@ public:
* Returns true if str1 starts (respectively ends) with str2
*/
static bool StringStartsWith(const char* str1, const char* str2);
- static bool StringStartsWith(const kwsys_stl::string& str1, const char* str2);
+ static bool StringStartsWith(const std::string& str1, const char* str2);
static bool StringEndsWith(const char* str1, const char* str2);
- static bool StringEndsWith(const kwsys_stl::string& str1, const char* str2);
+ static bool StringEndsWith(const std::string& str1, const char* str2);
/**
* Returns a pointer to the last occurence of str2 in str1
@@ -204,14 +199,14 @@ public:
* Return the string cropped to a given length by removing chars in the
* center of the string and replacing them with an ellipsis (...)
*/
- static kwsys_stl::string CropString(const kwsys_stl::string&,size_t max_len);
+ static std::string CropString(const std::string&,size_t max_len);
/** split a path by separator into an array of strings, default is /.
If isPath is true then the string is treated like a path and if
s starts with a / then the first element of the returned array will
be /, so /foo/bar will be [/, foo, bar]
*/
- static kwsys_stl::vector<String> SplitString(const kwsys_stl::string& s, char separator = '/',
+ static std::vector<String> SplitString(const std::string& s, char separator = '/',
bool isPath = false);
/**
* Perform a case-independent string comparison
@@ -229,16 +224,16 @@ public:
* Split a string on its newlines into multiple lines
* Return false only if the last line stored had no newline
*/
- static bool Split(const kwsys_stl::string& s, kwsys_stl::vector<kwsys_stl::string>& l);
- static bool Split(const kwsys_stl::string& s, kwsys_stl::vector<kwsys_stl::string>& l, char separator);
+ static bool Split(const std::string& s, std::vector<std::string>& l);
+ static bool Split(const std::string& s, std::vector<std::string>& l, char separator);
/**
* Return string with space added between capitalized words
* (i.e. EatMyShorts becomes Eat My Shorts )
* (note that IEatShorts becomes IEat Shorts)
*/
- static kwsys_stl::string AddSpaceBetweenCapitalizedWords(
- const kwsys_stl::string&);
+ static std::string AddSpaceBetweenCapitalizedWords(
+ const std::string&);
/**
* Append two or more strings and produce new one.
@@ -265,7 +260,7 @@ public:
/**
* Escape specific characters in 'str'.
*/
- static kwsys_stl::string EscapeChars(
+ static std::string EscapeChars(
const char *str, const char *chars_to_escape, char escape_char = '\\');
/** -----------------------------------------------------------------
@@ -276,7 +271,7 @@ public:
/**
* Replace Windows file system slashes with Unix-style slashes.
*/
- static void ConvertToUnixSlashes(kwsys_stl::string& path);
+ static void ConvertToUnixSlashes(std::string& path);
#ifdef _WIN32
/**
@@ -286,20 +281,20 @@ public:
* will be prefixed with \\?\UNC\. All output will also be converted to
* absolute paths with Windows-style backslashes.
**/
- static kwsys_stl::wstring ConvertToWindowsExtendedPath(const kwsys_stl::string&);
+ static std::wstring ConvertToWindowsExtendedPath(const std::string&);
#endif
/**
* For windows this calls ConvertToWindowsOutputPath and for unix
* it calls ConvertToUnixOutputPath
*/
- static kwsys_stl::string ConvertToOutputPath(const kwsys_stl::string&);
+ static std::string ConvertToOutputPath(const std::string&);
/**
* Convert the path to a string that can be used in a unix makefile.
* double slashes are removed, and spaces are escaped.
*/
- static kwsys_stl::string ConvertToUnixOutputPath(const kwsys_stl::string&);
+ static std::string ConvertToUnixOutputPath(const std::string&);
/**
* Convert the path to string that can be used in a windows project or
@@ -307,7 +302,7 @@ public:
* the string, the slashes are converted to windows style backslashes, and
* if there are spaces in the string it is double quoted.
*/
- static kwsys_stl::string ConvertToWindowsOutputPath(const kwsys_stl::string&);
+ static std::string ConvertToWindowsOutputPath(const std::string&);
/**
* Return true if a file exists in the current directory.
@@ -318,9 +313,9 @@ public:
* for read access is only done on POSIX systems.)
*/
static bool FileExists(const char* filename, bool isFile);
- static bool FileExists(const kwsys_stl::string& filename, bool isFile);
+ static bool FileExists(const std::string& filename, bool isFile);
static bool FileExists(const char* filename);
- static bool FileExists(const kwsys_stl::string& filename);
+ static bool FileExists(const std::string& filename);
/**
* Test if a file exists and can be accessed with the requested
@@ -334,7 +329,7 @@ public:
*/
static bool TestFileAccess(const char* filename,
TestFilePermissions permissions);
- static bool TestFileAccess(const kwsys_stl::string& filename,
+ static bool TestFileAccess(const std::string& filename,
TestFilePermissions permissions);
/**
@@ -349,12 +344,12 @@ public:
/**
* Return file length
*/
- static unsigned long FileLength(const kwsys_stl::string& filename);
+ static unsigned long FileLength(const std::string& filename);
/**
Change the modification time or create a file
*/
- static bool Touch(const kwsys_stl::string& filename, bool create);
+ static bool Touch(const std::string& filename, bool create);
/**
* Compare file modification times.
@@ -362,8 +357,8 @@ public:
* When true is returned, result has -1, 0, +1 for
* f1 older, same, or newer than f2.
*/
- static bool FileTimeCompare(const kwsys_stl::string& f1,
- const kwsys_stl::string& f2,
+ static bool FileTimeCompare(const std::string& f1,
+ const std::string& f2,
int* result);
/**
@@ -378,17 +373,17 @@ public:
* does not exist path is returned unchanged. This does nothing
* on unix but return path.
*/
- static kwsys_stl::string GetActualCaseForPath(const kwsys_stl::string& path);
+ static std::string GetActualCaseForPath(const std::string& path);
/**
* Given the path to a program executable, get the directory part of
* the path with the file stripped off. If there is no directory
* part, the empty string is returned.
*/
- static kwsys_stl::string GetProgramPath(const kwsys_stl::string&);
- static bool SplitProgramPath(const kwsys_stl::string& in_name,
- kwsys_stl::string& dir,
- kwsys_stl::string& file,
+ static std::string GetProgramPath(const std::string&);
+ static bool SplitProgramPath(const std::string& in_name,
+ std::string& dir,
+ std::string& file,
bool errorReport = true);
/**
@@ -404,8 +399,8 @@ public:
* installPrefix is a possibly null pointer to the install directory.
*/
static bool FindProgramPath(const char* argv0,
- kwsys_stl::string& pathOut,
- kwsys_stl::string& errorMsg,
+ std::string& pathOut,
+ std::string& errorMsg,
const char* exeName = 0,
const char* buildDir = 0,
const char* installPrefix = 0);
@@ -416,11 +411,11 @@ public:
* (which defaults to the current working directory). The full path
* is returned.
*/
- static kwsys_stl::string CollapseFullPath(const kwsys_stl::string& in_relative);
- static kwsys_stl::string CollapseFullPath(const kwsys_stl::string& in_relative,
+ static std::string CollapseFullPath(const std::string& in_relative);
+ static std::string CollapseFullPath(const std::string& in_relative,
const char* in_base);
- static kwsys_stl::string CollapseFullPath(const kwsys_stl::string& in_relative,
- const kwsys_stl::string& in_base);
+ static std::string CollapseFullPath(const std::string& in_relative,
+ const std::string& in_base);
/**
* Get the real path for a given path, removing all symlinks. In
@@ -429,8 +424,8 @@ public:
* NULL. Otherwise empty string is returned and errorMessage
* contains error description.
*/
- static kwsys_stl::string GetRealPath(const kwsys_stl::string& path,
- kwsys_stl::string* errorMessage = 0);
+ static std::string GetRealPath(const std::string& path,
+ std::string* errorMessage = 0);
/**
* Split a path name into its root component and the rest of the
@@ -448,7 +443,7 @@ public:
* given.
*/
static const char* SplitPathRootComponent(const std::string& p,
- kwsys_stl::string* root=0);
+ std::string* root=0);
/**
* Split a path name into its basic components. The first component
@@ -461,76 +456,76 @@ public:
* platform supports them.
*/
static void SplitPath(const std::string& p,
- kwsys_stl::vector<kwsys_stl::string>& components,
+ std::vector<std::string>& components,
bool expand_home_dir = true);
/**
* Join components of a path name into a single string. See
* SplitPath for the format of the components.
*/
- static kwsys_stl::string JoinPath(
- const kwsys_stl::vector<kwsys_stl::string>& components);
- static kwsys_stl::string JoinPath(
- kwsys_stl::vector<kwsys_stl::string>::const_iterator first,
- kwsys_stl::vector<kwsys_stl::string>::const_iterator last);
+ static std::string JoinPath(
+ const std::vector<std::string>& components);
+ static std::string JoinPath(
+ std::vector<std::string>::const_iterator first,
+ std::vector<std::string>::const_iterator last);
/**
* Compare a path or components of a path.
*/
- static bool ComparePath(const kwsys_stl::string& c1, const kwsys_stl::string& c2);
+ static bool ComparePath(const std::string& c1, const std::string& c2);
/**
* Return path of a full filename (no trailing slashes)
*/
- static kwsys_stl::string GetFilenamePath(const kwsys_stl::string&);
+ static std::string GetFilenamePath(const std::string&);
/**
* Return file name of a full filename (i.e. file name without path)
*/
- static kwsys_stl::string GetFilenameName(const kwsys_stl::string&);
+ static std::string GetFilenameName(const std::string&);
/**
* Split a program from its arguments and handle spaces in the paths
*/
static void SplitProgramFromArgs(
- const kwsys_stl::string& path,
- kwsys_stl::string& program, kwsys_stl::string& args);
+ const std::string& path,
+ std::string& program, std::string& args);
/**
* Return longest file extension of a full filename (dot included)
*/
- static kwsys_stl::string GetFilenameExtension(const kwsys_stl::string&);
+ static std::string GetFilenameExtension(const std::string&);
/**
* Return shortest file extension of a full filename (dot included)
*/
- static kwsys_stl::string GetFilenameLastExtension(
- const kwsys_stl::string& filename);
+ static std::string GetFilenameLastExtension(
+ const std::string& filename);
/**
* Return file name without extension of a full filename
*/
- static kwsys_stl::string GetFilenameWithoutExtension(
- const kwsys_stl::string&);
+ static std::string GetFilenameWithoutExtension(
+ const std::string&);
/**
* Return file name without its last (shortest) extension
*/
- static kwsys_stl::string GetFilenameWithoutLastExtension(
- const kwsys_stl::string&);
+ static std::string GetFilenameWithoutLastExtension(
+ const std::string&);
/**
* Return whether the path represents a full path (not relative)
*/
- static bool FileIsFullPath(const kwsys_stl::string&);
+ static bool FileIsFullPath(const std::string&);
static bool FileIsFullPath(const char*);
/**
* For windows return the short path for the given path,
* Unix just a pass through
*/
- static bool GetShortPath(const kwsys_stl::string& path, kwsys_stl::string& result);
+ static bool GetShortPath(const std::string& path, std::string& result);
/**
* Read line from file. Make sure to get everything. Due to a buggy stream
@@ -539,20 +534,20 @@ public:
* end-of-file was reached. If the has_newline argument is specified, it will
* be true when the line read had a newline character.
*/
- static bool GetLineFromStream(kwsys_ios::istream& istr,
- kwsys_stl::string& line,
+ static bool GetLineFromStream(std::istream& istr,
+ std::string& line,
bool* has_newline=0,
long sizeLimit=-1);
/**
* Get the parent directory of the directory or file
*/
- static kwsys_stl::string GetParentDirectory(const kwsys_stl::string& fileOrDir);
+ static std::string GetParentDirectory(const std::string& fileOrDir);
/**
* Check if the given file or directory is in subdirectory of dir
*/
- static bool IsSubDirectory(const kwsys_stl::string& fileOrDir, const kwsys_stl::string& dir);
+ static bool IsSubDirectory(const std::string& fileOrDir, const std::string& dir);
/** -----------------------------------------------------------------
* File Manipulation Routines
@@ -562,7 +557,7 @@ public:
/**
* Open a file considering unicode.
*/
- static FILE* Fopen(const kwsys_stl::string& file, const char* mode);
+ static FILE* Fopen(const std::string& file, const char* mode);
/**
* Make a new directory if it is not there. This function
@@ -570,36 +565,36 @@ public:
* prior to calling this function.
*/
static bool MakeDirectory(const char* path);
- static bool MakeDirectory(const kwsys_stl::string& path);
+ static bool MakeDirectory(const std::string& path);
/**
* Copy the source file to the destination file only
* if the two files differ.
*/
- static bool CopyFileIfDifferent(const kwsys_stl::string& source,
- const kwsys_stl::string& destination);
+ static bool CopyFileIfDifferent(const std::string& source,
+ const std::string& destination);
/**
* Compare the contents of two files. Return true if different
*/
- static bool FilesDiffer(const kwsys_stl::string& source, const kwsys_stl::string& destination);
+ static bool FilesDiffer(const std::string& source, const std::string& destination);
/**
* Return true if the two files are the same file
*/
- static bool SameFile(const kwsys_stl::string& file1, const kwsys_stl::string& file2);
+ static bool SameFile(const std::string& file1, const std::string& file2);
/**
* Copy a file.
*/
- static bool CopyFileAlways(const kwsys_stl::string& source, const kwsys_stl::string& destination);
+ static bool CopyFileAlways(const std::string& source, const std::string& destination);
/**
* Copy a file. If the "always" argument is true the file is always
* copied. If it is false, the file is copied only if it is new or
* has changed.
*/
- static bool CopyAFile(const kwsys_stl::string& source, const kwsys_stl::string& destination,
+ static bool CopyAFile(const std::string& source, const std::string& destination,
bool always = true);
/**
@@ -608,18 +603,18 @@ public:
* always copied. If it is false, only files that have changed or
* are new are copied.
*/
- static bool CopyADirectory(const kwsys_stl::string& source, const kwsys_stl::string& destination,
+ static bool CopyADirectory(const std::string& source, const std::string& destination,
bool always = true);
/**
* Remove a file
*/
- static bool RemoveFile(const kwsys_stl::string& source);
+ static bool RemoveFile(const std::string& source);
/**
* Remove a directory
*/
- static bool RemoveADirectory(const kwsys_stl::string& source);
+ static bool RemoveADirectory(const std::string& source);
/**
* Get the maximum full file path length
@@ -629,56 +624,56 @@ public:
/**
* Find a file in the system PATH, with optional extra paths
*/
- static kwsys_stl::string FindFile(
- const kwsys_stl::string& name,
- const kwsys_stl::vector<kwsys_stl::string>& path =
- kwsys_stl::vector<kwsys_stl::string>(),
+ static std::string FindFile(
+ const std::string& name,
+ const std::vector<std::string>& path =
+ std::vector<std::string>(),
bool no_system_path = false);
/**
* Find a directory in the system PATH, with optional extra paths
*/
- static kwsys_stl::string FindDirectory(
- const kwsys_stl::string& name,
- const kwsys_stl::vector<kwsys_stl::string>& path =
- kwsys_stl::vector<kwsys_stl::string>(),
+ static std::string FindDirectory(
+ const std::string& name,
+ const std::vector<std::string>& path =
+ std::vector<std::string>(),
bool no_system_path = false);
/**
* Find an executable in the system PATH, with optional extra paths
*/
- static kwsys_stl::string FindProgram(
+ static std::string FindProgram(
const char* name,
- const kwsys_stl::vector<kwsys_stl::string>& path =
- kwsys_stl::vector<kwsys_stl::string>(),
+ const std::vector<std::string>& path =
+ std::vector<std::string>(),
bool no_system_path = false);
- static kwsys_stl::string FindProgram(
- const kwsys_stl::string& name,
- const kwsys_stl::vector<kwsys_stl::string>& path =
- kwsys_stl::vector<kwsys_stl::string>(),
+ static std::string FindProgram(
+ const std::string& name,
+ const std::vector<std::string>& path =
+ std::vector<std::string>(),
bool no_system_path = false);
- static kwsys_stl::string FindProgram(
- const kwsys_stl::vector<kwsys_stl::string>& names,
- const kwsys_stl::vector<kwsys_stl::string>& path =
- kwsys_stl::vector<kwsys_stl::string>(),
+ static std::string FindProgram(
+ const std::vector<std::string>& names,
+ const std::vector<std::string>& path =
+ std::vector<std::string>(),
bool no_system_path = false);
/**
* Find a library in the system PATH, with optional extra paths
*/
- static kwsys_stl::string FindLibrary(
- const kwsys_stl::string& name,
- const kwsys_stl::vector<kwsys_stl::string>& path);
+ static std::string FindLibrary(
+ const std::string& name,
+ const std::vector<std::string>& path);
/**
* Return true if the file is a directory
*/
- static bool FileIsDirectory(const kwsys_stl::string& name);
+ static bool FileIsDirectory(const std::string& name);
/**
* Return true if the file is a symlink
*/
- static bool FileIsSymlink(const kwsys_stl::string& name);
+ static bool FileIsSymlink(const std::string& name);
/**
* Return true if the file has a given signature (first set of bytes)
@@ -710,13 +705,13 @@ public:
* Create a symbolic link if the platform supports it. Returns whether
* creation succeded.
*/
- static bool CreateSymlink(const kwsys_stl::string& origName, const kwsys_stl::string& newName);
+ static bool CreateSymlink(const std::string& origName, const std::string& newName);
/**
* Read the contents of a symbolic link. Returns whether reading
* succeded.
*/
- static bool ReadSymlink(const kwsys_stl::string& newName, kwsys_stl::string& origName);
+ static bool ReadSymlink(const std::string& newName, std::string& origName);
/**
* Try to locate the file 'filename' in the directory 'dir'.
@@ -735,7 +730,7 @@ public:
*/
static bool LocateFileInDir(const char *filename,
const char *dir,
- kwsys_stl::string& filename_found,
+ std::string& filename_found,
int try_filename_dirs = 0);
/** compute the relative path from local to remote. local must
@@ -746,17 +741,17 @@ public:
/a/b/c/d to /a/b/c1/d1 -> ../../c1/d1
from /usr/src to /usr/src/test/blah/foo.cpp -> test/blah/foo.cpp
*/
- static kwsys_stl::string RelativePath(const kwsys_stl::string& local, const kwsys_stl::string& remote);
+ static std::string RelativePath(const std::string& local, const std::string& remote);
/**
* Return file's modified time
*/
- static long int ModifiedTime(const kwsys_stl::string& filename);
+ static long int ModifiedTime(const std::string& filename);
/**
* Return file's creation time (Win32: works only for NTFS, not FAT)
*/
- static long int CreationTime(const kwsys_stl::string& filename);
+ static long int CreationTime(const std::string& filename);
/**
* Visual C++ does not define mode_t (note that Borland does, however).
@@ -774,11 +769,9 @@ public:
* if a honor_umask parameter is set to true.
*/
static bool GetPermissions(const char* file, mode_t& mode);
- static bool GetPermissions(const kwsys_stl::string& file, mode_t& mode);
- static bool SetPermissions(
- const char* file, mode_t mode, bool honor_umask = false);
- static bool SetPermissions(
- const kwsys_stl::string& file, mode_t mode, bool honor_umask = false);
+ static bool GetPermissions(const std::string& file, mode_t& mode);
+ static bool SetPermissions(const char* file, mode_t mode, bool honor_umask = false);
+ static bool SetPermissions(const std::string& file, mode_t mode, bool honor_umask = false);
/** -----------------------------------------------------------------
* Time Manipulation Routines
@@ -791,7 +784,7 @@ public:
/**
* Get current date/time
*/
- static kwsys_stl::string GetCurrentDateTime(const char* format);
+ static std::string GetCurrentDateTime(const char* format);
/** -----------------------------------------------------------------
* Registry Manipulation Routines
@@ -808,26 +801,26 @@ public:
/**
* Get a list of subkeys.
*/
- static bool GetRegistrySubKeys(const kwsys_stl::string& key,
- kwsys_stl::vector<kwsys_stl::string>& subkeys,
+ static bool GetRegistrySubKeys(const std::string& key,
+ std::vector<std::string>& subkeys,
KeyWOW64 view = KeyWOW64_Default);
/**
* Read a registry value
*/
- static bool ReadRegistryValue(const kwsys_stl::string& key, kwsys_stl::string &value,
+ static bool ReadRegistryValue(const std::string& key, std::string &value,
KeyWOW64 view = KeyWOW64_Default);
/**
* Write a registry value
*/
- static bool WriteRegistryValue(const kwsys_stl::string& key, const kwsys_stl::string& value,
+ static bool WriteRegistryValue(const std::string& key, const std::string& value,
KeyWOW64 view = KeyWOW64_Default);
/**
* Delete a registry value
*/
- static bool DeleteRegistryValue(const kwsys_stl::string& key,
+ static bool DeleteRegistryValue(const std::string& key,
KeyWOW64 view = KeyWOW64_Default);
/** -----------------------------------------------------------------
@@ -840,39 +833,39 @@ public:
* string vector passed in. If env is set then the value
* of env will be used instead of PATH.
*/
- static void GetPath(kwsys_stl::vector<kwsys_stl::string>& path,
+ static void GetPath(std::vector<std::string>& path,
const char* env=0);
/**
* Read an environment variable
*/
static const char* GetEnv(const char* key);
- static const char* GetEnv(const kwsys_stl::string& key);
- static bool GetEnv(const char* key, kwsys_stl::string& result);
- static bool GetEnv(const kwsys_stl::string& key, kwsys_stl::string& result);
+ static const char* GetEnv(const std::string& key);
+ static bool GetEnv(const char* key, std::string& result);
+ static bool GetEnv(const std::string& key, std::string& result);
/** Put a string into the environment
of the form var=value */
- static bool PutEnv(const kwsys_stl::string& env);
+ static bool PutEnv(const std::string& env);
/** Remove a string from the environment.
Input is of the form "var" or "var=value" (value is ignored). */
- static bool UnPutEnv(const kwsys_stl::string& env);
+ static bool UnPutEnv(const std::string& env);
/**
* Get current working directory CWD
*/
- static kwsys_stl::string GetCurrentWorkingDirectory(bool collapse =true);
+ static std::string GetCurrentWorkingDirectory(bool collapse =true);
/**
* Change directory to the directory specified
*/
- static int ChangeDirectory(const kwsys_stl::string& dir);
+ static int ChangeDirectory(const std::string& dir);
/**
* Get the result of strerror(errno)
*/
- static kwsys_stl::string GetLastSystemError();
+ static std::string GetLastSystemError();
/**
* When building DEBUG with MSVC, this enables a hook that prevents
@@ -891,18 +884,18 @@ public:
/**
* Add an entry in the path translation table.
*/
- static void AddTranslationPath(const kwsys_stl::string& dir, const kwsys_stl::string& refdir);
+ static void AddTranslationPath(const std::string& dir, const std::string& refdir);
/**
* If dir is different after CollapseFullPath is called,
* Then insert it into the path translation table
*/
- static void AddKeepPath(const kwsys_stl::string& dir);
+ static void AddKeepPath(const std::string& dir);
/**
* Update path by going through the Path Translation table;
*/
- static void CheckTranslationPath(kwsys_stl::string & path);
+ static void CheckTranslationPath(std::string & path);
/**
* Delay the execution for a specified amount of time specified
@@ -914,7 +907,7 @@ public:
* Get the operating system name and version
* This is implemented for Win32 only for the moment
*/
- static kwsys_stl::string GetOperatingSystemNameAndVersion();
+ static std::string GetOperatingSystemNameAndVersion();
/** -----------------------------------------------------------------
* URL Manipulation Routines
@@ -927,9 +920,9 @@ public:
* and fill protocol as appropriate.
* Return false if the URL does not have the required form, true otherwise.
*/
- static bool ParseURLProtocol( const kwsys_stl::string& URL,
- kwsys_stl::string& protocol,
- kwsys_stl::string& dataglom );
+ static bool ParseURLProtocol( const std::string& URL,
+ std::string& protocol,
+ std::string& dataglom );
/**
* Parse a string (a URL without protocol prefix) with the form:
@@ -938,13 +931,13 @@ public:
* when values are found.
* Return true if the string matches the format; false otherwise.
*/
- static bool ParseURL( const kwsys_stl::string& URL,
- kwsys_stl::string& protocol,
- kwsys_stl::string& username,
- kwsys_stl::string& password,
- kwsys_stl::string& hostname,
- kwsys_stl::string& dataport,
- kwsys_stl::string& datapath );
+ static bool ParseURL( const std::string& URL,
+ std::string& protocol,
+ std::string& username,
+ std::string& password,
+ std::string& hostname,
+ std::string& dataport,
+ std::string& datapath );
private:
/**
@@ -968,10 +961,10 @@ private:
/**
* Actual implementation of ReplaceString.
*/
- static void ReplaceString(kwsys_stl::string& source,
+ static void ReplaceString(std::string& source,
const char* replace,
size_t replaceSize,
- const kwsys_stl::string& with);
+ const std::string& with);
/**
* Actual implementation of FileIsFullPath.
@@ -982,10 +975,10 @@ private:
* Find a filename (file or directory) in the system PATH, with
* optional extra paths.
*/
- static kwsys_stl::string FindName(
- const kwsys_stl::string& name,
- const kwsys_stl::vector<kwsys_stl::string>& path =
- kwsys_stl::vector<kwsys_stl::string>(),
+ static std::string FindName(
+ const std::string& name,
+ const std::vector<std::string>& path =
+ std::vector<std::string>(),
bool no_system_path = false);
@@ -1005,10 +998,4 @@ private:
} // namespace @KWSYS_NAMESPACE@
-/* Undefine temporary macros. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# undef kwsys_stl
-# undef kwsys_ios
-#endif
-
#endif
diff --git a/Source/kwsys/hash_fun.hxx.in b/Source/kwsys/hash_fun.hxx.in
index 6f787dd..4872b51 100644
--- a/Source/kwsys/hash_fun.hxx.in
+++ b/Source/kwsys/hash_fun.hxx.in
@@ -38,8 +38,8 @@
#define @KWSYS_NAMESPACE@_hash_fun_hxx
#include <@KWSYS_NAMESPACE@/Configure.hxx>
-#include <@KWSYS_NAMESPACE@/cstddef> // size_t
-#include <@KWSYS_NAMESPACE@/stl/string> // string
+#include <stddef.h> // size_t
+#include <string>
namespace @KWSYS_NAMESPACE@
{
@@ -55,90 +55,90 @@ inline size_t _stl_hash_string(const char* __s)
return size_t(__h);
}
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<char*> {
size_t operator()(const char* __s) const { return _stl_hash_string(__s); }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<const char*> {
size_t operator()(const char* __s) const { return _stl_hash_string(__s); }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
- struct hash<@KWSYS_NAMESPACE@_stl::string> {
- size_t operator()(const @KWSYS_NAMESPACE@_stl::string & __s) const { return _stl_hash_string(__s.c_str()); }
+template <>
+ struct hash<std::string> {
+ size_t operator()(const std::string & __s) const { return _stl_hash_string(__s.c_str()); }
};
#if !defined(__BORLANDC__)
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
- struct hash<const @KWSYS_NAMESPACE@_stl::string> {
- size_t operator()(const @KWSYS_NAMESPACE@_stl::string & __s) const { return _stl_hash_string(__s.c_str()); }
+template <>
+ struct hash<const std::string> {
+ size_t operator()(const std::string & __s) const { return _stl_hash_string(__s.c_str()); }
};
#endif
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<char> {
size_t operator()(char __x) const { return __x; }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<unsigned char> {
size_t operator()(unsigned char __x) const { return __x; }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<signed char> {
size_t operator()(unsigned char __x) const { return __x; }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<short> {
size_t operator()(short __x) const { return __x; }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<unsigned short> {
size_t operator()(unsigned short __x) const { return __x; }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<int> {
size_t operator()(int __x) const { return __x; }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<unsigned int> {
size_t operator()(unsigned int __x) const { return __x; }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<long> {
size_t operator()(long __x) const { return __x; }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<unsigned long> {
size_t operator()(unsigned long __x) const { return __x; }
};
// use long long or __int64
#if @KWSYS_USE_LONG_LONG@
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<long long> {
size_t operator()(long long __x) const { return __x; }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<unsigned long long> {
size_t operator()(unsigned long long __x) const { return __x; }
};
#elif @KWSYS_USE___INT64@
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<__int64> {
size_t operator()(__int64 __x) const { return __x; }
};
-@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
+template <>
struct hash<unsigned __int64> {
size_t operator()(unsigned __int64 __x) const { return __x; }
};
diff --git a/Source/kwsys/hash_map.hxx.in b/Source/kwsys/hash_map.hxx.in
index 6d4379d..60c7086 100644
--- a/Source/kwsys/hash_map.hxx.in
+++ b/Source/kwsys/hash_map.hxx.in
@@ -39,7 +39,7 @@
#include <@KWSYS_NAMESPACE@/hashtable.hxx>
#include <@KWSYS_NAMESPACE@/hash_fun.hxx>
-#include <@KWSYS_NAMESPACE@/stl/functional> // equal_to
+#include <functional> // equal_to
#if defined(_MSC_VER)
# pragma warning (push)
@@ -58,9 +58,9 @@ namespace @KWSYS_NAMESPACE@
// select1st is an extension: it is not part of the standard.
template <class T1, class T2>
struct hash_select1st:
- public @KWSYS_NAMESPACE@_stl::unary_function<@KWSYS_NAMESPACE@_stl::pair<T1, T2>, T1>
+ public std::unary_function<std::pair<T1, T2>, T1>
{
- const T1& operator()(const @KWSYS_NAMESPACE@_stl::pair<T1, T2>& __x) const
+ const T1& operator()(const std::pair<T1, T2>& __x) const
{ return __x.first; }
};
@@ -68,8 +68,8 @@ struct hash_select1st:
template <class _Key, class _Tp,
class _HashFcn = hash<_Key>,
- class _EqualKey = @KWSYS_NAMESPACE@_stl::equal_to<_Key>,
- class _Alloc = @KWSYS_NAMESPACE@_HASH_DEFAULT_ALLOCATOR(char) >
+ class _EqualKey = std::equal_to<_Key>,
+ class _Alloc = std::allocator<char> >
class hash_map;
template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
@@ -81,7 +81,7 @@ template <class _Key, class _Tp, class _HashFcn, class _EqualKey,
class hash_map
{
private:
- typedef hashtable<@KWSYS_NAMESPACE@_stl::pair<const _Key,_Tp>,_Key,_HashFcn,
+ typedef hashtable<std::pair<const _Key,_Tp>,_Key,_HashFcn,
hash_select1st<const _Key,_Tp>,_EqualKey,_Alloc> _Ht;
_Ht _M_ht;
@@ -119,7 +119,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
-#if @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES
template <class _InputIterator>
hash_map(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
@@ -140,48 +139,14 @@ public:
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
-#else
- hash_map(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-
- hash_map(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-#endif
-
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(hash_map& __hs) { _M_ht.swap(__hs._M_ht); }
- friend bool operator==@KWSYS_NAMESPACE@_CXX_NULL_TEMPLATE_ARGS(const hash_map&,
- const hash_map&);
+ friend bool operator==<>(const hash_map&,
+ const hash_map&);
iterator begin() { return _M_ht.begin(); }
iterator end() { return _M_ht.end(); }
@@ -189,20 +154,12 @@ public:
const_iterator end() const { return _M_ht.end(); }
public:
- @KWSYS_NAMESPACE@_stl::pair<iterator,bool> insert(const value_type& __obj)
+ std::pair<iterator,bool> insert(const value_type& __obj)
{ return _M_ht.insert_unique(__obj); }
-#if @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_unique(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- { _M_ht.insert_unique(__f, __l); }
-#endif
- @KWSYS_NAMESPACE@_stl::pair<iterator,bool> insert_noresize(const value_type& __obj)
+ std::pair<iterator,bool> insert_noresize(const value_type& __obj)
{ return _M_ht.insert_unique_noresize(__obj); }
iterator find(const key_type& __key) { return _M_ht.find(__key); }
@@ -215,9 +172,9 @@ public:
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
- @KWSYS_NAMESPACE@_stl::pair<iterator, iterator> equal_range(const key_type& __key)
+ std::pair<iterator, iterator> equal_range(const key_type& __key)
{ return _M_ht.equal_range(__key); }
- @KWSYS_NAMESPACE@_stl::pair<const_iterator, const_iterator>
+ std::pair<const_iterator, const_iterator>
equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
@@ -260,8 +217,8 @@ swap(hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
template <class _Key, class _Tp,
class _HashFcn = hash<_Key>,
- class _EqualKey = @KWSYS_NAMESPACE@_stl::equal_to<_Key>,
- class _Alloc = @KWSYS_NAMESPACE@_HASH_DEFAULT_ALLOCATOR(char) >
+ class _EqualKey = std::equal_to<_Key>,
+ class _Alloc = std::allocator<char> >
class hash_multimap;
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
@@ -274,7 +231,7 @@ template <class _Key, class _Tp, class _HashFcn, class _EqualKey,
class hash_multimap
{
private:
- typedef hashtable<@KWSYS_NAMESPACE@_stl::pair<const _Key, _Tp>, _Key, _HashFcn,
+ typedef hashtable<std::pair<const _Key, _Tp>, _Key, _HashFcn,
hash_select1st<const _Key, _Tp>, _EqualKey, _Alloc>
_Ht;
_Ht _M_ht;
@@ -313,7 +270,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
-#if @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES
template <class _InputIterator>
hash_multimap(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
@@ -334,48 +290,14 @@ public:
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
-#else
- hash_multimap(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-
- hash_multimap(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-#endif
-
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(hash_multimap& __hs) { _M_ht.swap(__hs._M_ht); }
- friend bool operator==@KWSYS_NAMESPACE@_CXX_NULL_TEMPLATE_ARGS(const hash_multimap&,
- const hash_multimap&);
+ friend bool operator==<>(const hash_multimap&,
+ const hash_multimap&);
iterator begin() { return _M_ht.begin(); }
iterator end() { return _M_ht.end(); }
@@ -385,17 +307,9 @@ public:
public:
iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
-#if @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_equal(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- { _M_ht.insert_equal(__f, __l); }
-#endif
iterator insert_noresize(const value_type& __obj)
{ return _M_ht.insert_equal_noresize(__obj); }
@@ -405,9 +319,9 @@ public:
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
- @KWSYS_NAMESPACE@_stl::pair<iterator, iterator> equal_range(const key_type& __key)
+ std::pair<iterator, iterator> equal_range(const key_type& __key)
{ return _M_ht.equal_range(__key); }
- @KWSYS_NAMESPACE@_stl::pair<const_iterator, const_iterator>
+ std::pair<const_iterator, const_iterator>
equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
diff --git a/Source/kwsys/hash_set.hxx.in b/Source/kwsys/hash_set.hxx.in
index 5ee01a5..c314979 100644
--- a/Source/kwsys/hash_set.hxx.in
+++ b/Source/kwsys/hash_set.hxx.in
@@ -39,7 +39,7 @@
#include <@KWSYS_NAMESPACE@/hashtable.hxx>
#include <@KWSYS_NAMESPACE@/hash_fun.hxx>
-#include <@KWSYS_NAMESPACE@/stl/functional> // equal_to
+#include <functional> // equal_to
#if defined(_MSC_VER)
# pragma warning (push)
@@ -57,7 +57,7 @@ namespace @KWSYS_NAMESPACE@
// identity is an extension: it is not part of the standard.
template <class _Tp>
-struct _Identity : public @KWSYS_NAMESPACE@_stl::unary_function<_Tp,_Tp>
+struct _Identity : public std::unary_function<_Tp,_Tp>
{
const _Tp& operator()(const _Tp& __x) const { return __x; }
};
@@ -66,8 +66,8 @@ struct _Identity : public @KWSYS_NAMESPACE@_stl::unary_function<_Tp,_Tp>
template <class _Value,
class _HashFcn = hash<_Value>,
- class _EqualKey = @KWSYS_NAMESPACE@_stl::equal_to<_Value>,
- class _Alloc = @KWSYS_NAMESPACE@_HASH_DEFAULT_ALLOCATOR(char) >
+ class _EqualKey = std::equal_to<_Value>,
+ class _Alloc = std::allocator<char> >
class hash_set;
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
@@ -116,7 +116,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
-#if @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES
template <class _InputIterator>
hash_set(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
@@ -136,40 +135,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
-#else
-
- hash_set(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-
- hash_set(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-#endif
public:
size_type size() const { return _M_ht.size(); }
@@ -177,43 +142,35 @@ public:
bool empty() const { return _M_ht.empty(); }
void swap(hash_set& __hs) { _M_ht.swap(__hs._M_ht); }
- friend bool operator==@KWSYS_NAMESPACE@_CXX_NULL_TEMPLATE_ARGS(const hash_set&,
- const hash_set&);
+ friend bool operator==<>(const hash_set&,
+ const hash_set&);
iterator begin() const { return _M_ht.begin(); }
iterator end() const { return _M_ht.end(); }
public:
- @KWSYS_NAMESPACE@_stl::pair<iterator, bool> insert(const value_type& __obj)
+ std::pair<iterator, bool> insert(const value_type& __obj)
{
typedef typename _Ht::iterator _Ht_iterator;
- @KWSYS_NAMESPACE@_stl::pair<_Ht_iterator, bool> __p = _M_ht.insert_unique(__obj);
- return @KWSYS_NAMESPACE@_stl::pair<iterator,bool>(__p.first, __p.second);
+ std::pair<_Ht_iterator, bool> __p = _M_ht.insert_unique(__obj);
+ return std::pair<iterator,bool>(__p.first, __p.second);
}
-#if @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_unique(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- {_M_ht.insert_unique(__f, __l); }
-#endif
- @KWSYS_NAMESPACE@_stl::pair<iterator, bool> insert_noresize(const value_type& __obj)
+ std::pair<iterator, bool> insert_noresize(const value_type& __obj)
{
typedef typename _Ht::iterator _Ht_iterator;
- @KWSYS_NAMESPACE@_stl::pair<_Ht_iterator, bool> __p =
+ std::pair<_Ht_iterator, bool> __p =
_M_ht.insert_unique_noresize(__obj);
- return @KWSYS_NAMESPACE@_stl::pair<iterator, bool>(__p.first, __p.second);
+ return std::pair<iterator, bool>(__p.first, __p.second);
}
iterator find(const key_type& __key) const { return _M_ht.find(__key); }
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
- @KWSYS_NAMESPACE@_stl::pair<iterator, iterator> equal_range(const key_type& __key) const
+ std::pair<iterator, iterator> equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
@@ -254,8 +211,8 @@ swap(hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
template <class _Value,
class _HashFcn = hash<_Value>,
- class _EqualKey = @KWSYS_NAMESPACE@_stl::equal_to<_Value>,
- class _Alloc = @KWSYS_NAMESPACE@_HASH_DEFAULT_ALLOCATOR(char) >
+ class _EqualKey = std::equal_to<_Value>,
+ class _Alloc = std::allocator<char> >
class hash_multiset;
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
@@ -305,7 +262,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
-#if @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES
template <class _InputIterator>
hash_multiset(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
@@ -325,40 +281,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
-#else
-
- hash_multiset(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-
- hash_multiset(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-#endif
public:
size_type size() const { return _M_ht.size(); }
@@ -366,8 +288,8 @@ public:
bool empty() const { return _M_ht.empty(); }
void swap(hash_multiset& hs) { _M_ht.swap(hs._M_ht); }
- friend bool operator==@KWSYS_NAMESPACE@_CXX_NULL_TEMPLATE_ARGS(const hash_multiset&,
- const hash_multiset&);
+ friend bool operator==<>(const hash_multiset&,
+ const hash_multiset&);
iterator begin() const { return _M_ht.begin(); }
iterator end() const { return _M_ht.end(); }
@@ -375,17 +297,9 @@ public:
public:
iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
-#if @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_equal(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- { _M_ht.insert_equal(__f, __l); }
-#endif
iterator insert_noresize(const value_type& __obj)
{ return _M_ht.insert_equal_noresize(__obj); }
@@ -393,7 +307,7 @@ public:
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
- @KWSYS_NAMESPACE@_stl::pair<iterator, iterator> equal_range(const key_type& __key) const
+ std::pair<iterator, iterator> equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
diff --git a/Source/kwsys/hashtable.hxx.in b/Source/kwsys/hashtable.hxx.in
index 7e7dc42..9a20226 100644
--- a/Source/kwsys/hashtable.hxx.in
+++ b/Source/kwsys/hashtable.hxx.in
@@ -44,13 +44,13 @@
#include <@KWSYS_NAMESPACE@/Configure.hxx>
-#include <@KWSYS_NAMESPACE@/cstddef> // size_t
-#include <@KWSYS_NAMESPACE@/stl/algorithm> // lower_bound
-#include <@KWSYS_NAMESPACE@/stl/functional> // unary_function
-#include <@KWSYS_NAMESPACE@/stl/iterator> // iterator_traits
-#include <@KWSYS_NAMESPACE@/stl/memory> // allocator
-#include <@KWSYS_NAMESPACE@/stl/utility> // pair
-#include <@KWSYS_NAMESPACE@/stl/vector> // vector
+#include <stddef.h> // size_t
+#include <algorithm> // lower_bound
+#include <functional> // unary_function
+#include <iterator> // iterator_traits
+#include <memory> // allocator
+#include <utility> // pair
+#include <vector> // vector
#if defined(_MSC_VER)
# pragma warning (push)
@@ -73,238 +73,9 @@
# endif
#endif
-#if @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_TEMPLATE
-# define @KWSYS_NAMESPACE@_HASH_DEFAULT_ALLOCATOR(T) @KWSYS_NAMESPACE@_stl::allocator< T >
-#elif @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_NONTEMPLATE
-# define @KWSYS_NAMESPACE@_HASH_DEFAULT_ALLOCATOR(T) @KWSYS_NAMESPACE@_stl::allocator
-#else
-# define @KWSYS_NAMESPACE@_HASH_DEFAULT_ALLOCATOR(T) @KWSYS_NAMESPACE@_stl::alloc
-#endif
-
-#if @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_OBJECTS
-# define @KWSYS_NAMESPACE@_HASH_BUCKETS_INIT(__a) _M_buckets(__a)
-# define @KWSYS_NAMESPACE@_HASH_BUCKETS_GET_ALLOCATOR(__b) , __b.get_allocator()
-#else
-# define @KWSYS_NAMESPACE@_HASH_BUCKETS_INIT(__a) _M_buckets()
-# define @KWSYS_NAMESPACE@_HASH_BUCKETS_GET_ALLOCATOR(__b)
-#endif
-
namespace @KWSYS_NAMESPACE@
{
-//----------------------------------------------------------------------------
-// Define an allocator adaptor for platforms that do not provide an
-// allocator with the rebind member.
-#if !@KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_REBIND
-
-// Utility functions to convert item counts.
-inline size_t hash_sizeof(void*) { return sizeof(char); }
-inline size_t hash_sizeof(const void*) { return sizeof(char); }
-template <class TPtr> inline size_t hash_sizeof(TPtr p)
-{
- static_cast<void>(p);
- return sizeof(*p);
-}
-template <class POut, class PIn, class TSize>
-inline TSize hash_allocator_n(POut out, PIn in, TSize n)
-{
- return n*(hash_sizeof(out)/hash_sizeof(in) +
- (hash_sizeof(out)%hash_sizeof(in)>0));
-}
-
-// Define an allocation method to use the native allocator with
-// the proper signature. The following signatures of the allocate
-// method are used on various STL implementations:
-// pointer allocate(size_type, const void* hint)
-// pointer allocate(size_type)
-// static pointer allocate(size_type, const void* hint)
-// static pointer allocate(size_type)
-// Where pointer might be a real type or void*.
-// This set of overloads decodes the signature for a particular STL.
-// The extra three int/long arguments will favor certain signatures
-// over others in the case that multiple are present to avoid
-// ambiguity errors.
-template <class TAlloc, class PIn, class TSize, class THint, class POut>
-inline void hash_allocate(TAlloc* a, PIn (TAlloc::*allocate)(TSize, THint),
- TSize n_out, const void* hint, POut& out,
- int, int, int)
-{
- TSize n_in = hash_allocator_n(POut(), PIn(), n_out);
- void* vout = (a->*allocate)(n_in, const_cast<THint>(hint));
- out = static_cast<POut>(vout);
-}
-
-template <class TAlloc, class PIn, class TSize, class POut>
-inline void hash_allocate(TAlloc* a, PIn (TAlloc::*allocate)(TSize),
- TSize n_out, const void*, POut& out,
- int, int, long)
-{
- TSize n_in = hash_allocator_n(POut(), PIn(), n_out);
- void* vout = (a->*allocate)(n_in);
- out = static_cast<POut>(vout);
-}
-
-template <class PIn, class TSize, class THint, class POut>
-inline void hash_allocate(void*, PIn (*allocate)(TSize, THint),
- TSize n_out, const void* hint, POut& out,
- int, long, long)
-{
- TSize n_in = hash_allocator_n(POut(), PIn(), n_out);
- void* vout = allocate(n_in, const_cast<THint>(hint));
- out = static_cast<POut>(vout);
-}
-
-template <class PIn, class TSize, class POut>
-inline void hash_allocate(void*, PIn (*allocate)(TSize),
- TSize n_out, const void*, POut& out,
- long, long, long)
-{
- TSize n_in = hash_allocator_n(POut(), PIn(), n_out);
- void* vout = allocate(n_in);
- out = static_cast<POut>(vout);
-}
-
-// Define a deallocation method to use the native allocator with
-// the proper signature. The following signatures of the deallocate
-// method are used on various STL implementations:
-// void deallocate(pointer, size_type)
-// void deallocate(pointer)
-// static void deallocate(pointer, size_type)
-// static void deallocate(pointer)
-// Where pointer might be a real type or void*.
-// This set of overloads decodes the signature for a particular STL.
-// The extra three int/long arguments will favor certain signatures
-// over others in the case that multiple are present to avoid
-// ambiguity errors.
-template <class TAlloc, class PIn, class TSize, class PInReal, class POut>
-inline void hash_deallocate(TAlloc* a, void (TAlloc::*deallocate)(PIn, TSize),
- PInReal, POut p, TSize n_out, int, int, int)
-{
- TSize n_in = hash_allocator_n(POut(), PInReal(), n_out);
- void* vout = p;
- (a->*deallocate)(static_cast<PIn>(vout), n_in);
-}
-
-template <class TAlloc, class PIn, class TSize, class PInReal, class POut>
-inline void hash_deallocate(TAlloc* a, void (TAlloc::*deallocate)(PIn),
- PInReal, POut p, TSize, int, int, long)
-{
- void* vout = p;
- (a->*deallocate)(static_cast<PIn>(vout));
-}
-
-template <class PIn, class TSize, class PInReal, class POut>
-inline void hash_deallocate(void*, void (*deallocate)(PIn, TSize),
- PInReal, POut p, TSize n_out, int, long, long)
-{
- TSize n_in = hash_allocator_n(POut(), PInReal(), n_out);
- void* vout = p;
- deallocate(static_cast<PIn>(vout), n_in);
-}
-
-template <class PIn, class TSize, class PInReal, class POut>
-inline void hash_deallocate(void*, void (*deallocate)(PIn),
- PInReal, POut p, TSize, long, long, long)
-{
- void* vout = p;
- deallocate(static_cast<PIn>(vout));
-}
-
-// Use the same four overloads as hash_allocate to decode the type
-// really used for allocation. This is passed as PInReal to the
-// deallocate functions so that hash_allocator_n has the proper size.
-template <class TAlloc, class PIn, class TSize, class THint>
-inline PIn hash_allocate_type(PIn (TAlloc::*)(TSize, THint),
- int, int, int) { return 0; }
-template <class TAlloc, class PIn, class TSize>
-inline PIn hash_allocate_type(PIn (TAlloc::*)(TSize),
- int, int, long) { return 0; }
-template <class PIn, class TSize, class THint>
-inline PIn hash_allocate_type(PIn (*)(TSize, THint),
- int, long, long) { return 0; }
-template <class PIn, class TSize>
-inline PIn hash_allocate_type(PIn (*)(TSize),
- long, long, long) { return 0; }
-
-// Define the comparison operators in terms of a base type to avoid
-// needing templated versions.
-class hash_allocator_base {};
-inline bool operator==(const hash_allocator_base&,
- const hash_allocator_base&) throw() { return true; }
-inline bool operator!=(const hash_allocator_base&,
- const hash_allocator_base&) throw() { return false; }
-
-// Define the allocator template.
-template <class T, class Alloc>
-class hash_allocator: public hash_allocator_base
-{
-private:
- // Store the real allocator privately.
- typedef Alloc alloc_type;
- alloc_type alloc_;
-
-public:
- // Standard allocator interface.
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef T* pointer;
- typedef const T* const_pointer;
- typedef T& reference;
- typedef const T& const_reference;
- typedef T value_type;
-
- hash_allocator() throw(): alloc_() {}
- hash_allocator(const hash_allocator_base&) throw() : alloc_() {}
- hash_allocator(const hash_allocator& a) throw() : alloc_(a.alloc_) {}
- hash_allocator(const alloc_type& a) throw() : alloc_(a) {}
- ~hash_allocator() throw() {}
-# if @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES
- template <class U>
- struct rebind { typedef hash_allocator<U, alloc_type> other; };
-# endif
- pointer address(reference x) const { return &x; }
- const_pointer address(const_reference x) const { return &x; }
- typedef void* void_pointer;
- typedef const void* const_void_pointer;
- pointer allocate(size_type n=1, const_void_pointer hint = 0)
- {
- if(n)
- {
- pointer p;
- hash_allocate(&alloc_, &alloc_type::allocate, n, hint, p, 1, 1, 1);
- return p;
- }
- else
- {
- return 0;
- }
- }
- void deallocate(pointer p, size_type n=1)
- {
- if(n)
- {
- hash_deallocate(&alloc_, &alloc_type::deallocate,
- hash_allocate_type(&alloc_type::allocate, 1, 1, 1),
- p, n, 1, 1, 1);
- }
- }
-#if @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
- size_type max_size(size_type s) const throw()
- {
- return alloc_.max_size(s);
- }
-#else
- size_type max_size() const throw()
- {
- size_type n = alloc_.max_size() / sizeof(value_type);
- return n>0? n:1;
- }
-#endif
- void construct(pointer p, const value_type& val) { new (p) value_type(val); }
- void destroy(pointer p) { (void)p; p->~value_type(); }
-};
-#endif
-
template <class _Val>
struct _Hashtable_node
{
@@ -317,7 +88,7 @@ private:
template <class _Val, class _Key, class _HashFcn,
class _ExtractKey, class _EqualKey,
- class _Alloc = @KWSYS_NAMESPACE@_HASH_DEFAULT_ALLOCATOR(char) >
+ class _Alloc = std::allocator<char> >
class hashtable;
template <class _Val, class _Key, class _HashFcn,
@@ -341,7 +112,7 @@ struct _Hashtable_iterator {
const_iterator;
typedef _Hashtable_node<_Val> _Node;
- typedef @KWSYS_NAMESPACE@_stl::forward_iterator_tag iterator_category;
+ typedef std::forward_iterator_tag iterator_category;
typedef _Val value_type;
typedef ptrdiff_t difference_type;
typedef size_t size_type;
@@ -378,7 +149,7 @@ struct _Hashtable_const_iterator {
const_iterator;
typedef _Hashtable_node<_Val> _Node;
- typedef @KWSYS_NAMESPACE@_stl::forward_iterator_tag iterator_category;
+ typedef std::forward_iterator_tag iterator_category;
typedef _Val value_type;
typedef ptrdiff_t difference_type;
typedef size_t size_type;
@@ -427,7 +198,7 @@ static inline size_t _stl_next_prime(size_t __n)
{
const unsigned long* __first = get_stl_prime_list();
const unsigned long* __last = get_stl_prime_list() + (int)_stl_num_primes;
- const unsigned long* pos = @KWSYS_NAMESPACE@_stl::lower_bound(__first, __last, __n);
+ const unsigned long* pos = std::lower_bound(__first, __last, __n);
return pos == __last ? *(__last - 1) : *pos;
}
@@ -470,27 +241,13 @@ public:
private:
typedef _Hashtable_node<_Val> _Node;
-#if @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_REBIND
public:
typedef typename _Alloc::template rebind<_Val>::other allocator_type;
allocator_type get_allocator() const { return _M_node_allocator; }
private:
typedef typename _Alloc::template rebind<_Node>::other _M_node_allocator_type;
typedef typename _Alloc::template rebind<_Node*>::other _M_node_ptr_allocator_type;
- typedef @KWSYS_NAMESPACE@_stl::vector<_Node*,_M_node_ptr_allocator_type> _M_buckets_type;
-#else
-public:
- typedef hash_allocator<_Val, _Alloc> allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-private:
- typedef hash_allocator<_Node, _Alloc> _M_node_allocator_type;
-# if @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_OBJECTS
- typedef hash_allocator<_Node*, _Alloc> _M_node_ptr_allocator_type;
-# else
- typedef _Alloc _M_node_ptr_allocator_type;
-# endif
- typedef @KWSYS_NAMESPACE@_stl::vector<_Node*,_M_node_ptr_allocator_type> _M_buckets_type;
-#endif
+ typedef std::vector<_Node*,_M_node_ptr_allocator_type> _M_buckets_type;
private:
_M_node_allocator_type _M_node_allocator;
@@ -525,7 +282,7 @@ public:
_M_hash(__hf),
_M_equals(__eql),
_M_get_key(__ext),
- @KWSYS_NAMESPACE@_HASH_BUCKETS_INIT(__a),
+ _M_buckets(__a),
_M_num_elements(0)
{
_M_initialize_buckets(__n);
@@ -539,7 +296,7 @@ public:
_M_hash(__hf),
_M_equals(__eql),
_M_get_key(_ExtractKey()),
- @KWSYS_NAMESPACE@_HASH_BUCKETS_INIT(__a),
+ _M_buckets(__a),
_M_num_elements(0)
{
_M_initialize_buckets(__n);
@@ -550,7 +307,7 @@ public:
_M_hash(__ht._M_hash),
_M_equals(__ht._M_equals),
_M_get_key(__ht._M_get_key),
- @KWSYS_NAMESPACE@_HASH_BUCKETS_INIT(__ht.get_allocator()),
+ _M_buckets(__ht.get_allocator()),
_M_num_elements(0)
{
_M_copy_from(__ht);
@@ -576,11 +333,11 @@ public:
void swap(hashtable& __ht)
{
- @KWSYS_NAMESPACE@_stl::swap(_M_hash, __ht._M_hash);
- @KWSYS_NAMESPACE@_stl::swap(_M_equals, __ht._M_equals);
- @KWSYS_NAMESPACE@_stl::swap(_M_get_key, __ht._M_get_key);
+ std::swap(_M_hash, __ht._M_hash);
+ std::swap(_M_equals, __ht._M_equals);
+ std::swap(_M_get_key, __ht._M_get_key);
_M_buckets.swap(__ht._M_buckets);
- @KWSYS_NAMESPACE@_stl::swap(_M_num_elements, __ht._M_num_elements);
+ std::swap(_M_num_elements, __ht._M_num_elements);
}
iterator begin()
@@ -603,8 +360,8 @@ public:
const_iterator end() const { return const_iterator(0, this); }
- friend bool operator==@KWSYS_NAMESPACE@_CXX_NULL_TEMPLATE_ARGS(const hashtable&,
- const hashtable&);
+ friend bool operator==<>(const hashtable&,
+ const hashtable&);
public:
@@ -621,7 +378,7 @@ public:
return __result;
}
- @KWSYS_NAMESPACE@_stl::pair<iterator, bool> insert_unique(const value_type& __obj)
+ std::pair<iterator, bool> insert_unique(const value_type& __obj)
{
resize(_M_num_elements + 1);
return insert_unique_noresize(__obj);
@@ -633,38 +390,26 @@ public:
return insert_equal_noresize(__obj);
}
- @KWSYS_NAMESPACE@_stl::pair<iterator, bool> insert_unique_noresize(const value_type& __obj);
+ std::pair<iterator, bool> insert_unique_noresize(const value_type& __obj);
iterator insert_equal_noresize(const value_type& __obj);
-#if @KWSYS_NAMESPACE@_STL_HAS_ITERATOR_TRAITS
-# define @KWSYS_NAMESPACE@_HASH_ITERATOR_CATEGORY(T,I) \
- typename @KWSYS_NAMESPACE@_stl::iterator_traits< T >::iterator_category()
-#elif @KWSYS_NAMESPACE@_STL_HAS_ITERATOR_CATEGORY
-# define @KWSYS_NAMESPACE@_HASH_ITERATOR_CATEGORY(T,I) \
- @KWSYS_NAMESPACE@_stl::iterator_category( I )
-#elif @KWSYS_NAMESPACE@_STL_HAS___ITERATOR_CATEGORY
-# define @KWSYS_NAMESPACE@_HASH_ITERATOR_CATEGORY(T,I) \
- @KWSYS_NAMESPACE@_stl::__iterator_category( I )
-#endif
-
-#if @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES && defined(@KWSYS_NAMESPACE@_HASH_ITERATOR_CATEGORY)
template <class _InputIterator>
void insert_unique(_InputIterator __f, _InputIterator __l)
{
insert_unique(__f, __l,
- @KWSYS_NAMESPACE@_HASH_ITERATOR_CATEGORY(_InputIterator, __f));
+ typename std::iterator_traits<_InputIterator>::iterator_category());
}
template <class _InputIterator>
void insert_equal(_InputIterator __f, _InputIterator __l)
{
insert_equal(__f, __l,
- @KWSYS_NAMESPACE@_HASH_ITERATOR_CATEGORY(_InputIterator, __f));
+ typename std::iterator_traits<_InputIterator>::iterator_category());
}
template <class _InputIterator>
void insert_unique(_InputIterator __f, _InputIterator __l,
- @KWSYS_NAMESPACE@_stl::input_iterator_tag)
+ std::input_iterator_tag)
{
for ( ; __f != __l; ++__f)
insert_unique(*__f);
@@ -672,7 +417,7 @@ public:
template <class _InputIterator>
void insert_equal(_InputIterator __f, _InputIterator __l,
- @KWSYS_NAMESPACE@_stl::input_iterator_tag)
+ std::input_iterator_tag)
{
for ( ; __f != __l; ++__f)
insert_equal(*__f);
@@ -680,10 +425,10 @@ public:
template <class _ForwardIterator>
void insert_unique(_ForwardIterator __f, _ForwardIterator __l,
- @KWSYS_NAMESPACE@_stl::forward_iterator_tag)
+ std::forward_iterator_tag)
{
size_type __n = 0;
- @KWSYS_NAMESPACE@_stl::distance(__f, __l, __n);
+ std::distance(__f, __l, __n);
resize(_M_num_elements + __n);
for ( ; __n > 0; --__n, ++__f)
insert_unique_noresize(*__f);
@@ -691,51 +436,15 @@ public:
template <class _ForwardIterator>
void insert_equal(_ForwardIterator __f, _ForwardIterator __l,
- @KWSYS_NAMESPACE@_stl::forward_iterator_tag)
+ std::forward_iterator_tag)
{
size_type __n = 0;
- @KWSYS_NAMESPACE@_stl::distance(__f, __l, __n);
+ std::distance(__f, __l, __n);
resize(_M_num_elements + __n);
for ( ; __n > 0; --__n, ++__f)
insert_equal_noresize(*__f);
}
-#else
- void insert_unique(const value_type* __f, const value_type* __l)
- {
- size_type __n = __l - __f;
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_unique_noresize(*__f);
- }
-
- void insert_equal(const value_type* __f, const value_type* __l)
- {
- size_type __n = __l - __f;
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_equal_noresize(*__f);
- }
-
- void insert_unique(const_iterator __f, const_iterator __l)
- {
- size_type __n = 0;
- @KWSYS_NAMESPACE@_stl::distance(__f, __l, __n);
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_unique_noresize(*__f);
- }
-
- void insert_equal(const_iterator __f, const_iterator __l)
- {
- size_type __n = 0;
- @KWSYS_NAMESPACE@_stl::distance(__f, __l, __n);
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_equal_noresize(*__f);
- }
-#endif
-
reference find_or_insert(const value_type& __obj);
iterator find(const key_type& __key)
@@ -771,10 +480,10 @@ public:
return __result;
}
- @KWSYS_NAMESPACE@_stl::pair<iterator, iterator>
+ std::pair<iterator, iterator>
equal_range(const key_type& __key);
- @KWSYS_NAMESPACE@_stl::pair<const_iterator, const_iterator>
+ std::pair<const_iterator, const_iterator>
equal_range(const key_type& __key) const;
size_type erase(const key_type& __key);
@@ -936,7 +645,7 @@ inline void swap(hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht1,
}
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-@KWSYS_NAMESPACE@_stl::pair<@KWSYS_NAMESPACE@_CXX_DECL_TYPENAME hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator, bool>
+std::pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator, bool>
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::insert_unique_noresize(const value_type& __obj)
{
@@ -945,13 +654,13 @@ hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
- return @KWSYS_NAMESPACE@_stl::pair<iterator, bool>(iterator(__cur, this), false);
+ return std::pair<iterator, bool>(iterator(__cur, this), false);
_Node* __tmp = _M_new_node(__obj);
__tmp->_M_next = __first;
_M_buckets[__n] = __tmp;
++_M_num_elements;
- return @KWSYS_NAMESPACE@_stl::pair<iterator, bool>(iterator(__tmp, this), true);
+ return std::pair<iterator, bool>(iterator(__tmp, this), true);
}
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
@@ -999,11 +708,11 @@ hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::find_or_insert(const value_type& __obj)
}
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-@KWSYS_NAMESPACE@_stl::pair<@KWSYS_NAMESPACE@_CXX_DECL_TYPENAME hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator,
- @KWSYS_NAMESPACE@_CXX_DECL_TYPENAME hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator>
+std::pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator,
+ typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator>
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::equal_range(const key_type& __key)
{
- typedef @KWSYS_NAMESPACE@_stl::pair<iterator, iterator> _Pii;
+ typedef std::pair<iterator, iterator> _Pii;
const size_type __n = _M_bkt_num_key(__key);
for (_Node* __first = _M_buckets[__n]; __first; __first = __first->_M_next)
@@ -1021,12 +730,12 @@ hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::equal_range(const key_type& __key)
}
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-@KWSYS_NAMESPACE@_stl::pair<@KWSYS_NAMESPACE@_CXX_DECL_TYPENAME hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator,
- @KWSYS_NAMESPACE@_CXX_DECL_TYPENAME hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator>
+std::pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator,
+ typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator>
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::equal_range(const key_type& __key) const
{
- typedef @KWSYS_NAMESPACE@_stl::pair<const_iterator, const_iterator> _Pii;
+ typedef std::pair<const_iterator, const_iterator> _Pii;
const size_type __n = _M_bkt_num_key(__key);
for (const _Node* __first = _M_buckets[__n] ;
@@ -1164,8 +873,8 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
const size_type __n = _M_next_size(__num_elements_hint);
if (__n > __old_n) {
_M_buckets_type __tmp(
- __n, (_Node*)(0)
- @KWSYS_NAMESPACE@_HASH_BUCKETS_GET_ALLOCATOR(_M_buckets));
+ __n, (_Node*)(0),
+ _M_buckets.get_allocator());
try {
for (size_type __bucket = 0; __bucket < __old_n; ++__bucket) {
_Node* __first = _M_buckets[__bucket];
@@ -1274,14 +983,6 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
} // namespace @KWSYS_NAMESPACE@
-// Normally the comparison operators should be found in the @KWSYS_NAMESPACE@
-// namespace by argument dependent lookup. For compilers that do not
-// support it we must bring them into the global namespace now.
-#if !@KWSYS_NAMESPACE@_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
-using @KWSYS_NAMESPACE@::operator==;
-using @KWSYS_NAMESPACE@::operator!=;
-#endif
-
// Undo warning suppression.
#if defined(__clang__) && defined(__has_warning)
# if __has_warning("-Wdeprecated")
diff --git a/Source/kwsys/kwsysPlatformTestsCXX.cxx b/Source/kwsys/kwsysPlatformTestsCXX.cxx
index 1596fe4..94579b3 100644
--- a/Source/kwsys/kwsysPlatformTestsCXX.cxx
+++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx
@@ -9,110 +9,11 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
-// Setup for tests that use result of stl namespace test.
-#if defined(KWSYS_STL_HAVE_STD)
-# if KWSYS_STL_HAVE_STD
-# define kwsys_stl std
-# else
-# define kwsys_stl
-# endif
-#endif
-
-// Setup for tests that use iostreams.
-#if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD)
-# if defined(_MSC_VER)
-# pragma warning (push,1)
-# endif
-# if KWSYS_IOS_USE_ANSI
-# include <iostream>
-# else
-# include <iostream.h>
-# endif
-# if defined(_MSC_VER)
-# pragma warning (pop)
-# endif
-# if KWSYS_IOS_HAVE_STD
-# define kwsys_ios std
-# else
-# define kwsys_ios
-# endif
-#endif
-
-#ifdef TEST_KWSYS_STL_HAVE_STD
-#include <list>
-void f(std ::list<int>*) {}
-int main() { return 0; }
-#endif
-
-#ifdef TEST_KWSYS_IOS_USE_ANSI
-#include <iosfwd>
-int main() { return 0; }
-#endif
-
-#ifdef TEST_KWSYS_IOS_HAVE_STD
-#include <iosfwd>
-void f(std ::ostream*) {}
-int main() { return 0; }
-#endif
-
-#ifdef TEST_KWSYS_IOS_USE_SSTREAM
-#include <sstream>
-#if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96
-# error "GCC 2.96 stringstream is buggy"
-#endif
-int main()
-{
- std ::ostringstream ostr;
- ostr << "hello";
- if(ostr.str().size() == 5)
- {
- return 0;
- }
- return -1;
-}
-#endif
-
-#ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H
-#include <strstream.h>
-int main() { return 0; }
-#endif
-
-#ifdef TEST_KWSYS_IOS_USE_STRSTREA_H
-#include <strstrea.h>
-int main() { return 0; }
-#endif
-
-#ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM
-# include <iostream.h>
-# include <string>
-void f(ostream& os, const kwsys_stl::string& s) { os << s; }
-int main() { return 0; }
-#endif
-
-#ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM
-# include <iostream.h>
-# include <string>
-void f(istream& is, kwsys_stl::string& s) { is >> s; }
-int main() { return 0; }
-#endif
-
-#ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR
-# include <string>
-bool f(const kwsys_stl::string& s) { return s != ""; }
-int main() { return 0; }
-#endif
-
#ifdef TEST_KWSYS_CXX_HAS_CSTDIO
#include <cstdio>
int main() { return 0; }
#endif
-#ifdef TEST_KWSYS_CXX_HAS_CSTDDEF
-#include <cstddef>
-void f(size_t) {}
-int main() { return 0; }
-#endif
-
#ifdef TEST_KWSYS_CXX_HAS_LONG_LONG
long long f(long long n) { return n; }
int main()
@@ -131,150 +32,6 @@ int main()
}
#endif
-#ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
-template <class T> class A;
-template <class T> int f(A<T>&);
-template <class T> class A
-{
-public:
- // "friend int f<>(A<T>&)" would conform
- friend int f(A<T>&);
-private:
- int x;
-};
-
-template <class T> int f(A<T>& a) { return a.x = 0; }
-template int f(A<int>&);
-
-int main()
-{
- A<int> a;
- return f(a);
-}
-#endif
-
-#ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES
-template <class U>
-class A
-{
-public:
- U u;
- A(): u(0) {}
- template <class V> V m(V* p) { return *p = u; }
-};
-
-int main()
-{
- A<short> a;
- int s = 1;
- return a.m(&s);
-}
-#endif
-
-#ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION
-template <class T> struct A {};
-template <> struct A<int*>
-{
- static int f() { return 0; }
-};
-int main() { return A<int*>::f(); }
-#endif
-
-#ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
-namespace N
-{
- class A {};
- int f(A*) { return 0; }
-}
-void f(void*);
-int main()
-{
- N::A* a = 0;
- return f(a);
-}
-#endif
-
-#ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS
-#include <iterator>
-#include <list>
-void f(kwsys_stl::iterator_traits<kwsys_stl::list<int>::iterator>::iterator_category const&) {}
-int main() { return 0; }
-#endif
-
-#ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY
-#include <iterator>
-#include <list>
-void f(kwsys_stl::list<int>::iterator x) { kwsys_stl::iterator_category(x); }
-int main() { return 0; }
-#endif
-
-#ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY
-#include <iterator>
-#include <list>
-void f(kwsys_stl::list<int>::iterator x) { kwsys_stl::__iterator_category(x); }
-int main() { return 0; }
-#endif
-
-#ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
-#include <memory>
-template <class Alloc>
-void f(const Alloc&)
-{
- typedef typename Alloc::size_type alloc_size_type;
-}
-int main()
-{
- f(kwsys_stl::allocator<char>());
- return 0;
-}
-#endif
-
-#ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
-#include <memory>
-void f(kwsys_stl::allocator::size_type const&) {}
-int main() { return 0; }
-#endif
-
-#ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND
-#include <memory>
-template <class T, class Alloc>
-void f(const T&, const Alloc&)
-{
- typedef typename Alloc::template rebind<T>::other alloc_type;
-}
-int main()
-{
- f(0, kwsys_stl::allocator<char>());
- return 0;
-}
-#endif
-
-#ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
-#include <memory>
-void f(kwsys_stl::allocator<char> const& a)
-{
- a.max_size(sizeof(int));
-}
-int main()
-{
- f(kwsys_stl::allocator<char>());
- return 0;
-}
-#endif
-
-#ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS
-#include <vector>
-void f(kwsys_stl::vector<int> const& v1)
-{
- kwsys_stl::vector<int>(1, 1, v1.get_allocator());
-}
-int main()
-{
- f(kwsys_stl::vector<int>());
- return 0;
-}
-#endif
-
#ifdef TEST_KWSYS_STAT_HAS_ST_MTIM
#include <sys/types.h>
#include <sys/stat.h>
@@ -323,62 +80,55 @@ int main()
}
#endif
-#ifdef TEST_KWSYS_IOS_HAVE_BINARY
-int test_binary(int, ...)
-{
- return 0;
-}
-int main()
-{
- return test_binary(1, kwsys_ios::ios::binary);
-}
-#endif
-
#ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG
-int test_istream(kwsys_ios::istream& is, long long& x)
+# include <iostream>
+int test_istream(std::istream& is, long long& x)
{
return (is >> x)? 1:0;
}
int main()
{
long long x = 0;
- return test_istream(kwsys_ios::cin, x);
+ return test_istream(std::cin, x);
}
#endif
#ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG
-int test_ostream(kwsys_ios::ostream& os, long long x)
+# include <iostream>
+int test_ostream(std::ostream& os, long long x)
{
return (os << x)? 1:0;
}
int main()
{
long long x = 0;
- return test_ostream(kwsys_ios::cout, x);
+ return test_ostream(std::cout, x);
}
#endif
#ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64
-int test_istream(kwsys_ios::istream& is, __int64& x)
+# include <iostream>
+int test_istream(std::istream& is, __int64& x)
{
return (is >> x)? 1:0;
}
int main()
{
__int64 x = 0;
- return test_istream(kwsys_ios::cin, x);
+ return test_istream(std::cin, x);
}
#endif
#ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64
-int test_ostream(kwsys_ios::ostream& os, __int64 x)
+# include <iostream>
+int test_ostream(std::ostream& os, __int64 x)
{
return (os << x)? 1:0;
}
int main()
{
__int64 x = 0;
- return test_ostream(kwsys_ios::cout, x);
+ return test_ostream(std::cout, x);
}
#endif
diff --git a/Source/kwsys/kwsys_cstddef.hxx.in b/Source/kwsys/kwsys_cstddef.hxx.in
deleted file mode 100644
index 925c030..0000000
--- a/Source/kwsys/kwsys_cstddef.hxx.in
+++ /dev/null
@@ -1,35 +0,0 @@
-/*============================================================================
- KWSys - Kitware System Library
- 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 @KWSYS_NAMESPACE@_cstddef
-#define @KWSYS_NAMESPACE@_cstddef
-
-#include <@KWSYS_NAMESPACE@/Configure.hxx>
-
-/* Avoid warnings in MSVC standard headers. */
-#ifdef _MSC_VER
-# pragma warning (push, 1)
-# pragma warning (disable: 4702)
-# pragma warning (disable: 4786)
-#endif
-
-/* Include the real header. */
-#if @KWSYS_NAMESPACE@_CXX_HAS_CSTDDEF
-# include <cstddef>
-#else
-# include <stddef.h>
-#endif
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-#endif
diff --git a/Source/kwsys/kwsys_ios_fstream.h.in b/Source/kwsys/kwsys_ios_fstream.h.in
deleted file mode 100644
index 4b1a8cf..0000000
--- a/Source/kwsys/kwsys_ios_fstream.h.in
+++ /dev/null
@@ -1,46 +0,0 @@
-/*============================================================================
- KWSys - Kitware System Library
- 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 @KWSYS_NAMESPACE@_ios_fstream
-#define @KWSYS_NAMESPACE@_ios_fstream
-
-#include <@KWSYS_NAMESPACE@/Configure.hxx>
-
-#ifdef _MSC_VER
-# pragma warning (push, 1)
-# pragma warning (disable: 4702)
-# pragma warning (disable: 4995) /* Old streams are deprecated. */
-#endif
-
-#if @KWSYS_NAMESPACE@_IOS_USE_ANSI
-# include <fstream>
-#else
-# include <fstream.h>
-#endif
-
-#if !@KWSYS_NAMESPACE@_IOS_USE_SSTREAM
-namespace @KWSYS_NAMESPACE@_ios
-{
- using @KWSYS_NAMESPACE@_ios_namespace::ostream;
- using @KWSYS_NAMESPACE@_ios_namespace::istream;
- using @KWSYS_NAMESPACE@_ios_namespace::ofstream;
- using @KWSYS_NAMESPACE@_ios_namespace::ifstream;
- using @KWSYS_NAMESPACE@_ios_namespace::ios;
- using @KWSYS_NAMESPACE@_ios_namespace::endl;
- using @KWSYS_NAMESPACE@_ios_namespace::flush;
-}
-#endif
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-#endif
diff --git a/Source/kwsys/kwsys_ios_iosfwd.h.in b/Source/kwsys/kwsys_ios_iosfwd.h.in
deleted file mode 100644
index f4fafeb..0000000
--- a/Source/kwsys/kwsys_ios_iosfwd.h.in
+++ /dev/null
@@ -1,49 +0,0 @@
-/*============================================================================
- KWSys - Kitware System Library
- 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 @KWSYS_NAMESPACE@_ios_iosfwd
-#define @KWSYS_NAMESPACE@_ios_iosfwd
-
-#include <@KWSYS_NAMESPACE@/Configure.hxx>
-
-#ifdef _MSC_VER
-#pragma warning (push, 1)
-#pragma warning (disable: 4702)
-#endif
-
-#if @KWSYS_NAMESPACE@_IOS_USE_ANSI
-# include <iosfwd>
-#else
-class fstream;
-class ifstream;
-class ios;
-class istream;
-class ofstream;
-class ostream;
-#endif
-
-#if !@KWSYS_NAMESPACE@_IOS_USE_SSTREAM
-namespace @KWSYS_NAMESPACE@_ios
-{
- using @KWSYS_NAMESPACE@_ios_namespace::fstream;
- using @KWSYS_NAMESPACE@_ios_namespace::ifstream;
- using @KWSYS_NAMESPACE@_ios_namespace::ios;
- using @KWSYS_NAMESPACE@_ios_namespace::istream;
- using @KWSYS_NAMESPACE@_ios_namespace::ofstream;
- using @KWSYS_NAMESPACE@_ios_namespace::ostream;
-}
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#endif
diff --git a/Source/kwsys/kwsys_ios_iostream.h.in b/Source/kwsys/kwsys_ios_iostream.h.in
deleted file mode 100644
index 43fc4d5..0000000
--- a/Source/kwsys/kwsys_ios_iostream.h.in
+++ /dev/null
@@ -1,99 +0,0 @@
-/*============================================================================
- KWSys - Kitware System Library
- 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 @KWSYS_NAMESPACE@_ios_iostream
-#define @KWSYS_NAMESPACE@_ios_iostream
-
-#include <@KWSYS_NAMESPACE@/Configure.hxx>
-
-#ifdef _MSC_VER
-# pragma warning (push, 1)
-# pragma warning (disable: 4702)
-# pragma warning (disable: 4995) /* Old streams are deprecated. */
-#endif
-
-#if @KWSYS_NAMESPACE@_IOS_USE_ANSI
-# include <iostream>
-#else
-# include <iostream.h>
-#endif
-
-// The HP implementation of iostream defines cin, cout, cerr, and clog
-// as macros in order to do thread-private streams.
-// See /opt/aCC/include/iostream/iostream.h for details.
-// This block redefines the macros in a safe way that is also compatible
-// with the HP definitions and the using declarations below.
-
-#if !@KWSYS_NAMESPACE@_IOS_USE_SSTREAM
-# if defined(__HP_aCC) && (defined(HP_THREAD_SAFE) || defined(_THREAD_SAFE))
-# if defined(cin) && !defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CIN)
-# define @KWSYS_NAMESPACE@_IOS_HP_HACK_CIN
-# undef cin
-# define cin __tcin.ref()
-# endif
-# if defined(cout) && !defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_COUT)
-# define @KWSYS_NAMESPACE@_IOS_HP_HACK_COUT
-# undef cout
-# define cout __tcout.ref()
-# endif
-# if defined(cerr) && !defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CERR)
-# define @KWSYS_NAMESPACE@_IOS_HP_HACK_CERR
-# undef cerr
-# define cerr __tcerr.ref()
-# endif
-# if defined(clog) && !defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CLOG)
-# define @KWSYS_NAMESPACE@_IOS_HP_HACK_CLOG
-# undef clog
-# define clog __tclog.ref()
-# endif
-# endif
-#endif
-
-// If using our own sstream emulation code, put the standard
-// streams in the same namespace.
-#if !@KWSYS_NAMESPACE@_IOS_USE_SSTREAM
-namespace @KWSYS_NAMESPACE@_ios
-{
- typedef int streamsize;
- typedef int streamoff;
- using @KWSYS_NAMESPACE@_ios_namespace::ostream;
- using @KWSYS_NAMESPACE@_ios_namespace::istream;
- using @KWSYS_NAMESPACE@_ios_namespace::ios;
- using @KWSYS_NAMESPACE@_ios_namespace::endl;
- using @KWSYS_NAMESPACE@_ios_namespace::flush;
-# if defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CIN)
- using @KWSYS_NAMESPACE@_ios_namespace::__tcin;
-# else
- using @KWSYS_NAMESPACE@_ios_namespace::cin;
-# endif
-# if defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_COUT)
- using @KWSYS_NAMESPACE@_ios_namespace::__tcout;
-# else
- using @KWSYS_NAMESPACE@_ios_namespace::cout;
-# endif
-# if defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CERR)
- using @KWSYS_NAMESPACE@_ios_namespace::__tcerr;
-# else
- using @KWSYS_NAMESPACE@_ios_namespace::cerr;
-# endif
-# if defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CLOG)
- using @KWSYS_NAMESPACE@_ios_namespace::__tclog;
-# else
- using @KWSYS_NAMESPACE@_ios_namespace::clog;
-# endif
-}
-#endif
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-#endif
diff --git a/Source/kwsys/kwsys_ios_sstream.h.in b/Source/kwsys/kwsys_ios_sstream.h.in
deleted file mode 100644
index 29d250c..0000000
--- a/Source/kwsys/kwsys_ios_sstream.h.in
+++ /dev/null
@@ -1,199 +0,0 @@
-/*============================================================================
- KWSys - Kitware System Library
- 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 @KWSYS_NAMESPACE@_ios_sstream
-#define @KWSYS_NAMESPACE@_ios_sstream
-
-#include <@KWSYS_NAMESPACE@/Configure.hxx>
-
-/* Define this macro temporarily to keep the code readable. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# define kwsys_stl @KWSYS_NAMESPACE@_stl
-#endif
-
-#if @KWSYS_NAMESPACE@_IOS_USE_SSTREAM
-# ifdef _MSC_VER
-# pragma warning (push, 1)
-# pragma warning (disable: 4702)
-# endif
-# include <sstream>
-# ifdef _MSC_VER
-# pragma warning(pop)
-# endif
-#else
-# ifdef _MSC_VER
-# pragma warning (push, 1)
-# pragma warning (disable: 4702)
-# pragma warning (disable: 4995) /* Old streams are deprecated. */
-# endif
-# if @KWSYS_NAMESPACE@_IOS_USE_ANSI
-# include <strstream>
-# elif @KWSYS_NAMESPACE@_IOS_USE_STRSTREAM_H
-# include <strstream.h>
-# elif @KWSYS_NAMESPACE@_IOS_USE_STRSTREA_H
-# include <strstrea.h>
-# endif
-# if @KWSYS_NAMESPACE@_IOS_USE_ANSI
-# include <new> // Need placement operator new.
-# else
-# include <new.h> // Need placement operator new.
-# endif
-# ifdef _MSC_VER
-# pragma warning(pop)
-# endif
-
-// Only have old std strstream classes. Wrap them to look like new
-// ostringstream and istringstream classes.
-
-# include <@KWSYS_NAMESPACE@/stl/string>
-
-namespace @KWSYS_NAMESPACE@_ios
-{
-using @KWSYS_NAMESPACE@_ios_namespace::streambuf;
-using @KWSYS_NAMESPACE@_ios_namespace::ostream;
-using @KWSYS_NAMESPACE@_ios_namespace::istream;
-using @KWSYS_NAMESPACE@_ios_namespace::strstream;
-using @KWSYS_NAMESPACE@_ios_namespace::istrstream;
-using @KWSYS_NAMESPACE@_ios_namespace::ostrstream;
-using @KWSYS_NAMESPACE@_ios_namespace::ios;
-using @KWSYS_NAMESPACE@_ios_namespace::endl;
-using @KWSYS_NAMESPACE@_ios_namespace::ends;
-using @KWSYS_NAMESPACE@_ios_namespace::flush;
-
-class stringstream_cleanup
-{
-public:
- stringstream_cleanup(strstream& str): m_StrStream(str) {}
- ~stringstream_cleanup() { m_StrStream.rdbuf()->freeze(0); }
- static void IgnoreUnusedVariable(const stringstream_cleanup&) {}
-protected:
- strstream& m_StrStream;
-private:
- void operator=(stringstream_cleanup const&);
-};
-
-class stringstream: public strstream
-{
-public:
- typedef strstream Superclass;
- stringstream() {}
- stringstream(const kwsys_stl::string& s) { *this << s.c_str(); }
- kwsys_stl::string str()
- {
- stringstream_cleanup cleanup(*this);
- stringstream_cleanup::IgnoreUnusedVariable(cleanup);
-// Visual Studio 6 has a strstream::pcount, but this is not rdbuf()->pcount()
-#if (@KWSYS_NAMESPACE@_IOS_USE_STRSTREA_H) && defined(_MSC_VER) && (_MSC_VER == 1200)
- int count = this->pcount();
-#elif defined(__WATCOMC__)
- int count = this->rdbuf()->out_waiting();
-#else
- int count = this->rdbuf()->pcount();
-#endif
- const char* ptr = this->Superclass::str();
- return kwsys_stl::string(ptr?ptr:"", count);
- }
- void str(const kwsys_stl::string& s)
- {
- this->~stringstream();
- new (this) stringstream(s);
- }
-private:
- stringstream(const stringstream&);
- void operator=(const stringstream&);
-};
-
-class ostringstream_cleanup
-{
-public:
- ostringstream_cleanup(ostrstream& ostr): m_OStrStream(ostr) {}
- ~ostringstream_cleanup() { m_OStrStream.rdbuf()->freeze(0); }
- static void IgnoreUnusedVariable(const ostringstream_cleanup&) {}
-protected:
- ostrstream& m_OStrStream;
-private:
- void operator=(ostringstream_cleanup const&);
-};
-
-class ostringstream: public ostrstream
-{
-public:
- typedef ostrstream Superclass;
- ostringstream() {}
- ostringstream(const kwsys_stl::string& s) { *this << s.c_str(); }
- kwsys_stl::string str()
- {
- ostringstream_cleanup cleanup(*this);
- ostringstream_cleanup::IgnoreUnusedVariable(cleanup);
- int count = this->pcount();
- const char* ptr = this->Superclass::str();
- return kwsys_stl::string(ptr?ptr:"", count);
- }
- void str(const kwsys_stl::string& s)
- {
- this->~ostringstream();
- new (this) ostringstream(s);
- }
-private:
- ostringstream(const ostringstream&);
- void operator=(const ostringstream&);
-};
-
-#if defined(_MSC_VER)
-# pragma warning (push)
-# pragma warning (disable: 4097) /* typedef-name used as synonym for class */
-#endif
-#if defined(__WATCOMC__)
-// W728: class modifiers for 'A' conflict with class modifiers for 'B'
-# pragma warning 728 10
-#endif
-
-class istringstream: private kwsys_stl::string, public istrstream
-{
-public:
- typedef kwsys_stl::string StdString;
- typedef istrstream IStrStream;
- istringstream(): StdString(),
- IStrStream(const_cast<char*>(StdString::c_str())) {}
- istringstream(const kwsys_stl::string& s):
- StdString(s), IStrStream(const_cast<char*>(StdString::c_str())) {}
- kwsys_stl::string str() const { return *this; }
- void str(const kwsys_stl::string& s)
- {
- this->~istringstream();
- new (this) istringstream(s);
- }
- void clear(int flags)
- {
- this->IStrStream::clear(flags);
- }
-private:
- istringstream(const istringstream&);
- void operator=(const istringstream&);
-};
-
-#if defined(__WATCOMC__)
-# pragma warning 728 9
-#endif
-#if defined(_MSC_VER)
-# pragma warning (pop)
-#endif
-
-} // namespace @KWSYS_NAMESPACE@_ios
-
-#endif
-
-/* Undefine temporary macro. */
-#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
-# undef kwsys_stl
-#endif
-
-#endif
diff --git a/Source/kwsys/kwsys_stl.hxx.in b/Source/kwsys/kwsys_stl.hxx.in
deleted file mode 100644
index 610e6d4..0000000
--- a/Source/kwsys/kwsys_stl.hxx.in
+++ /dev/null
@@ -1,49 +0,0 @@
-/*============================================================================
- KWSys - Kitware System Library
- 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 @KWSYS_NAMESPACE@_stl_@KWSYS_STL_HEADER@
-#define @KWSYS_NAMESPACE@_stl_@KWSYS_STL_HEADER@
-
-#include <@KWSYS_NAMESPACE@/Configure.hxx>
-
-/* Avoid warnings in MSVC standard headers. */
-#ifdef _MSC_VER
-# pragma warning (push, 1)
-# pragma warning (disable: 4702)
-# pragma warning (disable: 4786)
-#endif
-
-/* The HP standard library defines the functor "times" instead of
- "multiplies" as specified by C++98 20.3.2 for backward
- compatibility with earlier specifications. Defining this macro
- fixes this behavior. The name "times" also conflicts with the
- function declared in sys/times.h on that platform, so we must do
- this as a work-around anyway. */
-#if defined(__HP_aCC) && !defined(__HPACC_USING_MULTIPLIES_IN_FUNCTIONAL)
-# define __HPACC_USING_MULTIPLIES_IN_FUNCTIONAL
-# define @KWSYS_NAMESPACE@_DEFINED___HPACC_USING_MULTIPLIES_IN_FUNCTIONAL
-#endif
-
-/* Include the real header. */
-#include <@KWSYS_STL_HEADER@>
-
-/* Cleanup. */
-#if defined(@KWSYS_NAMESPACE@_DEFINED___HPACC_USING_MULTIPLIES_IN_FUNCTIONAL)
-# undef @KWSYS_NAMESPACE@_DEFINED___HPACC_USING_MULTIPLIES_IN_FUNCTIONAL
-# undef __HPACC_USING_MULTIPLIES_IN_FUNCTIONAL
-#endif
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-@KWSYS_STL_HEADER_EXTRA@
-#endif
diff --git a/Source/kwsys/kwsys_stl_string.hxx.in b/Source/kwsys/kwsys_stl_string.hxx.in
deleted file mode 100644
index cd312cb..0000000
--- a/Source/kwsys/kwsys_stl_string.hxx.in
+++ /dev/null
@@ -1,123 +0,0 @@
-/*============================================================================
- KWSys - Kitware System Library
- 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.
-============================================================================*/
-
-// This header is extra code for <@KWSYS_NAMESPACE@/stl/string>.
-#if !defined(@KWSYS_NAMESPACE@_stl_string_including_hxx)
-# error "The header <@KWSYS_NAMESPACE@/stl/string.hxx> may be included only by <@KWSYS_NAMESPACE@/stl/string>."
-#endif
-
-// Provide the istream operator for the stl string if it is not
-// provided by the system or another copy of kwsys. Allow user code
-// to block this definition by defining the macro
-// @KWSYS_NAMESPACE@_STL_STRING_NO_ISTREAM
-// to avoid conflicts with other libraries. User code can test for
-// this definition by checking the macro
-// @KWSYS_NAMESPACE@_STL_STRING_ISTREAM_DEFINED
-#if !@KWSYS_NAMESPACE@_STL_STRING_HAVE_ISTREAM && !defined(@KWSYS_NAMESPACE@_STL_STRING_NO_ISTREAM) && !defined(KWSYS_STL_STRING_ISTREAM_DEFINED)
-# define KWSYS_STL_STRING_ISTREAM_DEFINED
-# define @KWSYS_NAMESPACE@_STL_STRING_ISTREAM_DEFINED
-# include <ctype.h> // isspace
-# include <@KWSYS_NAMESPACE@/ios/iostream>
-# if defined(__WATCOMC__)
-namespace @KWSYS_NAMESPACE@
-{
-struct ios_istream_hack: public kwsys_ios::istream
-{ void eatwhite() { this->@KWSYS_NAMESPACE@_ios::istream::eatwhite(); } };
-}
-# endif
-inline @KWSYS_NAMESPACE@_ios::istream&
-operator>>(@KWSYS_NAMESPACE@_ios::istream& is,
- @KWSYS_NAMESPACE@_stl::string& s)
-{
- // Keep track of the resulting state.
- int state = @KWSYS_NAMESPACE@_ios::ios::goodbit;
-
- // Save the width setting and set it back to zero.
- size_t n = static_cast<size_t>(is.width(0));
-
- // Clear any old contents of the output string.
- s.erase();
-
- // Skip leading whitespace.
-#if defined(__WATCOMC__)
- static_cast<@KWSYS_NAMESPACE@::ios_istream_hack&>(is).eatwhite();
-#else
- is.eatwhite();
-#endif
- @KWSYS_NAMESPACE@_ios::istream& okay = is;
-
- if(okay)
- {
- // Select a maximum possible length.
- if(n == 0 || n >= s.max_size())
- {
- n = s.max_size();
- }
-
- // Read until a space is found or the maximum length is reached.
- bool success = false;
- for(int c = is.peek(); (--n > 0 && c != EOF && !isspace(c)); c = is.peek())
- {
- s += static_cast<char>(c);
- success = true;
- is.ignore();
- }
-
- // Set flags for resulting state.
- if(is.peek() == EOF) { state |= @KWSYS_NAMESPACE@_ios::ios::eofbit; }
- if(!success) { state |= @KWSYS_NAMESPACE@_ios::ios::failbit; }
- }
-
- // Set the final result state.
- is.clear(state);
- return is;
-}
-#endif
-
-// Provide the ostream operator for the stl string if it is not
-// provided by the system or another copy of kwsys. Allow user code
-// to block this definition by defining the macro
-// @KWSYS_NAMESPACE@_STL_STRING_NO_OSTREAM
-// to avoid conflicts with other libraries. User code can test for
-// this definition by checking the macro
-// @KWSYS_NAMESPACE@_STL_STRING_OSTREAM_DEFINED
-#if !@KWSYS_NAMESPACE@_STL_STRING_HAVE_OSTREAM && !defined(@KWSYS_NAMESPACE@_STL_STRING_NO_OSTREAM) && !defined(KWSYS_STL_STRING_OSTREAM_DEFINED)
-# define KWSYS_STL_STRING_OSTREAM_DEFINED
-# define @KWSYS_NAMESPACE@_STL_STRING_OSTREAM_DEFINED
-# include <@KWSYS_NAMESPACE@/ios/iostream>
-inline @KWSYS_NAMESPACE@_ios::ostream&
-operator<<(@KWSYS_NAMESPACE@_ios::ostream& os,
- @KWSYS_NAMESPACE@_stl::string const& s)
-{
- return os << s.c_str();
-}
-#endif
-
-// Provide the operator!= for the stl string and char* if it is not
-// provided by the system or another copy of kwsys. Allow user code
-// to block this definition by defining the macro
-// @KWSYS_NAMESPACE@_STL_STRING_NO_NEQ_CHAR
-// to avoid conflicts with other libraries. User code can test for
-// this definition by checking the macro
-// @KWSYS_NAMESPACE@_STL_STRING_NEQ_CHAR_DEFINED
-#if !@KWSYS_NAMESPACE@_STL_STRING_HAVE_NEQ_CHAR && !defined(@KWSYS_NAMESPACE@_STL_STRING_NO_NEQ_CHAR) && !defined(KWSYS_STL_STRING_NEQ_CHAR_DEFINED)
-# define KWSYS_STL_STRING_NEQ_CHAR_DEFINED
-# define @KWSYS_NAMESPACE@_STL_STRING_NEQ_CHAR_DEFINED
-inline bool operator!=(@KWSYS_NAMESPACE@_stl::string const& s, const char* c)
-{
- return !(s == c);
-}
-inline bool operator!=(const char* c, @KWSYS_NAMESPACE@_stl::string const& s)
-{
- return !(s == c);
-}
-#endif
diff --git a/Source/kwsys/testCommandLineArguments.cxx b/Source/kwsys/testCommandLineArguments.cxx
index 6a03c0f..525522d 100644
--- a/Source/kwsys/testCommandLineArguments.cxx
+++ b/Source/kwsys/testCommandLineArguments.cxx
@@ -11,16 +11,16 @@
============================================================================*/
#include "kwsysPrivate.h"
#include KWSYS_HEADER(CommandLineArguments.hxx)
-#include KWSYS_HEADER(ios/iostream)
-#include KWSYS_HEADER(stl/vector)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "CommandLineArguments.hxx.in"
-# include "kwsys_ios_iostream.h.in"
#endif
+#include <iostream>
+#include <vector>
+
#include <stddef.h> /* size_t */
#include <string.h> /* strcmp */
@@ -28,10 +28,10 @@ static void* random_ptr = reinterpret_cast<void*>(0x123);
static int argument(const char* arg, const char* value, void* call_data)
{
- kwsys_ios::cout << "Got argument: \"" << arg << "\" value: \"" << (value?value:"(null)") << "\"" << kwsys_ios::endl;
+ std::cout << "Got argument: \"" << arg << "\" value: \"" << (value?value:"(null)") << "\"" << std::endl;
if ( call_data != random_ptr )
{
- kwsys_ios::cerr << "Problem processing call_data" << kwsys_ios::endl;
+ std::cerr << "Problem processing call_data" << std::endl;
return 0;
}
return 1;
@@ -39,10 +39,10 @@ static int argument(const char* arg, const char* value, void* call_data)
static int unknown_argument(const char* argument, void* call_data)
{
- kwsys_ios::cout << "Got unknown argument: \"" << argument << "\"" << kwsys_ios::endl;
+ std::cout << "Got unknown argument: \"" << argument << "\"" << std::endl;
if ( call_data != random_ptr )
{
- kwsys_ios::cerr << "Problem processing call_data" << kwsys_ios::endl;
+ std::cerr << "Problem processing call_data" << std::endl;
return 0;
}
return 1;
@@ -53,8 +53,8 @@ static bool CompareTwoItemsOnList(int i1, int i2) { return i1 == i2; }
static bool CompareTwoItemsOnList(double i1, double i2) { return i1 == i2; }
static bool CompareTwoItemsOnList(const char* i1,
const char* i2) { return strcmp(i1, i2) == 0; }
-static bool CompareTwoItemsOnList(const kwsys_stl::string& i1,
- const kwsys_stl::string& i2) { return i1 == i2; }
+static bool CompareTwoItemsOnList(const std::string& i1,
+ const std::string& i2) { return i1 == i2; }
int testCommandLineArguments(int argc, char* argv[])
{
@@ -74,26 +74,26 @@ int testCommandLineArguments(int argc, char* argv[])
int some_int_variable = 10;
double some_double_variable = 10.10;
char* some_string_variable = 0;
- kwsys_stl::string some_stl_string_variable = "";
+ std::string some_stl_string_variable = "";
bool some_bool_variable = false;
bool some_bool_variable1 = false;
bool bool_arg1 = false;
int bool_arg2 = 0;
- kwsys_stl::vector<int> numbers_argument;
+ std::vector<int> numbers_argument;
int valid_numbers[] = { 5, 1, 8, 3, 7, 1, 3, 9, 7, 1 };
- kwsys_stl::vector<double> doubles_argument;
+ std::vector<double> doubles_argument;
double valid_doubles[] = { 12.5, 1.31, 22 };
- kwsys_stl::vector<bool> bools_argument;
+ std::vector<bool> bools_argument;
bool valid_bools[] = { true, true, false };
- kwsys_stl::vector<char*> strings_argument;
+ std::vector<char*> strings_argument;
const char* valid_strings[] = { "andy", "bill", "brad", "ken" };
- kwsys_stl::vector<kwsys_stl::string> stl_strings_argument;
- kwsys_stl::string valid_stl_strings[] = { "ken", "brad", "bill", "andy" };
+ std::vector<std::string> stl_strings_argument;
+ std::string valid_stl_strings[] = { "ken", "brad", "bill", "andy" };
typedef kwsys::CommandLineArguments argT;
@@ -122,47 +122,47 @@ int testCommandLineArguments(int argc, char* argv[])
if ( !arg.Parse() )
{
- kwsys_ios::cerr << "Problem parsing arguments" << kwsys_ios::endl;
+ std::cerr << "Problem parsing arguments" << std::endl;
res = 1;
}
- kwsys_ios::cout << "Help: " << arg.GetHelp() << kwsys_ios::endl;
+ std::cout << "Help: " << arg.GetHelp() << std::endl;
- kwsys_ios::cout << "Some int variable was set to: " << some_int_variable << kwsys_ios::endl;
- kwsys_ios::cout << "Some double variable was set to: " << some_double_variable << kwsys_ios::endl;
+ std::cout << "Some int variable was set to: " << some_int_variable << std::endl;
+ std::cout << "Some double variable was set to: " << some_double_variable << std::endl;
if ( some_string_variable && strcmp(some_string_variable, "test string with space") == 0)
{
- kwsys_ios::cout << "Some string variable was set to: " << some_string_variable << kwsys_ios::endl;
+ std::cout << "Some string variable was set to: " << some_string_variable << std::endl;
delete [] some_string_variable;
}
else
{
- kwsys_ios::cerr << "Problem setting string variable" << kwsys_ios::endl;
+ std::cerr << "Problem setting string variable" << std::endl;
res = 1;
}
size_t cc;
#define CompareTwoLists(list1, list_valid, lsize) \
if ( list1.size() != lsize ) \
{ \
- kwsys_ios::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \
- << " should be: " << lsize << kwsys_ios::endl; \
+ std::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \
+ << " should be: " << lsize << std::endl; \
res = 1; \
} \
else \
{ \
- kwsys_ios::cout << #list1 " argument set:"; \
+ std::cout << #list1 " argument set:"; \
for ( cc =0; cc < lsize; ++ cc ) \
{ \
- kwsys_ios::cout << " " << list1[cc]; \
+ std::cout << " " << list1[cc]; \
if ( !CompareTwoItemsOnList(list1[cc], list_valid[cc]) ) \
{ \
- kwsys_ios::cerr << "Problem setting " #list1 ". Value of " \
+ std::cerr << "Problem setting " #list1 ". Value of " \
<< cc << " is: [" << list1[cc] << "] <> [" \
- << list_valid[cc] << "]" << kwsys_ios::endl; \
+ << list_valid[cc] << "]" << std::endl; \
res = 1; \
break; \
} \
} \
- kwsys_ios::cout << kwsys_ios::endl; \
+ std::cout << std::endl; \
}
CompareTwoLists(numbers_argument, valid_numbers, 10);
@@ -171,12 +171,12 @@ int testCommandLineArguments(int argc, char* argv[])
CompareTwoLists(strings_argument, valid_strings, 4);
CompareTwoLists(stl_strings_argument, valid_stl_strings, 4);
- kwsys_ios::cout << "Some STL String variable was set to: " << some_stl_string_variable << kwsys_ios::endl;
- kwsys_ios::cout << "Some bool variable was set to: " << some_bool_variable << kwsys_ios::endl;
- kwsys_ios::cout << "Some bool variable was set to: " << some_bool_variable1 << kwsys_ios::endl;
- kwsys_ios::cout << "bool_arg1 variable was set to: " << bool_arg1 << kwsys_ios::endl;
- kwsys_ios::cout << "bool_arg2 variable was set to: " << bool_arg2 << kwsys_ios::endl;
- kwsys_ios::cout << kwsys_ios::endl;
+ std::cout << "Some STL String variable was set to: " << some_stl_string_variable << std::endl;
+ std::cout << "Some bool variable was set to: " << some_bool_variable << std::endl;
+ std::cout << "Some bool variable was set to: " << some_bool_variable1 << std::endl;
+ std::cout << "bool_arg1 variable was set to: " << bool_arg1 << std::endl;
+ std::cout << "bool_arg2 variable was set to: " << bool_arg2 << std::endl;
+ std::cout << std::endl;
for ( cc = 0; cc < strings_argument.size(); ++ cc )
{
diff --git a/Source/kwsys/testCommandLineArguments1.cxx b/Source/kwsys/testCommandLineArguments1.cxx
index b65c37f..6eb465d 100644
--- a/Source/kwsys/testCommandLineArguments1.cxx
+++ b/Source/kwsys/testCommandLineArguments1.cxx
@@ -11,16 +11,16 @@
============================================================================*/
#include "kwsysPrivate.h"
#include KWSYS_HEADER(CommandLineArguments.hxx)
-#include KWSYS_HEADER(ios/iostream)
-#include KWSYS_HEADER(stl/vector)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "CommandLineArguments.hxx.in"
-# include "kwsys_ios_iostream.h.in"
#endif
+#include <iostream>
+#include <vector>
+
#include <assert.h> /* assert */
#include <string.h> /* strcmp */
@@ -31,7 +31,7 @@ int testCommandLineArguments1(int argc, char* argv[])
int n = 0;
char* m = 0;
- kwsys_stl::string p;
+ std::string p;
int res = 0;
typedef kwsys::CommandLineArguments argT;
@@ -43,27 +43,27 @@ int testCommandLineArguments1(int argc, char* argv[])
if ( !arg.Parse() )
{
- kwsys_ios::cerr << "Problem parsing arguments" << kwsys_ios::endl;
+ std::cerr << "Problem parsing arguments" << std::endl;
res = 1;
}
if ( n != 24 )
{
- kwsys_ios::cout << "Problem setting N. Value of N: " << n << kwsys_ios::endl;
+ std::cout << "Problem setting N. Value of N: " << n << std::endl;
res = 1;
}
if ( !m || strcmp(m, "test value") != 0 )
{
- kwsys_ios::cout << "Problem setting M. Value of M: " << m << kwsys_ios::endl;
+ std::cout << "Problem setting M. Value of M: " << m << std::endl;
res = 1;
}
if ( p != "1" )
{
- kwsys_ios::cout << "Problem setting P. Value of P: " << p << kwsys_ios::endl;
+ std::cout << "Problem setting P. Value of P: " << p << std::endl;
res = 1;
}
- kwsys_ios::cout << "Value of N: " << n << kwsys_ios::endl;
- kwsys_ios::cout << "Value of M: " << m << kwsys_ios::endl;
- kwsys_ios::cout << "Value of P: " << p << kwsys_ios::endl;
+ std::cout << "Value of N: " << n << std::endl;
+ std::cout << "Value of M: " << m << std::endl;
+ std::cout << "Value of P: " << p << std::endl;
if ( m )
{
delete [] m;
@@ -79,25 +79,25 @@ int testCommandLineArguments1(int argc, char* argv[])
};
if ( newArgc != 9 )
{
- kwsys_ios::cerr << "Bad number of unused arguments: " << newArgc << kwsys_ios::endl;
+ std::cerr << "Bad number of unused arguments: " << newArgc << std::endl;
res = 1;
}
for ( cc = 0; cc < newArgc; ++ cc )
{
assert(newArgv[cc]); /* Quiet Clang scan-build. */
- kwsys_ios::cout << "Unused argument[" << cc << "] = [" << newArgv[cc] << "]"
- << kwsys_ios::endl;
+ std::cout << "Unused argument[" << cc << "] = [" << newArgv[cc] << "]"
+ << std::endl;
if ( cc >= 9 )
{
- kwsys_ios::cerr << "Too many unused arguments: " << cc << kwsys_ios::endl;
+ std::cerr << "Too many unused arguments: " << cc << std::endl;
res = 1;
}
else if ( valid_unused_args[cc] &&
strcmp(valid_unused_args[cc], newArgv[cc]) != 0 )
{
- kwsys_ios::cerr << "Bad unused argument [" << cc << "] \""
+ std::cerr << "Bad unused argument [" << cc << "] \""
<< newArgv[cc] << "\" should be: \"" << valid_unused_args[cc] << "\""
- << kwsys_ios::endl;
+ << std::endl;
res = 1;
}
}
diff --git a/Source/kwsys/testDynamicLoader.cxx b/Source/kwsys/testDynamicLoader.cxx
index 58adb84..695a134 100644
--- a/Source/kwsys/testDynamicLoader.cxx
+++ b/Source/kwsys/testDynamicLoader.cxx
@@ -12,8 +12,6 @@
#include "kwsysPrivate.h"
#include KWSYS_HEADER(DynamicLoader.hxx)
-#include KWSYS_HEADER(ios/iostream)
-#include KWSYS_HEADER(stl/string)
#if defined(__BEOS__) || defined(__HAIKU__)
#include <be/kernel/OS.h> /* disable_debugger() API. */
@@ -23,18 +21,19 @@
// duplicate the above list of headers.
#if 0
# include "DynamicLoader.hxx.in"
-# include "kwsys_ios_iostream.h.in"
-# include "kwsys_stl_string.hxx.in"
#endif
+#include <string>
+#include <iostream>
+
// Include with <> instead of "" to avoid getting any in-source copy
// left on disk.
#include <testSystemTools.h>
-static kwsys_stl::string GetLibName(const char* lname)
+static std::string GetLibName(const char* lname)
{
// Construct proper name of lib
- kwsys_stl::string slname;
+ std::string slname;
slname = EXECUTABLE_OUTPUT_PATH;
#ifdef CMAKE_INTDIR
slname += "/";
@@ -56,30 +55,30 @@ static kwsys_stl::string GetLibName(const char* lname)
*/
int TestDynamicLoader(const char* libname, const char* symbol, int r1, int r2, int r3)
{
- kwsys_ios::cerr << "Testing: " << libname << kwsys_ios::endl;
+ std::cerr << "Testing: " << libname << std::endl;
kwsys::DynamicLoader::LibraryHandle l
= kwsys::DynamicLoader::OpenLibrary(libname);
// If result is incompatible with expectation just fails (xor):
if( (r1 && !l) || (!r1 && l) )
{
- kwsys_ios::cerr
- << kwsys::DynamicLoader::LastError() << kwsys_ios::endl;
+ std::cerr
+ << kwsys::DynamicLoader::LastError() << std::endl;
return 1;
}
kwsys::DynamicLoader::SymbolPointer f
= kwsys::DynamicLoader::GetSymbolAddress(l, symbol);
if( (r2 && !f) || (!r2 && f) )
{
- kwsys_ios::cerr
- << kwsys::DynamicLoader::LastError() << kwsys_ios::endl;
+ std::cerr
+ << kwsys::DynamicLoader::LastError() << std::endl;
return 1;
}
#ifndef __APPLE__
int s = kwsys::DynamicLoader::CloseLibrary(l);
if( (r3 && !s) || (!r3 && s) )
{
- kwsys_ios::cerr
- << kwsys::DynamicLoader::LastError() << kwsys_ios::endl;
+ std::cerr
+ << kwsys::DynamicLoader::LastError() << std::endl;
return 1;
}
#else
@@ -118,7 +117,7 @@ int testDynamicLoader(int argc, char *argv[])
res += TestDynamicLoader("libdl.so", "TestDynamicLoader",1,0,1);
#endif
// Now try on the generated library
- kwsys_stl::string libname = GetLibName(KWSYS_NAMESPACE_STRING "TestDynload");
+ std::string libname = GetLibName(KWSYS_NAMESPACE_STRING "TestDynload");
res += TestDynamicLoader(libname.c_str(), "dummy",1,0,1);
res += TestDynamicLoader(libname.c_str(), "TestDynamicLoaderSymbolPointer",1,1,1);
res += TestDynamicLoader(libname.c_str(), "_TestDynamicLoaderSymbolPointer",1,0,1);
diff --git a/Source/kwsys/testEncoding.cxx b/Source/kwsys/testEncoding.cxx
index 094588c..842b17d 100644
--- a/Source/kwsys/testEncoding.cxx
+++ b/Source/kwsys/testEncoding.cxx
@@ -17,8 +17,8 @@
#include KWSYS_HEADER(Encoding.hxx)
#include KWSYS_HEADER(Encoding.h)
-#include KWSYS_HEADER(ios/iostream)
+#include <iostream>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
@@ -28,7 +28,6 @@
#if 0
# include "Encoding.hxx.in"
# include "Encoding.h.in"
-# include "kwsys_ios_iostream.h.in"
#endif
//----------------------------------------------------------------------------
diff --git a/Source/kwsys/testFStream.cxx b/Source/kwsys/testFStream.cxx
index 9abfd4c..ac5220a 100644
--- a/Source/kwsys/testFStream.cxx
+++ b/Source/kwsys/testFStream.cxx
@@ -16,7 +16,6 @@
#endif
#include KWSYS_HEADER(FStream.hxx)
-#include KWSYS_HEADER(ios/iostream)
#include <string.h>
#ifdef __BORLANDC__
# include <mem.h> /* memcmp */
@@ -26,9 +25,9 @@
// duplicate the above list of headers.
#if 0
# include "FStream.hxx.in"
-# include "kwsys_ios_iostream.h.in"
#endif
+#include <iostream>
//----------------------------------------------------------------------------
static int testNoFile()
@@ -95,20 +94,20 @@ static int testBOM()
kwsys::FStream::BOM bom = kwsys::FStream::ReadBOM(in);
if(bom != expected_bom[i])
{
- kwsys_ios::cout << "Unexpected BOM " << i << std::endl;
+ std::cout << "Unexpected BOM " << i << std::endl;
return 1;
}
char data[45];
in.read(data, file_data[i][0]);
if(!in.good())
{
- kwsys_ios::cout << "Unable to read data " << i << std::endl;
+ std::cout << "Unable to read data " << i << std::endl;
return 1;
}
if(memcmp(data, file_data[i]+1, file_data[i][0]) != 0)
{
- kwsys_ios::cout << "Incorrect read data " << i << std::endl;
+ std::cout << "Incorrect read data " << i << std::endl;
return 1;
}
@@ -125,20 +124,20 @@ static int testBOM()
kwsys::FStream::BOM bom = kwsys::FStream::ReadBOM(in);
if(bom != kwsys::FStream::BOM_None)
{
- kwsys_ios::cout << "Unexpected BOM for none case" << std::endl;
+ std::cout << "Unexpected BOM for none case" << std::endl;
return 1;
}
char data[45];
in.read(data, file_data[0][0]);
if(!in.good())
{
- kwsys_ios::cout << "Unable to read data for none case" << std::endl;
+ std::cout << "Unable to read data for none case" << std::endl;
return 1;
}
if(memcmp(data, file_data[0]+1, file_data[0][0]) != 0)
{
- kwsys_ios::cout << "Incorrect read data for none case" << std::endl;
+ std::cout << "Incorrect read data for none case" << std::endl;
return 1;
}
}
@@ -156,20 +155,20 @@ static int testBOM()
kwsys::FStream::BOM bom = kwsys::FStream::ReadBOM(in);
if(bom != kwsys::FStream::BOM_UTF8)
{
- kwsys_ios::cout << "Unexpected BOM for utf-8 case" << std::endl;
+ std::cout << "Unexpected BOM for utf-8 case" << std::endl;
return 1;
}
char data[45];
in.read(data, file_data[0][0]);
if(!in.good())
{
- kwsys_ios::cout << "Unable to read data for utf-8 case" << std::endl;
+ std::cout << "Unable to read data for utf-8 case" << std::endl;
return 1;
}
if(memcmp(data, file_data[0]+1, file_data[0][0]) != 0)
{
- kwsys_ios::cout << "Incorrect read data for utf-8 case" << std::endl;
+ std::cout << "Incorrect read data for utf-8 case" << std::endl;
return 1;
}
}
diff --git a/Source/kwsys/testHashSTL.cxx b/Source/kwsys/testHashSTL.cxx
index ac5cf74..ab1f83e 100644
--- a/Source/kwsys/testHashSTL.cxx
+++ b/Source/kwsys/testHashSTL.cxx
@@ -12,7 +12,6 @@
#include "kwsysPrivate.h"
#include KWSYS_HEADER(hash_map.hxx)
#include KWSYS_HEADER(hash_set.hxx)
-#include KWSYS_HEADER(ios/iostream)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
@@ -20,9 +19,10 @@
# include "hash_map.hxx.in"
# include "hash_set.hxx.in"
# include "hashtable.hxx.in"
-# include "kwsys_ios_iostream.h.in"
#endif
+#include <iostream>
+
#if defined(_MSC_VER)
# pragma warning (disable:4786)
#endif
@@ -44,8 +44,8 @@ static bool test_hash_map()
int sum = 0;
for(mtype::iterator mi = m.begin(); mi != m.end(); ++mi)
{
- kwsys_ios::cout << "Found entry [" << mi->first << "," << mi->second << "]"
- << kwsys_ios::endl;
+ std::cout << "Found entry [" << mi->first << "," << mi->second << "]"
+ << std::endl;
sum += mi->second;
}
return sum == 3;
@@ -60,7 +60,7 @@ static bool test_hash_set()
int sum = 0;
for(stype::iterator si = s.begin(); si != s.end(); ++si)
{
- kwsys_ios::cout << "Found entry [" << *si << "]" << kwsys_ios::endl;
+ std::cout << "Found entry [" << *si << "]" << std::endl;
sum += *si;
}
return sum == 3;
diff --git a/Source/kwsys/testIOS.cxx b/Source/kwsys/testIOS.cxx
index f0c7f1a..396a09d 100644
--- a/Source/kwsys/testIOS.cxx
+++ b/Source/kwsys/testIOS.cxx
@@ -10,158 +10,149 @@
See the License for more information.
============================================================================*/
#include "kwsysPrivate.h"
-#include KWSYS_HEADER(stl/vector)
-#include KWSYS_HEADER(ios/sstream)
-#include KWSYS_HEADER(ios/fstream)
-#include KWSYS_HEADER(ios/iostream)
-
-// Work-around CMake dependency scanning limitation. This must
-// duplicate the above list of headers.
-#if 0
-# include "kwsys_stl_string.hxx.in"
-# include "kwsys_stl_vector.h.in"
-# include "kwsys_ios_sstream.h.in"
-# include "kwsys_ios_fstream.h.in"
-# include "kwsys_ios_iostream.h.in"
-#endif
+#include KWSYS_HEADER(Configure.hxx)
+#include <sstream>
+#include <fstream>
+#include <iostream>
+#include <vector>
#include <string.h> /* strlen */
int testIOS(int, char*[])
{
- kwsys_ios::ostringstream ostr;
+ std::ostringstream ostr;
const char hello[] = "hello";
ostr << hello;
if(ostr.str() != hello)
{
- kwsys_ios::cerr << "failed to write hello to ostr" << kwsys_ios::endl;
+ std::cerr << "failed to write hello to ostr" << std::endl;
return 1;
}
const char world[] = "world";
- kwsys_ios::ostringstream ostr2;
+ std::ostringstream ostr2;
ostr2.write( hello, strlen(hello) ); /* I could do sizeof */
ostr2.put( '\0' );
ostr2.write( world, strlen(world) );
if(ostr2.str().size() != strlen(hello) + 1 + strlen(world) )
{
- kwsys_ios::cerr << "failed to write hello to ostr2" << kwsys_ios::endl;
+ std::cerr << "failed to write hello to ostr2" << std::endl;
return 1;
}
static const unsigned char array[] = { 0xff,0x4f,0xff,0x51,0x00,0x29,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x01,0x01,0xff,0x52,0x00,0x0c,0x00,0x00,0x00,0x01,0x00,0x05,0x04,0x04,0x00,0x01,0xff,0x5c,0x00,0x13,0x40,0x40,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0xff,0x64,0x00,0x2c,0x00,0x00,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x62,0x79,0x20,0x49,0x54,0x4b,0x2f,0x47,0x44,0x43,0x4d,0x2f,0x4f,0x70,0x65,0x6e,0x4a,0x50,0x45,0x47,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x31,0x2e,0x30,0xff,0x90,0x00,0x0a,0x00,0x00,0x00,0x00,0x06,0x2c,0x00,0x01,0xff,0x93,0xcf,0xb0,0x18,0x08,0x7f,0xc6,0x99,0xbf,0xff,0xc0,0xf8,0xc1,0xc1,0xf3,0x05,0x81,0xf2,0x83,0x0a,0xa5,0xff,0x10,0x90,0xbf,0x2f,0xff,0x04,0xa8,0x7f,0xc0,0xf8,0xc4,0xc1,0xf3,0x09,0x81,0xf3,0x0c,0x19,0x34 };
const size_t narray = sizeof(array); // 180
- kwsys_ios::stringstream strstr;
+ std::stringstream strstr;
strstr.write( (char*)array, narray );
//strstr.seekp( narray / 2 ); // set position of put pointer in mid string
if(strstr.str().size() != narray )
{
- kwsys_ios::cerr << "failed to write array to strstr" << kwsys_ios::endl;
+ std::cerr << "failed to write array to strstr" << std::endl;
return 1;
}
- kwsys_ios::istringstream istr(" 10 20 str ");
- kwsys_stl::string s;
+ std::istringstream istr(" 10 20 str ");
+ std::string s;
int x;
if(istr >> x)
{
if(x != 10)
{
- kwsys_ios::cerr << "x != 10" << kwsys_ios::endl;
+ std::cerr << "x != 10" << std::endl;
return 1;
}
}
else
{
- kwsys_ios::cerr << "Failed to read 10 from istr" << kwsys_ios::endl;
+ std::cerr << "Failed to read 10 from istr" << std::endl;
return 1;
}
if(istr >> x)
{
if(x != 20)
{
- kwsys_ios::cerr << "x != 20" << kwsys_ios::endl;
+ std::cerr << "x != 20" << std::endl;
return 1;
}
}
else
{
- kwsys_ios::cerr << "Failed to read 20 from istr" << kwsys_ios::endl;
+ std::cerr << "Failed to read 20 from istr" << std::endl;
return 1;
}
if(istr >> s)
{
if(s != "str")
{
- kwsys_ios::cerr << "s != \"str\"" << kwsys_ios::endl;
+ std::cerr << "s != \"str\"" << std::endl;
return 1;
}
}
else
{
- kwsys_ios::cerr << "Failed to read str from istr" << kwsys_ios::endl;
+ std::cerr << "Failed to read str from istr" << std::endl;
return 1;
}
if(istr >> s)
{
- kwsys_ios::cerr << "Able to read past end of stream" << kwsys_ios::endl;
+ std::cerr << "Able to read past end of stream" << std::endl;
return 1;
}
else
{
// Clear the failure.
- istr.clear(istr.rdstate() & ~kwsys_ios::ios::eofbit);
- istr.clear(istr.rdstate() & ~kwsys_ios::ios::failbit);
+ istr.clear(istr.rdstate() & ~std::ios::eofbit);
+ istr.clear(istr.rdstate() & ~std::ios::failbit);
}
istr.str("30");
if(istr >> x)
{
if(x != 30)
{
- kwsys_ios::cerr << "x != 30" << kwsys_ios::endl;
+ std::cerr << "x != 30" << std::endl;
return 1;
}
}
else
{
- kwsys_ios::cerr << "Failed to read 30 from istr" << kwsys_ios::endl;
+ std::cerr << "Failed to read 30 from istr" << std::endl;
return 1;
}
- kwsys_ios::stringstream sstr;
+ std::stringstream sstr;
sstr << "40 str2";
if(sstr >> x)
{
if(x != 40)
{
- kwsys_ios::cerr << "x != 40" << kwsys_ios::endl;
+ std::cerr << "x != 40" << std::endl;
return 1;
}
}
else
{
- kwsys_ios::cerr << "Failed to read 40 from sstr" << kwsys_ios::endl;
+ std::cerr << "Failed to read 40 from sstr" << std::endl;
return 1;
}
if(sstr >> s)
{
if(s != "str2")
{
- kwsys_ios::cerr << "s != \"str2\"" << kwsys_ios::endl;
+ std::cerr << "s != \"str2\"" << std::endl;
return 1;
}
}
else
{
- kwsys_ios::cerr << "Failed to read str2 from sstr" << kwsys_ios::endl;
+ std::cerr << "Failed to read str2 from sstr" << std::endl;
return 1;
}
// Just try to compile this.
if(x == 12345)
{
- kwsys_ios::ifstream fin("/does_not_exist",
- kwsys_ios::ios::in | kwsys_ios_binary);
+ std::ifstream fin("/does_not_exist",
+ std::ios::in | std::ios::binary);
}
- kwsys_ios::cout << "IOS tests passed" << kwsys_ios::endl;
+ std::cout << "IOS tests passed" << std::endl;
return 0;
}
diff --git a/Source/kwsys/testSystemInformation.cxx b/Source/kwsys/testSystemInformation.cxx
index fc8ea55..c96751a 100644
--- a/Source/kwsys/testSystemInformation.cxx
+++ b/Source/kwsys/testSystemInformation.cxx
@@ -11,15 +11,15 @@
============================================================================*/
#include "kwsysPrivate.h"
#include KWSYS_HEADER(SystemInformation.hxx)
-#include KWSYS_HEADER(ios/iostream)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "SystemInformation.hxx.in"
-# include "kwsys_ios_iostream.h.in"
#endif
+#include <iostream>
+
#if defined(KWSYS_USE_LONG_LONG)
# if defined(KWSYS_IOS_HAS_OSTREAM_LONG_LONG)
# define iostreamLongLong(x) (x)
@@ -36,18 +36,18 @@
# error "No Long Long"
#endif
-#define printMethod(info, m) kwsys_ios::cout << #m << ": " \
+#define printMethod(info, m) std::cout << #m << ": " \
<< info.m() << "\n"
-#define printMethod2(info, m, unit) kwsys_ios::cout << #m << ": " \
+#define printMethod2(info, m, unit) std::cout << #m << ": " \
<< info.m() << " " << unit << "\n"
-#define printMethod3(info, m, unit) kwsys_ios::cout << #m << ": " \
+#define printMethod3(info, m, unit) std::cout << #m << ": " \
<< iostreamLongLong(info.m) << " " << unit << "\n"
int testSystemInformation(int, char*[])
{
- kwsys_ios::cout << "CTEST_FULL_OUTPUT\n"; // avoid truncation
+ std::cout << "CTEST_FULL_OUTPUT\n"; // avoid truncation
kwsys::SystemInformation info;
info.RunCPUCheck();
@@ -93,16 +93,16 @@ int testSystemInformation(int, char*[])
{
if (info.DoesCPUSupportFeature(static_cast<long int>(1) << i))
{
- kwsys_ios::cout << "CPU feature " << i << "\n";
+ std::cout << "CPU feature " << i << "\n";
}
}
/* test stack trace
*/
- kwsys_ios::cout
- << "Program Stack:" << kwsys_ios::endl
- << kwsys::SystemInformation::GetProgramStack(0,0) << kwsys_ios::endl
- << kwsys_ios::endl;
+ std::cout
+ << "Program Stack:" << std::endl
+ << kwsys::SystemInformation::GetProgramStack(0,0) << std::endl
+ << std::endl;
/* test segv handler
info.SetStackTraceOnError(1);
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index bc9ca5e..a0f904f 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -16,19 +16,19 @@
#endif
#include KWSYS_HEADER(SystemTools.hxx)
-#include KWSYS_HEADER(ios/iostream)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "SystemTools.hxx.in"
-# include "kwsys_ios_iostream.h.in"
#endif
// Include with <> instead of "" to avoid getting any in-source copy
// left on disk.
#include <testSystemTools.h>
+#include <iostream>
+#include <sstream>
#include <string.h> /* strcmp */
#if defined(_WIN32) && !defined(__CYGWIN__)
# include <io.h> /* _umask (MSVC) / umask (Borland) */
@@ -63,17 +63,17 @@ static const char* toUnixPaths[][2] =
{0, 0}
};
-static bool CheckConvertToUnixSlashes(kwsys_stl::string input,
- kwsys_stl::string output)
+static bool CheckConvertToUnixSlashes(std::string input,
+ std::string output)
{
- kwsys_stl::string result = input;
+ std::string result = input;
kwsys::SystemTools::ConvertToUnixSlashes(result);
if ( result != output )
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToUnixSlashes - input: " << input
<< " output: " << result << " expected: " << output
- << kwsys_ios::endl;
+ << std::endl;
return false;
}
return true;
@@ -87,19 +87,19 @@ static const char* checkEscapeChars[][4] =
{0, 0, 0, 0}
};
-static bool CheckEscapeChars(kwsys_stl::string input,
+static bool CheckEscapeChars(std::string input,
const char *chars_to_escape,
char escape_char,
- kwsys_stl::string output)
+ std::string output)
{
- kwsys_stl::string result = kwsys::SystemTools::EscapeChars(
+ std::string result = kwsys::SystemTools::EscapeChars(
input.c_str(), chars_to_escape, escape_char);
if (result != output)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with CheckEscapeChars - input: " << input
<< " output: " << result << " expected: " << output
- << kwsys_ios::endl;
+ << std::endl;
return false;
}
return true;
@@ -109,75 +109,75 @@ static bool CheckEscapeChars(kwsys_stl::string input,
static bool CheckFileOperations()
{
bool res = true;
- const kwsys_stl::string testNonExistingFile(TEST_SYSTEMTOOLS_SOURCE_DIR
+ const std::string testNonExistingFile(TEST_SYSTEMTOOLS_SOURCE_DIR
"/testSystemToolsNonExistingFile");
- const kwsys_stl::string testDotFile(TEST_SYSTEMTOOLS_SOURCE_DIR
+ const std::string testDotFile(TEST_SYSTEMTOOLS_SOURCE_DIR
"/.");
- const kwsys_stl::string testBinFile(TEST_SYSTEMTOOLS_SOURCE_DIR
+ const std::string testBinFile(TEST_SYSTEMTOOLS_SOURCE_DIR
"/testSystemTools.bin");
- const kwsys_stl::string testTxtFile(TEST_SYSTEMTOOLS_SOURCE_DIR
+ const std::string testTxtFile(TEST_SYSTEMTOOLS_SOURCE_DIR
"/testSystemTools.cxx");
- const kwsys_stl::string testNewDir(TEST_SYSTEMTOOLS_BINARY_DIR
+ const std::string testNewDir(TEST_SYSTEMTOOLS_BINARY_DIR
"/testSystemToolsNewDir");
- const kwsys_stl::string testNewFile(testNewDir + "/testNewFile.txt");
+ const std::string testNewFile(testNewDir + "/testNewFile.txt");
if (kwsys::SystemTools::DetectFileType(testNonExistingFile.c_str()) !=
kwsys::SystemTools::FileTypeUnknown)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with DetectFileType - failed to detect type of: "
- << testNonExistingFile << kwsys_ios::endl;
+ << testNonExistingFile << std::endl;
res = false;
}
if (kwsys::SystemTools::DetectFileType(testDotFile.c_str()) !=
kwsys::SystemTools::FileTypeUnknown)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with DetectFileType - failed to detect type of: "
- << testDotFile << kwsys_ios::endl;
+ << testDotFile << std::endl;
res = false;
}
if (kwsys::SystemTools::DetectFileType(testBinFile.c_str()) !=
kwsys::SystemTools::FileTypeBinary)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with DetectFileType - failed to detect type of: "
- << testBinFile << kwsys_ios::endl;
+ << testBinFile << std::endl;
res = false;
}
if (kwsys::SystemTools::DetectFileType(testTxtFile.c_str()) !=
kwsys::SystemTools::FileTypeText)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with DetectFileType - failed to detect type of: "
- << testTxtFile << kwsys_ios::endl;
+ << testTxtFile << std::endl;
res = false;
}
if (kwsys::SystemTools::FileLength(testBinFile) != 766)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with FileLength - incorrect length for: "
- << testBinFile << kwsys_ios::endl;
+ << testBinFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::MakeDirectory(testNewDir))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with MakeDirectory for: "
- << testNewDir << kwsys_ios::endl;
+ << testNewDir << std::endl;
res = false;
}
if (!kwsys::SystemTools::Touch(testNewFile.c_str(), true))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with Touch for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
@@ -195,34 +195,34 @@ static bool CheckFileOperations()
mode_t origPerm, thisPerm;
if (!kwsys::SystemTools::GetPermissions(testNewFile, origPerm))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with GetPermissions (1) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::SetPermissions(testNewFile, 0))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with SetPermissions (1) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::GetPermissions(testNewFile, thisPerm))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with GetPermissions (2) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if ((thisPerm & fullMask) != 0)
{
- kwsys_ios::cerr
+ std::cerr
<< "SetPermissions failed to set permissions (1) for: "
<< testNewFile << ": actual = " << thisPerm << "; expected = "
- << 0 << kwsys_ios::endl;
+ << 0 << std::endl;
res = false;
}
@@ -230,70 +230,70 @@ static bool CheckFileOperations()
if (kwsys::SystemTools::TestFileAccess(testNewFile,
kwsys::TEST_FILE_WRITE))
{
- kwsys_ios::cerr
+ std::cerr
<< "TestFileAccess incorrectly indicated that this is a writable file:"
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::TestFileAccess(testNewFile,
kwsys::TEST_FILE_OK))
{
- kwsys_ios::cerr
+ std::cerr
<< "TestFileAccess incorrectly indicated that this file does not exist:"
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
// Test restoring/setting full permissions.
if (!kwsys::SystemTools::SetPermissions(testNewFile, fullMask))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with SetPermissions (2) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::GetPermissions(testNewFile, thisPerm))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with GetPermissions (3) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if ((thisPerm & fullMask) != fullMask)
{
- kwsys_ios::cerr
+ std::cerr
<< "SetPermissions failed to set permissions (2) for: "
<< testNewFile << ": actual = " << thisPerm << "; expected = "
- << fullMask << kwsys_ios::endl;
+ << fullMask << std::endl;
res = false;
}
// Test setting file permissions while honoring umask
if (!kwsys::SystemTools::SetPermissions(testNewFile, fullMask, true))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with SetPermissions (3) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::GetPermissions(testNewFile, thisPerm))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with GetPermissions (4) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if ((thisPerm & fullMask) != 0)
{
- kwsys_ios::cerr
+ std::cerr
<< "SetPermissions failed to honor umask for: "
<< testNewFile << ": actual = " << thisPerm << "; expected = "
- << 0 << kwsys_ios::endl;
+ << 0 << std::endl;
res = false;
}
@@ -303,35 +303,35 @@ static bool CheckFileOperations()
// Restore file permissions
if (!kwsys::SystemTools::SetPermissions(testNewFile, origPerm))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with SetPermissions (4) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
// Remove the test file
if (!kwsys::SystemTools::RemoveFile(testNewFile))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveFile: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
- kwsys_stl::string const testFileMissing(testNewDir + "/testMissingFile.txt");
+ std::string const testFileMissing(testNewDir + "/testMissingFile.txt");
if (!kwsys::SystemTools::RemoveFile(testFileMissing))
{
std::string const& msg = kwsys::SystemTools::GetLastSystemError();
- kwsys_ios::cerr <<
+ std::cerr <<
"RemoveFile(\"" << testFileMissing << "\") failed: " << msg << "\n";
res = false;
}
- kwsys_stl::string const testFileMissingDir(testNewDir + "/missing/file.txt");
+ std::string const testFileMissingDir(testNewDir + "/missing/file.txt");
if (!kwsys::SystemTools::RemoveFile(testFileMissingDir))
{
std::string const& msg = kwsys::SystemTools::GetLastSystemError();
- kwsys_ios::cerr <<
+ std::cerr <<
"RemoveFile(\"" << testFileMissingDir << "\") failed: " << msg << "\n";
res = false;
}
@@ -339,9 +339,9 @@ static bool CheckFileOperations()
kwsys::SystemTools::Touch(testNewFile.c_str(), true);
if (!kwsys::SystemTools::RemoveADirectory(testNewDir))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveADirectory for: "
- << testNewDir << kwsys_ios::endl;
+ << testNewDir << std::endl;
res = false;
}
@@ -349,14 +349,14 @@ static bool CheckFileOperations()
// Perform the same file and directory creation and deletion tests but
// with paths > 256 characters in length.
- const kwsys_stl::string testNewLongDir(
+ const std::string testNewLongDir(
TEST_SYSTEMTOOLS_BINARY_DIR "/"
"012345678901234567890123456789012345678901234567890123456789"
"012345678901234567890123456789012345678901234567890123456789"
"012345678901234567890123456789012345678901234567890123456789"
"012345678901234567890123456789012345678901234567890123456789"
"01234567890123");
- const kwsys_stl::string testNewLongFile(testNewLongDir + "/"
+ const std::string testNewLongFile(testNewLongDir + "/"
"012345678901234567890123456789012345678901234567890123456789"
"012345678901234567890123456789012345678901234567890123456789"
"012345678901234567890123456789012345678901234567890123456789"
@@ -365,34 +365,34 @@ static bool CheckFileOperations()
if (!kwsys::SystemTools::MakeDirectory(testNewLongDir))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with MakeDirectory for: "
- << testNewLongDir << kwsys_ios::endl;
+ << testNewLongDir << std::endl;
res = false;
}
if (!kwsys::SystemTools::Touch(testNewLongFile.c_str(), true))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with Touch for: "
- << testNewLongFile << kwsys_ios::endl;
+ << testNewLongFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::RemoveFile(testNewLongFile))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveFile: "
- << testNewLongFile << kwsys_ios::endl;
+ << testNewLongFile << std::endl;
res = false;
}
kwsys::SystemTools::Touch(testNewLongFile.c_str(), true);
if (!kwsys::SystemTools::RemoveADirectory(testNewLongDir))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveADirectory for: "
- << testNewLongDir << kwsys_ios::endl;
+ << testNewLongDir << std::endl;
res = false;
}
#endif
@@ -405,12 +405,12 @@ static bool CheckStringOperations()
{
bool res = true;
- kwsys_stl::string test = "mary had a little lamb.";
+ std::string test = "mary had a little lamb.";
if (kwsys::SystemTools::CapitalizedWords(test) != "Mary Had A Little Lamb.")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with CapitalizedWords "
- << '"' << test << '"' << kwsys_ios::endl;
+ << '"' << test << '"' << std::endl;
res = false;
}
@@ -418,9 +418,9 @@ static bool CheckStringOperations()
if (kwsys::SystemTools::UnCapitalizedWords(test) !=
"mary had a little lamb.")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with UnCapitalizedWords "
- << '"' << test << '"' << kwsys_ios::endl;
+ << '"' << test << '"' << std::endl;
res = false;
}
@@ -428,9 +428,9 @@ static bool CheckStringOperations()
if (kwsys::SystemTools::AddSpaceBetweenCapitalizedWords(test) !=
"Mary Had The Little Lamb.")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with AddSpaceBetweenCapitalizedWords "
- << '"' << test << '"' << kwsys_ios::endl;
+ << '"' << test << '"' << std::endl;
res = false;
}
@@ -438,9 +438,9 @@ static bool CheckStringOperations()
kwsys::SystemTools::AppendStrings("Mary Had A"," Little Lamb.");
if (strcmp(cres,"Mary Had A Little Lamb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with AppendStrings "
- << "\"Mary Had A\" \" Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A\" \" Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres;
@@ -449,18 +449,18 @@ static bool CheckStringOperations()
kwsys::SystemTools::AppendStrings("Mary Had"," A ","Little Lamb.");
if (strcmp(cres,"Mary Had A Little Lamb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with AppendStrings "
- << "\"Mary Had\" \" A \" \"Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had\" \" A \" \"Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres;
if (kwsys::SystemTools::CountChar("Mary Had A Little Lamb.",'a') != 3)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with CountChar "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
@@ -468,9 +468,9 @@ static bool CheckStringOperations()
kwsys::SystemTools::RemoveChars("Mary Had A Little Lamb.","aeiou");
if (strcmp(cres,"Mry Hd A Lttl Lmb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveChars "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres;
@@ -479,9 +479,9 @@ static bool CheckStringOperations()
kwsys::SystemTools::RemoveCharsButUpperHex("Mary Had A Little Lamb.");
if (strcmp(cres,"A"))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveCharsButUpperHex "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres;
@@ -491,9 +491,9 @@ static bool CheckStringOperations()
kwsys::SystemTools::ReplaceChars(cres2,"aeiou",'X');
if (strcmp(cres2,"MXry HXd A LXttlX LXmb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ReplaceChars "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres2;
@@ -501,27 +501,27 @@ static bool CheckStringOperations()
if (!kwsys::SystemTools::StringStartsWith("Mary Had A Little Lamb.",
"Mary "))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with StringStartsWith "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
if (!kwsys::SystemTools::StringEndsWith("Mary Had A Little Lamb.",
" Lamb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with StringEndsWith "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
cres = kwsys::SystemTools::DuplicateString("Mary Had A Little Lamb.");
if (strcmp(cres,"Mary Had A Little Lamb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with DuplicateString "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres;
@@ -530,20 +530,20 @@ static bool CheckStringOperations()
if (kwsys::SystemTools::CropString(test,13) !=
"Mary ...Lamb.")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with CropString "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
- kwsys_stl::vector<kwsys_stl::string> lines;
+ std::vector<std::string> lines;
kwsys::SystemTools::Split("Mary Had A Little Lamb.",lines,' ');
if (lines[0] != "Mary" || lines[1] != "Had" ||
lines[2] != "A" || lines[3] != "Little" || lines[4] != "Lamb.")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with Split "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
@@ -552,10 +552,10 @@ static bool CheckStringOperations()
("L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") !=
L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -563,10 +563,10 @@ static bool CheckStringOperations()
("L:/Local Mojo/Hex Power Pack/Iffy Voodoo") !=
L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"L:/Local Mojo/Hex Power Pack/Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -574,10 +574,10 @@ static bool CheckStringOperations()
("\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") !=
L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -585,70 +585,70 @@ static bool CheckStringOperations()
("//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo") !=
L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("//") !=
L"//")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"//\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\") !=
L"\\\\.\\")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"\\\\.\\\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X") !=
L"\\\\.\\X")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"\\\\.\\X\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X:") !=
L"\\\\?\\X:")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"\\\\.\\X:\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X:\\") !=
L"\\\\?\\X:\\")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"\\\\.\\X:\\\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("NUL") !=
L"\\\\.\\NUL")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"NUL\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -658,10 +658,10 @@ static bool CheckStringOperations()
("L://Local Mojo/Hex Power Pack/Iffy Voodoo") !=
"\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsOutputPath "
<< "\"L://Local Mojo/Hex Power Pack/Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -669,10 +669,10 @@ static bool CheckStringOperations()
("//grayson/Local Mojo/Hex Power Pack/Iffy Voodoo") !=
"\"\\\\grayson\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsOutputPath "
<< "\"//grayson/Local Mojo/Hex Power Pack/Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -680,10 +680,10 @@ static bool CheckStringOperations()
("//Local Mojo/Hex Power Pack/Iffy Voodoo") !=
"//Local\\ Mojo/Hex\\ Power\\ Pack/Iffy\\ Voodoo")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToUnixOutputPath "
<< "\"//Local Mojo/Hex Power Pack/Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -692,20 +692,20 @@ static bool CheckStringOperations()
//----------------------------------------------------------------------------
-static bool CheckPutEnv(const kwsys_stl::string& env, const char* name, const char* value)
+static bool CheckPutEnv(const std::string& env, const char* name, const char* value)
{
if(!kwsys::SystemTools::PutEnv(env))
{
- kwsys_ios::cerr << "PutEnv(\"" << env
- << "\") failed!" << kwsys_ios::endl;
+ std::cerr << "PutEnv(\"" << env
+ << "\") failed!" << std::endl;
return false;
}
const char* v = kwsys::SystemTools::GetEnv(name);
v = v? v : "(null)";
if(strcmp(v, value) != 0)
{
- kwsys_ios::cerr << "GetEnv(\"" << name << "\") returned \""
- << v << "\", not \"" << value << "\"!" << kwsys_ios::endl;
+ std::cerr << "GetEnv(\"" << name << "\") returned \""
+ << v << "\", not \"" << value << "\"!" << std::endl;
return false;
}
return true;
@@ -715,14 +715,14 @@ static bool CheckUnPutEnv(const char* env, const char* name)
{
if(!kwsys::SystemTools::UnPutEnv(env))
{
- kwsys_ios::cerr << "UnPutEnv(\"" << env << "\") failed!"
- << kwsys_ios::endl;
+ std::cerr << "UnPutEnv(\"" << env << "\") failed!"
+ << std::endl;
return false;
}
if(const char* v = kwsys::SystemTools::GetEnv(name))
{
- kwsys_ios::cerr << "GetEnv(\"" << name << "\") returned \""
- << v << "\", not (null)!" << kwsys_ios::endl;
+ std::cerr << "GetEnv(\"" << name << "\") returned \""
+ << v << "\", not (null)!" << std::endl;
return false;
}
return true;
@@ -744,15 +744,15 @@ static bool CheckEnvironmentOperations()
static bool CheckRelativePath(
- const kwsys_stl::string& local,
- const kwsys_stl::string& remote,
- const kwsys_stl::string& expected)
+ const std::string& local,
+ const std::string& remote,
+ const std::string& expected)
{
- kwsys_stl::string result = kwsys::SystemTools::RelativePath(local, remote);
+ std::string result = kwsys::SystemTools::RelativePath(local, remote);
if(expected != result)
{
- kwsys_ios::cerr << "RelativePath(" << local << ", " << remote
- << ") yielded " << result << " instead of " << expected << kwsys_ios::endl;
+ std::cerr << "RelativePath(" << local << ", " << remote
+ << ") yielded " << result << " instead of " << expected << std::endl;
return false;
}
return true;
@@ -770,14 +770,14 @@ static bool CheckRelativePaths()
}
static bool CheckCollapsePath(
- const kwsys_stl::string& path,
- const kwsys_stl::string& expected)
+ const std::string& path,
+ const std::string& expected)
{
- kwsys_stl::string result = kwsys::SystemTools::CollapseFullPath(path);
+ std::string result = kwsys::SystemTools::CollapseFullPath(path);
if(expected != result)
{
- kwsys_ios::cerr << "CollapseFullPath(" << path
- << ") yielded " << result << " instead of " << expected << kwsys_ios::endl;
+ std::cerr << "CollapseFullPath(" << path
+ << ") yielded " << result << " instead of " << expected << std::endl;
return false;
}
return true;
@@ -791,6 +791,66 @@ static bool CheckCollapsePath()
return res;
}
+static std::string StringVectorToString(const std::vector<std::string>& vec)
+{
+ std::stringstream ss;
+ ss << "vector(";
+ for (std::vector<std::string>::const_iterator i = vec.begin();
+ i != vec.end(); ++i)
+ {
+ if (i != vec.begin())
+ {
+ ss << ", ";
+ }
+ ss << *i;
+ }
+ ss << ")";
+ return ss.str();
+}
+
+static bool CheckGetPath()
+{
+ const char* envName = "S";
+#ifdef _WIN32
+ const char* envValue = "C:\\Somewhere\\something;D:\\Temp";
+#else
+ const char* envValue = "/Somewhere/something:/tmp";
+#endif
+ const char* registryPath = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MyApp; MyKey]";
+
+ std::vector<std::string> originalPathes;
+ originalPathes.push_back(registryPath);
+
+ std::vector<std::string> expectedPathes;
+ expectedPathes.push_back(registryPath);
+#ifdef _WIN32
+ expectedPathes.push_back("C:/Somewhere/something");
+ expectedPathes.push_back("D:/Temp");
+#else
+ expectedPathes.push_back("/Somewhere/something");
+ expectedPathes.push_back("/tmp");
+#endif
+
+ bool res = true;
+ res &= CheckPutEnv(std::string(envName) + "=" + envValue, envName, envValue);
+
+ std::vector<std::string> pathes = originalPathes;
+ kwsys::SystemTools::GetPath(pathes, envName);
+
+ if (pathes != expectedPathes)
+ {
+ std::cerr <<
+ "GetPath(" << StringVectorToString(originalPathes) <<
+ ", " << envName << ") yielded " << StringVectorToString(pathes) <<
+ " instead of " << StringVectorToString(expectedPathes) <<
+ std::endl;
+ res = false;
+ }
+
+ res &= CheckUnPutEnv(envName, envName);
+ return res;
+}
+
//----------------------------------------------------------------------------
int testSystemTools(int, char*[])
{
@@ -803,7 +863,7 @@ int testSystemTools(int, char*[])
}
// Special check for ~
- kwsys_stl::string output;
+ std::string output;
if(kwsys::SystemTools::GetEnv("HOME", output))
{
output += "/foo bar/lala";
@@ -826,5 +886,7 @@ int testSystemTools(int, char*[])
res &= CheckCollapsePath();
+ res &= CheckGetPath();
+
return res ? 0 : 1;
}
diff --git a/Templates/CPack.GenericDescription.txt b/Templates/CPack.GenericDescription.txt
index 9ca1802..712ee14 100644
--- a/Templates/CPack.GenericDescription.txt
+++ b/Templates/CPack.GenericDescription.txt
@@ -1,5 +1,5 @@
DESCRIPTION
===========
-This is an installer created using CPack (http://www.cmake.org). No additional installation instructions provided.
+This is an installer created using CPack (https://cmake.org). No additional installation instructions provided.
diff --git a/Templates/CPack.GenericLicense.txt b/Templates/CPack.GenericLicense.txt
index c211bb3..09c6218 100644
--- a/Templates/CPack.GenericLicense.txt
+++ b/Templates/CPack.GenericLicense.txt
@@ -1,5 +1,5 @@
LICENSE
=======
-This is an installer created using CPack (http://www.cmake.org). No license provided.
+This is an installer created using CPack (https://cmake.org). No license provided.
diff --git a/Templates/Windows/SmallLogo44x44.png b/Templates/Windows/SmallLogo44x44.png
new file mode 100644
index 0000000..28810b7
--- /dev/null
+++ b/Templates/Windows/SmallLogo44x44.png
Binary files differ
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 801d7e8..c82cb68 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -213,6 +213,29 @@ if(BUILD_TESTING)
set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
+ if(CMAKE_OSX_SYSROOT)
+ execute_process(
+ COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version ProductName
+ OUTPUT_VARIABLE _stdout
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE _stderr
+ RESULT_VARIABLE _failed
+ )
+ if(NOT _failed)
+ set(CMAKE_OSX_SDKPRODUCT "${_stdout}")
+ endif()
+
+ execute_process(
+ COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version SDKVersion
+ OUTPUT_VARIABLE _stdout
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE _stderr
+ RESULT_VARIABLE _failed
+ )
+ if(NOT _failed)
+ set(CMAKE_OSX_SDKVERSION "${_stdout}")
+ endif()
+ endif()
endif()
# Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value,
@@ -253,15 +276,20 @@ if(BUILD_TESTING)
if(TEST_RESOURCES)
ADD_TEST_MACRO(VSResource VSResource)
endif()
+ ADD_TEST_MACRO(MSManifest MSManifest)
ADD_TEST_MACRO(Simple Simple)
ADD_TEST_MACRO(PreOrder PreOrder)
ADD_TEST_MACRO(MissingSourceFile MissingSourceFile)
set_tests_properties(MissingSourceFile PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c")
- if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 6.1)
- if(CMAKE_GENERATOR STREQUAL "Xcode")
- ADD_TEST_MACRO(SwiftMix SwiftMix)
- ADD_TEST_MACRO(SwiftOnly SwiftOnly)
+ if(CMake_TEST_XCODE_VERSION AND CMAKE_OSX_SDKVERSION AND CMAKE_OSX_SDKPRODUCT)
+ if((NOT CMake_TEST_XCODE_VERSION VERSION_LESS 6.1) AND
+ ((NOT CMAKE_OSX_SDKPRODUCT STREQUAL "Mac OS X") OR
+ (NOT CMAKE_OSX_SDKVERSION VERSION_LESS 10.10)))
+ if(CMAKE_GENERATOR STREQUAL "Xcode")
+ ADD_TEST_MACRO(SwiftMix SwiftMix)
+ ADD_TEST_MACRO(SwiftOnly SwiftOnly)
+ endif()
endif()
endif()
if(CMAKE_Fortran_COMPILER)
@@ -1337,6 +1365,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_subdirectory(FindOpenSSL)
endif()
+ add_subdirectory(FindThreads)
+
# Matlab module
if(CMake_TEST_FindMatlab)
ADD_TEST_MACRO(FindMatlab.basic_checks ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>)
@@ -1925,13 +1955,15 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
set(reg_vs10 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]")
set(reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]")
set(reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]")
+ set(reg_vs14 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]")
set(reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]")
set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]")
+ set(reg_ws10_0 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\Setup\\Build Tools for Windows 10;srcPath]")
set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]")
set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]")
select_wince_sdk(reg_wince wince_sdk)
set(reg_tegra "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;sdkRoot]")
- foreach(reg vs10 vs11 vs12 ws80 ws81 wp80 wp81 wince tegra)
+ foreach(reg vs10 vs11 vs12 vs14 ws80 ws81 ws10_0 wp80 wp81 wince tegra)
get_filename_component(r "${reg_${reg}}" ABSOLUTE)
if(IS_DIRECTORY "${r}")
set(${reg} 1)
@@ -1978,6 +2010,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
-DCMAKE_SYSTEM_VERSION=8.1
)
endif()
+ if(vs14 AND ws10_0)
+ add_test_VSWinStorePhone(vs14-store10_0-X86 "Visual Studio 14 2015" WindowsStore 10.0)
+ add_test_VSWinStorePhone(vs14-store10_0-ARM "Visual Studio 14 2015 ARM" WindowsStore 10.0)
+ add_test_VSWinStorePhone(vs14-store10_0-X64 "Visual Studio 14 2015 Win64" WindowsStore 10.0)
+ endif()
if(vs11 AND wp80)
add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0)
add_test_VSWinStorePhone(vs11-phone80-ARM "Visual Studio 11 2012 ARM" WindowsPhone 8.0)
diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
index 055b183..da614e9 100644
--- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
+++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
@@ -105,6 +105,13 @@ set(linux64_test2_libs "c;/opt/sun/sunstudio12/prod/lib/amd64/libc_supp.a")
set(linux64_test2_dirs "/opt/sun/sunstudio12/prod/lib/amd64;/lib64;/usr/lib64")
list(APPEND platforms linux64_test2)
+# -specs=redhat-hardened-ld
+set(linux64_test3_text "COLLECT_GCC_OPTIONS='-specs=/usr/lib/rpm/redhat/redhat-hardened-ld' '-v' '-O2' '-g' '-pipe' '-Wall' '-Werror=format-security' '-fexceptions' '-fstack-protector-strong' '--param' 'ssp-buffer-size=4' '-grecord-gcc-switches' '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' '-m64' '-mtune=generic' '-I' '/usr/lib64/gfortran/modules' '-o' 'a.out' '-rdynamic' '-shared-libgcc' '-march=x86-64' '-pie'
+ /usr/libexec/gcc/x86_64-redhat-linux/5.1.1/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/5.1.1/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/5.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccNzxFD8.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z now -pie -o a.out /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/Scrt1.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1 -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../.. -z relro dummy.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/5.1.1/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/crtn.o")
+set(linux64_test3_libs "gfortran;m;quadmath;m;c")
+set(linux64_test3_dirs "/usr/lib/gcc/x86_64-redhat-linux/5.1.1;/usr/lib64;/lib64;/usr/lib")
+list(APPEND platforms linux64_test3)
+
#-----------------------------------------------------------------------------
# Mac
diff --git a/Tests/CPackComponents/CMakeLists.txt b/Tests/CPackComponents/CMakeLists.txt
index 1cb8669..3c8ae35 100644
--- a/Tests/CPackComponents/CMakeLists.txt
+++ b/Tests/CPackComponents/CMakeLists.txt
@@ -72,7 +72,7 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
set(CPACK_NSIS_MENU_LINKS
"ftp://ftpserver" "Test Ftp Link"
"ftps://ftpsserver" "Test Ftps Link"
- "http://www.cmake.org" "CMake Web Site"
+ "https://cmake.org" "CMake Web Site"
"https://github.com/" "Test Https Link"
"mailto:kitware@kitware.com" "Test MailTo Link"
"news://newsserver" "Test News Link"
diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt
index 5c4eeab..093b23f 100644
--- a/Tests/CPackComponentsDEB/CMakeLists.txt
+++ b/Tests/CPackComponentsDEB/CMakeLists.txt
@@ -80,6 +80,43 @@ set(CPACK_COMPONENT_HEADERS_DESCRIPTION
# depend on the libraries component.
set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
+# creates preinst/prerm scripts with specific permissions. Those permissions
+# (especially executable) should be in the final archive
+find_program(CHMOD_PROG chmod)
+if(CHMOD_PROG)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/preinst "echo default_preinst")
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/prerm "echo default_prerm")
+
+ # Those should have 755 permission normally. We mess it up to see if
+ # CPACK_DEBIAN_APPLICATIONS_PACKAGE_CONTROL_STRICT_PERMISSION is able to fix
+ # it.
+ execute_process(COMMAND ${CHMOD_PROG} 640 ${CMAKE_CURRENT_BINARY_DIR}/preinst)
+ execute_process(COMMAND ${CHMOD_PROG} 640 ${CMAKE_CURRENT_BINARY_DIR}/prerm)
+
+ set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_CONTROL_EXTRA
+ "${CMAKE_CURRENT_BINARY_DIR}/preinst;${CMAKE_CURRENT_BINARY_DIR}/prerm")
+
+ set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
+endif()
+
+# creates a symbolic link and a directory. Those should not be hashed.
+# warning: relocation of the symlink is not supported (symlinks with relative
+# paths)
+execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink mylibapp symtest)
+install(FILES ${CPackComponentsDEB_BINARY_DIR}/symtest
+ DESTINATION bin
+ COMPONENT applications)
+
+if(EXISTS "./dirtest")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ./dirtest)
+endif()
+# NOTE: directory left empty on purpose
+execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ./dirtest)
+# NOTE: we should not add the trailing "/" to dirtest
+install(DIRECTORY ${CPackComponentsDEB_BINARY_DIR}/dirtest
+ DESTINATION bin/
+ COMPONENT applications)
+
# We may use the CPack specific config file in order
# to tailor CPack behavior on a CPack generator specific way
# (Behavior would be different for RPM or TGZ or DEB ...)
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
index 5460b1a..ff22f8f 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
@@ -36,7 +36,7 @@ find_program(LINTIAN_EXECUTABLE lintian)
if(LINTIAN_EXECUTABLE)
set(lintian_output_errors_all "")
foreach(_f IN LISTS actual_output)
- set(STRINGS_TO_AVOID "E:([^\r\n]*)control-file-has-bad-permissions")
+ set(STRINGS_TO_AVOID "E:([^\r\n]*)control-file-has-bad-permissions" "E:([^\r\n]*)md5sums-lists-nonexistent-file")
lintian_check_specific_errors(lintian_output_errors
FILENAME "${_f}"
ERROR_REGEX_STRINGS "${STRINGS_TO_AVOID}")
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
index b96669e..bf9f81d 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
@@ -137,6 +137,8 @@ endfunction()
# This function runs dpkg-deb on a .deb and returns its output
+# the default behaviour it to run "--info" on the specified Debian package
+# ACTION is one of the option accepted by dpkg-deb
function(run_dpkgdeb dpkg_deb_output)
set(${dpkg_deb_output} "" PARENT_SCOPE)
@@ -144,7 +146,7 @@ function(run_dpkgdeb dpkg_deb_output)
if(DPKGDEB_EXECUTABLE)
set(options "")
- set(oneValueArgs "FILENAME")
+ set(oneValueArgs "FILENAME" "ACTION")
set(multiValueArgs "")
cmake_parse_arguments(run_dpkgdeb_deb "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
@@ -153,8 +155,12 @@ function(run_dpkgdeb dpkg_deb_output)
message(FATAL_ERROR "error: run_dpkgdeb needs FILENAME to be set")
endif()
- # run lintian
- execute_process(COMMAND ${DPKGDEB_EXECUTABLE} -I ${run_dpkgdeb_deb_FILENAME}
+ if(NOT run_dpkgdeb_deb_ACTION)
+ set(run_dpkgdeb_deb_ACTION "--info")
+ endif()
+
+ # run dpkg-deb
+ execute_process(COMMAND ${DPKGDEB_EXECUTABLE} ${run_dpkgdeb_deb_ACTION} ${run_dpkgdeb_deb_FILENAME}
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
OUTPUT_VARIABLE DPKGDEB_OUTPUT
RESULT_VARIABLE DPKGDEB_RESULT
diff --git a/Tests/CPackComponentsDEB/license.txt b/Tests/CPackComponentsDEB/license.txt
index ba8ba48..d829d93 100644
--- a/Tests/CPackComponentsDEB/license.txt
+++ b/Tests/CPackComponentsDEB/license.txt
@@ -1,3 +1,3 @@
LICENSE
-------
-This is an installer created using CPack (http://www.cmake.org). No license provided.
+This is an installer created using CPack (https://cmake.org). No license provided.
diff --git a/Tests/CPackComponentsForAll/license.txt b/Tests/CPackComponentsForAll/license.txt
index ba8ba48..d829d93 100644
--- a/Tests/CPackComponentsForAll/license.txt
+++ b/Tests/CPackComponentsForAll/license.txt
@@ -1,3 +1,3 @@
LICENSE
-------
-This is an installer created using CPack (http://www.cmake.org). No license provided.
+This is an installer created using CPack (https://cmake.org). No license provided.
diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt
index 638e788..73eaf4f 100644
--- a/Tests/CPackWiXGenerator/CMakeLists.txt
+++ b/Tests/CPackWiXGenerator/CMakeLists.txt
@@ -64,7 +64,7 @@ set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/patch.xml")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt")
set(CPACK_WIX_PROPERTY_ARPCOMMENTS "My Custom ARPCOMMENTS")
-set(CPACK_WIX_PROPERTY_ARPHELPLINK "http://www.cmake.org")
+set(CPACK_WIX_PROPERTY_ARPHELPLINK "https://cmake.org")
include(CPack)
diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in
index 29f7e7f..b2e6d6d 100644
--- a/Tests/CTestCoverageCollectGCOV/test.cmake.in
+++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in
@@ -12,9 +12,9 @@ ctest_build()
ctest_test()
list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
- "/foo/something"
- "/3rdparty/"
- "/bar/somethingelse"
+ "/foo/something"
+ "/3rdparty/"
+ "/bar/somethingelse"
)
include(CTestCoverageCollectGCOV)
diff --git a/Tests/Contracts/Trilinos/CMakeLists.txt b/Tests/Contracts/Trilinos/CMakeLists.txt
index f5757b5..8d74ca5 100644
--- a/Tests/Contracts/Trilinos/CMakeLists.txt
+++ b/Tests/Contracts/Trilinos/CMakeLists.txt
@@ -27,7 +27,7 @@ endif()
message(STATUS "HOME='${HOME}'")
if(NOT DEFINED url)
- set(url "http://www.cmake.org/files/contracts/trilinos-11.4.1.tar.gz")
+ set(url "https://cmake.org/files/contracts/trilinos-11.4.1.tar.gz")
endif()
message(STATUS "url='${url}'")
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index 2b9e844..aedc89b 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -29,14 +29,14 @@ add_custom_command(TARGET testLib1 POST_BUILD
$<TARGET_FILE:testLib1>.genex
)
install(FILES $<TARGET_FILE:testLib1>.genex
- DESTINATION lib
+ DESTINATION $<1:lib>$<0:/wrong>
)
set_property(TARGET testLib1 PROPERTY MY_FILES
${CMAKE_CURRENT_SOURCE_DIR}/testLib1file1.txt
${CMAKE_CURRENT_SOURCE_DIR}/testLib1file2.txt
)
install(FILES $<TARGET_PROPERTY:testLib1,MY_FILES>
- DESTINATION doc
+ DESTINATION $<1:doc>$<0:/wrong>
)
# Test library with empty link interface. Link it to an implementation
@@ -136,7 +136,7 @@ add_library(testLibDepends testLibDepends.c)
target_link_libraries(testLibDepends LINK_PUBLIC testLibRequired)
macro(add_include_lib _libName)
- file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_libName}.c" "// no content\n")
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_libName}.c" "/* no content */\n")
add_library(${_libName} "${CMAKE_CURRENT_BINARY_DIR}/${_libName}.c")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_libName}")
set_property(TARGET ${_libName} APPEND PROPERTY
@@ -144,7 +144,7 @@ macro(add_include_lib _libName)
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/${_libName}>"
)
if (NOT "${ARGV1}" STREQUAL "NO_HEADER")
- file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_libName}/${_libName}.h" "// no content\n")
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_libName}/${_libName}.h" "/* no content */\n")
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${_libName}/${_libName}.h"
DESTINATION include/${_libName}
@@ -182,7 +182,7 @@ install(FILES
)
add_include_lib(testLibIncludeRequired6)
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired7/testLibIncludeRequired7.h" "// No content\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired7/testLibIncludeRequired7.h" "/* No content */\n")
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired7/testLibIncludeRequired7.h"
DESTINATION include/testLibIncludeRequired7
@@ -391,22 +391,22 @@ install(TARGETS
install(EXPORT RequiredExp NAMESPACE Req:: FILE testLibRequiredTargets.cmake DESTINATION lib/cmake/testLibRequired)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest/installIncludesTest.h" "// No content\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest/installIncludesTest.h" "/* No content */\n")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2/installIncludesTest2.h" "// No content\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2/installIncludesTest2.h" "/* No content */\n")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest3/testLibRequired")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest3/testLibRequired/installIncludesTest3.h" "// No content\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest3/testLibRequired/installIncludesTest3.h" "/* No content */\n")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/testLibRequired/installIncludesTest4")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibRequired/installIncludesTest4/installIncludesTest4.h" "// No content\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibRequired/installIncludesTest4/installIncludesTest4.h" "/* No content */\n")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest5")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest5/installIncludesTest5.h" "// No content\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest5/installIncludesTest5.h" "/* No content */\n")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest6")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest6/installIncludesTest6.h" "// No content\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest6/installIncludesTest6.h" "/* No content */\n")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7/installIncludesTest7.h" "// No content\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7/installIncludesTest7.h" "/* No content */\n")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8/installIncludesTest8.h" "// No content\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8/installIncludesTest8.h" "/* No content */\n")
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest/installIncludesTest.h"
DESTINATION installIncludesTest
@@ -551,5 +551,5 @@ install(
ARCHIVE DESTINATION lib
INCLUDES DESTINATION include/abs
)
-install(DIRECTORY include/abs DESTINATION include)
+install(DIRECTORY include/abs DESTINATION $<1:include>$<0:/wrong>)
install(EXPORT expAbs NAMESPACE expAbs_ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/expAbs)
diff --git a/Tests/ExternalProject/Example/CMakeLists.txt b/Tests/ExternalProject/Example/CMakeLists.txt
index 69ebaaf..4c12895 100644
--- a/Tests/ExternalProject/Example/CMakeLists.txt
+++ b/Tests/ExternalProject/Example/CMakeLists.txt
@@ -5,7 +5,7 @@ include(ExternalProject)
ExternalProject_Add(
cmake281
- URL http://www.cmake.org/files/v2.8/cmake-2.8.1.tar.gz
+ URL https://cmake.org/files/v2.8/cmake-2.8.1.tar.gz
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
BUILD_COMMAND ""
)
diff --git a/Tests/FindGTK2/CMakeLists.txt b/Tests/FindGTK2/CMakeLists.txt
index 1c5987c..0105fae 100644
--- a/Tests/FindGTK2/CMakeLists.txt
+++ b/Tests/FindGTK2/CMakeLists.txt
@@ -9,6 +9,7 @@ if(GTK2_GTK_FOUND)
"${CMake_BINARY_DIR}/Tests/FindGTK2/GTK2Components/gtk"
${build_generator_args}
--build-target gtk-all-libs
+ --build-project gtk
--build-exe-dir "${CMake_BINARY_DIR}/Tests/FindGTK2/GTK2Components/gtk"
--force-new-ctest-process
--test-command ${CMAKE_CTEST_COMMAND} -V
@@ -22,6 +23,7 @@ if(GTK2_GTKMM_FOUND)
"${CMake_BINARY_DIR}/Tests/FindGTK2/GTK2Components/gtkmm"
${build_generator_args}
--build-target gtkmm-all-libs
+ --build-project gtkmm
--build-exe-dir "${CMake_BINARY_DIR}/Tests/FindGTK2/GTK2Components/gtkmm"
--force-new-ctest-process
--test-command ${CMAKE_CTEST_COMMAND} -V
@@ -310,6 +312,7 @@ if(TARGET GTK2::gtkmm)
"${CMake_BINARY_DIR}/Tests/FindGTK2/GTK2Targets/gtkmm"
${build_generator_args}
--build-target gtkmm-target
+ --build-project gtkmm
--build-exe-dir "${CMake_BINARY_DIR}/Tests/FindGTK2/GTK2Targets/gtkmm"
--force-new-ctest-process
--test-command ${CMAKE_CTEST_COMMAND} -V
diff --git a/Tests/FindPackageModeMakefileTest/Makefile.in b/Tests/FindPackageModeMakefileTest/Makefile.in
index e4df9d6..8e7ff72 100644
--- a/Tests/FindPackageModeMakefileTest/Makefile.in
+++ b/Tests/FindPackageModeMakefileTest/Makefile.in
@@ -4,6 +4,7 @@ include cmakeExecutable.mk
CMAKE_CURRENT_BINARY_DIR = "@CMAKE_CURRENT_BINARY_DIR@"
CMAKE_CXX_COMPILER = "@CMAKE_CXX_COMPILER@"
CMAKE_CXX_COMPILER_ID = "@CMAKE_CXX_COMPILER_ID@"
+CMAKE_CXX_FLAGS = @CMAKE_CXX_FLAGS@
CMAKE_FOO = $(CMAKE) --find-package -DCMAKE_MODULE_PATH=$(CMAKE_CURRENT_BINARY_DIR) -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=$(CMAKE_CXX_COMPILER_ID)
@@ -14,7 +15,7 @@ all: pngtest
main.o: clean main.cpp
@$(CMAKE_FOO) -DMODE=COMPILE >$(tmp)
@foo="`cat $(tmp)`"; \
- printf '"%s" %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CXXFLAGS)" "$$foo" >$(tmp)
+ printf '"%s" %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$$foo" >$(tmp)
@cat $(tmp)
@sh $(tmp)
@rm -f $(tmp)
@@ -22,7 +23,7 @@ main.o: clean main.cpp
pngtest: main.o
@$(CMAKE_FOO) -DMODE=LINK >$(tmp)
@foo="`cat $(tmp)`"; \
- printf '"%s" %s %s -o pngtest main.o %s\n' $(CMAKE_CXX_COMPILER) "$(CXXFLAGS)" "$(LDFLAGS)" "$$foo" >$(tmp)
+ printf '"%s" %s %s -o pngtest main.o %s\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$(LDFLAGS)" "$$foo" >$(tmp)
@cat $(tmp)
@sh $(tmp)
@rm -f $(tmp)
diff --git a/Tests/FindThreads/C-only/CMakeLists.txt b/Tests/FindThreads/C-only/CMakeLists.txt
new file mode 100644
index 0000000..ab4ca0d
--- /dev/null
+++ b/Tests/FindThreads/C-only/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+project(FindThreads_C-only C)
+
+set(CMAKE_THREAD_PREFER_PTHREAD On)
+find_package(Threads REQUIRED)
+
+if (NOT WIN32)
+ add_executable(thr ${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/CheckForPthreads.c)
+ target_link_libraries(thr Threads::Threads)
+endif ()
diff --git a/Tests/FindThreads/CMakeLists.txt b/Tests/FindThreads/CMakeLists.txt
new file mode 100644
index 0000000..aa9499b
--- /dev/null
+++ b/Tests/FindThreads/CMakeLists.txt
@@ -0,0 +1,11 @@
+foreach (_lang IN ITEMS C CXX)
+ add_test(NAME FindThreads.${_lang}-only COMMAND ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindThreads/${_lang}-only"
+ "${CMake_BINARY_DIR}/Tests/FindThreads/${_lang}-only"
+ ${build_generator_args}
+ --build-project FindThreads_${_lang}-only
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V
+ )
+endforeach ()
diff --git a/Tests/FindThreads/CXX-only/CMakeLists.txt b/Tests/FindThreads/CXX-only/CMakeLists.txt
new file mode 100644
index 0000000..9993123
--- /dev/null
+++ b/Tests/FindThreads/CXX-only/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
+project(FindThreads_CXX-only CXX)
+
+set(CMAKE_THREAD_PREFER_PTHREAD On)
+find_package(Threads REQUIRED)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/CheckForPthreads.c
+ ${CMAKE_CURRENT_BINARY_DIR}/CheckForPthreads.cxx)
+
+if (NOT WIN32)
+ add_executable(thr ${CMAKE_CURRENT_BINARY_DIR}/CheckForPthreads.cxx)
+ target_link_libraries(thr Threads::Threads)
+endif ()
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 758165c..27f33a2 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -66,7 +66,7 @@ add_custom_target(check-part1 ALL
-Dtest_colons_4=$<1:C:\\CMake>
-Dtest_colons_5=$<1:C:/CMake>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part1.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 1 of 3)"
+ COMMAND ${CMAKE_COMMAND} -E echo "check done (part 1 of 4)"
VERBATIM
)
@@ -137,7 +137,7 @@ add_custom_target(check-part2 ALL
-Dtest_arbitrary_content_comma_9=$<1:a,,b,,>
-Dtest_arbitrary_content_comma_10=$<1:,,a,,b,,>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part2.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 3)"
+ COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 4)"
VERBATIM
)
@@ -221,7 +221,27 @@ add_custom_target(check-part3 ALL
-Dequal22=$<EQUAL:10,-012>
-Dequal23=$<EQUAL:-10,-012>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)"
+ COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 4)"
+ VERBATIM
+ )
+
+if(WIN32)
+ set(test_shell_path c:/shell/path)
+else()
+ set(test_shell_path /shell/path)
+endif()
+set(path_prefix BYPASS_FURTHER_CONVERSION)
+
+add_custom_target(check-part4 ALL
+ COMMAND ${CMAKE_COMMAND}
+ # Prefix path to bypass its further conversion when being processed by
+ # CMake as command-line argument
+ -Dtest_shell_path=${path_prefix}$<SHELL_PATH:${test_shell_path}>
+ -Dpath_prefix=${path_prefix}
+ -DWIN32=${WIN32}
+ -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part4.cmake
+ COMMAND ${CMAKE_COMMAND} -E echo "check done (part 4 of 4)"
VERBATIM
)
diff --git a/Tests/GeneratorExpression/check-common.cmake b/Tests/GeneratorExpression/check-common.cmake
index 8ffebd7..faf5d4f 100644
--- a/Tests/GeneratorExpression/check-common.cmake
+++ b/Tests/GeneratorExpression/check-common.cmake
@@ -1,5 +1,5 @@
-macro(check var val)
+function(check var val)
if(NOT "${${var}}" STREQUAL "${val}")
message(SEND_ERROR "${var} is \"${${var}}\", not \"${val}\"")
endif()
-endmacro()
+endfunction()
diff --git a/Tests/GeneratorExpression/check-part1.cmake b/Tests/GeneratorExpression/check-part1.cmake
index 3207582..60b193f 100644
--- a/Tests/GeneratorExpression/check-part1.cmake
+++ b/Tests/GeneratorExpression/check-part1.cmake
@@ -55,5 +55,5 @@ check(test_semicolon ";")
check(test_colons_1 ":")
check(test_colons_2 "::")
check(test_colons_3 "Qt5::Core")
-check(test_colons_4 "C:\\\\CMake")
+check(test_colons_4 [[C:\CMake]])
check(test_colons_5 "C:/CMake")
diff --git a/Tests/GeneratorExpression/check-part4.cmake b/Tests/GeneratorExpression/check-part4.cmake
new file mode 100644
index 0000000..9e516d5
--- /dev/null
+++ b/Tests/GeneratorExpression/check-part4.cmake
@@ -0,0 +1,15 @@
+include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake)
+
+string(REPLACE ${path_prefix} "" test_shell_path ${test_shell_path})
+
+if(WIN32)
+ if(CMAKE_GENERATOR STREQUAL "MSYS Makefiles")
+ check(test_shell_path [[/c/shell/path]])
+ elseif(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
+ check(test_shell_path [[c:/shell/path]])
+ else()
+ check(test_shell_path [[c:\shell\path]])
+ endif()
+else()
+ check(test_shell_path [[/shell/path]])
+endif()
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
index 8e2bd0a..5b99ea7 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -5,7 +5,7 @@ project(TargetIncludeDirectories)
macro(create_header _name)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_name}")
- file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_name}/${_name}.h" "//${_name}.h\n")
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_name}/${_name}.h" "/* ${_name}.h */\n")
endmacro()
create_header(bar)
@@ -88,7 +88,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/bad/common.h" "#error Should not be incl
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/good")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/good/common.h" "#include \"othergood.h\"\n")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/othergood")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/othergood/othergood.h" "// No error\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/othergood/othergood.h" "/* No error */\n")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libothergood.cpp" "// No content \n")
add_library(libothergood "${CMAKE_CURRENT_BINARY_DIR}/libothergood.cpp")
@@ -149,7 +149,7 @@ target_include_directories(lib5
)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/prefix_foo/prefix_bar/prefix_bat")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/prefix_foo/prefix_bar/prefix_bat/prefix_foo_bar_bat.h" "// prefix_foo_bar_bat.h\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/prefix_foo/prefix_bar/prefix_bat/prefix_foo_bar_bat.h" "/* prefix_foo_bar_bat.h */\n")
target_include_directories(TargetIncludeDirectories PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/prefix_$<JOIN:foo;bar;bat,/prefix_>")
diff --git a/Tests/MSManifest/CMakeLists.txt b/Tests/MSManifest/CMakeLists.txt
new file mode 100644
index 0000000..300cfa6
--- /dev/null
+++ b/Tests/MSManifest/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.3)
+project(MSManifest C)
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+add_subdirectory(Subdir)
diff --git a/Tests/MSManifest/Subdir/CMakeLists.txt b/Tests/MSManifest/Subdir/CMakeLists.txt
new file mode 100644
index 0000000..a47cf00
--- /dev/null
+++ b/Tests/MSManifest/Subdir/CMakeLists.txt
@@ -0,0 +1,9 @@
+configure_file(test.manifest.in test.manifest)
+add_executable(MSManifest main.c ${CMAKE_CURRENT_BINARY_DIR}/test.manifest)
+
+if(MSVC AND NOT MSVC_VERSION LESS 1400)
+ add_custom_command(TARGET MSManifest POST_BUILD VERBATIM
+ COMMAND ${CMAKE_COMMAND} -Dexe=$<TARGET_FILE:MSManifest>
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
+ )
+endif()
diff --git a/Tests/MSManifest/Subdir/check.cmake b/Tests/MSManifest/Subdir/check.cmake
new file mode 100644
index 0000000..b7b6841
--- /dev/null
+++ b/Tests/MSManifest/Subdir/check.cmake
@@ -0,0 +1,6 @@
+file(STRINGS "${exe}" content REGEX "name=\"Kitware.CMake.MSManifestTest\"")
+if(content)
+ message(STATUS "Expected manifest content found:\n ${content}")
+else()
+ message(FATAL_ERROR "Expected manifest content not found in\n ${exe}")
+endif()
diff --git a/Tests/MSManifest/Subdir/main.c b/Tests/MSManifest/Subdir/main.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/Tests/MSManifest/Subdir/main.c
@@ -0,0 +1 @@
+int main(void) { return 0; }
diff --git a/Tests/MSManifest/Subdir/test.manifest.in b/Tests/MSManifest/Subdir/test.manifest.in
new file mode 100644
index 0000000..540961a
--- /dev/null
+++ b/Tests/MSManifest/Subdir/test.manifest.in
@@ -0,0 +1,4 @@
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity type="win32" version="1.0.0.0"
+ name="Kitware.CMake.MSManifestTest"/>
+</assembly>
diff --git a/Tests/OutOfBinary/CMakeLists.txt b/Tests/OutOfBinary/CMakeLists.txt
index e327541..f50536e 100644
--- a/Tests/OutOfBinary/CMakeLists.txt
+++ b/Tests/OutOfBinary/CMakeLists.txt
@@ -1,2 +1,4 @@
add_library(outlib outlib.c)
+add_executable(outexe outexe.c)
+target_link_libraries(outexe subdir)
diff --git a/Tests/OutOfBinary/outexe.c b/Tests/OutOfBinary/outexe.c
new file mode 100644
index 0000000..6f14043
--- /dev/null
+++ b/Tests/OutOfBinary/outexe.c
@@ -0,0 +1,2 @@
+extern int subdir(void);
+int main(void) { return subdir(); }
diff --git a/Tests/OutOfSource/SubDir/CMakeLists.txt b/Tests/OutOfSource/SubDir/CMakeLists.txt
index c5df36e..e18dbb9 100644
--- a/Tests/OutOfSource/SubDir/CMakeLists.txt
+++ b/Tests/OutOfSource/SubDir/CMakeLists.txt
@@ -6,3 +6,5 @@ add_subdirectory(${OutOfSource_SOURCE_DIR}/../OutOfBinary
# subdir to a sibling dir
add_subdirectory(${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir OutOfSourceSubdir )
+
+add_library(subdir subdir.c)
diff --git a/Tests/OutOfSource/SubDir/subdir.c b/Tests/OutOfSource/SubDir/subdir.c
new file mode 100644
index 0000000..0d0d827
--- /dev/null
+++ b/Tests/OutOfSource/SubDir/subdir.c
@@ -0,0 +1 @@
+int subdir(void) { return 0; }
diff --git a/Tests/Plugin/src/example_exe.cxx b/Tests/Plugin/src/example_exe.cxx
index bc4b03e..12d9204 100644
--- a/Tests/Plugin/src/example_exe.cxx
+++ b/Tests/Plugin/src/example_exe.cxx
@@ -32,7 +32,7 @@ int main()
if(!handle)
{
std::cerr << "Could not open plugin \""
- << libName << "\"!" << std::endl;
+ << libName.c_str() << "\"!" << std::endl;
return 1;
}
kwsys::DynamicLoader::SymbolPointer sym =
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index ebcfc0f..d5aca55 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -101,7 +101,14 @@ add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.c
)
set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h")
-set_target_properties(QtAutogen codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE)
+add_executable(targetObjectsTest targetObjectsTest.cpp $<TARGET_OBJECTS:privateSlot>)
+target_link_libraries(targetObjectsTest ${QT_LIBRARIES})
+
+set_target_properties(
+ QtAutogen codeeditorLib privateSlot targetObjectsTest
+ PROPERTIES
+ AUTOMOC TRUE
+)
include(GenerateExportHeader)
# The order is relevant here. B depends on A, and B headers depend on A
diff --git a/Tests/QtAutogen/targetObjectsTest.cpp b/Tests/QtAutogen/targetObjectsTest.cpp
new file mode 100644
index 0000000..766b775
--- /dev/null
+++ b/Tests/QtAutogen/targetObjectsTest.cpp
@@ -0,0 +1,5 @@
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake
new file mode 100644
index 0000000..ef33012
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake
@@ -0,0 +1,19 @@
+enable_language(C)
+
+add_executable(main main.c ${CMAKE_CURRENT_BINARY_DIR}/test.manifest)
+
+if(MSVC AND NOT MSVC_VERSION LESS 1400)
+ set(EXTRA_CHECK [[
+file(STRINGS "$<TARGET_FILE:main>" content REGEX "name=\"Kitware.CMake.C-Exe-Manifest-step[0-9]\"")
+if(NOT "${content}" MATCHES "name=\"Kitware.CMake.C-Exe-Manifest-step${check_step}\"")
+ set(RunCMake_TEST_FAILED "Binary has no manifest with name=\"Kitware.CMake.C-Exe-Manifest-step${check_step}\":\n ${content}")
+endif()
+]])
+endif()
+
+file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+set(check_pairs
+ \"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/test.manifest\"
+ )
+${EXTRA_CHECK}
+")
diff --git a/Tests/RunCMake/BuildDepends/C-Exe-Manifest.step1.cmake b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.step1.cmake
new file mode 100644
index 0000000..c0b939d
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.step1.cmake
@@ -0,0 +1,6 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/test.manifest" [[
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity type="win32" version="1.0.0.0"
+ name="Kitware.CMake.C-Exe-Manifest-step1"/>
+</assembly>
+]])
diff --git a/Tests/RunCMake/BuildDepends/C-Exe-Manifest.step2.cmake b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.step2.cmake
new file mode 100644
index 0000000..a75bf21
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.step2.cmake
@@ -0,0 +1,6 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/test.manifest" [[
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity type="win32" version="1.0.0.0"
+ name="Kitware.CMake.C-Exe-Manifest-step2"/>
+</assembly>
+]])
diff --git a/Tests/RunCMake/BuildDepends/C-Exe.cmake b/Tests/RunCMake/BuildDepends/C-Exe.cmake
new file mode 100644
index 0000000..5057ca9
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/C-Exe.cmake
@@ -0,0 +1,12 @@
+enable_language(C)
+
+add_executable(main ${CMAKE_CURRENT_BINARY_DIR}/main.c)
+
+file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+set(check_pairs
+ \"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/main.c\"
+ )
+set(check_exes
+ \"$<TARGET_FILE:main>\"
+ )
+")
diff --git a/Tests/RunCMake/BuildDepends/C-Exe.step1.cmake b/Tests/RunCMake/BuildDepends/C-Exe.step1.cmake
new file mode 100644
index 0000000..08e2949
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/C-Exe.step1.cmake
@@ -0,0 +1,3 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/main.c" [[
+int main(void) { return 1; }
+]])
diff --git a/Tests/RunCMake/BuildDepends/C-Exe.step2.cmake b/Tests/RunCMake/BuildDepends/C-Exe.step2.cmake
new file mode 100644
index 0000000..ee4530c
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/C-Exe.step2.cmake
@@ -0,0 +1,3 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/main.c" [[
+int main(void) { return 2; }
+]])
diff --git a/Tests/RunCMake/BuildDepends/CMakeLists.txt b/Tests/RunCMake/BuildDepends/CMakeLists.txt
new file mode 100644
index 0000000..74b3ff8
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.3)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
new file mode 100644
index 0000000..a578408
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -0,0 +1,40 @@
+include(RunCMake)
+
+if(RunCMake_GENERATOR STREQUAL "Borland Makefiles")
+ set(fs_delay 3)
+else()
+ set(fs_delay 1.125)
+endif()
+
+function(run_BuildDepends CASE)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${CASE}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ endif()
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ include(${RunCMake_SOURCE_DIR}/${CASE}.step1.cmake OPTIONAL)
+ run_cmake(${CASE})
+ set(RunCMake-check-file check.cmake)
+ set(check_step 1)
+ run_cmake_command(${CASE}-build1 ${CMAKE_COMMAND} --build . --config Debug)
+ if(run_BuildDepends_skip_step_2)
+ return()
+ endif()
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${fs_delay}) # handle 1s resolution
+ include(${RunCMake_SOURCE_DIR}/${CASE}.step2.cmake OPTIONAL)
+ set(check_step 2)
+ run_cmake_command(${CASE}-build2 ${CMAKE_COMMAND} --build . --config Debug)
+endfunction()
+
+run_BuildDepends(C-Exe)
+if(NOT RunCMake_GENERATOR MATCHES "Visual Studio [67]|Xcode")
+ if(RunCMake_GENERATOR MATCHES "Visual Studio 10")
+ # VS 10 forgets to re-link when a manifest changes
+ set(run_BuildDepends_skip_step_2 1)
+ endif()
+ run_BuildDepends(C-Exe-Manifest)
+ unset(run_BuildDepends_skip_step_2)
+endif()
diff --git a/Tests/RunCMake/BuildDepends/check.cmake b/Tests/RunCMake/BuildDepends/check.cmake
new file mode 100644
index 0000000..26a9eb6
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/check.cmake
@@ -0,0 +1,37 @@
+if(EXISTS ${RunCMake_TEST_BINARY_DIR}/check-debug.cmake)
+ include(${RunCMake_TEST_BINARY_DIR}/check-debug.cmake)
+ if(RunCMake_TEST_FAILED)
+ return()
+ endif()
+ foreach(exe IN LISTS check_exes)
+ execute_process(COMMAND ${exe} RESULT_VARIABLE res)
+ if(NOT res EQUAL ${check_step})
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}
+ '${exe}' returned '${res}' but expected '${check_step}'
+")
+ endif()
+ endforeach()
+ foreach(p IN LISTS check_pairs)
+ if("${p}" MATCHES "^(.*)\\|(.*)$")
+ set(lhs "${CMAKE_MATCH_1}")
+ set(rhs "${CMAKE_MATCH_2}")
+ if(NOT EXISTS "${lhs}")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}
+ '${lhs}' missing
+")
+ elseif(NOT EXISTS "${rhs}")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}
+ '${rhs}' missing
+")
+ elseif(NOT "${lhs}" IS_NEWER_THAN "${rhs}")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}
+ '${lhs}' is not newer than '${rhs}'
+")
+ endif()
+ endif()
+ endforeach()
+else()
+ set(RunCMake_TEST_FAILED "
+ '${RunCMake_TEST_BINARY_DIR}/check-debug.cmake' missing
+")
+endif()
diff --git a/Tests/RunCMake/BuildDepends/main.c b/Tests/RunCMake/BuildDepends/main.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/main.c
@@ -0,0 +1 @@
+int main(void) { return 0; }
diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
index fc58ea5..6331717 100644
--- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
@@ -11,3 +11,4 @@ run_cmake(CMP0026-LOCATION-CONFIG-OLD)
run_cmake(CMP0026-LOCATION-CONFIG-WARN)
run_cmake(ObjlibNotDefined)
run_cmake(LOCATION-and-TARGET_OBJECTS)
+run_cmake(clear-cached-information)
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt b/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt
new file mode 100644
index 0000000..c51e883
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt
@@ -0,0 +1,2 @@
+
+add_executable(Hello ${CMAKE_CURRENT_BINARY_DIR}/main.c)
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information.cmake b/Tests/RunCMake/CMP0026/clear-cached-information.cmake
new file mode 100644
index 0000000..dd2dd72
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/clear-cached-information.cmake
@@ -0,0 +1,14 @@
+
+enable_language(C)
+
+cmake_policy(SET CMP0026 OLD)
+
+add_subdirectory(clear-cached-information-dir)
+
+# Critical: this needs to happen in root CMakeLists.txt and not inside
+# the subdir.
+get_target_property(mypath Hello LOCATION)
+# Now we create the file later, so you can see, ultimately no error should
+# happen e.g. during generate phase:
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clear-cached-information-dir/main.c)
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/clear-cached-information-dir/main.c PROPERTIES GENERATED TRUE)
diff --git a/Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt
index 3d875ae..3cfa5d2 100644
--- a/Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0054/CMP0054-WARN-stderr.txt
@@ -9,3 +9,15 @@ CMake Warning \(dev\) at CMP0054-WARN.cmake:3 \(if\):
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
++
+CMake Warning \(dev\) at CMP0054-WARN.cmake:5 \(elseif\):
+ Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or
+ keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
+ details. Use the cmake_policy command to set the policy and suppress this
+ warning.
+
+ Quoted variables like "FOO" will no longer be dereferenced when the policy
+ is set to NEW. Since the policy is not set the OLD behavior will be used.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0054/CMP0054-WARN.cmake b/Tests/RunCMake/CMP0054/CMP0054-WARN.cmake
index 37855fc..a608929 100644
--- a/Tests/RunCMake/CMP0054/CMP0054-WARN.cmake
+++ b/Tests/RunCMake/CMP0054/CMP0054-WARN.cmake
@@ -2,4 +2,6 @@ set(FOO "BAR")
if(NOT "FOO" STREQUAL "BAR")
message(FATAL_ERROR "The given literals should match")
+elseif("FOO" STREQUAL "BING")
+ message(FATAL_ERROR "The given literals should not match")
endif()
diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt
index b1ebd49..5a8c263 100644
--- a/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN-stderr.txt
@@ -10,3 +10,16 @@ CMake Warning \(dev\) at CMP0054-keywords-WARN.cmake:1 \(if\):
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
++
+CMake Warning \(dev\) at CMP0054-keywords-WARN.cmake:3 \(elseif\):
+ Policy CMP0054 is not set: Only interpret if\(\) arguments as variables or
+ keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
+ details. Use the cmake_policy command to set the policy and suppress this
+ warning.
+
+ Quoted keywords like "DEFINED" will no longer be interpreted as keywords
+ when the policy is set to NEW. Since the policy is not set the OLD
+ behavior will be used.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake b/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake
index ee0a623..118ab3d 100644
--- a/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake
+++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-WARN.cmake
@@ -1,3 +1,5 @@
if("NOT" 1)
message(FATAL_ERROR "[\"NOT\" 1] evaluated true")
+elseif("DEFINED" NotDefined)
+ message(FATAL_ERROR "[\"DEFINED\" NotDefined] evaluated true")
endif()
diff --git a/Tests/RunCMake/CMP0064/CMP0064-WARN-stderr.txt b/Tests/RunCMake/CMP0064/CMP0064-WARN-stderr.txt
new file mode 100644
index 0000000..71f1ab7
--- /dev/null
+++ b/Tests/RunCMake/CMP0064/CMP0064-WARN-stderr.txt
@@ -0,0 +1,10 @@
+CMake Warning \(dev\) at CMP0064-WARN.cmake:3 \(if\):
+ Policy CMP0064 is not set: Support new TEST if\(\) operator. Run "cmake
+ --help-policy CMP0064" for policy details. Use the cmake_policy command to
+ set the policy and suppress this warning.
+
+ TEST will be interpreted as an operator when the policy is set to NEW.
+ Since the policy is not set the OLD behavior will be used.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0064/CMP0064-WARN.cmake b/Tests/RunCMake/CMP0064/CMP0064-WARN.cmake
index bffd3f3..8f26ec6 100644
--- a/Tests/RunCMake/CMP0064/CMP0064-WARN.cmake
+++ b/Tests/RunCMake/CMP0064/CMP0064-WARN.cmake
@@ -1,4 +1,4 @@
-cmake_policy(SET CMP0064 OLD)
+
if(TEST)
message(FATAL_ERROR "TEST was not recognized to be undefined")
diff --git a/Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake b/Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake
new file mode 100644
index 0000000..9339e46
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake
@@ -0,0 +1,15 @@
+function(BuildTargetInSubProject P T E)
+ try_compile(RESULTVAR
+ ${CMAKE_CURRENT_BINARY_DIR}/subproject
+ ${CMAKE_CURRENT_SOURCE_DIR}/subproject
+ ${P} ${T} OUTPUT_VARIABLE O)
+ if(E AND RESULTVAR)
+ message(STATUS "${P} target ${T} succeeded as expected")
+ elseif(E AND NOT RESULTVAR)
+ message(FATAL_ERROR "${P} target ${T} failed but should have succeeded. Output:${O}")
+ elseif(NOT E AND NOT RESULTVAR)
+ message(STATUS "${P} target ${T} failed as expected")
+ elseif(NOT E AND RESULTVAR)
+ message(FATAL_ERROR "${P} target ${T} succeeded but should have failed. Output:${O}")
+ endif()
+endfunction()
diff --git a/Tests/RunCMake/CMP0065/CMakeLists.txt b/Tests/RunCMake/CMP0065/CMakeLists.txt
new file mode 100644
index 0000000..74b3ff8
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.3)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0065/NEWBad.cmake b/Tests/RunCMake/CMP0065/NEWBad.cmake
new file mode 100644
index 0000000..79d9adb
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/NEWBad.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+include(BuildTargetInSubProject.cmake)
+
+BuildTargetInSubProject(TestPolicyCMP0065 FooNEWBad FALSE)
diff --git a/Tests/RunCMake/CMP0065/NEWGood.cmake b/Tests/RunCMake/CMP0065/NEWGood.cmake
new file mode 100644
index 0000000..a5b5d04
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/NEWGood.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+include(BuildTargetInSubProject.cmake)
+
+BuildTargetInSubProject(TestPolicyCMP0065 FooNEWGood TRUE)
diff --git a/Tests/RunCMake/CMP0065/OLDBad1.cmake b/Tests/RunCMake/CMP0065/OLDBad1.cmake
new file mode 100644
index 0000000..6d780b4
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/OLDBad1.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+include(BuildTargetInSubProject.cmake)
+
+BuildTargetInSubProject(TestPolicyCMP0065 FooOLDBad1 FALSE)
diff --git a/Tests/RunCMake/CMP0065/OLDBad2.cmake b/Tests/RunCMake/CMP0065/OLDBad2.cmake
new file mode 100644
index 0000000..7196473
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/OLDBad2.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+include(BuildTargetInSubProject.cmake)
+
+BuildTargetInSubProject(TestPolicyCMP0065 FooOLDBad2 FALSE)
diff --git a/Tests/RunCMake/CMP0065/RunCMakeTest.cmake b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake
new file mode 100644
index 0000000..254a4ec
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake
@@ -0,0 +1,8 @@
+include(RunCMake)
+
+run_cmake(OLDBad1)
+run_cmake(OLDBad2)
+run_cmake(NEWBad)
+run_cmake(NEWGood)
+run_cmake(WARN-OFF)
+run_cmake(WARN-ON)
diff --git a/Tests/RunCMake/CMP0065/WARN-OFF.cmake b/Tests/RunCMake/CMP0065/WARN-OFF.cmake
new file mode 100644
index 0000000..dbc9562
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/WARN-OFF.cmake
@@ -0,0 +1,3 @@
+
+enable_language(C)
+add_executable(main subproject/main.c)
diff --git a/Tests/RunCMake/CMP0065/WARN-ON-stderr.txt b/Tests/RunCMake/CMP0065/WARN-ON-stderr.txt
new file mode 100644
index 0000000..dda4fe5
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/WARN-ON-stderr.txt
@@ -0,0 +1,10 @@
+CMake Warning \(dev\) in CMakeLists.txt:
+ Policy CMP0065 is not set: Do not add flags to export symbols from
+ executables without the ENABLE_EXPORTS target property. Run "cmake
+ --help-policy CMP0065" for policy details. Use the cmake_policy command to
+ set the policy and suppress this warning.
+
+ For compatibility with older versions of CMake, additional flags may be
+ added to export symbols on all executables regardless of thier
+ ENABLE_EXPORTS property.
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0065/WARN-ON.cmake b/Tests/RunCMake/CMP0065/WARN-ON.cmake
new file mode 100644
index 0000000..6ed4a41
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/WARN-ON.cmake
@@ -0,0 +1,3 @@
+set(CMAKE_POLICY_WARNING_CMP0065 1)
+enable_language(C)
+add_executable(main subproject/main.c)
diff --git a/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt b/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt
new file mode 100644
index 0000000..bed5960
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 3.3)
+
+project(TestPolicyCMP0065 C)
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS BADFLAGS)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 OLD)
+add_executable(FooOLDBad1 main.c)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 OLD)
+add_executable(FooOLDBad2 main.c)
+set_target_properties(FooOLDBad2 PROPERTIES ENABLE_EXPORTS ON)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 NEW)
+add_executable(FooNEWGood main.c)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 NEW)
+add_executable(FooNEWBad main.c)
+set_target_properties(FooNEWBad PROPERTIES ENABLE_EXPORTS ON)
diff --git a/Tests/RunCMake/CMP0065/subproject/main.c b/Tests/RunCMake/CMP0065/subproject/main.c
new file mode 100644
index 0000000..98725db
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/subproject/main.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ printf("Hello World\n");
+ return 0;
+}
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 5bc9af8..1a0019f 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -104,6 +104,13 @@ add_RunCMake_test(CMP0057)
add_RunCMake_test(CMP0059)
add_RunCMake_test(CMP0060)
add_RunCMake_test(CMP0064)
+
+# The test for Policy 65 requires the use of the
+# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
+# generators ignore. The policy will have no effect on those generators.
+if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode")
+ add_RunCMake_test(CMP0065)
+endif()
if(CMAKE_GENERATOR MATCHES "Make")
add_RunCMake_test(Make)
endif()
@@ -124,6 +131,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
)
endif()
+add_RunCMake_test(BuildDepends)
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(CompilerChange)
endif()
@@ -139,6 +147,7 @@ add_RunCMake_test(GeneratorToolset)
add_RunCMake_test(GNUInstallDirs)
add_RunCMake_test(TargetPropertyGeneratorExpressions)
add_RunCMake_test(Languages)
+add_RunCMake_test(LinkStatic)
add_RunCMake_test(ObjectLibrary)
add_RunCMake_test(Swift)
add_RunCMake_test(TargetObjects)
@@ -281,7 +290,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
add_RunCMake_test(CompilerLauncher)
endif()
-add_RunCMake_test_group(CPack "DEB;RPM")
+add_RunCMake_test_group(CPack "DEB;RPM;TGZ")
# add a test to make sure symbols are exported from a shared library
# for MSVC compilers CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS property is used
add_RunCMake_test(AutoExportDll)
diff --git a/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake b/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake
new file mode 100644
index 0000000..7210e7d
--- /dev/null
+++ b/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake
@@ -0,0 +1,5 @@
+set(CPACK_COMPONENTS_ALL test)
+install(DIRECTORY DESTINATION empty
+ COMPONENT test)
+
+set(CPACK_PACKAGE_NAME "components_empty_dir")
diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
index 7ea2a24..aef1086 100644
--- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake
+++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
@@ -10,47 +10,12 @@ function(run_cpack_test TEST_NAME types build)
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
# execute cmake
- execute_process(
- COMMAND "${CMAKE_COMMAND}" -DRunCMake_TEST=${TEST_NAME}
- -DGENERATOR_TYPE=${TEST_TYPE} "${RunCMake_SOURCE_DIR}"
- WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}"
- RESULT_VARIABLE res
- OUTPUT_FILE "${RunCMake_TEST_BINARY_DIR}/test_output.txt"
- ERROR_FILE "${RunCMake_TEST_BINARY_DIR}/test_error.txt"
- )
-
- if(res)
- run_cmake_command(
- ${TEST_TYPE}/${TEST_NAME}
- "${CMAKE_COMMAND}"
- -DRunCMake_TEST_STEP=configure
- -Dreturn_code=${res}
- "-Dbin_dir=${RunCMake_TEST_BINARY_DIR}"
- -P "${RunCMake_SOURCE_DIR}/PreTestError.cmake"
- )
- return()
- endif()
+ set(RunCMake_TEST_OPTIONS "-DGENERATOR_TYPE=${TEST_TYPE}")
+ run_cmake(${TEST_NAME})
# execute optional build step
if(build)
- execute_process(
- COMMAND "${CMAKE_COMMAND}" --build "${RunCMake_TEST_BINARY_DIR}"
- RESULT_VARIABLE res
- OUTPUT_FILE "${RunCMake_TEST_BINARY_DIR}/test_output.txt"
- ERROR_FILE "${RunCMake_TEST_BINARY_DIR}/test_error.txt"
- )
- endif()
-
- if(res)
- run_cmake_command(
- ${TEST_TYPE}/${TEST_NAME}
- "${CMAKE_COMMAND}"
- -DRunCMake_TEST_STEP=build
- -Dreturn_code=${res}
- "-Dbin_dir=${RunCMake_TEST_BINARY_DIR}"
- -P "${RunCMake_SOURCE_DIR}/PreTestError.cmake"
- )
- return()
+ run_cmake_command(${TEST_NAME}-Build "${CMAKE_COMMAND}" --build "${RunCMake_TEST_BINARY_DIR}")
endif()
# execute cpack
diff --git a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake
new file mode 100644
index 0000000..5adca68
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake
@@ -0,0 +1,5 @@
+set(whitespaces_ "[\t\n\r ]*")
+
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_1 "components_empty_dir*.deb")
+set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$")
diff --git a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake
new file mode 100644
index 0000000..2720fe9
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake
@@ -0,0 +1,2 @@
+set(CPACK_PACKAGE_CONTACT "someone")
+set(CPACK_DEB_COMPONENT_INSTALL "ON")
diff --git a/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake
index 78b6114..5f929ff 100644
--- a/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake
@@ -1,11 +1,17 @@
set(foo_preinst "^echo default_preinst$")
+set(foo_preinst_permissions_regex "-rwxr-xr-x .*")
set(foo_prerm "^echo default_prerm$")
+set(foo_prerm_permissions_regex "-rwxr-xr-x .*")
verifyDebControl("${FOUND_FILE_1}" "foo" "preinst;prerm")
set(bar_preinst "^echo bar_preinst$")
+set(bar_prerm_permissions_regex "-rwx------ .*")
set(bar_prerm "^echo bar_prerm$")
+set(bar_prerm_permissions_regex "-rwx------ .*")
verifyDebControl("${FOUND_FILE_2}" "bar" "preinst;prerm")
set(bas_preinst "^echo default_preinst$")
+set(bas_prerm_permissions_regex "-rwxr-xr-x .*")
set(bas_prerm "^echo default_prerm$")
+set(bas_prerm_permissions_regex "-rwxr-xr-x .*")
verifyDebControl("${FOUND_FILE_3}" "bas" "preinst;prerm")
diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake
index 44c862d..ba39f2e 100644
--- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake
@@ -1,4 +1,4 @@
-function(checkDepends_ FILE REGEX)
+function(checkDependencies_ FILE REGEX)
set(whitespaces_ "[\t\n\r ]*")
getPackageInfo("${FILE}" "FILE_INFO_")
@@ -7,9 +7,28 @@ function(checkDepends_ FILE REGEX)
endif()
endfunction()
-checkDepends_("${FOUND_FILE_1}" ".*Depends${whitespaces_}:${whitespaces_}depend-application, depend-application-b.*")
-# use wildcard as we are using dependency auto detection
-checkDepends_("${FOUND_FILE_2}" ".*Depends${whitespaces_}:${whitespaces_}.*depend-application, depend-application-b.*")
-checkDepends_("${FOUND_FILE_3}" ".*Depends${whitespaces_}:${whitespaces_}depend-headers.*")
-checkDepends_("${FOUND_FILE_4}" ".*Depends${whitespaces_}:${whitespaces_}depend-default, depend-default-b.*")
-checkDepends_("${FOUND_FILE_5}" ".*Depends${whitespaces_}:${whitespaces_}depend-default, depend-default-b.*")
+foreach(dependency_type_ DEPENDS CONFLICTS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS)
+ string(TOLOWER "${dependency_type_}" lower_dependency_type_)
+ string(SUBSTRING ${lower_dependency_type_} 1 -1 lower_dependency_type_tail_)
+ string(SUBSTRING ${dependency_type_} 0 1 dependency_type_head_)
+ set(dependency_type_name_ "${dependency_type_head_}${lower_dependency_type_tail_}")
+
+ checkDependencies_("${FOUND_FILE_1}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b.*")
+ checkDependencies_("${FOUND_FILE_2}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}.*${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b.*")
+ checkDependencies_("${FOUND_FILE_3}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-headers.*")
+ checkDependencies_("${FOUND_FILE_4}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b.*")
+ checkDependencies_("${FOUND_FILE_5}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b.*")
+endforeach()
+
+checkDependencies_("${FOUND_FILE_1}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b")
+checkDependencies_("${FOUND_FILE_2}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b")
+checkDependencies_("${FOUND_FILE_3}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b")
+checkDependencies_("${FOUND_FILE_4}" ".*Provides${whitespaces_}:${whitespaces_}provided-lib.*")
+checkDependencies_("${FOUND_FILE_5}" ".*Provides${whitespaces_}:${whitespaces_}provided-lib_auto.*, provided-lib_auto-b.*")
+
+# PREDEPENDS
+checkDependencies_("${FOUND_FILE_1}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-application, predepends-application-b.*")
+checkDependencies_("${FOUND_FILE_2}" ".*Pre-Depends${whitespaces_}:${whitespaces_}.*predepends-application, predepends-application-b.*")
+checkDependencies_("${FOUND_FILE_3}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-headers.*")
+checkDependencies_("${FOUND_FILE_4}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-default, predepends-default-b.*")
+checkDependencies_("${FOUND_FILE_5}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-default, predepends-default-b.*")
diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake
index 9e09428..96a9f14 100644
--- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake
+++ b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake
@@ -7,9 +7,15 @@ set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS FALSE)
# to determine their dependencies and we can not be certain if there will be any
set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_SHLIBDEPS TRUE)
-set(CPACK_DEBIAN_PACKAGE_DEPENDS "depend-default, depend-default-b")
-set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_DEPENDS "depend-application, depend-application-b")
-set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_DEPENDS "depend-application, depend-application-b")
-set(CPACK_DEBIAN_HEADERS_PACKAGE_DEPENDS "depend-headers")
+foreach(dependency_type_ DEPENDS CONFLICTS PREDEPENDS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS)
+ string(TOLOWER "${dependency_type_}" lower_dependency_type_)
-# TODO add other dependency tests once CPackDeb supports them
+ set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b")
+ set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b")
+ set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b")
+ set(CPACK_DEBIAN_HEADERS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-headers")
+endforeach()
+
+set(CPACK_DEBIAN_PACKAGE_PROVIDES "provided-default, provided-default-b")
+set(CPACK_DEBIAN_LIBS_PACKAGE_PROVIDES "provided-lib")
+set(CPACK_DEBIAN_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b")
diff --git a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake
new file mode 100644
index 0000000..1552a36
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake
@@ -0,0 +1,5 @@
+set(whitespaces_ "[\t\n\r ]*")
+
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_1 "empty_dir*.deb")
+set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$")
diff --git a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake
new file mode 100644
index 0000000..8821ab9
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake
@@ -0,0 +1 @@
+set(CPACK_PACKAGE_CONTACT "someone")
diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake
index a204a3c..f490130 100644
--- a/Tests/RunCMake/CPack/DEB/Helpers.cmake
+++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake
@@ -14,7 +14,7 @@ function(verifyDebControl FILE PREFIX VERIFY_FILES)
ERROR_VARIABLE err_)
if(err_)
- message(FATAL_ERROR "Debian controll verification failed for file: "
+ message(FATAL_ERROR "Debian control verification failed for file: "
"'${FILE}'; error output: '${err_}'")
endif()
@@ -24,6 +24,19 @@ function(verifyDebControl FILE PREFIX VERIFY_FILES)
message(FATAL_ERROR "Unexpected content in for '${PREFIX}_${FILE_}'!"
" Content: '${content_}'")
endif()
+
+ execute_process(COMMAND ls -l "${CMAKE_CURRENT_BINARY_DIR}/control_${PREFIX}/${FILE_}"
+ OUTPUT_VARIABLE package_permissions_
+ ERROR_VARIABLE package_permissions_error_
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if(NOT package_permissions_error_)
+ if(NOT package_permissions_ MATCHES "${${PREFIX}_${FILE_}_permissions_regex}")
+ message(FATAL_ERROR "Unexpected file permissions for ${PREFIX}_${FILE_}: '${package_permissions_}'!")
+ endif()
+ else()
+ message(FATAL_ERROR "Listing file permissions failed (${package_permissions_error_})!")
+ endif()
endforeach()
endfunction()
diff --git a/Tests/RunCMake/CPack/DEB_EXTRA.cmake b/Tests/RunCMake/CPack/DEB_EXTRA.cmake
index 46d848d..3c291d5 100644
--- a/Tests/RunCMake/CPack/DEB_EXTRA.cmake
+++ b/Tests/RunCMake/CPack/DEB_EXTRA.cmake
@@ -2,14 +2,32 @@ install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo)
install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar)
install(FILES CMakeLists.txt DESTINATION bas COMPONENT bas)
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/preinst "echo default_preinst")
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/prerm "echo default_prerm")
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/preinst "echo default_preinst")
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/prerm "echo default_prerm")
+
+foreach(file_ preinst prerm)
+ file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/${file_}
+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
+ FILE_PERMISSIONS
+ OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+endforeach()
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
- "${CMAKE_CURRENT_BINARY_DIR}/preinst;${CMAKE_CURRENT_BINARY_DIR}/prerm")
+ "${CMAKE_CURRENT_BINARY_DIR}/preinst;${CMAKE_CURRENT_BINARY_DIR}/prerm;${CMAKE_CURRENT_BINARY_DIR}/conffiles")
+
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/preinst "echo bar_preinst")
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/prerm "echo bar_prerm")
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar/preinst "echo bar_preinst")
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar/prerm "echo bar_prerm")
+foreach(file_ preinst prerm)
+ # not acceptable permissions for lintian but we need to check that
+ # permissions are preserved
+ file(COPY ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/${file_}
+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bar
+ FILE_PERMISSIONS
+ OWNER_READ OWNER_WRITE OWNER_EXECUTE)
+endforeach()
set(CPACK_DEBIAN_BAR_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_BINARY_DIR}/bar/preinst;${CMAKE_CURRENT_BINARY_DIR}/bar/prerm")
diff --git a/Tests/RunCMake/CPack/DEPENDENCIES.cmake b/Tests/RunCMake/CPack/DEPENDENCIES.cmake
index 0aef925..4f6d65f 100644
--- a/Tests/RunCMake/CPack/DEPENDENCIES.cmake
+++ b/Tests/RunCMake/CPack/DEPENDENCIES.cmake
@@ -1,11 +1,13 @@
+set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp"
- "int test_lib();")
+ "int test_lib();\n")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp"
- "#include \"test_lib.hpp\"\nint test_lib() {return 0;}")
+ "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n")
add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
- "#include \"test_lib.hpp\"\nint main() {return test_lib();}")
+ "#include \"test_lib.hpp\"\nint main() {return test_lib();}\n")
add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
target_link_libraries(test_prog test_lib)
diff --git a/Tests/RunCMake/CPack/EMPTY_DIR.cmake b/Tests/RunCMake/CPack/EMPTY_DIR.cmake
new file mode 100644
index 0000000..023ba17
--- /dev/null
+++ b/Tests/RunCMake/CPack/EMPTY_DIR.cmake
@@ -0,0 +1,4 @@
+install(DIRECTORY DESTINATION empty
+ COMPONENT test)
+
+set(CPACK_PACKAGE_NAME "empty_dir")
diff --git a/Tests/RunCMake/CPack/PreTestError.cmake b/Tests/RunCMake/CPack/PreTestError.cmake
deleted file mode 100644
index f88f2e8..0000000
--- a/Tests/RunCMake/CPack/PreTestError.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-file(READ "${bin_dir}/test_output.txt" output)
-file(READ "${bin_dir}/test_error.txt" error)
-
-message(FATAL_ERROR "Error in pre-test phase '${RunCMake_TEST_STEP}'!\n"
- "Return code: '${return_code}'\n"
- "Info output: '${output}'\n"
- "Error output: '${error}'")
diff --git a/Tests/RunCMake/CPack/README.txt b/Tests/RunCMake/CPack/README.txt
index 365c737..ea68304 100644
--- a/Tests/RunCMake/CPack/README.txt
+++ b/Tests/RunCMake/CPack/README.txt
@@ -32,14 +32,14 @@ different types of packages. This script is placed into CPack test root
directory even if it will be used for only one of the generators.
If test will be used for multiple generators but some of them require some
-generator speciffic commands then those commands should be added to a separate
+generator specific commands then those commands should be added to a separate
file that should be located in '<generator_name>/<test_name>-specifics.cmake'
in CPack test root directory.
CPack execution phase:
----------------------
-Only exececutes CPack for content that was generated during CMake execution
+Only executes CPack for content that was generated during CMake execution
phase.
Verification of generated files:
diff --git a/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake
new file mode 100644
index 0000000..d396276
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake
@@ -0,0 +1,5 @@
+set(whitespaces_ "[\t\n\r ]*")
+
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_1 "components_empty_dir*.rpm")
+set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$")
diff --git a/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt b/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt
new file mode 100644
index 0000000..6ddca12
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt
@@ -0,0 +1 @@
+^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/COMPONENTS_EMPTY_DIR-build/_CPack_Packages/.*/RPM/SPECS/components_empty_dir.spec$
diff --git a/Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake
new file mode 100644
index 0000000..0c2977f
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake
@@ -0,0 +1,5 @@
+set(whitespaces_ "[\t\n\r ]*")
+
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_1 "empty_dir*.rpm")
+set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$")
diff --git a/Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt b/Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt
new file mode 100644
index 0000000..1777aa0
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt
@@ -0,0 +1 @@
+^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/EMPTY_DIR-build/_CPack_Packages/.*/RPM/SPECS/empty_dir.spec$
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 3e5714d..b7295f4 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -4,7 +4,9 @@ include(RunCMake)
include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake")
# args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP
-run_cpack_test(MINIMAL "RPM;DEB" false)
+run_cpack_test(MINIMAL "RPM;DEB;TGZ" false)
run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM" false)
run_cpack_test(DEB_EXTRA "DEB" false)
run_cpack_test(DEPENDENCIES "RPM;DEB" true)
+run_cpack_test(EMPTY_DIR "RPM;DEB;TGZ" true)
+run_cpack_test(COMPONENTS_EMPTY_DIR "RPM;DEB;TGZ" true)
diff --git a/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake
new file mode 100644
index 0000000..26e2ab0
--- /dev/null
+++ b/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake
@@ -0,0 +1,3 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_1 "components_empty_dir*.tar.gz")
+set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty/$")
diff --git a/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake
new file mode 100644
index 0000000..81a5035
--- /dev/null
+++ b/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake
@@ -0,0 +1 @@
+set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
diff --git a/Tests/RunCMake/CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake
new file mode 100644
index 0000000..a75514a
--- /dev/null
+++ b/Tests/RunCMake/CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake
@@ -0,0 +1,3 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_1 "empty_dir*.tar.gz")
+set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty_dir-0.1.1-[^\n]*/empty/$")
diff --git a/Tests/RunCMake/CPack/TGZ/Helpers.cmake b/Tests/RunCMake/CPack/TGZ/Helpers.cmake
new file mode 100644
index 0000000..f14d532
--- /dev/null
+++ b/Tests/RunCMake/CPack/TGZ/Helpers.cmake
@@ -0,0 +1,10 @@
+set(ALL_FILES_GLOB "*.tar.gz")
+
+function(getPackageContent FILE RESULT_VAR)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E tar -ztvf ${FILE}
+ OUTPUT_VARIABLE package_content_
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE)
+endfunction()
diff --git a/Tests/RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake b/Tests/RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake
new file mode 100644
index 0000000..5c31f27
--- /dev/null
+++ b/Tests/RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake
@@ -0,0 +1,5 @@
+set(whitespaces_ "[\t\n\r ]*")
+
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_1 "minimal*.tar.gz")
+set(EXPECTED_FILE_CONTENT_1 "^[^\n]*minimal-0.1.1-[^\n]*/foo/\n[^\n]*minimal-0.1.1-[^\n]*/foo/CMakeLists.txt$")
diff --git a/Tests/RunCMake/CPack/TGZ/Prerequirements.cmake b/Tests/RunCMake/CPack/TGZ/Prerequirements.cmake
new file mode 100644
index 0000000..dbaf682
--- /dev/null
+++ b/Tests/RunCMake/CPack/TGZ/Prerequirements.cmake
@@ -0,0 +1,4 @@
+function(get_test_prerequirements found_var config_file)
+ file(WRITE "${config_file}" "")
+ set(${found_var} true PARENT_SCOPE)
+endfunction()
diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake
index 96efa9e..6eab531 100644
--- a/Tests/RunCMake/CPack/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/VerifyResult.cmake
@@ -28,8 +28,9 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0)
if(NOT expected_content_list)
message(FATAL_ERROR
- "Unexpected file content for file No. '${file_no_}'!"
- " Content: '${PACKAGE_CONTENT}'"
+ "Unexpected file content for file No. '${file_no_}'!\n"
+ " Content: '${PACKAGE_CONTENT}'\n\n"
+ " Expected: '${EXPECTED_FILE_CONTENT_${file_no_}}'"
"${output_error_message}")
endif()
else()
@@ -56,7 +57,7 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0)
"${output_error_message}")
endif()
- # sanity check that we didn't accidentaly list wrong files with our regular
+ # sanity check that we didn't accidentally list wrong files with our regular
# expressions
foreach(expected_ IN LISTS allFoundFiles_)
list(FIND foundFiles_ "${expected_}" found_)
diff --git a/Tests/RunCMake/CPackConfig/Default-check.cmake b/Tests/RunCMake/CPackConfig/Default-check.cmake
new file mode 100644
index 0000000..b67fe81
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/Default-check.cmake
@@ -0,0 +1,7 @@
+include(${RunCMake_SOURCE_DIR}/check.cmake)
+
+test_variable(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Foo\\Bar")
+test_variable(CPACK_NSIS_PACKAGE_NAME "Bar\\Foo")
+
+test_variable(CPACK_SOURCE_IGNORE_FILES
+ "/CVS/;/\\.svn/;/\\.bzr/;/\\.hg/;/\\.git/;\\.swp$;\\.#;/#")
diff --git a/Tests/RunCMake/CPackConfig/Default.cmake b/Tests/RunCMake/CPackConfig/Default.cmake
new file mode 100644
index 0000000..3b3beb3
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/Default.cmake
@@ -0,0 +1,3 @@
+# two levels of escaping to pass through CPackConfig.cmake
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "Foo\\\\Bar")
+set(CPACK_NSIS_DISPLAY_NAME "Bar\\\\Foo")
diff --git a/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake b/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake
index 6787eb8..16d2cf3 100644
--- a/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake
@@ -1,3 +1,6 @@
include(RunCMake)
run_cmake(Simple)
+run_cmake(Default)
+run_cmake(Special)
+run_cmake(Verbatim)
diff --git a/Tests/RunCMake/CPackConfig/Special-check.cmake b/Tests/RunCMake/CPackConfig/Special-check.cmake
new file mode 100644
index 0000000..0624b79
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/Special-check.cmake
@@ -0,0 +1,5 @@
+include(${RunCMake_SOURCE_DIR}/check.cmake)
+
+test_variable(CPACK_BACKSLASH "\\")
+test_variable(CPACK_QUOTE "a;b;c")
+test_variable(CPACK_DOLLAR "ab")
diff --git a/Tests/RunCMake/CPackConfig/Special.cmake b/Tests/RunCMake/CPackConfig/Special.cmake
new file mode 100644
index 0000000..9442c93
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/Special.cmake
@@ -0,0 +1,3 @@
+set(CPACK_BACKSLASH "\\\\")
+set(CPACK_QUOTE "a\" b \"c")
+set(CPACK_DOLLAR "a\${NOTHING}b")
diff --git a/Tests/RunCMake/CPackConfig/Verbatim-check.cmake b/Tests/RunCMake/CPackConfig/Verbatim-check.cmake
new file mode 100644
index 0000000..958547d
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/Verbatim-check.cmake
@@ -0,0 +1,10 @@
+include(${RunCMake_SOURCE_DIR}/check.cmake)
+
+test_variable(CPACK_BACKSLASH "\\\\")
+test_variable(CPACK_QUOTE "a\" b \"c")
+test_variable(CPACK_DOLLAR "a\${NOTHING}b")
+
+# make sure the default for this is still set correctly with
+# CPACK_VERBATIM_VARIABLES on
+test_variable(CPACK_SOURCE_IGNORE_FILES
+ "/CVS/;/\\.svn/;/\\.bzr/;/\\.hg/;/\\.git/;\\.swp$;\\.#;/#")
diff --git a/Tests/RunCMake/CPackConfig/Verbatim.cmake b/Tests/RunCMake/CPackConfig/Verbatim.cmake
new file mode 100644
index 0000000..4d271c3
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/Verbatim.cmake
@@ -0,0 +1,5 @@
+set(CPACK_VERBATIM_VARIABLES YES)
+
+set(CPACK_BACKSLASH "\\\\")
+set(CPACK_QUOTE "a\" b \"c")
+set(CPACK_DOLLAR "a\${NOTHING}b")
diff --git a/Tests/RunCMake/CPackConfig/check.cmake b/Tests/RunCMake/CPackConfig/check.cmake
index 2fc9f11..ca6229e 100644
--- a/Tests/RunCMake/CPackConfig/check.cmake
+++ b/Tests/RunCMake/CPackConfig/check.cmake
@@ -1,3 +1,5 @@
+cmake_minimum_required(VERSION ${CMAKE_VERSION} FATAL_ERROR)
+
function(test_variable NAME EXPECTED_VALUE)
if(NOT "${${NAME}}" STREQUAL "${EXPECTED_VALUE}")
message(FATAL_ERROR "${NAME}: variable mismatch; expected [${EXPECTED_VALUE}] actual [${${NAME}}]")
@@ -5,3 +7,4 @@ function(test_variable NAME EXPECTED_VALUE)
endfunction()
include(${RunCMake_TEST_BINARY_DIR}/CPackConfig.cmake)
+include(${RunCMake_TEST_BINARY_DIR}/CPackSourceConfig.cmake)
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index dfc1e33..2bc3693 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -78,6 +78,21 @@ endfunction()
run_LabelCount()
+function(run_SerialFailed)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SerialFailed)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+add_test(NoSuchCommand no_such_command)
+set_tests_properties(NoSuchCommand PROPERTIES RUN_SERIAL ON)
+add_test(Echo \"${CMAKE_COMMAND}\" -E echo \"EchoTest\")
+")
+
+ run_cmake_command(SerialFailed ${CMAKE_CTEST_COMMAND} -V)
+endfunction()
+run_SerialFailed()
+
function(run_TestLoad name load)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TestLoad)
set(RunCMake_TEST_NO_CLEAN 1)
@@ -108,3 +123,20 @@ run_TestLoad(test-load-invalid 'two')
run_TestLoad(test-load-pass 10)
unset(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING})
+
+function(run_TestOutputSize)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TestOutputSize)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+ add_test(PassingTest \"${CMAKE_COMMAND}\" -E echo PassingTestOutput)
+ add_test(FailingTest \"${CMAKE_COMMAND}\" -E no_such_command)
+")
+ run_cmake_command(TestOutputSize
+ ${CMAKE_CTEST_COMMAND} -M Experimental -T Test
+ --test-output-size-passed 10
+ --test-output-size-failed 12
+ )
+endfunction()
+run_TestOutputSize()
diff --git a/Tests/RunCMake/CTestCommandLine/SerialFailed-result.txt b/Tests/RunCMake/CTestCommandLine/SerialFailed-result.txt
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/SerialFailed-result.txt
@@ -0,0 +1 @@
+8
diff --git a/Tests/RunCMake/CTestCommandLine/SerialFailed-stderr.txt b/Tests/RunCMake/CTestCommandLine/SerialFailed-stderr.txt
new file mode 100644
index 0000000..cafe565
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/SerialFailed-stderr.txt
@@ -0,0 +1 @@
+Unable to find executable: no_such_command
diff --git a/Tests/RunCMake/CTestCommandLine/SerialFailed-stdout.txt b/Tests/RunCMake/CTestCommandLine/SerialFailed-stdout.txt
new file mode 100644
index 0000000..d7144f7
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/SerialFailed-stdout.txt
@@ -0,0 +1,10 @@
+Could not find executable no_such_command
+.*
+2/2 Test #2: Echo ............................. Passed +[0-9.]+ sec
++
+50% tests passed, 1 tests failed out of 2
++
+Total Test time \(real\) = +[0-9.]+ sec
++
+The following tests FAILED:
+[ ]+1 - NoSuchCommand \(Not Run\)$
diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputSize-check.cmake b/Tests/RunCMake/CTestCommandLine/TestOutputSize-check.cmake
new file mode 100644
index 0000000..918d242
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestOutputSize-check.cmake
@@ -0,0 +1,17 @@
+file(GLOB test_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Test.xml")
+if(test_xml_file)
+ file(READ "${test_xml_file}" test_xml LIMIT 4096)
+ if("${test_xml}" MATCHES [[(<Test Status="passed">.*</Test>).*(<Test Status="failed">.*</Test>)]])
+ set(test_passed "${CMAKE_MATCH_1}")
+ set(test_failed "${CMAKE_MATCH_2}")
+ else()
+ set(RunCMake_TEST_FAILED "Test.xml does not contain a passed then failed test:\n ${test_xml}")
+ endif()
+ if(NOT "${test_passed}" MATCHES [[<Value>PassingTes\.\.\..*10 bytes]])
+ set(RunCMake_TEST_FAILED "Test.xml passed test output not truncated at 10 bytes:\n ${test_passed}")
+ elseif(NOT "${test_failed}" MATCHES [[<Value>CMake Error:\.\.\..*12 bytes]])
+ set(RunCMake_TEST_FAILED "Test.xml failed test output not truncated at 12 bytes:\n ${test_failed}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Test.xml not found")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputSize-result.txt b/Tests/RunCMake/CTestCommandLine/TestOutputSize-result.txt
new file mode 100644
index 0000000..9c558e3
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestOutputSize-result.txt
@@ -0,0 +1 @@
+.
diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputSize-stderr.txt b/Tests/RunCMake/CTestCommandLine/TestOutputSize-stderr.txt
new file mode 100644
index 0000000..ba4235d
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestOutputSize-stderr.txt
@@ -0,0 +1 @@
+Errors while running CTest
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 0da737d..cef6368 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -132,52 +132,6 @@ set(RunCMake_TEST_OPTIONS -Wno-dev -Wdev)
run_cmake(Wdev)
unset(RunCMake_TEST_OPTIONS)
-set(RunCMake_TEST_OPTIONS -Werror=dev)
-run_cmake(Werror_dev)
-unset(RunCMake_TEST_OPTIONS)
-
-set(RunCMake_TEST_OPTIONS -Wno-error=dev)
-run_cmake(Wno-error_deprecated)
-unset(RunCMake_TEST_OPTIONS)
-
-# -Wdev should not override deprecated options if specified
-set(RunCMake_TEST_OPTIONS -Wdev -Wno-deprecated)
-run_cmake(Wno-deprecated)
-unset(RunCMake_TEST_OPTIONS)
-set(RunCMake_TEST_OPTIONS -Wno-deprecated -Wdev)
-run_cmake(Wno-deprecated)
-unset(RunCMake_TEST_OPTIONS)
-
-# -Wdev should enable deprecated warnings as well
-set(RunCMake_TEST_OPTIONS -Wdev)
-run_cmake(Wdeprecated)
-unset(RunCMake_TEST_OPTIONS)
-
-# -Werror=dev should enable deprecated errors as well
-set(RunCMake_TEST_OPTIONS -Werror=dev)
-run_cmake(Werror_deprecated)
-unset(RunCMake_TEST_OPTIONS)
-
-set(RunCMake_TEST_OPTIONS -Wdeprecated)
-run_cmake(Wdeprecated)
-unset(RunCMake_TEST_OPTIONS)
-
-set(RunCMake_TEST_OPTIONS -Wno-deprecated)
-run_cmake(Wno-deprecated)
-unset(RunCMake_TEST_OPTIONS)
-
-set(RunCMake_TEST_OPTIONS -Werror=deprecated)
-run_cmake(Werror_deprecated)
-unset(RunCMake_TEST_OPTIONS)
-
-set(RunCMake_TEST_OPTIONS -Wno-error=deprecated)
-run_cmake(Wno-error_deprecated)
-unset(RunCMake_TEST_OPTIONS)
-
-run_cmake_command(W_bad-arg1 ${CMAKE_COMMAND} -W)
-run_cmake_command(W_bad-arg2 ${CMAKE_COMMAND} -Wno-)
-run_cmake_command(W_bad-arg3 ${CMAKE_COMMAND} -Werror=)
-
set(RunCMake_TEST_OPTIONS --debug-output)
run_cmake(debug-output)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/CommandLine/W_bad-arg1-result.txt b/Tests/RunCMake/CommandLine/W_bad-arg1-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/CommandLine/W_bad-arg1-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt b/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt
deleted file mode 100644
index e912728..0000000
--- a/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-CMake Error: -W must be followed with \[no-\]\[error=\]<name>.
-CMake Error: Problem processing arguments. Aborting.
diff --git a/Tests/RunCMake/CommandLine/W_bad-arg2-result.txt b/Tests/RunCMake/CommandLine/W_bad-arg2-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/CommandLine/W_bad-arg2-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt b/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt
deleted file mode 100644
index cc643df..0000000
--- a/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-CMake Error: No warning name provided.
-CMake Error: Problem processing arguments. Aborting.
diff --git a/Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt b/Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt
deleted file mode 100644
index cc643df..0000000
--- a/Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-CMake Error: No warning name provided.
-CMake Error: Problem processing arguments. Aborting.
diff --git a/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt b/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt
deleted file mode 100644
index e9be1dc..0000000
--- a/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Deprecation Warning at Wdeprecated.cmake:1 \(message\):
- Some deprecated warning
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CommandLine/Wdeprecated.cmake b/Tests/RunCMake/CommandLine/Wdeprecated.cmake
deleted file mode 100644
index 3142b42..0000000
--- a/Tests/RunCMake/CommandLine/Wdeprecated.cmake
+++ /dev/null
@@ -1 +0,0 @@
-message(DEPRECATION "Some deprecated warning")
diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
index f427303..92c1d23 100644
--- a/Tests/RunCMake/CommandLine/Wdev-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
@@ -2,4 +2,10 @@
Some Author Warning
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at Wdev.cmake:6 \(include\):
+ include\(\) given empty file name \(ignored\).
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CommandLine/Wdev.cmake b/Tests/RunCMake/CommandLine/Wdev.cmake
index 0242086..e5026ef 100644
--- a/Tests/RunCMake/CommandLine/Wdev.cmake
+++ b/Tests/RunCMake/CommandLine/Wdev.cmake
@@ -1 +1,6 @@
message(AUTHOR_WARNING "Some Author Warning")
+
+# with -Wdev this will also cause an AUTHOR_WARNING message, checks that
+# messages issued outside of the message command, by other CMake commands, also
+# are affected by -Wdev
+include("")
diff --git a/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt b/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt
deleted file mode 100644
index 6acdc73..0000000
--- a/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Deprecation Error at Werror_deprecated.cmake:1 \(message\):
- Some deprecated warning
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CommandLine/Werror_deprecated.cmake b/Tests/RunCMake/CommandLine/Werror_deprecated.cmake
deleted file mode 100644
index 3142b42..0000000
--- a/Tests/RunCMake/CommandLine/Werror_deprecated.cmake
+++ /dev/null
@@ -1 +0,0 @@
-message(DEPRECATION "Some deprecated warning")
diff --git a/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt b/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt
deleted file mode 100644
index c6b4e74..0000000
--- a/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-^CMake Error \(dev\) at Werror_dev.cmake:1 \(message\):
- Some author warning
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This error is for project developers. Use -Wno-error=dev to suppress it.$
diff --git a/Tests/RunCMake/CommandLine/Werror_dev.cmake b/Tests/RunCMake/CommandLine/Werror_dev.cmake
deleted file mode 100644
index e05cf9d..0000000
--- a/Tests/RunCMake/CommandLine/Werror_dev.cmake
+++ /dev/null
@@ -1 +0,0 @@
-message(AUTHOR_WARNING "Some author warning")
diff --git a/Tests/RunCMake/CommandLine/Wno-deprecated.cmake b/Tests/RunCMake/CommandLine/Wno-deprecated.cmake
deleted file mode 100644
index 3142b42..0000000
--- a/Tests/RunCMake/CommandLine/Wno-deprecated.cmake
+++ /dev/null
@@ -1 +0,0 @@
-message(DEPRECATION "Some deprecated warning")
diff --git a/Tests/RunCMake/CommandLine/Wno-dev.cmake b/Tests/RunCMake/CommandLine/Wno-dev.cmake
index 0242086..d81b858 100644
--- a/Tests/RunCMake/CommandLine/Wno-dev.cmake
+++ b/Tests/RunCMake/CommandLine/Wno-dev.cmake
@@ -1 +1,6 @@
message(AUTHOR_WARNING "Some Author Warning")
+
+# without -Wno-dev this will also cause an AUTHOR_WARNING message, checks that
+# messages issued outside of the message command, by other CMake commands, also
+# are affected by -Wno-dev
+include("")
diff --git a/Tests/RunCMake/CommandLine/Wno-error_deprecated.cmake b/Tests/RunCMake/CommandLine/Wno-error_deprecated.cmake
deleted file mode 100644
index 3142b42..0000000
--- a/Tests/RunCMake/CommandLine/Wno-error_deprecated.cmake
+++ /dev/null
@@ -1 +0,0 @@
-message(DEPRECATION "Some deprecated warning")
diff --git a/Tests/RunCMake/CommandLine/Wno-error_dev.cmake b/Tests/RunCMake/CommandLine/Wno-error_dev.cmake
deleted file mode 100644
index e05cf9d..0000000
--- a/Tests/RunCMake/CommandLine/Wno-error_dev.cmake
+++ /dev/null
@@ -1 +0,0 @@
-message(AUTHOR_WARNING "Some author warning")
diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
index c1b2227..8dc627d 100644
--- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
@@ -29,7 +29,7 @@ if (NOT CXX_FEATURES)
run_cmake(NoSupportedCxxFeatures)
run_cmake(NoSupportedCxxFeaturesGenex)
else()
- if(CXX_STANDARD_DEFAULT)
+ if(CXX_STANDARD_DEFAULT EQUAL 98)
run_cmake(LinkImplementationFeatureCycle)
endif()
run_cmake(LinkImplementationFeatureCycleSolved)
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE-stdout.txt b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE-stdout.txt
new file mode 100644
index 0000000..5f211eb
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE-stdout.txt
@@ -0,0 +1 @@
+-- g_ir_scanner: .*/g-ir-scanner
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE.cmake
new file mode 100644
index 0000000..c85efaa
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE.cmake
@@ -0,0 +1,9 @@
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(GOBJECT_INTROSPECTION QUIET gobject-introspection-1.0)
+
+if (GOBJECT_INTROSPECTION_FOUND)
+ pkg_get_variable(g_ir_scanner gobject-introspection-1.0 g_ir_scanner)
+ message(STATUS "g_ir_scanner: ${g_ir_scanner}")
+else ()
+ message(STATUS "g_ir_scanner: skipping test; gobject-introspection-1.0 not found /g-ir-scanner")
+endif ()
diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
index 29301d7..bb04aa2 100644
--- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
@@ -9,3 +9,9 @@ if(APPLE)
run_cmake(FindPkgConfig_CMAKE_FRAMEWORK_PATH)
run_cmake(FindPkgConfig_CMAKE_APPBUNDLE_PATH)
endif()
+
+# We need a real pkg-config to run the test for get_variable.
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+ run_cmake(FindPkgConfig_GET_VARIABLE)
+endif ()
diff --git a/Tests/RunCMake/CommandLine/Werror_dev-result.txt b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CommandLine/Werror_dev-result.txt
+++ b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-stderr.txt
new file mode 100644
index 0000000..8d3c4cc
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-stderr.txt
@@ -0,0 +1,17 @@
+CMake Error at BadSHELL_PATH.cmake:[0-9]+ \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<SHELL_PATH:>
+
+ "" is not an absolute path.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadSHELL_PATH.cmake:[0-9]+ \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<SHELL_PATH:Relative/Path>
+
+ "Relative/Path" is not an absolute path.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH.cmake b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH.cmake
new file mode 100644
index 0000000..5eff7bc
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH.cmake
@@ -0,0 +1,4 @@
+add_custom_target(check ALL COMMAND check
+ $<SHELL_PATH:>
+ $<SHELL_PATH:Relative/Path>
+ VERBATIM)
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 0679024..45175d8 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -10,6 +10,7 @@ run_cmake(BadTargetName)
run_cmake(BadTargetTypeInterface)
run_cmake(BadTargetTypeObject)
run_cmake(BadInstallPrefix)
+run_cmake(BadSHELL_PATH)
run_cmake(CMP0044-WARN)
run_cmake(NonValidTarget-C_COMPILER_ID)
run_cmake(NonValidTarget-CXX_COMPILER_ID)
diff --git a/Tests/RunCMake/LinkStatic/CMakeLists.txt b/Tests/RunCMake/LinkStatic/CMakeLists.txt
new file mode 100644
index 0000000..74b3ff8
--- /dev/null
+++ b/Tests/RunCMake/LinkStatic/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.3)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/set_property/LINK_SEARCH_STATIC.cmake b/Tests/RunCMake/LinkStatic/LINK_SEARCH_STATIC.cmake
index 70d2fee..6db5c85 100644
--- a/Tests/RunCMake/set_property/LINK_SEARCH_STATIC.cmake
+++ b/Tests/RunCMake/LinkStatic/LINK_SEARCH_STATIC.cmake
@@ -1,4 +1,4 @@
-project(LinkSearchStatic)
+enable_language(C)
set(CMAKE_LINK_SEARCH_START_STATIC ON)
add_executable(LinkSearchStartStaticInit1 LinkStatic.c)
diff --git a/Tests/RunCMake/set_property/LinkStatic.c b/Tests/RunCMake/LinkStatic/LinkStatic.c
index 3600977..3600977 100644
--- a/Tests/RunCMake/set_property/LinkStatic.c
+++ b/Tests/RunCMake/LinkStatic/LinkStatic.c
diff --git a/Tests/RunCMake/LinkStatic/RunCMakeTest.cmake b/Tests/RunCMake/LinkStatic/RunCMakeTest.cmake
new file mode 100644
index 0000000..0d29492
--- /dev/null
+++ b/Tests/RunCMake/LinkStatic/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(LINK_SEARCH_STATIC)
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index 46bc494..db9911d 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -102,7 +102,7 @@ function(run_cmake test)
endif()
foreach(o out err)
string(REGEX REPLACE "\r\n" "\n" actual_std${o} "${actual_std${o}}")
- string(REGEX REPLACE "(^|\n)((==[0-9]+==|BullseyeCoverage|[a-z]+\\([0-9]+\\) malloc:|Error kstat returned)[^\n]*\n)+" "\\1" actual_std${o} "${actual_std${o}}")
+ string(REGEX REPLACE "(^|\n)((==[0-9]+==|BullseyeCoverage|[a-z]+\\([0-9]+\\) malloc:|Error kstat returned|[^\n]*from Time Machine by path|[^\n]*Bullseye Testing Technology)[^\n]*\n)+" "\\1" actual_std${o} "${actual_std${o}}")
string(REGEX REPLACE "\n+$" "" actual_std${o} "${actual_std${o}}")
set(expect_${o} "")
if(DEFINED expect_std${o})
@@ -115,7 +115,11 @@ function(run_cmake test)
endif()
endforeach()
unset(RunCMake_TEST_FAILED)
- include(${top_src}/${test}-check.cmake OPTIONAL)
+ if(RunCMake-check-file AND EXISTS ${top_src}/${RunCMake-check-file})
+ include(${top_src}/${RunCMake-check-file})
+ else()
+ include(${top_src}/${test}-check.cmake OPTIONAL)
+ endif()
if(RunCMake_TEST_FAILED)
set(msg "${RunCMake_TEST_FAILED}\n${msg}")
endif()
diff --git a/Tests/RunCMake/Swift/Enable-stdout.txt b/Tests/RunCMake/Swift/Enable-stdout.txt
deleted file mode 100644
index 39e133f..0000000
--- a/Tests/RunCMake/Swift/Enable-stdout.txt
+++ /dev/null
@@ -1 +0,0 @@
--- The Swift compiler identification is Apple
diff --git a/Tests/RunCMake/Swift/Enable.cmake b/Tests/RunCMake/Swift/Enable.cmake
deleted file mode 100644
index 19f297a..0000000
--- a/Tests/RunCMake/Swift/Enable.cmake
+++ /dev/null
@@ -1 +0,0 @@
-enable_language(Swift)
diff --git a/Tests/RunCMake/Swift/RunCMakeTest.cmake b/Tests/RunCMake/Swift/RunCMakeTest.cmake
index 0a57121..4864295 100644
--- a/Tests/RunCMake/Swift/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Swift/RunCMakeTest.cmake
@@ -3,8 +3,6 @@ include(RunCMake)
if(RunCMake_GENERATOR STREQUAL Xcode)
if(XCODE_BELOW_6_1)
run_cmake(XcodeTooOld)
- else()
- run_cmake(Enable)
endif()
else()
run_cmake(NotSupported)
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index d0aa995..57047fb 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -19,6 +19,7 @@
\* CMP0052
\* CMP0060
\* CMP0063
+ \* CMP0065
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ctest_test/CMakeLists.txt.in b/Tests/RunCMake/ctest_test/CMakeLists.txt.in
index cedf379..e61b556 100644
--- a/Tests/RunCMake/ctest_test/CMakeLists.txt.in
+++ b/Tests/RunCMake/ctest_test/CMakeLists.txt.in
@@ -2,3 +2,4 @@ cmake_minimum_required(VERSION 3.1)
project(CTestTest@CASE_NAME@ NONE)
include(CTest)
add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
+@CASE_CMAKELISTS_SUFFIX_CODE@
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index 76dc143..e2f380c 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -59,3 +59,18 @@ function(run_TestChangeId)
run_ctest(TestChangeId)
endfunction()
run_TestChangeId()
+
+function(run_TestOutputSize)
+ set(CASE_CTEST_TEST_ARGS EXCLUDE RunCMakeVersion)
+ set(CASE_TEST_PREFIX_CODE [[
+set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 10)
+set(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 12)
+ ]])
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_test(NAME PassingTest COMMAND ${CMAKE_COMMAND} -E echo PassingTestOutput)
+add_test(NAME FailingTest COMMAND ${CMAKE_COMMAND} -E no_such_command)
+ ]])
+
+ run_ctest(TestOutputSize)
+endfunction()
+run_TestOutputSize()
diff --git a/Tests/RunCMake/ctest_test/TestOutputSize-check.cmake b/Tests/RunCMake/ctest_test/TestOutputSize-check.cmake
new file mode 100644
index 0000000..918d242
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestOutputSize-check.cmake
@@ -0,0 +1,17 @@
+file(GLOB test_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Test.xml")
+if(test_xml_file)
+ file(READ "${test_xml_file}" test_xml LIMIT 4096)
+ if("${test_xml}" MATCHES [[(<Test Status="passed">.*</Test>).*(<Test Status="failed">.*</Test>)]])
+ set(test_passed "${CMAKE_MATCH_1}")
+ set(test_failed "${CMAKE_MATCH_2}")
+ else()
+ set(RunCMake_TEST_FAILED "Test.xml does not contain a passed then failed test:\n ${test_xml}")
+ endif()
+ if(NOT "${test_passed}" MATCHES [[<Value>PassingTes\.\.\..*10 bytes]])
+ set(RunCMake_TEST_FAILED "Test.xml passed test output not truncated at 10 bytes:\n ${test_passed}")
+ elseif(NOT "${test_failed}" MATCHES [[<Value>CMake Error:\.\.\..*12 bytes]])
+ set(RunCMake_TEST_FAILED "Test.xml failed test output not truncated at 12 bytes:\n ${test_failed}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Test.xml not found")
+endif()
diff --git a/Tests/RunCMake/find_program/A/testAandB b/Tests/RunCMake/find_program/A/testAandB
new file mode 100755
index 0000000..1a24852
--- /dev/null
+++ b/Tests/RunCMake/find_program/A/testAandB
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/Tests/RunCMake/find_program/B/testAandB b/Tests/RunCMake/find_program/B/testAandB
new file mode 100755
index 0000000..1a24852
--- /dev/null
+++ b/Tests/RunCMake/find_program/B/testAandB
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/Tests/RunCMake/find_program/EnvAndHints-stdout.txt b/Tests/RunCMake/find_program/EnvAndHints-stdout.txt
new file mode 100644
index 0000000..39329b2
--- /dev/null
+++ b/Tests/RunCMake/find_program/EnvAndHints-stdout.txt
@@ -0,0 +1 @@
+-- PROG='[^']*/Tests/RunCMake/find_program/A/testAandB'
diff --git a/Tests/RunCMake/find_program/EnvAndHints.cmake b/Tests/RunCMake/find_program/EnvAndHints.cmake
new file mode 100644
index 0000000..14ebd6e
--- /dev/null
+++ b/Tests/RunCMake/find_program/EnvAndHints.cmake
@@ -0,0 +1,8 @@
+set(ENV_PATH "$ENV{PATH}")
+set(ENV{PATH} ${CMAKE_CURRENT_SOURCE_DIR}/A)
+find_program(PROG
+ NAMES testAandB
+ HINTS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B
+ )
+message(STATUS "PROG='${PROG}'")
+set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake
index 2adec11..89307c1 100644
--- a/Tests/RunCMake/find_program/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake
@@ -1,5 +1,6 @@
include(RunCMake)
+run_cmake(EnvAndHints)
run_cmake(DirsPerName)
run_cmake(NamesPerDir)
diff --git a/Tests/RunCMake/CommandLine/Werror_deprecated-result.txt b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CommandLine/Werror_deprecated-result.txt
+++ b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-result.txt
diff --git a/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-stderr.txt b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-stderr.txt
new file mode 100644
index 0000000..9844158
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<NOTAGENEX>
+
+ Expression did not evaluate to a known generator expression
diff --git a/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad.cmake b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad.cmake
new file mode 100644
index 0000000..f050cdf
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad.cmake
@@ -0,0 +1 @@
+install(DIRECTORY dir DESTINATION $<NOTAGENEX>)
diff --git a/Tests/RunCMake/CommandLine/W_bad-arg3-result.txt b/Tests/RunCMake/install/FILES-DESTINATION-bad-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CommandLine/W_bad-arg3-result.txt
+++ b/Tests/RunCMake/install/FILES-DESTINATION-bad-result.txt
diff --git a/Tests/RunCMake/install/FILES-DESTINATION-bad-stderr.txt b/Tests/RunCMake/install/FILES-DESTINATION-bad-stderr.txt
new file mode 100644
index 0000000..9844158
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-DESTINATION-bad-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<NOTAGENEX>
+
+ Expression did not evaluate to a known generator expression
diff --git a/Tests/RunCMake/install/FILES-DESTINATION-bad.cmake b/Tests/RunCMake/install/FILES-DESTINATION-bad.cmake
new file mode 100644
index 0000000..0fda078
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-DESTINATION-bad.cmake
@@ -0,0 +1 @@
+install(FILES empty.c DESTINATION $<NOTAGENEX>)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index a5f5bd0..043bd1f 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -6,6 +6,8 @@ run_cmake(DIRECTORY-message-lazy)
run_cmake(SkipInstallRulesWarning)
run_cmake(SkipInstallRulesNoWarning1)
run_cmake(SkipInstallRulesNoWarning2)
+run_cmake(DIRECTORY-DESTINATION-bad)
+run_cmake(FILES-DESTINATION-bad)
run_cmake(TARGETS-DESTINATION-bad)
run_cmake(CMP0062-OLD)
run_cmake(CMP0062-NEW)
diff --git a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt
new file mode 100644
index 0000000..dd5bae1
--- /dev/null
+++ b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt
@@ -0,0 +1,2 @@
+-- Target COMPILE_DEFINITIONS is 'a;b;c;d;;e'
+-- Directory COMPILE_DEFINITIONS is 'a;b;c;d;;e'
diff --git a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake
new file mode 100644
index 0000000..f0c63bf
--- /dev/null
+++ b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake
@@ -0,0 +1,3 @@
+include(Common.cmake)
+test_target_property(COMPILE_DEFINITIONS)
+test_directory_property(COMPILE_DEFINITIONS)
diff --git a/Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt b/Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt
new file mode 100644
index 0000000..bd5a992
--- /dev/null
+++ b/Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt
@@ -0,0 +1 @@
+-- Target COMPILE_FEATURES is 'a;b;c;d;;e'
diff --git a/Tests/RunCMake/set_property/COMPILE_FEATURES.cmake b/Tests/RunCMake/set_property/COMPILE_FEATURES.cmake
new file mode 100644
index 0000000..1ab52ef
--- /dev/null
+++ b/Tests/RunCMake/set_property/COMPILE_FEATURES.cmake
@@ -0,0 +1,2 @@
+include(Common.cmake)
+test_target_property(COMPILE_FEATURES)
diff --git a/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt b/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt
new file mode 100644
index 0000000..1a20501
--- /dev/null
+++ b/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt
@@ -0,0 +1,2 @@
+-- Target COMPILE_OPTIONS is 'a;b;c;d;;e'
+-- Directory COMPILE_OPTIONS is 'a;b;c;d;;e'
diff --git a/Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake b/Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake
new file mode 100644
index 0000000..75f0535
--- /dev/null
+++ b/Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake
@@ -0,0 +1,3 @@
+include(Common.cmake)
+test_target_property(COMPILE_OPTIONS)
+test_directory_property(COMPILE_OPTIONS)
diff --git a/Tests/RunCMake/set_property/Common.cmake b/Tests/RunCMake/set_property/Common.cmake
new file mode 100644
index 0000000..9d5e4f4
--- /dev/null
+++ b/Tests/RunCMake/set_property/Common.cmake
@@ -0,0 +1,28 @@
+macro(test_target_property PROP)
+ add_custom_target(CustomTarget)
+ set_property(TARGET CustomTarget PROPERTY ${PROP} x)
+ set_property(TARGET CustomTarget PROPERTY ${PROP})
+ set_property(TARGET CustomTarget APPEND PROPERTY ${PROP})
+ set_property(TARGET CustomTarget PROPERTY ${PROP} a)
+ set_property(TARGET CustomTarget APPEND PROPERTY ${PROP} "")
+ set_property(TARGET CustomTarget APPEND PROPERTY ${PROP} b c)
+ set_property(TARGET CustomTarget APPEND PROPERTY ${PROP})
+ set_property(TARGET CustomTarget APPEND PROPERTY ${PROP} "d;;e")
+ get_property(val TARGET CustomTarget PROPERTY ${PROP})
+ message(STATUS "Target ${PROP} is '${val}'")
+ set_property(TARGET CustomTarget PROPERTY ${PROP})
+endmacro()
+
+macro(test_directory_property PROP)
+ set_property(DIRECTORY PROPERTY ${PROP} x)
+ set_property(DIRECTORY PROPERTY ${PROP})
+ set_property(DIRECTORY APPEND PROPERTY ${PROP})
+ set_property(DIRECTORY PROPERTY ${PROP} a)
+ set_property(DIRECTORY APPEND PROPERTY ${PROP} "")
+ set_property(DIRECTORY APPEND PROPERTY ${PROP} b c)
+ set_property(DIRECTORY APPEND PROPERTY ${PROP})
+ set_property(DIRECTORY APPEND PROPERTY ${PROP} "d;;e")
+ get_property(val DIRECTORY PROPERTY ${PROP})
+ message(STATUS "Directory ${PROP} is '${val}'")
+ set_property(DIRECTORY PROPERTY ${PROP})
+endmacro()
diff --git a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt
new file mode 100644
index 0000000..c957dd5
--- /dev/null
+++ b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt
@@ -0,0 +1,2 @@
+-- Target INCLUDE_DIRECTORIES is 'a;b;c;d;;e'
+-- Directory INCLUDE_DIRECTORIES is 'a;b;c;d;;e'
diff --git a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake
new file mode 100644
index 0000000..c9a9151
--- /dev/null
+++ b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake
@@ -0,0 +1,3 @@
+include(Common.cmake)
+test_target_property(INCLUDE_DIRECTORIES)
+test_directory_property(INCLUDE_DIRECTORIES)
diff --git a/Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt b/Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt
new file mode 100644
index 0000000..9a3988e
--- /dev/null
+++ b/Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt
@@ -0,0 +1 @@
+-- Target LINK_LIBRARIES is 'a;b;c;d;;e'
diff --git a/Tests/RunCMake/set_property/LINK_LIBRARIES.cmake b/Tests/RunCMake/set_property/LINK_LIBRARIES.cmake
index 994e874..5155f59 100644
--- a/Tests/RunCMake/set_property/LINK_LIBRARIES.cmake
+++ b/Tests/RunCMake/set_property/LINK_LIBRARIES.cmake
@@ -1,7 +1,2 @@
-add_custom_target(CustomTarget)
-set_property(TARGET CustomTarget PROPERTY LINK_LIBRARIES)
-set_property(TARGET CustomTarget APPEND PROPERTY LINK_LIBRARIES)
-get_property(val TARGET CustomTarget PROPERTY LINK_LIBRARIES)
-if (NOT "${val}" STREQUAL "")
- message(FATAL_ERROR "LINK_LIBRARIES value is '${val}' but should be ''")
-endif()
+include(Common.cmake)
+test_target_property(LINK_LIBRARIES)
diff --git a/Tests/RunCMake/set_property/RunCMakeTest.cmake b/Tests/RunCMake/set_property/RunCMakeTest.cmake
index ada8804..37c7124 100644
--- a/Tests/RunCMake/set_property/RunCMakeTest.cmake
+++ b/Tests/RunCMake/set_property/RunCMakeTest.cmake
@@ -1,4 +1,9 @@
include(RunCMake)
+run_cmake(COMPILE_DEFINITIONS)
+run_cmake(COMPILE_FEATURES)
+run_cmake(COMPILE_OPTIONS)
+run_cmake(INCLUDE_DIRECTORIES)
run_cmake(LINK_LIBRARIES)
-run_cmake(LINK_SEARCH_STATIC)
+run_cmake(SOURCES)
+run_cmake(USER_PROP)
diff --git a/Tests/RunCMake/set_property/SOURCES-stdout.txt b/Tests/RunCMake/set_property/SOURCES-stdout.txt
new file mode 100644
index 0000000..921d5b1
--- /dev/null
+++ b/Tests/RunCMake/set_property/SOURCES-stdout.txt
@@ -0,0 +1 @@
+-- Target SOURCES is 'a;b;c;d;e'
diff --git a/Tests/RunCMake/set_property/SOURCES.cmake b/Tests/RunCMake/set_property/SOURCES.cmake
new file mode 100644
index 0000000..820641e
--- /dev/null
+++ b/Tests/RunCMake/set_property/SOURCES.cmake
@@ -0,0 +1,2 @@
+include(Common.cmake)
+test_target_property(SOURCES)
diff --git a/Tests/RunCMake/set_property/USER_PROP-stdout.txt b/Tests/RunCMake/set_property/USER_PROP-stdout.txt
new file mode 100644
index 0000000..107cc87
--- /dev/null
+++ b/Tests/RunCMake/set_property/USER_PROP-stdout.txt
@@ -0,0 +1,2 @@
+-- Target USER_PROP is 'a;b;c;d;;e'
+-- Directory USER_PROP is 'a;b;c;d;;e'
diff --git a/Tests/RunCMake/set_property/USER_PROP.cmake b/Tests/RunCMake/set_property/USER_PROP.cmake
new file mode 100644
index 0000000..aa0aa83
--- /dev/null
+++ b/Tests/RunCMake/set_property/USER_PROP.cmake
@@ -0,0 +1,3 @@
+include(Common.cmake)
+test_target_property(USER_PROP)
+test_directory_property(USER_PROP)
diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt
index cc3c3be..e365076 100644
--- a/Tests/SimpleInstall/CMakeLists.txt
+++ b/Tests/SimpleInstall/CMakeLists.txt
@@ -209,9 +209,9 @@ else()
ARCHIVE DESTINATION MyTest/lib/static
OPTIONAL # for coverage...target should always exist
)
- install(FILES lib1.h DESTINATION MyTest/include/foo)
+ install(FILES lib1.h DESTINATION MyTest/include/$<1:foo>$<0:/wrong>)
install(FILES lib2.h
- DESTINATION MyTest/include/foo
+ DESTINATION $<1:MyTest/include/foo>$<0:/wrong>
COMPONENT Development
PERMISSIONS OWNER_READ OWNER_WRITE
RENAME lib2renamed.h
@@ -252,7 +252,7 @@ else()
file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
install(
- DIRECTORY TestSubDir scripts/ DESTINATION MyTest/share
+ DIRECTORY TestSubDir scripts/ DESTINATION $<1:MyTest/share>$<0:/wrong>
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
@@ -263,14 +263,14 @@ else()
# Alternate directory installation for coverage.
install(
- DIRECTORY scripts/ DESTINATION MyTest/share/alt
+ DIRECTORY scripts/ DESTINATION $<1:MyTest/share/alt>$<0:/wrong>
COMPONENT Development
USE_SOURCE_PERMISSIONS
PATTERN "CVS" EXCLUDE
REGEX "\\.txt$" EXCLUDE
)
install(
- DIRECTORY TestSubDir DESTINATION MyTest/share/alt
+ DIRECTORY TestSubDir DESTINATION $<1:MyTest/share/alt>$<0:/wrong>
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt
index cc3c3be..e365076 100644
--- a/Tests/SimpleInstallS2/CMakeLists.txt
+++ b/Tests/SimpleInstallS2/CMakeLists.txt
@@ -209,9 +209,9 @@ else()
ARCHIVE DESTINATION MyTest/lib/static
OPTIONAL # for coverage...target should always exist
)
- install(FILES lib1.h DESTINATION MyTest/include/foo)
+ install(FILES lib1.h DESTINATION MyTest/include/$<1:foo>$<0:/wrong>)
install(FILES lib2.h
- DESTINATION MyTest/include/foo
+ DESTINATION $<1:MyTest/include/foo>$<0:/wrong>
COMPONENT Development
PERMISSIONS OWNER_READ OWNER_WRITE
RENAME lib2renamed.h
@@ -252,7 +252,7 @@ else()
file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
install(
- DIRECTORY TestSubDir scripts/ DESTINATION MyTest/share
+ DIRECTORY TestSubDir scripts/ DESTINATION $<1:MyTest/share>$<0:/wrong>
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
@@ -263,14 +263,14 @@ else()
# Alternate directory installation for coverage.
install(
- DIRECTORY scripts/ DESTINATION MyTest/share/alt
+ DIRECTORY scripts/ DESTINATION $<1:MyTest/share/alt>$<0:/wrong>
COMPONENT Development
USE_SOURCE_PERMISSIONS
PATTERN "CVS" EXCLUDE
REGEX "\\.txt$" EXCLUDE
)
install(
- DIRECTORY TestSubDir DESTINATION MyTest/share/alt
+ DIRECTORY TestSubDir DESTINATION $<1:MyTest/share/alt>$<0:/wrong>
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
diff --git a/Tests/SwiftMix/SwiftMain.swift b/Tests/SwiftMix/SwiftMain.swift
index 7e7c4ab..3629ac8 100644
--- a/Tests/SwiftMix/SwiftMain.swift
+++ b/Tests/SwiftMix/SwiftMain.swift
@@ -1,8 +1,10 @@
-@objc class SwiftMainClass {
+import Foundation
+
+@objc class SwiftMainClass : NSObject {
class func SwiftMain(argc:Int, argv:UnsafePointer<UnsafePointer<CChar>>) -> Int32 {
dump("argc: \(argc)")
for (var i = 0; i < argc; ++i) {
- var argi = String.fromCString(argv[i])
+ let argi = String.fromCString(argv[i])
dump("arg[\(i)]: \(argi)");
}
return 0;
diff --git a/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt b/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
index 3ee1855..f68e38e 100644
--- a/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
+++ b/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
@@ -35,12 +35,12 @@ add_library(hello SHARED hello.f)
add_library(world SHARED world.f)
target_link_libraries(hello world)
if(CMAKE_Fortran_COMPILER_ID MATCHES SunPro)
- target_link_libraries(hello fsu)
+ target_link_libraries(hello PRIVATE fsu)
if(CMAKE_Fortran_PLATFORM_ID MATCHES SunOS)
- target_link_libraries(hello sunmath m)
+ target_link_libraries(hello PRIVATE sunmath m)
test_sunquad(CMAKE_HAS_SUNQUAD)
if(CMAKE_HAS_SUNQUAD)
- target_link_libraries(hello sunquad)
+ target_link_libraries(hello PRIVATE sunquad)
endif()
endif()
endif()
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt
index 8357d5f..ae82755 100644
--- a/Tests/VSWinStorePhone/CMakeLists.txt
+++ b/Tests/VSWinStorePhone/CMakeLists.txt
@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 3.0)
project(VSWinStorePhone)
-
-if(MSVC_VERSION GREATER 1700)
+if(MSVC_VERSION GREATER 1899)
+ set(COMPILER_VERSION "14")
+elseif(MSVC_VERSION GREATER 1700)
set(COMPILER_VERSION "12")
elseif(MSVC_VERSION GREATER 1600)
set(COMPILER_VERSION "11")
@@ -91,6 +92,7 @@ elseif (NOT "${PLATFORM}" STREQUAL "DESKTOP")
set(ASSET_FILES ${ASSET_FILES}
Direct3DApp1/Assets/Logo.png
Direct3DApp1/Assets/SmallLogo.png
+ Direct3DApp1/Assets/SmallLogo44x44.png
Direct3DApp1/Assets/SplashScreen.png
Direct3DApp1/Assets/StoreLogo.png
)
@@ -124,4 +126,15 @@ source_group("Resource Files" FILES ${RESOURCE_FILES})
add_executable(${EXE_NAME} WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES})
set_property(TARGET ${EXE_NAME} PROPERTY VS_WINRT_COMPONENT TRUE)
+
+string(SUBSTRING "${CMAKE_SYSTEM_VERSION}" 0, 4, SHORT_VERSION)
+
+if("${SHORT_VERSION}" STREQUAL "10.0")
+ message(STATUS "Targeting Windows 10. Setting Extensions to version ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
+ set_property(TARGET ${EXE_NAME} PROPERTY VS_DESKTOP_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
+ set_property(TARGET ${EXE_NAME} PROPERTY VS_MOBILE_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
+ set_property(TARGET ${EXE_NAME} PROPERTY VS_IOT_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
+endif()
+
+
target_link_libraries(${EXE_NAME} d3d11)
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.png
new file mode 100644
index 0000000..28810b7
--- /dev/null
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/cmake/Package_vc14.store.appxmanifest.in b/Tests/VSWinStorePhone/cmake/Package_vc14.store.appxmanifest.in
new file mode 100644
index 0000000..6b27ab7
--- /dev/null
+++ b/Tests/VSWinStorePhone/cmake/Package_vc14.store.appxmanifest.in
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package
+ xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
+ xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
+ xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+ IgnorableNamespaces="uap mp">
+
+ <Identity Name="@PACKAGE_GUID@" Publisher="CN=mgong" Version="1.1.0.0" />
+ <mp:PhoneIdentity PhoneProductId="@PACKAGE_GUID@" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
+
+ <Properties>
+ <DisplayName>@SHORT_NAME@</DisplayName>
+ <PublisherDisplayName>mgong</PublisherDisplayName>
+ <Logo>Assets/StoreLogo.png</Logo>
+ </Properties>
+
+ <Dependencies>
+ <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.65535.65535" />
+ </Dependencies>
+
+ <Resources>
+ <Resource Language="x-generate" />
+ </Resources>
+ <Applications>
+ <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="@SHORT_NAME@.App">
+ <uap:VisualElements
+ DisplayName="@SHORT_NAME@"
+ Description="@SHORT_NAME@"
+ BackgroundColor="#336699"
+ Square150x150Logo="Assets/Logo.png"
+ Square44x44Logo="Assets/SmallLogo44x44.png">
+ <uap:SplashScreen Image="Assets/SplashScreen.png" />
+ </uap:VisualElements>
+ </Application>
+ </Applications>
+</Package>
diff --git a/Utilities/Release/Cygwin/README.cygwin.in b/Utilities/Release/Cygwin/README.cygwin.in
index 6c42a4c..17cf2a1 100644
--- a/Utilities/Release/Cygwin/README.cygwin.in
+++ b/Utilities/Release/Cygwin/README.cygwin.in
@@ -8,7 +8,7 @@ Build requirements
make
Canonical homepage:
- http://www.cmake.org
+ https://cmake.org
Canonical download:
ftp://www.cmake.org/pub/cmake/
diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake
index 4b93e6e..4cfa2ed 100644
--- a/Utilities/Release/create-cmake-release.cmake
+++ b/Utilities/Release/create-cmake-release.cmake
@@ -54,6 +54,7 @@ mkdir \${name}-build &&
cd \${name}-build &&
\"${CMAKE_COMMAND}\" ../\${name}-src/Utilities/Sphinx \\
-DCMAKE_INSTALL_PREFIX=\"\$inst/\" \\
+ -DCMAKE_DOC_DIR=doc/cmake \\
-DSPHINX_EXECUTABLE=\"${SPHINX_EXECUTABLE}\" \\
-DSPHINX_HTML=ON -DSPHINX_MAN=ON &&
make install &&
diff --git a/Utilities/Release/dash2win64_cygwin.cmake b/Utilities/Release/dash2win64_cygwin.cmake
index d15915a..c0cd761 100644
--- a/Utilities/Release/dash2win64_cygwin.cmake
+++ b/Utilities/Release/dash2win64_cygwin.cmake
@@ -1,5 +1,6 @@
set(CMAKE_RELEASE_DIRECTORY "c:/cygwin/home/dashboard/CMakeReleaseCygwin")
set(PROCESSORS 9)
+set(BOOTSTRAP_ARGS "")
set(MAKE_PROGRAM "make")
set(MAKE "${MAKE_PROGRAM} -j8")
set(HOST dash2win64)
diff --git a/Utilities/Release/dash2win64_release.cmake b/Utilities/Release/dash2win64_release.cmake
index 3ea895a..ecfd7c5 100644
--- a/Utilities/Release/dash2win64_release.cmake
+++ b/Utilities/Release/dash2win64_release.cmake
@@ -1,6 +1,6 @@
set(CMAKE_RELEASE_DIRECTORY "c:/cygwin/home/dashboard/CMakeReleaseDirectory")
set(CONFIGURE_WITH_CMAKE TRUE)
-set(CMAKE_CONFIGURE_PATH "c:/Program\\ Files\\ \\(x86\\)/CMake\\ 2.8/bin/cmake.exe")
+set(CMAKE_CONFIGURE_PATH "c:/Program\\ Files\\ \\(x86\\)/CMake/bin/cmake.exe")
set(PROCESSORS 8)
set(HOST dash2win64)
set(CPACK_BINARY_GENERATORS "NSIS ZIP")
@@ -8,6 +8,7 @@ set(CPACK_SOURCE_GENERATORS "ZIP")
set(MAKE_PROGRAM "make")
set(MAKE "${MAKE_PROGRAM} -j8")
set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
+CMAKE_DOC_DIR:STRING=doc/cmake
CMAKE_USE_OPENSSL:BOOL=OFF
CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
CMAKE_Fortran_COMPILER:FILEPATH=FALSE
diff --git a/Utilities/Release/dashmacmini2_release.cmake b/Utilities/Release/dashmacmini2_release.cmake
index 01f5b8b..cd4c5a1 100644
--- a/Utilities/Release/dashmacmini2_release.cmake
+++ b/Utilities/Release/dashmacmini2_release.cmake
@@ -1,7 +1,7 @@
set(PROCESSORS 2)
set(CMAKE_RELEASE_DIRECTORY /Users/kitware/CMakeReleaseDirectory)
set(USER_OVERRIDE "set(CMAKE_CXX_LINK_EXECUTABLE \\\"gcc <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -shared-libgcc -lstdc++-static\\\")")
-set(INSTALL_PREFIX /)
+set(BOOTSTRAP_ARGS "--prefix=/ --docdir=doc/cmake")
set(HOST dashmacmini2)
set(MAKE_PROGRAM "make")
set(MAKE "${MAKE_PROGRAM} -j2")
diff --git a/Utilities/Release/dashmacmini5_release.cmake b/Utilities/Release/dashmacmini5_release.cmake
index be1dfa9..b147013 100644
--- a/Utilities/Release/dashmacmini5_release.cmake
+++ b/Utilities/Release/dashmacmini5_release.cmake
@@ -1,7 +1,7 @@
set(PROCESSORS 4)
set(CMAKE_RELEASE_DIRECTORY /Users/kitware/CMakeReleaseDirectory)
# set(USER_OVERRIDE "set(CMAKE_CXX_LINK_EXECUTABLE \\\"gcc <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -shared-libgcc -lstdc++-static\\\")")
-set(INSTALL_PREFIX /)
+set(BOOTSTRAP_ARGS "--prefix=/ --docdir=doc/cmake")
set(HOST dashmacmini5)
set(MAKE_PROGRAM "make")
set(MAKE "${MAKE_PROGRAM} -j5")
diff --git a/Utilities/Release/linux64_release.cmake b/Utilities/Release/linux64_release.cmake
index 25da00a..81442e7 100644
--- a/Utilities/Release/linux64_release.cmake
+++ b/Utilities/Release/linux64_release.cmake
@@ -1,4 +1,5 @@
set(PROCESSORS 4)
+set(BOOTSTRAP_ARGS "--docdir=doc/cmake")
set(HOST linux64)
set(MAKE_PROGRAM "make")
set(CC /opt/gcc-4.9.2/bin/gcc)
diff --git a/Utilities/Release/magrathea_release.cmake b/Utilities/Release/magrathea_release.cmake
index b031eb8..0634dda 100644
--- a/Utilities/Release/magrathea_release.cmake
+++ b/Utilities/Release/magrathea_release.cmake
@@ -1,4 +1,5 @@
set(PROCESSORS 1)
+set(BOOTSTRAP_ARGS "--docdir=doc/cmake")
set(HOST magrathea)
set(MAKE_PROGRAM "make")
set(CC gcc332s)
diff --git a/Utilities/Release/release_cmake.sh.in b/Utilities/Release/release_cmake.sh.in
index 76fdb3a..06e720f 100755
--- a/Utilities/Release/release_cmake.sh.in
+++ b/Utilities/Release/release_cmake.sh.in
@@ -116,15 +116,9 @@ if [ ! -z "@CONFIGURE_WITH_CMAKE@" ]; then
@CMAKE_CONFIGURE_PATH@ ../@CMAKE_CREATE_VERSION@
check_exit_value $? "Configure cmake" || exit 1
else
- if [ -z "@INSTALL_PREFIX@" ]; then
- echo "Run cmake bootstrap --parallel=@PROCESSORS@"
- ../@CMAKE_CREATE_VERSION@/bootstrap --parallel=@PROCESSORS@
- check_exit_value $? "Bootstrap cmake" || exit 1
- else
- echo "Run cmake bootstrap --prefix=@INSTALL_PREFIX@ --parallel=@PROCESSORS@"
- ../@CMAKE_CREATE_VERSION@/bootstrap --prefix=@INSTALL_PREFIX@ --parallel=@PROCESSORS@
- check_exit_value $? "Bootstrap cmake" || exit 1
- fi
+ echo "Run cmake bootstrap @BOOTSTRAP_ARGS@ --parallel=@PROCESSORS@"
+ ../@CMAKE_CREATE_VERSION@/bootstrap @BOOTSTRAP_ARGS@ --parallel=@PROCESSORS@
+ check_exit_value $? "Bootstrap cmake" || exit 1
fi
echo "Build cmake with @MAKE@"
diff --git a/Utilities/Release/upload_release.cmake b/Utilities/Release/upload_release.cmake
index ac41300..171811a 100644
--- a/Utilities/Release/upload_release.cmake
+++ b/Utilities/Release/upload_release.cmake
@@ -1,6 +1,6 @@
set(CTEST_RUN_CURRENT_SCRIPT 0)
if(NOT VERSION)
- set(VERSION 3.3)
+ set(VERSION 3.4)
endif()
if(NOT DEFINED PROJECT_PREFIX)
set(PROJECT_PREFIX cmake-${VERSION})
diff --git a/Utilities/Sphinx/templates/layout.html b/Utilities/Sphinx/templates/layout.html
index 1c5728c..177e044 100644
--- a/Utilities/Sphinx/templates/layout.html
+++ b/Utilities/Sphinx/templates/layout.html
@@ -5,7 +5,7 @@
style="vertical-align: middle; margin-top: -2px" />
</li>
<li>
- <a href="http://www.cmake.org/">CMake</a>{{ reldelim1 }}
+ <a href="https://cmake.org/">CMake</a>{{ reldelim1 }}
</li>
<li>
<a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index d12c73f..39b70c0 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -43,6 +43,14 @@ if(WIN32)
set(HAVE_INET_PTON 0 CACHE INTERNAL "Do not use inet_pton")
endif()
+# Starting with OSX 10.11 there is an unrelated libnetwork library which will
+# be picked up during curl configuration. Linking against this library is
+# unnecessary and breaks backward compatibility of the resulting binaries
+# because libnetwork is unavailable on older OSX versions.
+if(APPLE)
+ set(HAVE_LIBNETWORK 0 CACHE INTERNAL "Do not use libnetwork")
+endif(APPLE)
+
# Disable warnings to avoid changing 3rd party code.
if(CMAKE_C_COMPILER_ID MATCHES
"^(GNU|Clang|AppleClang|XL|VisualAge|SunPro|MIPSpro|HP|Intel)$")
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
index 41896a7..7b33828 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
@@ -529,7 +529,7 @@ bool Reader::decodeNumber(Token& token, Value& decoded) {
return addError("'" + std::string(token.start_, token.end_) +
"' is not a number.",
token);
- Value::UInt digit(c - '0');
+ Value::UInt digit(static_cast<Value::UInt>(c - '0'));
if (value >= threshold) {
// We've hit or exceeded the max value divided by 10 (rounded down). If
// a) we've only just touched the limit, b) this is the last digit, and
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
index b64cdb0..e3f4e53 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
@@ -24,7 +24,9 @@
// Solaris
#if defined(__sun)
# include <ieeefp.h>
-# define isfinite finite
+# if !defined(isfinite)
+# define isfinite finite
+# endif
#endif
// AIX
diff --git a/bootstrap b/bootstrap
index 7b9a582..31e9b89 100755
--- a/bootstrap
+++ b/bootstrap
@@ -373,12 +373,6 @@ KWSYS_FILES="\
SystemTools.hxx \
Terminal.h"
-KWSYS_IOS_FILES="
- fstream \
- iosfwd \
- iostream \
- sstream"
-
KWIML_FILES='
ABI.h
INT.h
@@ -498,30 +492,7 @@ cmake_kwsys_config_replace_string ()
s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
- s/@KWSYS_IOS_USE_ANSI@/${KWSYS_IOS_USE_ANSI}/g;
- s/@KWSYS_IOS_HAVE_STD@/${KWSYS_IOS_HAVE_STD}/g;
- s/@KWSYS_IOS_USE_SSTREAM@/${KWSYS_IOS_USE_SSTREAM}/g;
- s/@KWSYS_IOS_USE_STRSTREAM_H@/${KWSYS_IOS_USE_STRSTREAM_H}/g;
- s/@KWSYS_IOS_USE_STRSTREA_H@/${KWSYS_IOS_USE_STRSTREA_H}/g;
- s/@KWSYS_IOS_HAVE_BINARY@/${KWSYS_IOS_HAVE_BINARY}/g;
- s/@KWSYS_STL_HAVE_STD@/${KWSYS_STL_HAVE_STD}/g;
- s/@KWSYS_STL_STRING_HAVE_ISTREAM@/${KWSYS_STL_STRING_HAVE_ISTREAM}/g;
- s/@KWSYS_STL_STRING_HAVE_OSTREAM@/${KWSYS_STL_STRING_HAVE_OSTREAM}/g;
- s/@KWSYS_STL_STRING_HAVE_NEQ_CHAR@/${KWSYS_STL_STRING_HAVE_NEQ_CHAR}/g;
- s/@KWSYS_STL_HAS_ITERATOR_TRAITS@/${KWSYS_STL_HAS_ITERATOR_TRAITS}/g;
- s/@KWSYS_STL_HAS_ITERATOR_CATEGORY@/${KWSYS_STL_HAS_ITERATOR_CATEGORY}/g;
- s/@KWSYS_STL_HAS___ITERATOR_CATEGORY@/${KWSYS_STL_HAS___ITERATOR_CATEGORY}/g;
- s/@KWSYS_STL_HAS_ALLOCATOR_TEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}/g;
- s/@KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE}/g;
- s/@KWSYS_STL_HAS_ALLOCATOR_REBIND@/${KWSYS_STL_HAS_ALLOCATOR_REBIND}/g;
- s/@KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT@/${KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT}/g;
- s/@KWSYS_STL_HAS_ALLOCATOR_OBJECTS@/${KWSYS_STL_HAS_ALLOCATOR_OBJECTS}/g;
s/@KWSYS_STL_HAS_WSTRING@/${KWSYS_STL_HAS_WSTRING}/g;
- s/@KWSYS_CXX_HAS_CSTDDEF@/${KWSYS_CXX_HAS_CSTDDEF}/g;
- s/@KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS@/${KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS}/g;
- s/@KWSYS_CXX_HAS_MEMBER_TEMPLATES@/${KWSYS_CXX_HAS_MEMBER_TEMPLATES}/g;
- s/@KWSYS_CXX_HAS_FULL_SPECIALIZATION@/${KWSYS_CXX_HAS_FULL_SPECIALIZATION}/g;
- s/@KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP@/${KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP}/g;
s/@KWSYS_STAT_HAS_ST_MTIM@/${KWSYS_STAT_HAS_ST_MTIM}/g;}" >> "${OUTFILE}${_tmp}"
if [ -f "${OUTFILE}${_tmp}" ]; then
if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
@@ -1202,38 +1173,13 @@ KWSYS_NAME_IS_KWSYS=0
KWSYS_BUILD_SHARED=0
KWSYS_LFS_AVAILABLE=0
KWSYS_LFS_REQUESTED=0
-KWSYS_IOS_USE_STRSTREAM_H=0
-KWSYS_IOS_USE_STRSTREA_H=0
-KWSYS_IOS_HAVE_STD=0
-KWSYS_IOS_USE_SSTREAM=0
-KWSYS_IOS_USE_ANSI=0
-KWSYS_IOS_HAVE_BINARY=0
-KWSYS_STL_HAVE_STD=0
KWSYS_STAT_HAS_ST_MTIM=0
-KWSYS_STL_STRING_HAVE_NEQ_CHAR=0
-KWSYS_STL_HAS_ITERATOR_TRAITS=0
-KWSYS_STL_HAS_ITERATOR_CATEGORY=0
-KWSYS_STL_HAS___ITERATOR_CATEGORY=0
-KWSYS_STL_HAS_ALLOCATOR_TEMPLATE=0
-KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE=0
-KWSYS_STL_HAS_ALLOCATOR_REBIND=0
-KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT=0
-KWSYS_STL_HAS_ALLOCATOR_OBJECTS=0
KWSYS_STL_HAS_WSTRING=0
KWSYS_CXX_HAS_SETENV=0
KWSYS_CXX_HAS_UNSETENV=0
KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=0
KWSYS_CXX_HAS_UTIMENSAT=0
KWSYS_CXX_HAS_UTIMES=0
-KWSYS_CXX_HAS_CSTDDEF=0
-KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS=0
-KWSYS_CXX_HAS_MEMBER_TEMPLATES=0
-KWSYS_CXX_HAS_FULL_SPECIALIZATION=0
-KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP=0
-
-# Hardcode these kwsys features. They work on all known UNIX compilers anyway.
-KWSYS_STL_STRING_HAVE_ISTREAM=1
-KWSYS_STL_STRING_HAVE_OSTREAM=1
if cmake_try_run "${cmake_cxx_compiler}" \
"${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_SETENV" \
@@ -1263,151 +1209,7 @@ else
fi
if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAVE_STD" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_STL_HAVE_STD=1
- echo "${cmake_cxx_compiler} has STL in std:: namespace"
-else
- echo "${cmake_cxx_compiler} does not have STL in std:: namespace"
-fi
-
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_ANSI" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_IOS_USE_ANSI=1
- echo "${cmake_cxx_compiler} has ANSI streams"
-else
- echo "${cmake_cxx_compiler} does not have ANSI streams"
-fi
-
-if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
- if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_IOS_HAVE_STD" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_IOS_HAVE_STD=1
- echo "${cmake_cxx_compiler} has streams in std:: namespace"
- else
- echo "${cmake_cxx_compiler} does not have streams in std:: namespace"
- fi
- if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_SSTREAM" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_IOS_USE_SSTREAM=1
- echo "${cmake_cxx_compiler} has sstream"
- else
- echo "${cmake_cxx_compiler} does not have sstream"
- fi
-fi
-
-if [ "x$KWSYS_IOS_USE_SSTREAM" = "x0" ]; then
- if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREAM_H" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_IOS_USE_STRSTREAM_H=1
- echo "${cmake_cxx_compiler} has strstream.h"
- else
- echo "${cmake_cxx_compiler} does not have strstream.h"
- fi
- if [ "x$KWSYS_IOS_USE_STRSTREAM_H" = "x0" ]; then
- if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREA_H" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_IOS_USE_STRSTREA_H=1
- echo "${cmake_cxx_compiler} has strstrea.h"
- else
- echo "${cmake_cxx_compiler} does not have strstrea.h"
- fi
- fi
-fi
-
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_STL_STRING_HAVE_NEQ_CHAR=1
- echo "${cmake_cxx_compiler} has operator!=(string, char*)"
-else
- echo "${cmake_cxx_compiler} does not have operator!=(string, char*)"
-fi
-
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_TRAITS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_STL_HAS_ITERATOR_TRAITS=1
- echo "${cmake_cxx_compiler} has stl iterator_traits"
-else
- echo "${cmake_cxx_compiler} does not have stl iterator_traits"
-fi
-
-if [ "x${KWSYS_STL_HAS_ITERATOR_TRAITS}" = "x0" ]; then
- if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_STL_HAS_ITERATOR_CATEGORY=1
- echo "${cmake_cxx_compiler} has old iterator_category"
- else
- echo "${cmake_cxx_compiler} does not have old iterator_category"
- fi
- if [ "x${KWSYS_STL_HAS_ITERATOR_CATEGORY}" = "x0" ]; then
- if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS___ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_STL_HAS___ITERATOR_CATEGORY=1
- echo "${cmake_cxx_compiler} has old __iterator_category"
- else
- echo "${cmake_cxx_compiler} does not have old __iterator_category"
- fi
- fi
-fi
-
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_STL_HAS_ALLOCATOR_TEMPLATE=1
- echo "${cmake_cxx_compiler} has standard template allocator"
-else
- echo "${cmake_cxx_compiler} does not have standard template allocator"
-fi
-
-if [ "x${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}" = "x1" ]; then
- if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_REBIND -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_STL_HAS_ALLOCATOR_REBIND=1
- echo "${cmake_cxx_compiler} has allocator<>::rebind<>"
- else
- echo "${cmake_cxx_compiler} does not have allocator<>::rebind<>"
- fi
-
- if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT=1
- echo "${cmake_cxx_compiler} has non-standard allocator<>::max_size argument"
- else
- echo "${cmake_cxx_compiler} does not have non-standard allocator<>::max_size argument"
- fi
-else
- if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE=1
- echo "${cmake_cxx_compiler} has old non-template allocator"
- else
- echo "${cmake_cxx_compiler} does not have old non-template allocator"
- fi
-fi
-
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_STL_HAS_ALLOCATOR_OBJECTS=1
- echo "${cmake_cxx_compiler} has stl containers supporting allocator objects"
-else
- echo "${cmake_cxx_compiler} does not have stl containers supporting allocator objects"
-fi
-
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_WSTRING -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
+ "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_WSTRING" \
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
KWSYS_STL_HAS_WSTRING=1
echo "${cmake_cxx_compiler} has stl wstring"
@@ -1416,51 +1218,6 @@ else
fi
if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_CSTDDEF" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_CXX_HAS_CSTDDEF=1
- echo "${cmake_cxx_compiler} has header cstddef"
-else
- echo "${cmake_cxx_compiler} does not have header cstddef"
-fi
-
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- echo "${cmake_cxx_compiler} does not require template friends to use <>"
-else
- KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS=1
- echo "${cmake_cxx_compiler} requires template friends to use <>"
-fi
-
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_CXX_HAS_MEMBER_TEMPLATES=1
- echo "${cmake_cxx_compiler} supports member templates"
-else
- echo "${cmake_cxx_compiler} does not support member templates"
-fi
-
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_CXX_HAS_FULL_SPECIALIZATION=1
- echo "${cmake_cxx_compiler} has standard template specialization syntax"
-else
- echo "${cmake_cxx_compiler} does not have standard template specialization syntax"
-fi
-
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP=1
- echo "${cmake_cxx_compiler} has argument dependent lookup"
-else
- echo "${cmake_cxx_compiler} does not have argument dependent lookup"
-fi
-
-if cmake_try_run "${cmake_cxx_compiler}" \
"${cmake_cxx_flags} -DTEST_KWSYS_STAT_HAS_ST_MTIM" \
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
KWSYS_STAT_HAS_ST_MTIM=1
@@ -1469,15 +1226,6 @@ else
echo "${cmake_cxx_compiler} does not have struct stat with st_mtim member"
fi
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_IOS_HAVE_BINARY -DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI} -DKWSYS_IOS_HAVE_STD=${KWSYS_IOS_HAVE_STD}" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_IOS_HAVE_BINARY=1
- echo "${cmake_cxx_compiler} has ios::binary openmode"
-else
- echo "${cmake_cxx_compiler} does not have ios::binary openmode"
-fi
-
# Just to be safe, let us store compiler and flags to the header file
cmake_bootstrap_version='$Revision$'
@@ -1549,22 +1297,6 @@ for a in ${KWSYS_FILES}; do
"${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
done
-for a in ${KWSYS_IOS_FILES}; do
- cmake_replace_string "${cmake_source_dir}/Source/kwsys/kwsys_ios_${a}.h.in" \
- "${cmake_bootstrap_dir}/cmsys/ios/${a}" KWSYS_NAMESPACE cmsys
-done
-
-cmake_replace_string "${cmake_source_dir}/Source/kwsys/kwsys_stl.hxx.in" \
- "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx_a" KWSYS_STL_HEADER_EXTRA ""
-
-cmake_replace_string "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx_a" \
- "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx_b" KWSYS_NAMESPACE cmsys
-
-for a in string vector set map algorithm; do
- cmake_replace_string "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx_b" \
- "${cmake_bootstrap_dir}/cmsys/stl/${a}" KWSYS_STL_HEADER ${a}
-done
-
for a in ${KWIML_FILES}; do
cmake_replace_string "${cmake_source_dir}/Utilities/KWIML/${a}.in" \
"${cmake_bootstrap_dir}/cmIML/${a}" KWIML cmIML