summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--Auxiliary/cmake-mode.el3
-rw-r--r--CMakeLists.txt10
-rw-r--r--Help/command/build_command.rst2
-rw-r--r--Help/command/include_external_msproject.rst3
-rw-r--r--Help/command/install.rst23
-rw-r--r--Help/command/list.rst13
-rw-r--r--Help/command/string.rst1
-rw-r--r--Help/command/try_compile.rst3
-rw-r--r--Help/generator/Visual Studio 6.rst10
-rw-r--r--Help/generator/Visual Studio 7.rst10
-rw-r--r--Help/manual/cmake-modules.7.rst1
-rw-r--r--Help/manual/cmake-properties.7.rst2
-rw-r--r--Help/manual/cmake-toolchains.7.rst7
-rw-r--r--Help/manual/cmake-variables.7.rst2
-rw-r--r--Help/manual/cmake.1.rst3
-rw-r--r--Help/module/FindLTTngUST.rst1
-rw-r--r--Help/prop_dir/COMPILE_DEFINITIONS.rst3
-rw-r--r--Help/prop_sf/COMPILE_DEFINITIONS.rst5
-rw-r--r--Help/prop_tgt/COMPILE_DEFINITIONS.rst3
-rw-r--r--Help/prop_tgt/COMPILE_PDB_NOTE.txt3
-rw-r--r--Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst18
-rw-r--r--Help/prop_tgt/PDB_NOTE.txt3
-rw-r--r--Help/prop_tgt/VS_CONFIGURATION_TYPE.rst10
-rw-r--r--Help/release/dev/0-sample-topic.rst7
-rw-r--r--Help/release/dev/FindGTest-depends.rst6
-rw-r--r--Help/release/dev/FindProtobuf-variable-case.rst7
-rw-r--r--Help/release/dev/FindProtobuf-version.rst6
-rw-r--r--Help/release/dev/add-FindLTTngUST.rst5
-rw-r--r--Help/release/dev/cpack-deb-autodep-ORIGIN-RPATH.rst6
-rw-r--r--Help/release/dev/cpack-rpm-upper-cased-components.rst15
-rw-r--r--Help/release/dev/cygwin-clang.rst4
-rw-r--r--Help/release/dev/deprecate-CMakeForceCompiler.rst5
-rw-r--r--Help/release/dev/enable-ssl-automatically.rst8
-rw-r--r--Help/release/dev/error-multiple-targets.rst6
-rw-r--r--Help/release/dev/install-EXCLUDE_FROM_ALL.rst5
-rw-r--r--Help/release/dev/list-FILTER-command.rst5
-rw-r--r--Help/release/dev/ninja-depfile-system-headers.rst5
-rw-r--r--Help/release/dev/remove-vs6-generator.rst4
-rw-r--r--Help/release/dev/remove-vs7.0-generator.rst5
-rw-r--r--Help/release/dev/try_compile-target-type.rst8
-rw-r--r--Help/release/dev/unix-timestamps.rst6
-rw-r--r--Help/release/dev/update-osx-release.rst5
-rw-r--r--Help/release/dev/vs-clang-cl.rst5
-rw-r--r--Help/release/dev/vs-remote-directory.rst7
-rw-r--r--Help/release/dev/vs-vcxproj-ConfigurationType.rst6
-rw-r--r--Help/release/index.rst2
-rw-r--r--Help/variable/CMAKE_CFG_INTDIR.rst1
-rw-r--r--Help/variable/CMAKE_GENERATOR.rst2
-rw-r--r--Help/variable/CMAKE_MAKE_PROGRAM.rst9
-rw-r--r--Help/variable/CMAKE_MFC_FLAG.rst2
-rw-r--r--Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst15
-rw-r--r--Help/variable/CMAKE_VS_MSDEV_COMMAND.rst10
-rw-r--r--Modules/BundleUtilities.cmake2
-rw-r--r--Modules/CMakeBackwardCompatibilityC.cmake4
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake19
-rw-r--r--Modules/CMakeFindCodeBlocks.cmake15
-rw-r--r--Modules/CMakeFindEclipseCDT4.cmake4
-rw-r--r--Modules/CMakeForceCompiler.cmake20
-rw-r--r--Modules/CMakeIOSInstallCombined.cmake12
-rw-r--r--Modules/CMakeTestCompilerCommon.cmake6
-rw-r--r--Modules/CMakeVS6BackwardCompatibility.cmake26
-rw-r--r--Modules/CPackDeb.cmake6
-rw-r--r--Modules/CPackRPM.cmake311
-rw-r--r--Modules/CPackWIX.cmake6
-rw-r--r--Modules/CTest.cmake3
-rw-r--r--Modules/CTestCoverageCollectGCOV.cmake64
-rw-r--r--Modules/Compiler/Clang-CXX-TestableFeatures.cmake4
-rw-r--r--Modules/Compiler/GNU.cmake4
-rw-r--r--Modules/Compiler/IAR-C.cmake3
-rw-r--r--Modules/Compiler/IAR-CXX.cmake3
-rw-r--r--Modules/Compiler/Intel-C.cmake2
-rw-r--r--Modules/Compiler/Intel-CXX.cmake2
-rw-r--r--Modules/Compiler/QCC.cmake2
-rw-r--r--Modules/CompilerId/VS-6.dsp.in48
-rw-r--r--Modules/FindBoost.cmake14
-rw-r--r--Modules/FindCUDA/make2cmake.cmake18
-rw-r--r--Modules/FindCUDA/run_nvcc.cmake1
-rw-r--r--Modules/FindGTest.cmake4
-rw-r--r--Modules/FindJNI.cmake17
-rw-r--r--Modules/FindLTTngUST.cmake111
-rw-r--r--Modules/FindProtobuf.cmake234
-rw-r--r--Modules/FindwxWidgets.cmake30
-rw-r--r--Modules/FortranCInterface.cmake313
-rw-r--r--Modules/GetPrerequisites.cmake2
-rw-r--r--Modules/Platform/CYGWIN-Clang-C.cmake1
-rw-r--r--Modules/Platform/CYGWIN-Clang-CXX.cmake1
-rw-r--r--Modules/Platform/Darwin-Clang.cmake2
-rw-r--r--Modules/Platform/Windows-MSVC.cmake34
-rw-r--r--Modules/Platform/Windows-df.cmake3
-rw-r--r--Source/CMakeLists.txt6
-rw-r--r--Source/CMakeVersion.cmake4
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx21
-rw-r--r--Source/CPack/cmCPackGenerator.cxx3
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx20
-rw-r--r--Source/cmCommonTargetGenerator.cxx32
-rw-r--r--Source/cmCommonTargetGenerator.h3
-rw-r--r--Source/cmComputeLinkDepends.cxx2
-rw-r--r--Source/cmCoreTryCompile.cxx73
-rw-r--r--Source/cmCoreTryCompile.h6
-rw-r--r--Source/cmCreateTestSourceList.cxx3
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx99
-rw-r--r--Source/cmExtraCodeBlocksGenerator.h7
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx12
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h2
-rw-r--r--Source/cmFileCommand.cxx9
-rw-r--r--Source/cmGeneratorTarget.cxx3
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmGlobalGenerator.cxx23
-rw-r--r--Source/cmGlobalGenerator.h6
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx6
-rw-r--r--Source/cmGlobalVisualStudio6Generator.cxx451
-rw-r--r--Source/cmGlobalVisualStudio6Generator.h113
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx227
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h26
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx3
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h1
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx32
-rw-r--r--Source/cmInstallCommand.cxx31
-rw-r--r--Source/cmInstallCommandArguments.cxx30
-rw-r--r--Source/cmInstallCommandArguments.h2
-rw-r--r--Source/cmInstallDirectoryGenerator.cxx4
-rw-r--r--Source/cmInstallDirectoryGenerator.h1
-rw-r--r--Source/cmInstallExportGenerator.cxx4
-rw-r--r--Source/cmInstallExportGenerator.h1
-rw-r--r--Source/cmInstallFilesCommand.cxx4
-rw-r--r--Source/cmInstallFilesGenerator.cxx4
-rw-r--r--Source/cmInstallFilesGenerator.h1
-rw-r--r--Source/cmInstallGenerator.cxx18
-rw-r--r--Source/cmInstallGenerator.h7
-rw-r--r--Source/cmInstallProgramsCommand.cxx4
-rw-r--r--Source/cmInstallScriptGenerator.cxx7
-rw-r--r--Source/cmInstallScriptGenerator.h2
-rw-r--r--Source/cmInstallTargetGenerator.cxx4
-rw-r--r--Source/cmInstallTargetGenerator.h1
-rw-r--r--Source/cmLinkItem.h2
-rw-r--r--Source/cmListCommand.cxx109
-rw-r--r--Source/cmListCommand.h6
-rw-r--r--Source/cmListFileCache.h3
-rw-r--r--Source/cmLocalGenerator.cxx8
-rw-r--r--Source/cmLocalNinjaGenerator.cxx17
-rw-r--r--Source/cmLocalNinjaGenerator.h1
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx2002
-rw-r--r--Source/cmLocalVisualStudio6Generator.h105
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx33
-rw-r--r--Source/cmLocalVisualStudio7Generator.h3
-rw-r--r--Source/cmMakefile.cxx48
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx34
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.h3
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx10
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx3
-rw-r--r--Source/cmSystemTools.cxx9
-rw-r--r--Source/cmTarget.cxx298
-rw-r--r--Source/cmTarget.h64
-rw-r--r--Source/cmTimestamp.cxx64
-rw-r--r--Source/cmTimestamp.h11
-rw-r--r--Source/cmTryCompileCommand.cxx2
-rw-r--r--Source/cmTryRunCommand.cxx2
-rw-r--r--Source/cmVS14CLFlagTable.h20
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx91
-rw-r--r--Source/cmXCodeObject.cxx126
-rw-r--r--Source/cmXCodeObject.h4
-rw-r--r--Source/cmake.cxx11
-rw-r--r--Source/cmakemain.cxx21
-rw-r--r--Source/kwsys/CommandLineArguments.cxx1
-rw-r--r--Source/kwsys/MD5.c8
-rw-r--r--Source/kwsys/Process.h.in7
-rw-r--r--Source/kwsys/ProcessUNIX.c13
-rw-r--r--Source/kwsys/ProcessWin32.c15
-rw-r--r--Source/kwsys/SystemInformation.cxx52
-rw-r--r--Source/kwsys/SystemTools.cxx112
-rw-r--r--Source/kwsys/testDynamicLoader.cxx2
-rw-r--r--Source/kwsys/testHashSTL.cxx1
-rw-r--r--Source/kwsys/testIOS.cxx6
-rw-r--r--Templates/CMakeVisualStudio6Configurations.cmake3
-rw-r--r--Templates/DLLFooter.dsptemplate4
-rw-r--r--Templates/DLLHeader.dsptemplate192
-rw-r--r--Templates/EXEFooter.dsptemplate4
-rw-r--r--Templates/EXEHeader.dsptemplate183
-rw-r--r--Templates/EXEWinHeader.dsptemplate187
-rw-r--r--Templates/UtilityFooter.dsptemplate2
-rw-r--r--Templates/UtilityHeader.dsptemplate95
-rw-r--r--Templates/staticLibFooter.dsptemplate4
-rw-r--r--Templates/staticLibHeader.dsptemplate173
-rw-r--r--Tests/AliasTarget/CMakeLists.txt7
-rw-r--r--Tests/BuildDepends/CMakeLists.txt5
-rw-r--r--Tests/CMakeLists.txt21
-rw-r--r--Tests/CMakeOnly/AllFindModules/CMakeLists.txt4
-rw-r--r--Tests/CMakeTests/String-TIMESTAMP-UnixTime.cmake22
-rw-r--r--Tests/CMakeTests/StringTest.cmake.in6
-rw-r--r--Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in12
-rw-r--r--Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in2
-rw-r--r--Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake8
-rw-r--r--Tests/CompileDefinitions/CMakeLists.txt5
-rw-r--r--Tests/Complex/CMakeLists.txt7
-rw-r--r--Tests/Complex/Executable/CMakeLists.txt3
-rw-r--r--Tests/ComplexOneConfig/CMakeLists.txt7
-rw-r--r--Tests/ComplexOneConfig/Executable/CMakeLists.txt3
-rw-r--r--Tests/CustomCommand/wrapper.cxx10
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt10
-rw-r--r--Tests/ExportImport/Export/testLib4libdbg1.c1
-rw-r--r--Tests/ExportImport/Export/testLib4libopt1.c1
-rw-r--r--Tests/ExternalProjectLocal/CMakeLists.txt12
-rw-r--r--Tests/ExternalProjectSubdir/CMakeLists.txt7
-rw-r--r--Tests/FindLTTngUST/CMakeLists.txt10
-rw-r--r--Tests/FindLTTngUST/Test/CMakeLists.txt18
-rw-r--r--Tests/FindLTTngUST/Test/main.c31
-rw-r--r--Tests/FindPackageModeMakefileTest/CMakeLists.txt3
-rw-r--r--Tests/Fortran/CMakeLists.txt4
-rw-r--r--Tests/Module/GenerateExportHeader/CMakeLists.txt16
-rw-r--r--Tests/Module/GenerateExportHeader/exportheader_test.cpp11
-rw-r--r--Tests/Module/GenerateExportHeader/reference/Win32-Clang/libshared_export.h41
-rw-r--r--Tests/Module/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h41
-rw-r--r--Tests/ObjectLibrary/A/CMakeLists.txt7
-rw-r--r--Tests/ObjectLibrary/B/CMakeLists.txt6
-rw-r--r--Tests/ObjectLibrary/B/b1_vs6.c1
-rw-r--r--Tests/ObjectLibrary/B/b2_vs6.c1
-rw-r--r--Tests/ObjectLibrary/CMakeLists.txt4
-rw-r--r--Tests/PDBDirectoryAndName/CMakeLists.txt14
-rw-r--r--Tests/Plugin/CMakeLists.txt7
-rw-r--r--Tests/PrecompiledHeader/CMakeLists.txt10
-rw-r--r--Tests/Preprocess/CMakeLists.txt43
-rw-r--r--Tests/Preprocess/preprocess.h.in6
-rw-r--r--Tests/Preprocess/preprocess_vs6.cxx3
-rw-r--r--Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake41
-rw-r--r--Tests/RunCMake/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake26
-rw-r--r--Tests/RunCMake/CPack/RPM/DEPENDENCIES-specifics.cmake20
-rw-r--r--Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-ExpectedFiles.cmake7
-rw-r--r--Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-VerifyResult.cmake29
-rw-r--r--Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-specifics.cmake19
-rw-r--r--Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-specifics.cmake4
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt5
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/RunCMake.cmake3
-rw-r--r--Tests/RunCMake/ToolchainFile/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/ToolchainFile/CallEnableLanguage-result.txt1
-rw-r--r--Tests/RunCMake/ToolchainFile/CallEnableLanguage-stderr.txt5
-rw-r--r--Tests/RunCMake/ToolchainFile/CallEnableLanguage-toolchain.cmake1
-rw-r--r--Tests/RunCMake/ToolchainFile/CallEnableLanguage.cmake (renamed from Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake)0
-rw-r--r--Tests/RunCMake/ToolchainFile/CallProject-result.txt1
-rw-r--r--Tests/RunCMake/ToolchainFile/CallProject-stderr.txt5
-rw-r--r--Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake1
-rw-r--r--Tests/RunCMake/ToolchainFile/CallProject.cmake (renamed from Tests/RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake)0
-rw-r--r--Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/VS10Project/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake24
-rw-r--r--Tests/RunCMake/VS10Project/VsConfigurationType.cmake3
-rw-r--r--Tests/RunCMake/VS10Project/foo.cpp1
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake20
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch-install-check.cmake25
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake19
-rw-r--r--Tests/RunCMake/cmake_parse_arguments/CornerCases.cmake20
-rw-r--r--Tests/RunCMake/cmake_parse_arguments/Initialization.cmake9
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-hash-mismatch-result.txt1
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-hash-mismatch-stderr.txt12
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake7
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-hash-mismatch.txt0
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-all-check.cmake1
-rw-r--r--Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-exc-check.cmake1
-rw-r--r--Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-uns-check.cmake1
-rw-r--r--Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL.cmake3
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake45
-rw-r--r--Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-all-check.cmake1
-rw-r--r--Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-exc-check.cmake1
-rw-r--r--Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-uns-check.cmake1
-rw-r--r--Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL.cmake5
-rw-r--r--Tests/RunCMake/install/main.c1
-rw-r--r--Tests/RunCMake/list/EmptyFilterRegex-result.txt1
-rw-r--r--Tests/RunCMake/list/EmptyFilterRegex-stderr.txt0
-rw-r--r--Tests/RunCMake/list/EmptyFilterRegex.cmake2
-rw-r--r--Tests/RunCMake/list/FILTER-NotList-result.txt1
-rw-r--r--Tests/RunCMake/list/FILTER-NotList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/FILTER-NotList.cmake2
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-InvalidMode-result.txt1
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-InvalidMode-stderr.txt4
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-InvalidMode.cmake2
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-InvalidOperator-result.txt1
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-InvalidOperator-stderr.txt4
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-InvalidOperator.cmake2
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-InvalidRegex-result.txt1
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-InvalidRegex-stderr.txt4
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-InvalidRegex.cmake2
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-TooManyArguments-result.txt1
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-TooManyArguments-stderr.txt4
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-TooManyArguments.cmake2
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-Valid0-result.txt1
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-Valid0-stderr.txt2
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-Valid0.cmake4
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-Valid1-result.txt1
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-Valid1-stderr.txt2
-rw-r--r--Tests/RunCMake/list/FILTER-REGEX-Valid1.cmake4
-rw-r--r--Tests/RunCMake/list/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/try_compile/TargetTypeExe.cmake14
-rw-r--r--Tests/RunCMake/try_compile/TargetTypeInvalid-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/TargetTypeInvalid-stderr.txt5
-rw-r--r--Tests/RunCMake/try_compile/TargetTypeInvalid.cmake2
-rw-r--r--Tests/RunCMake/try_compile/TargetTypeStatic.cmake14
-rw-r--r--Tests/RunCMake/try_compile/other.c1
-rw-r--r--Tests/TryCompile/CMakeLists.txt4
-rw-r--r--Tests/VSExternalInclude/CMakeLists.txt7
-rw-r--r--Tests/VSMidl/src/CMakeLists.txt8
-rw-r--r--Utilities/Release/bigmac_release.cmake (renamed from Utilities/Release/dashmacmini5_release.cmake)21
-rw-r--r--Utilities/Release/create-cmake-release.cmake2
-rw-r--r--Utilities/Release/linux64_release.cmake6
-rw-r--r--Utilities/Release/magrathea_release.cmake6
-rw-r--r--Utilities/Scripts/update-third-party.bash19
315 files changed, 2875 insertions, 5306 deletions
diff --git a/.gitattributes b/.gitattributes
index d3f7280..cb3565f 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -10,7 +10,6 @@ configure crlf=input
*.bat -crlf
*.bat.in -crlf
*.dsp -crlf
-*.dsptemplate -crlf
*.dsw -crlf
*.pfx -crlf
*.png -crlf
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index 08ac490..d74dba0 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -304,7 +304,8 @@ and store the result as a list in LISTVAR."
(save-window-excursion
(cmake-command-run (concat "--help-" listname "-list") nil temp-buffer-name)
(with-current-buffer temp-buffer-name
- (set listvar (cdr (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n" t))))))
+ ; FIXME: Ignore first line if it is "cmake version ..." from CMake < 3.0.
+ (set listvar (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n" t)))))
(symbol-value listvar)
))
)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9381f35..787f319 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -327,7 +327,15 @@ macro (CMAKE_BUILD_UTILITIES)
if(CMAKE_TESTS_CDASH_SERVER)
set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
endif()
- option(CMAKE_USE_OPENSSL "Use OpenSSL." OFF)
+ set(_CMAKE_USE_OPENSSL_DEFAULT OFF)
+ if(NOT DEFINED CMAKE_USE_OPENSSL AND NOT WIN32 AND NOT APPLE
+ AND CMAKE_SYSTEM_NAME MATCHES "(Linux|FreeBSD)")
+ find_package(OpenSSL QUIET)
+ if(OPENSSL_FOUND)
+ set(_CMAKE_USE_OPENSSL_DEFAULT ON)
+ endif()
+ endif()
+ option(CMAKE_USE_OPENSSL "Use OpenSSL." ${_CMAKE_USE_OPENSSL_DEFAULT})
mark_as_advanced(CMAKE_USE_OPENSSL)
if(CMAKE_USE_OPENSSL)
set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle")
diff --git a/Help/command/build_command.rst b/Help/command/build_command.rst
index 1298c1f..b83edaf 100644
--- a/Help/command/build_command.rst
+++ b/Help/command/build_command.rst
@@ -35,7 +35,7 @@ compatibility. Use the first signature instead.
It sets the given ``<cachevariable>`` to a command-line string as
above but without the ``--target`` option.
The ``<makecommand>`` is ignored but should be the full path to
-msdev, devenv, nmake, make or one of the end user build tools
+devenv, nmake, make or one of the end user build tools
for legacy invocations.
.. note::
diff --git a/Help/command/include_external_msproject.rst b/Help/command/include_external_msproject.rst
index 595762d..18a2b50 100644
--- a/Help/command/include_external_msproject.rst
+++ b/Help/command/include_external_msproject.rst
@@ -19,5 +19,4 @@ command to make things depend on the external project.
``TYPE``, ``GUID`` and ``PLATFORM`` are optional parameters that allow one to
specify the type of project, id (GUID) of the project and the name of
the target platform. This is useful for projects requiring values
-other than the default (e.g. WIX projects). These options are not
-supported by the Visual Studio 6 generator.
+other than the default (e.g. WIX projects).
diff --git a/Help/command/install.rst b/Help/command/install.rst
index 45167bc..aaf12cc 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -45,11 +45,15 @@ signatures that specify them. The common options are:
is associated, such as "runtime" or "development". During
component-specific installation only install rules associated with
the given component name will be executed. During a full installation
- all components are installed. If ``COMPONENT`` is not provided a
- default component "Unspecified" is created. The default component
- name may be controlled with the
+ all components are installed unless marked with ``EXCLUDE_FROM_ALL``.
+ If ``COMPONENT`` is not provided a default component "Unspecified" is
+ created. The default component name may be controlled with the
:variable:`CMAKE_INSTALL_DEFAULT_COMPONENT_NAME` variable.
+``EXCLUDE_FROM_ALL``
+ Specify that the file is excluded from a full installation and only
+ installed as part of a component-specific installation
+
``RENAME``
Specify a name for an installed file that may be different from the
original file. Renaming is allowed only when a single file is
@@ -75,7 +79,8 @@ Installing Targets
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
- [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]
+ [OPTIONAL] [EXCLUDE_FROM_ALL]
+ [NAMELINK_ONLY|NAMELINK_SKIP]
] [...]
[INCLUDES DESTINATION [<dir> ...]]
)
@@ -177,7 +182,7 @@ Installing Files
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
- [RENAME <name>] [OPTIONAL])
+ [RENAME <name>] [OPTIONAL] [EXCLUDE_FROM_ALL])
The ``FILES`` form specifies rules for installing files for a project.
File names given as relative paths are interpreted with respect to the
@@ -211,7 +216,8 @@ Installing Directories
[DIRECTORY_PERMISSIONS permissions...]
[USE_SOURCE_PERMISSIONS] [OPTIONAL] [MESSAGE_NEVER]
[CONFIGURATIONS [Debug|Release|...]]
- [COMPONENT <component>] [FILES_MATCHING]
+ [COMPONENT <component>] [EXCLUDE_FROM_ALL]
+ [FILES_MATCHING]
[[PATTERN <pattern> | REGEX <regex>]
[EXCLUDE] [PERMISSIONS permissions...]] [...])
@@ -287,7 +293,7 @@ Custom Installation Logic
::
install([[SCRIPT <file>] [CODE <code>]]
- [COMPONENT <component>] [...])
+ [COMPONENT <component>] [EXCLUDE_FROM_ALL] [...])
The ``SCRIPT`` form will invoke the given CMake script files during
installation. If the script file name is a relative path it will be
@@ -312,7 +318,8 @@ Installing Exports
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[EXPORT_LINK_INTERFACE_LIBRARIES]
- [COMPONENT <component>])
+ [COMPONENT <component>]
+ [EXCLUDE_FROM_ALL])
The ``EXPORT`` form generates and installs a CMake file containing code to
import targets from the installation tree into another project.
diff --git a/Help/command/list.rst b/Help/command/list.rst
index a7a05c7..f6b75bc 100644
--- a/Help/command/list.rst
+++ b/Help/command/list.rst
@@ -9,6 +9,7 @@ List operations.
list(GET <list> <element index> [<element index> ...]
<output variable>)
list(APPEND <list> [<element> ...])
+ list(FILTER <list> <INCLUDE|EXCLUDE> REGEX <regular_expression>)
list(FIND <list> <value> <output variable>)
list(INSERT <list> <element_index> <element> [<element> ...])
list(REMOVE_ITEM <list> <value> [<value> ...])
@@ -23,6 +24,12 @@ List operations.
``APPEND`` will append elements to the list.
+``FILTER`` will include or remove items from the list that match the
+mode's pattern.
+In ``REGEX`` mode, items will be matched against the given regular expression.
+For more information on regular expressions see also the :command:`string`
+command.
+
``FIND`` will return the index of the element specified in the list or -1
if it wasn't found.
@@ -38,9 +45,9 @@ difference is that ``REMOVE_ITEM`` will remove the given items, while
``SORT`` sorts the list in-place alphabetically.
-The list subcommands ``APPEND``, ``INSERT``, ``REMOVE_AT``, ``REMOVE_ITEM``,
-``REMOVE_DUPLICATES``, ``REVERSE`` and ``SORT`` may create new values for
-the list within the current CMake variable scope. Similar to the
+The list subcommands ``APPEND``, ``INSERT``, ``FILTER``, ``REMOVE_AT``,
+``REMOVE_ITEM``, ``REMOVE_DUPLICATES``, ``REVERSE`` and ``SORT`` may create new
+values for the list within the current CMake variable scope. Similar to the
:command:`set` command, the LIST command creates new variable values in the
current scope, even if the list itself is actually defined in a parent
scope. To propagate the results of these operations upwards, use
diff --git a/Help/command/string.rst b/Help/command/string.rst
index 0361c74..3f4050e 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -277,6 +277,7 @@ specifiers:
%j The day of the current year (001-366).
%m The month of the current year (01-12).
%M The minute of the current hour (00-59).
+ %s Seconds since midnight (UTC) 1-Jan-1970 (UNIX time).
%S The second of the current minute.
60 represents a leap second. (00-60)
%U The week number of the current year (00-53).
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst
index 28dae80..78b1bc7 100644
--- a/Help/command/try_compile.rst
+++ b/Help/command/try_compile.rst
@@ -112,3 +112,6 @@ 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.
+
+Set the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable to specify
+the type of target used for the source file signature.
diff --git a/Help/generator/Visual Studio 6.rst b/Help/generator/Visual Studio 6.rst
index 855589c..2dd07e0 100644
--- a/Help/generator/Visual Studio 6.rst
+++ b/Help/generator/Visual Studio 6.rst
@@ -1,10 +1,6 @@
Visual Studio 6
---------------
-Deprected. Generates Visual Studio 6 project files.
-
-.. note::
- This generator is deprecated and will be removed
- in a future version of CMake. It will still be
- possible to build with VS 6 tools using the
- :generator:`NMake Makefiles` generator.
+Removed. This once generated Visual Studio 6 project files, but the
+generator has been removed since CMake 3.6. It is still possible to
+build with VS 6 tools using the :generator:`NMake Makefiles` generator.
diff --git a/Help/generator/Visual Studio 7.rst b/Help/generator/Visual Studio 7.rst
index eb426f4..54d29df 100644
--- a/Help/generator/Visual Studio 7.rst
+++ b/Help/generator/Visual Studio 7.rst
@@ -1,10 +1,6 @@
Visual Studio 7
---------------
-Deprected. Generates Visual Studio .NET 2002 project files.
-
-.. note::
- This generator is deprecated and will be removed
- in a future version of CMake. It will still be
- possible to build with VS 7.0 tools using the
- :generator:`NMake Makefiles` generator.
+Removed. This once generated Visual Studio .NET 2002 project files, but
+the generator has been removed since CMake 3.6. It is still possible to
+build with VS 7.0 tools using the :generator:`NMake Makefiles` generator.
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index 10f05df..62910cf 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -135,6 +135,7 @@ All Modules
/module/FindLibLZMA
/module/FindLibXml2
/module/FindLibXslt
+ /module/FindLTTngUST
/module/FindLua50
/module/FindLua51
/module/FindLua
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index a41d484..fbde4eb 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -141,6 +141,7 @@ Properties on Targets
/prop_tgt/CXX_STANDARD_REQUIRED
/prop_tgt/DEBUG_POSTFIX
/prop_tgt/DEFINE_SYMBOL
+ /prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY
/prop_tgt/EchoString
/prop_tgt/ENABLE_EXPORTS
/prop_tgt/EXCLUDE_FROM_ALL
@@ -255,6 +256,7 @@ Properties on Targets
/prop_tgt/TYPE
/prop_tgt/VERSION
/prop_tgt/VISIBILITY_INLINES_HIDDEN
+ /prop_tgt/VS_CONFIGURATION_TYPE
/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION
/prop_tgt/VS_DOTNET_REFERENCES
/prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index 7b294a8..390220c 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -138,9 +138,10 @@ a path on the host to install to. The :variable:`CMAKE_INSTALL_PREFIX` is always
the runtime installation location, even when cross-compiling.
The :variable:`CMAKE_<LANG>_COMPILER` variables may be set to full paths, or to
-names of compilers to search for in standard locations. In cases where CMake does
-not have enough information to extract information from the compiler, the
-:module:`CMakeForceCompiler` module can be used to bypass some of the checks.
+names of compilers to search for in standard locations. For toolchains that
+do not support linking binaries without custom flags or scripts one may set
+the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable to ``STATIC_LIBRARY``
+to tell CMake not to try to link executables during its checks.
CMake ``find_*`` commands will look in the sysroot, and the :variable:`CMAKE_FIND_ROOT_PATH`
entries by default in all cases, as well as looking in the host system root prefix.
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 15eaece..cb50051 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -78,7 +78,6 @@ Variables that Provide Information
/variable/CMAKE_VS_DEVENV_COMMAND
/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
/variable/CMAKE_VS_MSBUILD_COMMAND
- /variable/CMAKE_VS_MSDEV_COMMAND
/variable/CMAKE_VS_NsightTegra_VERSION
/variable/CMAKE_VS_PLATFORM_NAME
/variable/CMAKE_VS_PLATFORM_TOOLSET
@@ -292,6 +291,7 @@ Variables that Control the Build
/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG
/variable/CMAKE_STATIC_LINKER_FLAGS
/variable/CMAKE_TRY_COMPILE_CONFIGURATION
+ /variable/CMAKE_TRY_COMPILE_TARGET_TYPE
/variable/CMAKE_USE_RELATIVE_PATHS
/variable/CMAKE_VISIBILITY_INLINES_HIDDEN
/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 92f5230..5295a48c 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -58,13 +58,14 @@ Options
<dir> = Project binary directory to be built.
--target <tgt> = Build <tgt> instead of default targets.
+ May only be specified once.
--config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.)
--use-stderr = Ignored. Behavior is default in CMake >= 3.0.
-- = Pass remaining options to the native tool.
- Run cmake --build with no options for quick help.
+ Run ``cmake --build`` with no options for quick help.
``-N``
View mode only.
diff --git a/Help/module/FindLTTngUST.rst b/Help/module/FindLTTngUST.rst
new file mode 100644
index 0000000..a775462
--- /dev/null
+++ b/Help/module/FindLTTngUST.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindLTTngUST.cmake
diff --git a/Help/prop_dir/COMPILE_DEFINITIONS.rst b/Help/prop_dir/COMPILE_DEFINITIONS.rst
index ab7e7f0..85adcb5 100644
--- a/Help/prop_dir/COMPILE_DEFINITIONS.rst
+++ b/Help/prop_dir/COMPILE_DEFINITIONS.rst
@@ -17,8 +17,7 @@ This property will be initialized in each directory by its value in the
directory's parent.
CMake will automatically drop some definitions that are not supported
-by the native build tool. The VS6 IDE does not support definition
-values with spaces (but NMake does).
+by the native build tool.
.. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
diff --git a/Help/prop_sf/COMPILE_DEFINITIONS.rst b/Help/prop_sf/COMPILE_DEFINITIONS.rst
index 7f7e7c7..1626825 100644
--- a/Help/prop_sf/COMPILE_DEFINITIONS.rst
+++ b/Help/prop_sf/COMPILE_DEFINITIONS.rst
@@ -13,8 +13,7 @@ the name COMPILE_DEFINITIONS_<CONFIG> where <CONFIG> is an upper-case
name (ex. "COMPILE_DEFINITIONS_DEBUG").
CMake will automatically drop some definitions that are not supported
-by the native build tool. The VS6 IDE does not support definition
-values with spaces (but NMake does). Xcode does not support
-per-configuration definitions on source files.
+by the native build tool. Xcode does not support per-configuration
+definitions on source files.
.. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
diff --git a/Help/prop_tgt/COMPILE_DEFINITIONS.rst b/Help/prop_tgt/COMPILE_DEFINITIONS.rst
index 00c49c3..059f913 100644
--- a/Help/prop_tgt/COMPILE_DEFINITIONS.rst
+++ b/Help/prop_tgt/COMPILE_DEFINITIONS.rst
@@ -11,8 +11,7 @@ automatically escape the value correctly for the native build system
values).
CMake will automatically drop some definitions that are not supported
-by the native build tool. The VS6 IDE does not support definition
-values with spaces (but NMake does).
+by the native build tool.
.. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
diff --git a/Help/prop_tgt/COMPILE_PDB_NOTE.txt b/Help/prop_tgt/COMPILE_PDB_NOTE.txt
index 5941d72..43003d9 100644
--- a/Help/prop_tgt/COMPILE_PDB_NOTE.txt
+++ b/Help/prop_tgt/COMPILE_PDB_NOTE.txt
@@ -3,6 +3,3 @@
``/Fd`` compiler flag and are not the same as linker-generated
program database files specified by the ``/pdb`` linker flag.
Use the |PDB_XXX| property to specify the latter.
-
- This property is not implemented by the :generator:`Visual Studio 6`
- generator.
diff --git a/Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst b/Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst
new file mode 100644
index 0000000..1ff5bf0
--- /dev/null
+++ b/Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst
@@ -0,0 +1,18 @@
+DEPLOYMENT_REMOTE_DIRECTORY
+---------------------------
+
+Set the WinCE project ``RemoteDirectory`` in ``DeploymentTool`` and
+``RemoteExecutable`` in ``DebuggerTool`` in ``.vcproj`` files generated
+by the :generator:`Visual Studio 9 2008` and :generator:`Visual Studio 8 2005`
+generators. This is useful when you want to debug on remote WinCE device.
+For example:
+
+.. code-block:: cmake
+
+ set_property(TARGET ${TARGET} PROPERTY
+ DEPLOYMENT_REMOTE_DIRECTORY "\\FlashStorage")
+
+produces::
+
+ <DeploymentTool RemoteDirectory="\FlashStorage" ... />
+ <DebuggerTool RemoteExecutable="\FlashStorage\target_file" ... />
diff --git a/Help/prop_tgt/PDB_NOTE.txt b/Help/prop_tgt/PDB_NOTE.txt
index f90ea81..b5ada07 100644
--- a/Help/prop_tgt/PDB_NOTE.txt
+++ b/Help/prop_tgt/PDB_NOTE.txt
@@ -7,6 +7,3 @@
``/pdb`` linker flag and are not the same as compiler-generated
program database files specified by the ``/Fd`` compiler flag.
Use the |COMPILE_PDB_XXX| property to specify the latter.
-
- This property is not implemented by the :generator:`Visual Studio 6`
- generator.
diff --git a/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst b/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst
new file mode 100644
index 0000000..ff987ff
--- /dev/null
+++ b/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst
@@ -0,0 +1,10 @@
+VS_CONFIGURATION_TYPE
+---------------------
+
+Visual Studio project configuration type.
+
+Sets the ``ConfigurationType`` attribute for a generated Visual Studio project.
+If this property is set, it overrides the default setting that is based on the
+target type (e.g. ``StaticLibrary``, ``Application``, ...).
+
+Supported on :ref:`Visual Studio Generators` for VS 2010 and higher.
diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst
new file mode 100644
index 0000000..e4cc01e
--- /dev/null
+++ b/Help/release/dev/0-sample-topic.rst
@@ -0,0 +1,7 @@
+0-sample-topic
+--------------
+
+* This is a sample release note for the change in a topic.
+ Developers should add similar notes for each topic branch
+ making a noteworthy change. Each document should be named
+ and titled to match the topic name to avoid merge conflicts.
diff --git a/Help/release/dev/FindGTest-depends.rst b/Help/release/dev/FindGTest-depends.rst
new file mode 100644
index 0000000..33c1489
--- /dev/null
+++ b/Help/release/dev/FindGTest-depends.rst
@@ -0,0 +1,6 @@
+FindGTest-depends
+-----------------
+
+* The :module:`FindGTest` module ``gtest_add_tests`` function now causes
+ CMake to automatically re-run when test sources change so that they
+ can be re-scanned.
diff --git a/Help/release/dev/FindProtobuf-variable-case.rst b/Help/release/dev/FindProtobuf-variable-case.rst
new file mode 100644
index 0000000..0df00e7
--- /dev/null
+++ b/Help/release/dev/FindProtobuf-variable-case.rst
@@ -0,0 +1,7 @@
+FindProtobuf-variable-case
+--------------------------
+
+* The :module:`FindProtobuf` module input and output variables were all renamed
+ from ``PROTOBUF_`` to ``Protobuf_`` for consistency with other find modules.
+ Input variables of the old case will be honored if provided, and output
+ variables of the old case are always provided.
diff --git a/Help/release/dev/FindProtobuf-version.rst b/Help/release/dev/FindProtobuf-version.rst
new file mode 100644
index 0000000..40c2ff5
--- /dev/null
+++ b/Help/release/dev/FindProtobuf-version.rst
@@ -0,0 +1,6 @@
+FindProtobuf-version
+--------------------
+
+* The :module:`FindProtobuf` module learned to provide a ``Protobuf_VERSION``
+ variable and check the version number requested in a :command:`find_package`
+ call.
diff --git a/Help/release/dev/add-FindLTTngUST.rst b/Help/release/dev/add-FindLTTngUST.rst
new file mode 100644
index 0000000..a156cc8
--- /dev/null
+++ b/Help/release/dev/add-FindLTTngUST.rst
@@ -0,0 +1,5 @@
+add-FindLTTngUST
+----------------
+
+* The :module:`FindLTTngUST` module was introduced to find the LTTng-UST
+ library.
diff --git a/Help/release/dev/cpack-deb-autodep-ORIGIN-RPATH.rst b/Help/release/dev/cpack-deb-autodep-ORIGIN-RPATH.rst
new file mode 100644
index 0000000..b0d6196
--- /dev/null
+++ b/Help/release/dev/cpack-deb-autodep-ORIGIN-RPATH.rst
@@ -0,0 +1,6 @@
+cpack-deb-autodep-ORIGIN-RPATH
+--------------------------------
+
+* The "CPackDeb" module learned how to handle ``$ORIGIN``
+ in ``CMAKE_INSTALL_RPATH`` when :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS`
+ is used for dependency auto detection.
diff --git a/Help/release/dev/cpack-rpm-upper-cased-components.rst b/Help/release/dev/cpack-rpm-upper-cased-components.rst
new file mode 100644
index 0000000..a5fb233
--- /dev/null
+++ b/Help/release/dev/cpack-rpm-upper-cased-components.rst
@@ -0,0 +1,15 @@
+cpack-rpm-upper-cased-components
+--------------------------------
+
+* The "CPackRPM" module now supports upper cased component name
+ in per component CPackRPM specific variables.
+ E.g. component named ``foo`` now expects component specific
+ variable to be ``CPACK_RPM_FOO_PACKAGE_NAME`` while before
+ it expected ``CPACK_RPM_foo_PACKAGE_NAME``.
+ Upper cased component name part in variables is compatible
+ with convention used for other CPack variables.
+ For back compatibility old format of variables is still valid
+ and prefered if both versions of variable are set, but the
+ preferred future use is upper cased component names in variables.
+ New variables that will be added to CPackRPM in later versions
+ will only support upper cased component variable format.
diff --git a/Help/release/dev/cygwin-clang.rst b/Help/release/dev/cygwin-clang.rst
new file mode 100644
index 0000000..7d06d2a
--- /dev/null
+++ b/Help/release/dev/cygwin-clang.rst
@@ -0,0 +1,4 @@
+cygwin-clang
+------------
+
+* The Clang compiler is now supported on CYGWIN.
diff --git a/Help/release/dev/deprecate-CMakeForceCompiler.rst b/Help/release/dev/deprecate-CMakeForceCompiler.rst
new file mode 100644
index 0000000..dc6e817
--- /dev/null
+++ b/Help/release/dev/deprecate-CMakeForceCompiler.rst
@@ -0,0 +1,5 @@
+deprecate-CMakeForceCompiler
+----------------------------
+
+* The :module:`CMakeForceCompiler` module and its macros are now deprecated.
+ See module documentation for an explanation.
diff --git a/Help/release/dev/enable-ssl-automatically.rst b/Help/release/dev/enable-ssl-automatically.rst
new file mode 100644
index 0000000..8ded656
--- /dev/null
+++ b/Help/release/dev/enable-ssl-automatically.rst
@@ -0,0 +1,8 @@
+enable-ssl-automatically
+------------------------
+
+* On Linux and FreeBSD platforms, when building CMake itself from source and
+ not using a system-provided libcurl, OpenSSL is now used by default if it is
+ found on the system. This enables SSL/TLS support for commands supporting
+ network communication via ``https``, such as :command:`file(DOWNLOAD)`,
+ :command:`file(UPLOAD)`, and :command:`ctest_submit`.
diff --git a/Help/release/dev/error-multiple-targets.rst b/Help/release/dev/error-multiple-targets.rst
new file mode 100644
index 0000000..060b26b
--- /dev/null
+++ b/Help/release/dev/error-multiple-targets.rst
@@ -0,0 +1,6 @@
+error-multiple-targets
+----------------------
+
+* The :manual:`cmake(1)` ``--build`` command-line tool now rejects multiple
+ ``--target`` options with an error instead of silently ignoring all but the
+ last one.
diff --git a/Help/release/dev/install-EXCLUDE_FROM_ALL.rst b/Help/release/dev/install-EXCLUDE_FROM_ALL.rst
new file mode 100644
index 0000000..a611eae
--- /dev/null
+++ b/Help/release/dev/install-EXCLUDE_FROM_ALL.rst
@@ -0,0 +1,5 @@
+install-EXCLUDE_FROM_ALL
+------------------------
+
+* The :command:`install` command learned a new ``EXCLUDE_FROM_ALL`` option
+ to leave installation rules out of the default installation.
diff --git a/Help/release/dev/list-FILTER-command.rst b/Help/release/dev/list-FILTER-command.rst
new file mode 100644
index 0000000..3fee4f0
--- /dev/null
+++ b/Help/release/dev/list-FILTER-command.rst
@@ -0,0 +1,5 @@
+list-FILTER-command
+-------------------
+
+* The :command:`list` command gained a ``FILTER`` sub-command to filter
+ list elements by regular expression.
diff --git a/Help/release/dev/ninja-depfile-system-headers.rst b/Help/release/dev/ninja-depfile-system-headers.rst
new file mode 100644
index 0000000..7033cef
--- /dev/null
+++ b/Help/release/dev/ninja-depfile-system-headers.rst
@@ -0,0 +1,5 @@
+ninja-depfile-system-headers
+----------------------------
+
+* The :generator:`Ninja` generator now includes system header files in build
+ dependencies to ensure correct re-builds when system packages are updated.
diff --git a/Help/release/dev/remove-vs6-generator.rst b/Help/release/dev/remove-vs6-generator.rst
new file mode 100644
index 0000000..921b93a
--- /dev/null
+++ b/Help/release/dev/remove-vs6-generator.rst
@@ -0,0 +1,4 @@
+remove-vs6-generator
+--------------------
+
+* The :generator:`Visual Studio 6` generator has been removed.
diff --git a/Help/release/dev/remove-vs7.0-generator.rst b/Help/release/dev/remove-vs7.0-generator.rst
new file mode 100644
index 0000000..314bef9
--- /dev/null
+++ b/Help/release/dev/remove-vs7.0-generator.rst
@@ -0,0 +1,5 @@
+remove-vs7.0-generator
+----------------------
+
+* The :generator:`Visual Studio 7` generator (for VS .NET 2002) has been
+ removed.
diff --git a/Help/release/dev/try_compile-target-type.rst b/Help/release/dev/try_compile-target-type.rst
new file mode 100644
index 0000000..cc41bf3
--- /dev/null
+++ b/Help/release/dev/try_compile-target-type.rst
@@ -0,0 +1,8 @@
+try_compile-target-type
+-----------------------
+
+* The :command:`try_compile` command learned to check a new
+ :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable to optionally
+ build a static library instead of an executable. This is useful
+ for cross-compiling toolchains that cannot link binaries without
+ custom flags or scripts.
diff --git a/Help/release/dev/unix-timestamps.rst b/Help/release/dev/unix-timestamps.rst
new file mode 100644
index 0000000..cdb0e5b
--- /dev/null
+++ b/Help/release/dev/unix-timestamps.rst
@@ -0,0 +1,6 @@
+unix-timestamps
+---------------
+
+* The :command:`string(TIMESTAMP)` and :command:`file(TIMESTAMP)`
+ commands gained support for the ``%s`` placeholder. This is
+ the number of seconds since the UNIX Epoch.
diff --git a/Help/release/dev/update-osx-release.rst b/Help/release/dev/update-osx-release.rst
new file mode 100644
index 0000000..7634c05
--- /dev/null
+++ b/Help/release/dev/update-osx-release.rst
@@ -0,0 +1,5 @@
+update-osx-release
+------------------
+
+* The precompiled OS X binary provided on ``cmake.org`` now requires
+ OS X 10.7 or newer.
diff --git a/Help/release/dev/vs-clang-cl.rst b/Help/release/dev/vs-clang-cl.rst
new file mode 100644
index 0000000..ac09188
--- /dev/null
+++ b/Help/release/dev/vs-clang-cl.rst
@@ -0,0 +1,5 @@
+vs-clang-cl
+-----------
+
+* The :generator:`Visual Studio 14 2015` generator learned to support the
+ Clang/C2 toolsets, e.g. with the ``-T v140_clang_3_7`` option.
diff --git a/Help/release/dev/vs-remote-directory.rst b/Help/release/dev/vs-remote-directory.rst
new file mode 100644
index 0000000..194236d
--- /dev/null
+++ b/Help/release/dev/vs-remote-directory.rst
@@ -0,0 +1,7 @@
+vs-remote-directory
+-------------------
+
+* The :generator:`Visual Studio 9 2008` and :generator:`Visual Studio 8 2005`
+ generators learned to generate the remote directory for WinCE project
+ deployment and debugger settings. See the
+ :prop_tgt:`DEPLOYMENT_REMOTE_DIRECTORY` target property.
diff --git a/Help/release/dev/vs-vcxproj-ConfigurationType.rst b/Help/release/dev/vs-vcxproj-ConfigurationType.rst
new file mode 100644
index 0000000..46d05b4
--- /dev/null
+++ b/Help/release/dev/vs-vcxproj-ConfigurationType.rst
@@ -0,0 +1,6 @@
+vs-vcxproj-ConfigurationType
+----------------------------
+
+* :ref:`Visual Studio Generators` for VS 2010 and above learned a new
+ :prop_tgt:`VS_CONFIGURATION_TYPE` target property to specify a custom
+ project file type.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index 6b7da3c..7ecf910 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -5,6 +5,8 @@ CMake Release Notes
This file should include the adjacent "dev.txt" file
in development versions but not in release versions.
+.. include:: dev.txt
+
Releases
========
diff --git a/Help/variable/CMAKE_CFG_INTDIR.rst b/Help/variable/CMAKE_CFG_INTDIR.rst
index dcc1aed..ba25a35 100644
--- a/Help/variable/CMAKE_CFG_INTDIR.rst
+++ b/Help/variable/CMAKE_CFG_INTDIR.rst
@@ -12,7 +12,6 @@ Example values:
::
- $(IntDir) = Visual Studio 6
$(ConfigurationName) = Visual Studio 7, 8, 9
$(Configuration) = Visual Studio 10
$(CONFIGURATION) = Xcode
diff --git a/Help/variable/CMAKE_GENERATOR.rst b/Help/variable/CMAKE_GENERATOR.rst
index 3f6ebc1..cce04c1 100644
--- a/Help/variable/CMAKE_GENERATOR.rst
+++ b/Help/variable/CMAKE_GENERATOR.rst
@@ -4,4 +4,4 @@ CMAKE_GENERATOR
The generator used to build the project. See :manual:`cmake-generators(7)`.
The name of the generator that is being used to generate the build
-files. (e.g. ``Unix Makefiles``, ``Visual Studio 6``, etc.)
+files. (e.g. ``Unix Makefiles``, ``Ninja``, etc.)
diff --git a/Help/variable/CMAKE_MAKE_PROGRAM.rst b/Help/variable/CMAKE_MAKE_PROGRAM.rst
index edf2732..a3b997a 100644
--- a/Help/variable/CMAKE_MAKE_PROGRAM.rst
+++ b/Help/variable/CMAKE_MAKE_PROGRAM.rst
@@ -34,12 +34,11 @@ to configure the project:
the CMake cache then CMake will use the specified value.
* The :ref:`Visual Studio Generators` set this to the full path to
- ``MSBuild.exe`` (VS >= 10), ``devenv.com`` (VS 7,8,9),
- ``VCExpress.exe`` (VS Express 8,9), or ``msdev.exe`` (VS 6).
+ ``MSBuild.exe`` (VS >= 10), ``devenv.com`` (VS 7,8,9), or
+ ``VCExpress.exe`` (VS Express 8,9).
(See also variables
- :variable:`CMAKE_VS_MSBUILD_COMMAND`,
- :variable:`CMAKE_VS_DEVENV_COMMAND`, and
- :variable:`CMAKE_VS_MSDEV_COMMAND`.)
+ :variable:`CMAKE_VS_MSBUILD_COMMAND` and
+ :variable:`CMAKE_VS_DEVENV_COMMAND`.
These generators prefer to lookup the build tool at build time
rather than to store ``CMAKE_MAKE_PROGRAM`` in the CMake cache
diff --git a/Help/variable/CMAKE_MFC_FLAG.rst b/Help/variable/CMAKE_MFC_FLAG.rst
index f60e7a5..1543677 100644
--- a/Help/variable/CMAKE_MFC_FLAG.rst
+++ b/Help/variable/CMAKE_MFC_FLAG.rst
@@ -5,7 +5,7 @@ Tell cmake to use MFC for an executable or dll.
This can be set in a ``CMakeLists.txt`` file and will enable MFC in the
application. It should be set to ``1`` for the static MFC library, and ``2``
-for the shared MFC library. This is used in Visual Studio 6 and 7
+for the shared MFC library. This is used in Visual Studio 7
project files. The CMakeSetup dialog used MFC and the ``CMakeLists.txt``
looks like this:
diff --git a/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst b/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
new file mode 100644
index 0000000..5fa8dfc
--- /dev/null
+++ b/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
@@ -0,0 +1,15 @@
+CMAKE_TRY_COMPILE_TARGET_TYPE
+-----------------------------
+
+Type of target generated for :command:`try_compile` calls using the
+source file signature. Valid values are:
+
+``EXECUTABLE``
+ Use :command:`add_executable` to name the source file in the
+ generated project. This is the default if no value is given.
+
+``STATIC_LIBRARY``
+ Use :command:`add_library` with the ``STATIC`` option to name the
+ source file in the generated project. This avoids running the
+ linker and is intended for use with cross-compiling toolchains
+ that cannot link without custom flags or linker scripts.
diff --git a/Help/variable/CMAKE_VS_MSDEV_COMMAND.rst b/Help/variable/CMAKE_VS_MSDEV_COMMAND.rst
deleted file mode 100644
index 718baaf..0000000
--- a/Help/variable/CMAKE_VS_MSDEV_COMMAND.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-CMAKE_VS_MSDEV_COMMAND
-----------------------
-
-The :generator:`Visual Studio 6` generator sets this variable to the
-``msdev.exe`` command installed with Visual Studio 6.
-
-This variable is not defined by other generators even if ``msdev.exe``
-is installed on the computer.
-
-See also the :variable:`CMAKE_MAKE_PROGRAM` variable.
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 45dda40..4b52afa 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -479,7 +479,7 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
get_item_rpaths("${resolved_item}" item_rpaths)
- if(item MATCHES "[^/]+\\.framework/")
+ if((NOT item MATCHES "\\.dylib$") AND (item MATCHES "[^/]+\\.framework/"))
# For frameworks, construct the name under the embedded path from the
# opening "${item_name}.framework/" to the closing "/${item_name}":
#
diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake
index 4783d68..685cd52 100644
--- a/Modules/CMakeBackwardCompatibilityC.cmake
+++ b/Modules/CMakeBackwardCompatibilityC.cmake
@@ -17,10 +17,6 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
include(CMakeVS7BackwardCompatibility)
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif()
-if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
- include(CMakeVS6BackwardCompatibility)
- set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-endif()
if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
# Old CMake versions did not support OS X universal binaries anyway,
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index feae1c4..b1a2cf2 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -149,15 +149,15 @@ Id flags: ${testflags}
")
# Compile the compiler identification source.
- if(CMAKE_GENERATOR STREQUAL "Visual Studio 6" AND
- lang STREQUAL "Fortran")
- set(CMAKE_${lang}_COMPILER_ID_RESULT 1)
- set(CMAKE_${lang}_COMPILER_ID_OUTPUT "No Intel Fortran in VS 6")
- elseif("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([0-9]+)")
+ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([0-9]+)")
set(vs_version ${CMAKE_MATCH_1})
set(id_platform ${CMAKE_VS_PLATFORM_NAME})
set(id_lang "${lang}")
- set(id_cl cl.exe)
+ if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*")
+ set(id_cl clang.exe)
+ else()
+ set(id_cl cl.exe)
+ endif()
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
set(v NsightTegra)
set(ext vcxproj)
@@ -175,13 +175,10 @@ Id flags: ${testflags}
elseif(NOT "${vs_version}" VERSION_LESS 10)
set(v 10)
set(ext vcxproj)
- elseif(NOT "${vs_version}" VERSION_LESS 7)
+ else()
set(id_version ${vs_version}.00)
set(v 7)
set(ext vcproj)
- else()
- set(v 6)
- set(ext dsp)
endif()
if(CMAKE_VS_PLATFORM_TOOLSET)
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
@@ -235,8 +232,6 @@ Id flags: ${testflags}
)
elseif(CMAKE_VS_DEVENV_COMMAND)
set(command "${CMAKE_VS_DEVENV_COMMAND}" "CompilerId${lang}.${ext}" "/build" "Debug")
- elseif(CMAKE_VS_MSDEV_COMMAND)
- set(command "${CMAKE_VS_MSDEV_COMMAND}" "CompilerId${lang}.${ext}" "/make")
else()
set(command "")
endif()
diff --git a/Modules/CMakeFindCodeBlocks.cmake b/Modules/CMakeFindCodeBlocks.cmake
index f8d8d59..bf85ea0 100644
--- a/Modules/CMakeFindCodeBlocks.cmake
+++ b/Modules/CMakeFindCodeBlocks.cmake
@@ -23,3 +23,18 @@ endif()
# Determine builtin macros and include dirs:
include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
+
+# Try to find out how many CPUs we have and set the -j argument for make accordingly
+set(_CMAKE_CODEBLOCKS_INITIAL_MAKE_ARGS "")
+
+include(ProcessorCount)
+processorcount(_CMAKE_CODEBLOCKS_PROCESSOR_COUNT)
+
+# Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
+# (we may also get here in the future e.g. for ninja)
+if("${_CMAKE_CODEBLOCKS_PROCESSOR_COUNT}" GREATER 1 AND CMAKE_HOST_UNIX AND "${CMAKE_MAKE_PROGRAM}" MATCHES make)
+ set(_CMAKE_CODEBLOCKS_INITIAL_MAKE_ARGS "-j${_CMAKE_CODEBLOCKS_PROCESSOR_COUNT}")
+endif()
+
+# This variable is used by the CodeBlocks generator and appended to the make invocation commands.
+set(CMAKE_CODEBLOCKS_MAKE_ARGUMENTS "${_CMAKE_CODEBLOCKS_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when CodeBlocks invokes make. Enter e.g. -j<some_number> to get parallel builds")
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index 85c1fdf..5bf738a 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -30,6 +30,8 @@ function(_FIND_ECLIPSE_VERSION)
set(_ECLIPSE_VERSION_NAME_3.7 "Indigo" )
set(_ECLIPSE_VERSION_NAME_4.2 "Juno" )
set(_ECLIPSE_VERSION_NAME_4.3 "Kepler" )
+ set(_ECLIPSE_VERSION_NAME_4.4 "Luna" )
+ set(_ECLIPSE_VERSION_NAME_4.5 "Mars" )
if(NOT DEFINED CMAKE_ECLIPSE_VERSION)
if(CMAKE_ECLIPSE_EXECUTABLE)
@@ -65,6 +67,8 @@ function(_FIND_ECLIPSE_VERSION)
"3.7 (${_ECLIPSE_VERSION_NAME_3.7})"
"4.2 (${_ECLIPSE_VERSION_NAME_4.2})"
"4.3 (${_ECLIPSE_VERSION_NAME_4.3})"
+ "4.4 (${_ECLIPSE_VERSION_NAME_4.4})"
+ "4.5 (${_ECLIPSE_VERSION_NAME_4.5})"
)
endfunction()
diff --git a/Modules/CMakeForceCompiler.cmake b/Modules/CMakeForceCompiler.cmake
index faa0dc5..d16d184 100644
--- a/Modules/CMakeForceCompiler.cmake
+++ b/Modules/CMakeForceCompiler.cmake
@@ -2,9 +2,7 @@
# CMakeForceCompiler
# ------------------
#
-# Discouraged. Avoid using this module if possible. It will be deprecated
-# by a future version of CMake once alternatives have been provided for all
-# toolchain file use cases.
+# Deprecated. Do not use.
#
# The macros provided by this module were once intended for use by
# cross-compiling toolchain files when CMake was not able to automatically
@@ -14,11 +12,11 @@
# CMake detects from a compiler is now too extensive to be provided by
# toolchain files using these macros.
#
-# The only known remaining use case for these macros is to write toolchain
-# files for cross-compilers that cannot link binaries without special flags or
-# custom linker scripts. These macros cause CMake to skip checks it normally
-# performs as part of enabling a language and introspecting the toolchain.
-# However, skipping these checks may limit some generation functionality.
+# One common use case for this module was to skip CMake's checks for a
+# working compiler when using a cross-compiler that cannot link binaries
+# without special flags or custom linker scripts. This case is now supported
+# by setting the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable in the
+# toolchain file instead.
#
# -------------------------------------------------------------------------
#
@@ -78,6 +76,8 @@
# License text for the above reference.)
macro(CMAKE_FORCE_C_COMPILER compiler id)
+ message(DEPRECATION "The CMAKE_FORCE_C_COMPILER macro is deprecated. "
+ "Instead just set CMAKE_C_COMPILER and allow CMake to identify the compiler.")
set(CMAKE_C_COMPILER "${compiler}")
set(CMAKE_C_COMPILER_ID_RUN TRUE)
set(CMAKE_C_COMPILER_ID ${id})
@@ -90,6 +90,8 @@ macro(CMAKE_FORCE_C_COMPILER compiler id)
endmacro()
macro(CMAKE_FORCE_CXX_COMPILER compiler id)
+ message(DEPRECATION "The CMAKE_FORCE_CXX_COMPILER macro is deprecated. "
+ "Instead just set CMAKE_CXX_COMPILER and allow CMake to identify the compiler.")
set(CMAKE_CXX_COMPILER "${compiler}")
set(CMAKE_CXX_COMPILER_ID_RUN TRUE)
set(CMAKE_CXX_COMPILER_ID ${id})
@@ -102,6 +104,8 @@ macro(CMAKE_FORCE_CXX_COMPILER compiler id)
endmacro()
macro(CMAKE_FORCE_Fortran_COMPILER compiler id)
+ message(DEPRECATION "The CMAKE_FORCE_Fortran_COMPILER macro is deprecated. "
+ "Instead just set CMAKE_Fortran_COMPILER and allow CMake to identify the compiler.")
set(CMAKE_Fortran_COMPILER "${compiler}")
set(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
set(CMAKE_Fortran_COMPILER_ID ${id})
diff --git a/Modules/CMakeIOSInstallCombined.cmake b/Modules/CMakeIOSInstallCombined.cmake
index f052a3b..1256f56 100644
--- a/Modules/CMakeIOSInstallCombined.cmake
+++ b/Modules/CMakeIOSInstallCombined.cmake
@@ -52,7 +52,14 @@ function(_ios_install_combined_get_build_setting sdk variable resultvar)
endif()
if(NOT output MATCHES " ${variable} = ([^\n]*)")
- message(FATAL_ERROR "${variable} not found.")
+ if("${variable}" STREQUAL "VALID_ARCHS")
+ # VALID_ARCHS may be unset by user for given SDK
+ # (e.g. for build without simulator).
+ set("${resultvar}" "" PARENT_SCOPE)
+ return()
+ else()
+ message(FATAL_ERROR "${variable} not found.")
+ endif()
endif()
set("${resultvar}" "${CMAKE_MATCH_1}" PARENT_SCOPE)
@@ -72,6 +79,9 @@ function(_ios_install_combined_get_valid_archs sdk resultvar)
list(REMOVE_ITEM valid_archs "") # remove empty elements
list(REMOVE_DUPLICATES valid_archs)
+ string(REPLACE ";" " " printable "${valid_archs}")
+ _ios_install_combined_message("Architectures (${sdk}): ${printable}")
+
set("${resultvar}" "${valid_archs}" PARENT_SCOPE)
endfunction()
diff --git a/Modules/CMakeTestCompilerCommon.cmake b/Modules/CMakeTestCompilerCommon.cmake
index d51b503..e0d45e7 100644
--- a/Modules/CMakeTestCompilerCommon.cmake
+++ b/Modules/CMakeTestCompilerCommon.cmake
@@ -13,9 +13,5 @@
# License text for the above reference.)
function(PrintTestCompilerStatus LANG MSG)
- if(CMAKE_GENERATOR MATCHES Make)
- message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
- else()
- message(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
- endif()
+ message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
endfunction()
diff --git a/Modules/CMakeVS6BackwardCompatibility.cmake b/Modules/CMakeVS6BackwardCompatibility.cmake
deleted file mode 100644
index ca48b85..0000000
--- a/Modules/CMakeVS6BackwardCompatibility.cmake
+++ /dev/null
@@ -1,26 +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.)
-
-# hard code these for fast backwards compatibility tests
-set (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type")
-set (CMAKE_SIZEOF_LONG 4 CACHE INTERNAL "Size of long data type")
-set (CMAKE_SIZEOF_VOID_P 4 CACHE INTERNAL "Size of void* data type")
-set (CMAKE_SIZEOF_CHAR 1 CACHE INTERNAL "Size of char data type")
-set (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short data type")
-set (CMAKE_SIZEOF_FLOAT 4 CACHE INTERNAL "Size of float data type")
-set (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double data type")
-set (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
- "Does the compiler support ansi for scope.")
-set (CMAKE_USE_WIN32_THREADS TRUE CACHE BOOL "Use the win32 thread library.")
-set (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 2aaef61..b41d926 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -504,6 +504,9 @@ function(cpack_deb_prepare_package_vars)
file(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian)
file(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "")
+ # Create a DEBIAN directory so that dpkg-shlibdeps can find the package dir when resolving $ORIGIN.
+ file(MAKE_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}/DEBIAN")
+
# Add --ignore-missing-info if the tool supports it
execute_process(COMMAND env LC_ALL=C ${SHLIBDEPS_EXECUTABLE} --help
OUTPUT_VARIABLE _TMP_HELP
@@ -544,6 +547,9 @@ function(cpack_deb_prepare_package_vars)
# Remove blank control file
# Might not be safe if package actual contain file or directory named debian
file(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/debian")
+
+ # remove temporary directory that was created only for dpkg-shlibdeps execution
+ file(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/DEBIAN")
else()
if(CPACK_DEBIAN_PACKAGE_DEBUG)
message(AUTHOR_WARNING "CPackDeb Debug: Using only user-provided depends because package does not contain executable files that link to shared libraries.")
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 7fb11c3..7ffec13 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -7,25 +7,35 @@
# Variables specific to CPack RPM generator
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
-# 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 :
-# 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
-# generator so when CPACK_RPM_COMPONENT_INSTALL is ON some more
-# CPACK_RPM_<ComponentName>_XXXX variables may be used in order to have
-# component specific values. Note however that <componentName> refers
-# to the **grouping name**. This may be either a component name or a
-# component GROUP name. Usually those vars correspond to RPM spec file
-# entities, one may find information about spec files here
-# http://www.rpm.org/wiki/Docs. You'll find a detailed usage of
-# CPackRPM on the wiki:
-#
-# ::
+# 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 : https://cmake.org/Wiki/CMake:CPackConfiguration.
#
-# https://cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
+# CPackRPM has specific features which are controlled by the specifics
+# :code:`CPACK_RPM_XXX` variables.
#
+# :code:`CPACK_RPM_<COMPONENT>_XXXX` variables may be used in order to have
+# **component** specific values. Note however that ``<COMPONENT>`` refers to the
+# **grouping name** written in upper case. It may be either a component name or
+# a component GROUP name. Usually those vars correspond to RPM spec file
+# entities, one may find information about spec files here
+# http://www.rpm.org/wiki/Docs
+#
+# .. note::
+#
+# `<COMPONENT>` part of variables is prefered to be in upper case (for e.g. if
+# component is named `foo` then use `CPACK_RPM_FOO_XXXX` variable name format)
+# as is with other `CPACK_<COMPONENT>_XXXX` variables.
+# For the purposes of back compatibility (CMake/CPack version 3.5 and lower)
+# support for same cased component (e.g. `fOo` would be used as
+# `CPACK_RPM_fOo_XXXX`) is still supported for variables defined in older
+# versions of CMake/CPack but is not guaranteed for variables that
+# will be added in the future. For the sake of back compatibility same cased
+# component variables also override upper cased versions where both are
+# present.
+#
+# List of CPack/RPM specific variables:
+# https://cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 .
# However as a handy reminder here comes the list of specific variables:
#
# .. variable:: CPACK_RPM_PACKAGE_SUMMARY
@@ -557,7 +567,7 @@
# invalid location.
#=============================================================================
-# Copyright 2007-2009 Kitware, Inc.
+# Copyright 2007-2016 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -575,6 +585,8 @@ function(cpack_rpm_prepare_relocation_paths)
# set appropriate prefix, remove possible trailing slash and convert backslashes to slashes
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX)
file(TO_CMAKE_PATH "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX}" PATH_PREFIX)
+ elseif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_PACKAGE_PREFIX)
+ file(TO_CMAKE_PATH "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_PACKAGE_PREFIX}" PATH_PREFIX)
else()
file(TO_CMAKE_PATH "${CPACK_PACKAGING_INSTALL_PREFIX}" PATH_PREFIX)
endif()
@@ -585,7 +597,8 @@ function(cpack_rpm_prepare_relocation_paths)
# set base path prefix
if(EXISTS "${WDIR}/${PATH_PREFIX}")
if(NOT CPACK_RPM_NO_INSTALL_PREFIX_RELOCATION AND
- NOT CPACK_RPM_NO_${CPACK_RPM_PACKAGE_COMPONENT}_INSTALL_PREFIX_RELOCATION)
+ NOT CPACK_RPM_NO_${CPACK_RPM_PACKAGE_COMPONENT}_INSTALL_PREFIX_RELOCATION AND
+ NOT CPACK_RPM_NO_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_INSTALL_PREFIX_RELOCATION)
set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}Prefix: ${PATH_PREFIX}\n")
list(APPEND RPM_USED_PACKAGE_PREFIXES "${PATH_PREFIX}")
@@ -1044,6 +1057,17 @@ if(NOT UNIX)
message(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
endif()
+function(cpack_rpm_variable_fallback OUTPUT_VAR_NAME)
+ set(FALLBACK_VAR_NAMES ${ARGN})
+
+ foreach(variable_name IN LISTS FALLBACK_VAR_NAMES)
+ if(${variable_name})
+ set(${OUTPUT_VAR_NAME} "${${variable_name}}" PARENT_SCOPE)
+ break()
+ endif()
+ endforeach()
+endfunction()
+
function(cpack_rpm_generate_package)
# rpmbuild is the basic command for building RPM package
# it may be a simple (symbolic) link to rpm command.
@@ -1124,12 +1148,10 @@ function(cpack_rpm_generate_package)
# CPACK_RPM_PACKAGE_SUMMARY (mandatory)
- #Check for component summary first.
- #If not set, it will use regular package summary logic.
if(CPACK_RPM_PACKAGE_COMPONENT)
- if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_SUMMARY)
- set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_SUMMARY})
- endif()
+ cpack_rpm_variable_fallback("CPACK_RPM_PACKAGE_SUMMARY"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_SUMMARY"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_PACKAGE_SUMMARY")
endif()
if(NOT CPACK_RPM_PACKAGE_SUMMARY)
@@ -1142,17 +1164,15 @@ function(cpack_rpm_generate_package)
endif()
# CPACK_RPM_PACKAGE_NAME (mandatory)
-
if(NOT CPACK_RPM_PACKAGE_NAME)
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
endif()
if(CPACK_RPM_PACKAGE_COMPONENT)
- if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_NAME)
- set(CPACK_RPM_PACKAGE_NAME ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_NAME})
- else()
- set(CPACK_RPM_PACKAGE_NAME ${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_COMPONENT})
- endif()
+ set(CPACK_RPM_PACKAGE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_COMPONENT}")
+ cpack_rpm_variable_fallback("CPACK_RPM_PACKAGE_NAME"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_NAME"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_PACKAGE_NAME")
endif()
# CPACK_RPM_PACKAGE_VERSION (mandatory)
@@ -1179,19 +1199,18 @@ function(cpack_rpm_generate_package)
endif()
endif()
- set(_CPACK_RPM_PACKAGE_ARCHITECTURE ${CPACK_RPM_PACKAGE_ARCHITECTURE})
-
- #prefer component architecture
if(CPACK_RPM_PACKAGE_COMPONENT)
- if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_ARCHITECTURE)
- set(_CPACK_RPM_PACKAGE_ARCHITECTURE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_ARCHITECTURE})
- if(CPACK_RPM_PACKAGE_DEBUG)
- message("CPackRPM:Debug: using component build arch = ${_CPACK_RPM_PACKAGE_ARCHITECTURE}")
- endif()
+ cpack_rpm_variable_fallback("CPACK_RPM_PACKAGE_ARCHITECTURE"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_ARCHITECTURE"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_PACKAGE_ARCHITECTURE")
+
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: using component build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
endif()
endif()
- if(${_CPACK_RPM_PACKAGE_ARCHITECTURE} STREQUAL "noarch")
- set(TMP_RPM_BUILDARCH "Buildarch: ${_CPACK_RPM_PACKAGE_ARCHITECTURE}")
+
+ if(${CPACK_RPM_PACKAGE_ARCHITECTURE} STREQUAL "noarch")
+ set(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
else()
set(TMP_RPM_BUILDARCH "")
endif()
@@ -1214,13 +1233,10 @@ function(cpack_rpm_generate_package)
endif()
# CPACK_RPM_PACKAGE_GROUP
-
- #Check for component group first.
- #If not set, it will use regular package group logic.
if(CPACK_RPM_PACKAGE_COMPONENT)
- if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_GROUP)
- set(CPACK_RPM_PACKAGE_GROUP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_GROUP})
- endif()
+ cpack_rpm_variable_fallback("CPACK_RPM_PACKAGE_GROUP"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_GROUP"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_PACKAGE_GROUP")
endif()
if(NOT CPACK_RPM_PACKAGE_GROUP)
@@ -1247,14 +1263,11 @@ function(cpack_rpm_generate_package)
# - set to a default value
#
- #Check for a component description first.
- #If not set, it will use regular package description logic.
if(CPACK_RPM_PACKAGE_COMPONENT)
- if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_DESCRIPTION)
- set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_DESCRIPTION})
- elseif(CPACK_COMPONENT_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_DESCRIPTION)
- set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_COMPONENT_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_DESCRIPTION})
- endif()
+ cpack_rpm_variable_fallback("CPACK_RPM_PACKAGE_DESCRIPTION"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_DESCRIPTION"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_PACKAGE_DESCRIPTION"
+ "CPACK_COMPONENT_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_DESCRIPTION")
endif()
if(NOT CPACK_RPM_PACKAGE_DESCRIPTION)
@@ -1306,32 +1319,21 @@ function(cpack_rpm_generate_package)
# If component specific var is not provided we use the global one
# for each component
foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN)
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
+ endif()
+ if(CPACK_RPM_PACKAGE_COMPONENT)
+ cpack_rpm_variable_fallback("CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_PACKAGE_${_RPM_SPEC_HEADER}")
+ endif()
+
+ if(DEFINED CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
if(CPACK_RPM_PACKAGE_DEBUG)
- message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
- endif()
- if(CPACK_RPM_PACKAGE_COMPONENT)
- if(DEFINED CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER})
- if(CPACK_RPM_PACKAGE_DEBUG)
- message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}")
- endif()
- set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}})
- else()
- if(DEFINED CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
- if(CPACK_RPM_PACKAGE_DEBUG)
- message("CPackRPM:Debug: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined")
- message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
- endif()
- set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
- endif()
- endif()
- else()
- if(DEFINED CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
- if(CPACK_RPM_PACKAGE_DEBUG)
- message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
- endif()
- set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
- endif()
+ message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
endif()
+ set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
+ endif()
# Treat the RPM Spec keyword iff it has been properly defined
if(DEFINED CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
@@ -1373,94 +1375,38 @@ function(cpack_rpm_generate_package)
# May be used to embed a post (un)installation script in the spec file.
# The refered script file(s) will be read and directly
# put after the %post or %postun section
- if(CPACK_RPM_PACKAGE_COMPONENT)
- if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_INSTALL_SCRIPT_FILE)
- set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_INSTALL_SCRIPT_FILE})
- else()
- set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
- endif()
- if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
- set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE})
- else()
- set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
- endif()
- else()
- set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
- set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
- endif()
-
- # Handle post-install file if it has been specified
- if(CPACK_RPM_POST_INSTALL_READ_FILE)
- if(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
- file(READ ${CPACK_RPM_POST_INSTALL_READ_FILE} CPACK_RPM_SPEC_POSTINSTALL)
- else()
- message("CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_READ_FILE}> does not exists - ignoring")
- endif()
- else()
- # reset SPEC var value if no post install file has been specified
- # (either globally or component-wise)
- set(CPACK_RPM_SPEC_POSTINSTALL "")
- endif()
-
- # Handle post-uninstall file if it has been specified
- if(CPACK_RPM_POST_UNINSTALL_READ_FILE)
- if(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
- file(READ ${CPACK_RPM_POST_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_POSTUNINSTALL)
- else()
- message("CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_READ_FILE}> does not exists - ignoring")
- endif()
- else()
- # reset SPEC var value if no post uninstall file has been specified
- # (either globally or component-wise)
- set(CPACK_RPM_SPEC_POSTUNINSTALL "")
- endif()
-
+ # ----------------------------------------------------------------
# CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE)
# CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE)
# May be used to embed a pre (un)installation script in the spec file.
# The refered script file(s) will be read and directly
# put after the %pre or %preun section
- if(CPACK_RPM_PACKAGE_COMPONENT)
- if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
- set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE})
- else()
- set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
- endif()
- if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
- set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE})
- else()
- set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
- endif()
- else()
- set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
- set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
- endif()
+ foreach(RPM_SCRIPT_FILE_TYPE_ "INSTALL" "UNINSTALL")
+ foreach(RPM_SCRIPT_FILE_TIME_ "PRE" "POST")
+ set("CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_READ_FILE"
+ "${CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_SCRIPT_FILE}")
- # Handle pre-install file if it has been specified
- if(CPACK_RPM_PRE_INSTALL_READ_FILE)
- if(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
- file(READ ${CPACK_RPM_PRE_INSTALL_READ_FILE} CPACK_RPM_SPEC_PREINSTALL)
- else()
- message("CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_READ_FILE}> does not exists - ignoring")
- endif()
- else()
- # reset SPEC var value if no pre-install file has been specified
- # (either globally or component-wise)
- set(CPACK_RPM_SPEC_PREINSTALL "")
- endif()
+ if(CPACK_RPM_PACKAGE_COMPONENT)
+ cpack_rpm_variable_fallback("CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_READ_FILE"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_SCRIPT_FILE"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_SCRIPT_FILE")
+ endif()
- # Handle pre-uninstall file if it has been specified
- if(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
- if(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
- file(READ ${CPACK_RPM_PRE_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_PREUNINSTALL)
- else()
- message("CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_READ_FILE}> does not exists - ignoring")
- endif()
- else()
- # reset SPEC var value if no pre-uninstall file has been specified
- # (either globally or component-wise)
- set(CPACK_RPM_SPEC_PREUNINSTALL "")
- endif()
+ # Handle file if it has been specified
+ if(CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_READ_FILE)
+ if(EXISTS ${CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_READ_FILE})
+ file(READ ${CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_READ_FILE}
+ "CPACK_RPM_SPEC_${RPM_SCRIPT_FILE_TIME_}${RPM_SCRIPT_FILE_TYPE_}")
+ else()
+ message("CPackRPM:Warning: CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_SCRIPT_FILE <${CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_READ_FILE}> does not exists - ignoring")
+ endif()
+ else()
+ # reset SPEC var value if no file has been specified
+ # (either globally or component-wise)
+ set("CPACK_RPM_SPEC_${RPM_SCRIPT_FILE_TIME_}${RPM_SCRIPT_FILE_TYPE_}" "")
+ endif()
+ endforeach()
+ endforeach()
# CPACK_RPM_CHANGELOG_FILE
# May be used to embed a changelog in the spec file.
@@ -1495,7 +1441,7 @@ function(cpack_rpm_generate_package)
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SPECS)
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SRPMS)
- #set(CPACK_RPM_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${_CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
+ #set(CPACK_RPM_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
set(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
# it seems rpmbuild can't handle spaces in the path
# neither escaping (as below) nor putting quotes around the path seem to help
@@ -1510,12 +1456,14 @@ function(cpack_rpm_generate_package)
# This must be done BEFORE the CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL handling
if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_ABSOLUTE_DESTINATION_FILES)
- set(COMPONENT_FILES_TAG "CPACK_ABSOLUTE_DESTINATION_FILES_${CPACK_RPM_PACKAGE_COMPONENT}")
- set(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL "${${COMPONENT_FILES_TAG}}")
- if(CPACK_RPM_PACKAGE_DEBUG)
- message("CPackRPM:Debug: Handling Absolute Destination Files: <${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}>")
- message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
- endif()
+ cpack_rpm_variable_fallback("COMPONENT_FILES_TAG"
+ "CPACK_ABSOLUTE_DESTINATION_FILES_${CPACK_RPM_PACKAGE_COMPONENT}"
+ "CPACK_ABSOLUTE_DESTINATION_FILES_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}")
+ set(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL "${${COMPONENT_FILES_TAG}}")
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: Handling Absolute Destination Files: <${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}>")
+ message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
+ endif()
endif()
else()
if(CPACK_ABSOLUTE_DESTINATION_FILES)
@@ -1524,22 +1472,18 @@ function(cpack_rpm_generate_package)
endif()
# In component case, set CPACK_RPM_USER_FILELIST_INTERNAL with CPACK_RPM_<COMPONENT>_USER_FILELIST.
+ set(CPACK_RPM_USER_FILELIST_INTERNAL "")
if(CPACK_RPM_PACKAGE_COMPONENT)
- if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_USER_FILELIST)
- set(CPACK_RPM_USER_FILELIST_INTERNAL ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_USER_FILELIST})
- if(CPACK_RPM_PACKAGE_DEBUG)
- message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
- message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
- endif()
- else()
- set(CPACK_RPM_USER_FILELIST_INTERNAL "")
- endif()
- else()
- if(CPACK_RPM_USER_FILELIST)
- set(CPACK_RPM_USER_FILELIST_INTERNAL "${CPACK_RPM_USER_FILELIST}")
- else()
- set(CPACK_RPM_USER_FILELIST_INTERNAL "")
+ cpack_rpm_variable_fallback("CPACK_RPM_USER_FILELIST_INTERNAL"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_USER_FILELIST"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_USER_FILELIST")
+
+ if(CPACK_RPM_PACKAGE_DEBUG AND CPACK_RPM_USER_FILELIST_INTERNAL)
+ message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
+ message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
endif()
+ elseif(CPACK_RPM_USER_FILELIST)
+ set(CPACK_RPM_USER_FILELIST_INTERNAL "${CPACK_RPM_USER_FILELIST}")
endif()
# Handle user specified file line list in CPACK_RPM_USER_FILELIST_INTERNAL
@@ -1578,7 +1522,6 @@ function(cpack_rpm_generate_package)
if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
list(REMOVE_ITEM CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL ${F_PATH})
endif()
-
endforeach()
# Rebuild CPACK_RPM_INSTALL_FILES
@@ -1650,8 +1593,10 @@ function(cpack_rpm_generate_package)
#
# We can have a component specific spec file.
- if(CPACK_RPM_PACKAGE_COMPONENT AND CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_USER_BINARY_SPECFILE)
- set(CPACK_RPM_USER_BINARY_SPECFILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_USER_BINARY_SPECFILE})
+ if(CPACK_RPM_PACKAGE_COMPONENT)
+ cpack_rpm_variable_fallback("CPACK_RPM_USER_BINARY_SPECFILE"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_USER_BINARY_SPECFILE"
+ "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_USER_BINARY_SPECFILE")
endif()
# We should generate a USER spec file template:
@@ -1762,7 +1707,7 @@ mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" $RPM_BUILD_ROOT
COMMAND "${RPMBUILD_EXECUTABLE}" -bb
--define "_topdir ${CPACK_RPM_DIRECTORY}"
--buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
- --target "${_CPACK_RPM_PACKAGE_ARCHITECTURE}"
+ --target "${CPACK_RPM_PACKAGE_ARCHITECTURE}"
"${CPACK_RPM_BINARY_SPECFILE}"
WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
RESULT_VARIABLE CPACK_RPMBUILD_EXEC_RESULT
diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index 4994005..3c90561 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -234,7 +234,7 @@
# * ARPCOMMENTS - Comments
# * ARPHELPLINK - Help and support information URL
# * ARPURLINFOABOUT - General information URL
-# * URLUPDATEINFO - Update information URL
+# * ARPURLUPDATEINFO - Update information URL
# * ARPHELPTELEPHONE - Help and support telephone number
# * ARPSIZE - Size (in kilobytes) of the application
@@ -256,14 +256,14 @@ if(NOT CPACK_WIX_ROOT)
endif()
find_program(CPACK_WIX_CANDLE_EXECUTABLE candle
- PATHS "${CPACK_WIX_ROOT}/bin")
+ PATHS "${CPACK_WIX_ROOT}" PATH_SUFFIXES "bin")
if(NOT CPACK_WIX_CANDLE_EXECUTABLE)
message(FATAL_ERROR "Could not find the WiX candle executable.")
endif()
find_program(CPACK_WIX_LIGHT_EXECUTABLE light
- PATHS "${CPACK_WIX_ROOT}/bin")
+ PATHS "${CPACK_WIX_ROOT}" PATH_SUFFIXES "bin")
if(NOT CPACK_WIX_LIGHT_EXECUTABLE)
message(FATAL_ERROR "Could not find the WiX light executable.")
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 8278c5c..a27eb4b 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -230,9 +230,6 @@ if(BUILD_TESTING)
get_filename_component(DART_CXX_NAME
"${CMAKE_MAKE_PROGRAM}" ${DART_NAME_COMPONENT})
endif()
- if(DART_CXX_NAME MATCHES "msdev")
- set(DART_CXX_NAME "vs60")
- endif()
if(DART_CXX_NAME MATCHES "devenv")
GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME)
endif()
diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index ef3aa76..f31e432 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -46,6 +46,13 @@
# is run as ``gcov <options>... -o <gcov-dir> <file>.gcda``.
# If not specified, the default option is just ``-b``.
#
+# ``GLOB``
+# Recursively search for .gcda files in build_dir rather than
+# determining search locations by reading TargetDirectories.txt.
+#
+# ``DELETE``
+# Delete coverage files after they've been packaged into the .tar.
+#
# ``QUIET``
# Suppress non-error messages that otherwise would have been
# printed out by this function.
@@ -64,7 +71,7 @@
# License text for the above reference.)
include(CMakeParseArguments)
function(ctest_coverage_collect_gcov)
- set(options QUIET)
+ set(options QUIET GLOB DELETE)
set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND)
set(multiValueArgs GCOV_OPTIONS)
cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}"
@@ -91,22 +98,32 @@ function(ctest_coverage_collect_gcov)
# run gcov on each gcda file in the binary tree
set(gcda_files)
set(label_files)
- # look for gcda files in the target directories
- # could do a glob from the top of the binary tree but
- # this will be faster and only look where the files will be
- file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs
- ENCODING UTF-8)
- foreach(target_dir ${target_dirs})
- file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda")
- list(LENGTH gfiles len)
- # if we have gcda files then also grab the labels file for that target
- if(${len} GREATER 0)
- file(GLOB_RECURSE lfiles RELATIVE ${binary_dir}
- "${target_dir}/Labels.json")
- list(APPEND gcda_files ${gfiles})
- list(APPEND label_files ${lfiles})
- endif()
- endforeach()
+ if (GCOV_GLOB)
+ file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "*.gcda")
+ list(LENGTH gfiles len)
+ # if we have gcda files then also grab the labels file for that target
+ if(${len} GREATER 0)
+ file(GLOB_RECURSE lfiles RELATIVE ${binary_dir} "Labels.json")
+ list(APPEND gcda_files ${gfiles})
+ list(APPEND label_files ${lfiles})
+ endif()
+ else()
+ # look for gcda files in the target directories
+ # this will be faster and only look where the files will be
+ file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs
+ ENCODING UTF-8)
+ foreach(target_dir ${target_dirs})
+ file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda")
+ list(LENGTH gfiles len)
+ # if we have gcda files then also grab the labels file for that target
+ if(${len} GREATER 0)
+ file(GLOB_RECURSE lfiles RELATIVE ${binary_dir}
+ "${target_dir}/Labels.json")
+ list(APPEND gcda_files ${gfiles})
+ list(APPEND label_files ${lfiles})
+ endif()
+ endforeach()
+ endif()
# return early if no coverage files were found
list(LENGTH gcda_files len)
if(len EQUAL 0)
@@ -134,6 +151,11 @@ function(ctest_coverage_collect_gcov)
OUTPUT_VARIABLE out
RESULT_VARIABLE res
WORKING_DIRECTORY ${coverage_dir})
+
+ if (GCOV_DELETE)
+ file(REMOVE ${gcda_file})
+ endif()
+
endforeach()
if(NOT "${res}" EQUAL 0)
if (NOT GCOV_QUIET)
@@ -201,4 +223,12 @@ ${label_files}
"--format=gnutar"
--files-from=${coverage_dir}/coverage_file_list.txt
WORKING_DIRECTORY ${binary_dir})
+
+ if (GCOV_DELETE)
+ string(REPLACE "\n" ";" gcov_files "${gcov_files}")
+ foreach(gcov_file ${gcov_files})
+ file(REMOVE ${binary_dir}/${gcov_file})
+ endforeach()
+ endif()
+
endfunction()
diff --git a/Modules/Compiler/Clang-CXX-TestableFeatures.cmake b/Modules/Compiler/Clang-CXX-TestableFeatures.cmake
index b39475c..69965a6 100644
--- a/Modules/Compiler/Clang-CXX-TestableFeatures.cmake
+++ b/Modules/Compiler/Clang-CXX-TestableFeatures.cmake
@@ -8,7 +8,6 @@ set(testable_features
cxx_constexpr
cxx_contextual_conversions
cxx_decltype
- cxx_decltype_incomplete_return_types
cxx_default_function_template_args
cxx_defaulted_functions
cxx_delegating_constructors
@@ -36,6 +35,9 @@ set(testable_features
cxx_variable_templates
cxx_variadic_templates
)
+if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ list(APPEND testable_features cxx_decltype_incomplete_return_types)
+endif()
foreach(feature ${testable_features})
set(_cmake_feature_test_${feature} "${_cmake_oldestSupported} && __has_feature(${feature})")
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 764fbf9..c2d393d 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -41,7 +41,7 @@ macro(__compiler_gnu lang)
# distcc does not transform -o to -MT when invoking the preprocessor
# internally, as it ought to. Work around this bug by setting -MT here
# even though it isn't strictly necessary.
- set(CMAKE_DEPFILE_FLAGS_${lang} "-MMD -MT <OBJECT> -MF <DEPFILE>")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <OBJECT> -MF <DEPFILE>")
endif()
# Initial configuration flags.
@@ -52,7 +52,7 @@ macro(__compiler_gnu lang)
set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
- if(NOT APPLE)
+ if(NOT APPLE OR NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4) # work around #4462
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
endif()
endmacro()
diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake
index d2c7df9..f1b6ff7 100644
--- a/Modules/Compiler/IAR-C.cmake
+++ b/Modules/Compiler/IAR-C.cmake
@@ -7,6 +7,9 @@ set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <I
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
+set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "-f")
+set(CMAKE_DEPFILE_FLAGS_C "--dependencies=ns <DEPFILE>")
+
# The toolchains for ARM and AVR are quite different:
if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index 03ecdf1..ffb144f 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -7,7 +7,8 @@ set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <INCLUDES
set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
-
+set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "-f")
+set(CMAKE_DEPFILE_FLAGS_CXX "--dependencies=ns <DEPFILE>")
if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index dfba4b2..77363eb 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -6,7 +6,7 @@ set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
-set(CMAKE_DEPFILE_FLAGS_C "-MMD -MT <OBJECT> -MF <DEPFILE>")
+set(CMAKE_DEPFILE_FLAGS_C "-MD -MT <OBJECT> -MF <DEPFILE>")
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index 7947695..02c636c 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -6,7 +6,7 @@ set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
-set(CMAKE_DEPFILE_FLAGS_CXX "-MMD -MT <OBJECT> -MF <DEPFILE>")
+set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <OBJECT> -MF <DEPFILE>")
set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/QCC.cmake b/Modules/Compiler/QCC.cmake
index 76477e4..f69c7bd 100644
--- a/Modules/Compiler/QCC.cmake
+++ b/Modules/Compiler/QCC.cmake
@@ -20,5 +20,5 @@ macro(__compiler_qcc lang)
set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "-V")
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-Wp,-isystem,")
- set(CMAKE_DEPFILE_FLAGS_${lang} "-Wc,-MMD,<DEPFILE>,-MT,<OBJECT>,-MF,<DEPFILE>")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "-Wc,-MD,<DEPFILE>,-MT,<OBJECT>,-MF,<DEPFILE>")
endmacro()
diff --git a/Modules/CompilerId/VS-6.dsp.in b/Modules/CompilerId/VS-6.dsp.in
deleted file mode 100644
index 48c9a23..0000000
--- a/Modules/CompilerId/VS-6.dsp.in
+++ /dev/null
@@ -1,48 +0,0 @@
-# Microsoft Developer Studio Project File - Name="CompilerId@id_lang@" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=CompilerId@id_lang@ - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "CompilerId@id_lang@.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "CompilerId@id_lang@.mak" CFG="CompilerId@id_lang@ - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "CompilerId@id_lang@ - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-CPP=cl.exe
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "."
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD CPP /nologo /MDd /c
-LINK32=link.exe
-# ADD LINK32 /nologo /version:0.0 /subsystem:console /machine:x86 /out:"CompilerId@id_lang@.exe" /IGNORE:4089
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Cmds=for %%i in (@id_cl@) do @echo CMAKE_@id_lang@_COMPILER=%%~$PATH:i
-# End Special Build Tool
-# Begin Target
-
-# Name "CompilerId@id_lang@ - Win32 Debug"
-# Begin Group "Source Files"
-
-# Begin Source File
-
-SOURCE="@id_src@"
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index c3058ea..728dcdf 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -745,9 +745,10 @@ endfunction()
# defined; FALSE if dependency information is unavailable).
#
# componentvar - the component list variable name
+# extravar - the indirect dependency list variable name
#
#
-function(_Boost_MISSING_DEPENDENCIES componentvar)
+function(_Boost_MISSING_DEPENDENCIES componentvar extravar)
# _boost_unprocessed_components - list of components requiring processing
# _boost_processed_components - components already processed (or currently being processed)
# _boost_new_components - new components discovered for future processing
@@ -773,7 +774,12 @@ function(_Boost_MISSING_DEPENDENCIES componentvar)
set(_boost_unprocessed_components ${_boost_new_components})
unset(_boost_new_components)
endwhile()
+ set(_boost_extra_components ${_boost_processed_components})
+ if(_boost_extra_components AND ${componentvar})
+ list(REMOVE_ITEM _boost_extra_components ${${componentvar}})
+ endif()
set(${componentvar} ${_boost_processed_components} PARENT_SCOPE)
+ set(${extravar} ${_boost_extra_components} PARENT_SCOPE)
endfunction()
#
@@ -1306,7 +1312,7 @@ endif()
# Additional components may be required via component dependencies.
# Add any missing components to the list.
-_Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS)
+_Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS _Boost_EXTRA_FIND_COMPONENTS)
# If thread is required, get the thread libs as a dependency
list(FIND Boost_FIND_COMPONENTS thread _Boost_THREAD_DEPENDENCY_LIBS)
@@ -1484,6 +1490,10 @@ if(Boost_FOUND)
list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
endif()
endforeach()
+ if(_Boost_MISSING_COMPONENTS AND _Boost_EXTRA_FIND_COMPONENTS)
+ # Optional indirect dependencies are not counted as missing.
+ list(REMOVE_ITEM _Boost_MISSING_COMPONENTS ${_Boost_EXTRA_FIND_COMPONENTS})
+ endif()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}")
diff --git a/Modules/FindCUDA/make2cmake.cmake b/Modules/FindCUDA/make2cmake.cmake
index c433fa8..802f93a 100644
--- a/Modules/FindCUDA/make2cmake.cmake
+++ b/Modules/FindCUDA/make2cmake.cmake
@@ -35,6 +35,16 @@
# This converts a file written in makefile syntax into one that can be included
# by CMake.
+# Input variables
+#
+# verbose:BOOL=<> OFF: Be as quiet as possible (default)
+# ON : Extra output
+#
+# input_file:FILEPATH=<> Path to dependecy file in makefile format
+#
+# output_file:FILEPATH=<> Path to file with dependencies in CMake readable variable
+#
+
file(READ ${input_file} depend_text)
if (NOT "${depend_text}" STREQUAL "")
@@ -62,12 +72,16 @@ if (NOT "${depend_text}" STREQUAL "")
if (EXISTS "/${file}")
set(file "/${file}")
else()
- message(WARNING " Removing non-existent dependency file: ${file}")
+ if(verbose)
+ message(WARNING " Removing non-existent dependency file: ${file}")
+ endif()
set(file "")
endif()
endif()
- if(NOT IS_DIRECTORY "${file}")
+ # Make sure we check to see if we have a file, before asking if it is not a directory.
+ # if(NOT IS_DIRECTORY "") will return TRUE.
+ if(file AND NOT IS_DIRECTORY "${file}")
# If softlinks start to matter, we should change this to REALPATH. For now we need
# to flatten paths, because nvcc can generate stuff like /bin/../include instead of
# just /include.
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index 8032309..12b83e0 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -207,6 +207,7 @@ cuda_execute_process(
COMMAND "${CMAKE_COMMAND}"
-D "input_file:FILEPATH=${NVCC_generated_dependency_file}"
-D "output_file:FILEPATH=${cmake_dependency_file}.tmp"
+ -D "verbose=${verbose}"
-P "${CUDA_make2cmake}"
)
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index ca49e4a..a7ffcfe 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -82,8 +82,7 @@
# ``AUTO`` to find them from executable target
#
# However, note that this macro will slow down your tests by running
-# an executable for each test and test fixture. You will also have to
-# re-run CMake after adding or removing tests or test fixtures.
+# an executable for each test and test fixture.
#
# Example usage::
#
@@ -119,6 +118,7 @@ function(GTEST_ADD_TESTS executable extra_args)
set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*")
set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
foreach(source ${ARGN})
+ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${source})
file(READ "${source}" contents)
string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
foreach(hit ${found_tests})
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index 135038c..8fe8f7a 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -92,10 +92,14 @@ macro(java_append_library_directories _var)
if(_path MATCHES "{libarch}")
foreach(_libarch ${_java_libarch})
string(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
- list(APPEND ${_var} "${_newpath}")
+ if(EXISTS ${_newpath})
+ list(APPEND ${_var} "${_newpath}")
+ endif()
endforeach()
else()
- list(APPEND ${_var} "${_path}")
+ if(EXISTS ${_path})
+ list(APPEND ${_var} "${_path}")
+ endif()
endif()
endforeach()
endmacro()
@@ -147,6 +151,9 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
/usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch} # can this one be removed according to #8821 ? Alex
/usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora
+ /usr/lib/jvm/java-8-openjdk-{libarch}/lib/{libarch} # ubuntu 15.10
+ /usr/lib/jvm/java-7-openjdk-{libarch}/lib/{libarch} # ubuntu 15.10
+ /usr/lib/jvm/java-6-openjdk-{libarch}/lib/{libarch} # ubuntu 15.10
# Debian specific paths for default JVM
/usr/lib/jvm/default-java/jre/lib/{libarch}
/usr/lib/jvm/default-java/jre/lib
@@ -181,6 +188,9 @@ list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
+)
+
+JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_INCLUDE_DIRECTORIES
/usr/include
/usr/local/include
/usr/lib/java/include
@@ -190,6 +200,9 @@ list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES
/usr/lib/jvm/java-1.5.0-sun/include
/usr/lib/jvm/java-6-sun-1.6.0.00/include # can this one be removed according to #8821 ? Alex
/usr/lib/jvm/java-6-openjdk/include
+ /usr/lib/jvm/java-8-openjdk-{libarch}/include # ubuntu 15.10
+ /usr/lib/jvm/java-7-openjdk-{libarch}/include # ubuntu 15.10
+ /usr/lib/jvm/java-6-openjdk-{libarch}/include # ubuntu 15.10
/usr/local/share/java/include
/usr/lib/j2sdk1.4-sun/include
/usr/lib/j2sdk1.5-sun/include
diff --git a/Modules/FindLTTngUST.cmake b/Modules/FindLTTngUST.cmake
new file mode 100644
index 0000000..e3220ac
--- /dev/null
+++ b/Modules/FindLTTngUST.cmake
@@ -0,0 +1,111 @@
+#.rst:
+# FindLTTngUST
+# ------------
+#
+# This module finds the `LTTng-UST <http://lttng.org/>`__ library.
+#
+# Imported target
+# ^^^^^^^^^^^^^^^
+#
+# This module defines the following :prop_tgt:`IMPORTED` target:
+#
+# ``LTTng::UST``
+# The LTTng-UST library, if found
+#
+# Result variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module sets the following
+#
+# ``LTTNGUST_FOUND``
+# ``TRUE`` if system has LTTng-UST
+# ``LTTNGUST_INCLUDE_DIRS``
+# The LTTng-UST include directories
+# ``LTTNGUST_LIBRARIES``
+# The libraries needed to use LTTng-UST
+# ``LTTNGUST_VERSION_STRING``
+# The LTTng-UST version
+# ``LTTNGUST_HAS_TRACEF``
+# ``TRUE`` if the ``tracef()`` API is available in the system's LTTng-UST
+# ``LTTNGUST_HAS_TRACELOG``
+# ``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST
+
+#=============================================================================
+# Copyright 2016 Kitware, Inc.
+# Copyright 2016 Philippe Proulx <pproulx@efficios.com>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+find_path(LTTNGUST_INCLUDE_DIRS NAMES lttng/tracepoint.h)
+find_library(LTTNGUST_LIBRARIES NAMES lttng-ust)
+
+if(LTTNGUST_INCLUDE_DIRS AND LTTNGUST_LIBRARIES)
+ # find tracef() and tracelog() support
+ set(LTTNGUST_HAS_TRACEF 0)
+ set(LTTNGUST_HAS_TRACELOG 0)
+
+ if(EXISTS "${LTTNGUST_INCLUDE_DIRS}/lttng/tracef.h")
+ set(LTTNGUST_HAS_TRACEF TRUE)
+ endif()
+
+ if(EXISTS "${LTTNGUST_INCLUDE_DIRS}/lttng/tracelog.h")
+ set(LTTNGUST_HAS_TRACELOG TRUE)
+ endif()
+
+ # get version
+ set(lttngust_version_file "${LTTNGUST_INCLUDE_DIRS}/lttng/ust-version.h")
+
+ if(EXISTS "${lttngust_version_file}")
+ file(STRINGS "${lttngust_version_file}" lttngust_version_major_string
+ REGEX "^[\t ]*#define[\t ]+LTTNG_UST_MAJOR_VERSION[\t ]+[0-9]+[\t ]*$")
+ file(STRINGS "${lttngust_version_file}" lttngust_version_minor_string
+ REGEX "^[\t ]*#define[\t ]+LTTNG_UST_MINOR_VERSION[\t ]+[0-9]+[\t ]*$")
+ file(STRINGS "${lttngust_version_file}" lttngust_version_patch_string
+ REGEX "^[\t ]*#define[\t ]+LTTNG_UST_PATCHLEVEL_VERSION[\t ]+[0-9]+[\t ]*$")
+ string(REGEX REPLACE ".*([0-9]+).*" "\\1"
+ lttngust_v_major "${lttngust_version_major_string}")
+ string(REGEX REPLACE ".*([0-9]+).*" "\\1"
+ lttngust_v_minor "${lttngust_version_minor_string}")
+ string(REGEX REPLACE ".*([0-9]+).*" "\\1"
+ lttngust_v_patch "${lttngust_version_patch_string}")
+ set(LTTNGUST_VERSION_STRING
+ "${lttngust_v_major}.${lttngust_v_minor}.${lttngust_v_patch}")
+ unset(lttngust_version_major_string)
+ unset(lttngust_version_minor_string)
+ unset(lttngust_version_patch_string)
+ unset(lttngust_v_major)
+ unset(lttngust_v_minor)
+ unset(lttngust_v_patch)
+ endif()
+
+ unset(lttngust_version_file)
+
+ if(NOT TARGET LTTng::UST)
+ add_library(LTTng::UST UNKNOWN IMPORTED)
+ set_target_properties(LTTng::UST PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${LTTNGUST_INCLUDE_DIRS}"
+ INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${LTTNGUST_LIBRARIES}")
+ endif()
+
+ # add libdl to required libraries
+ set(LTTNGUST_LIBRARIES ${LTTNGUST_LIBRARIES} ${CMAKE_DL_LIBS})
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set LTTNGUST_FOUND to
+# TRUE if all listed variables are TRUE
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(LTTngUST FOUND_VAR LTTNGUST_FOUND
+ REQUIRED_VARS LTTNGUST_LIBRARIES
+ LTTNGUST_INCLUDE_DIRS
+ VERSION_VAR LTTNGUST_VERSION_STRING)
+mark_as_advanced(LTTNGUST_LIBRARIES LTTNGUST_INCLUDE_DIRS)
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 2f13b09..8042073 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -6,47 +6,51 @@
#
# The following variables can be set and are optional:
#
-# ``PROTOBUF_SRC_ROOT_FOLDER``
+# ``Protobuf_SRC_ROOT_FOLDER``
# When compiling with MSVC, if this cache variable is set
# the protobuf-default VS project build locations
# (vsprojects/Debug and vsprojects/Release
# or vsprojects/x64/Debug and vsprojects/x64/Release)
# will be searched for libraries and binaries.
-# ``PROTOBUF_IMPORT_DIRS``
+# ``Protobuf_IMPORT_DIRS``
# List of additional directories to be searched for
# imported .proto files.
+# ``Protobuf_DEBUG``
+# Show debug messages.
#
# Defines the following variables:
#
-# ``PROTOBUF_FOUND``
+# ``Protobuf_FOUND``
# Found the Google Protocol Buffers library
# (libprotobuf & header files)
-# ``PROTOBUF_INCLUDE_DIRS``
+# ``Protobuf_VERSION``
+# Version of package found.
+# ``Protobuf_INCLUDE_DIRS``
# Include directories for Google Protocol Buffers
-# ``PROTOBUF_LIBRARIES``
+# ``Protobuf_LIBRARIES``
# The protobuf libraries
-# ``PROTOBUF_PROTOC_LIBRARIES``
+# ``Protobuf_PROTOC_LIBRARIES``
# The protoc libraries
-# ``PROTOBUF_LITE_LIBRARIES``
+# ``Protobuf_LITE_LIBRARIES``
# The protobuf-lite libraries
#
# The following cache variables are also available to set or use:
#
-# ``PROTOBUF_LIBRARY``
+# ``Protobuf_LIBRARY``
# The protobuf library
-# ``PROTOBUF_PROTOC_LIBRARY``
+# ``Protobuf_PROTOC_LIBRARY``
# The protoc library
-# ``PROTOBUF_INCLUDE_DIR``
+# ``Protobuf_INCLUDE_DIR``
# The include directory for protocol buffers
-# ``PROTOBUF_PROTOC_EXECUTABLE``
+# ``Protobuf_PROTOC_EXECUTABLE``
# The protoc compiler
-# ``PROTOBUF_LIBRARY_DEBUG``
+# ``Protobuf_LIBRARY_DEBUG``
# The protobuf library (debug)
-# ``PROTOBUF_PROTOC_LIBRARY_DEBUG``
+# ``Protobuf_PROTOC_LIBRARY_DEBUG``
# The protoc library (debug)
-# ``PROTOBUF_LITE_LIBRARY``
+# ``Protobuf_LITE_LIBRARY``
# The protobuf lite library
-# ``PROTOBUF_LITE_LIBRARY_DEBUG``
+# ``Protobuf_LITE_LIBRARY_DEBUG``
# The protobuf lite library (debug)
#
# Example:
@@ -54,12 +58,12 @@
# .. code-block:: cmake
#
# find_package(Protobuf REQUIRED)
-# include_directories(${PROTOBUF_INCLUDE_DIRS})
+# 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})
+# target_link_libraries(bar ${Protobuf_LIBRARIES})
#
# .. note::
# The ``protobuf_generate_cpp`` and ``protobuf_generate_python``
@@ -125,8 +129,8 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif()
- if(DEFINED PROTOBUF_IMPORT_DIRS)
- foreach(DIR ${PROTOBUF_IMPORT_DIRS})
+ 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)
@@ -147,9 +151,9 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
- COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
+ COMMAND ${Protobuf_PROTOC_EXECUTABLE}
ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
- DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}
+ DEPENDS ${ABS_FIL} ${Protobuf_PROTOC_EXECUTABLE}
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
VERBATIM )
endforeach()
@@ -179,8 +183,8 @@ function(PROTOBUF_GENERATE_PYTHON SRCS)
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif()
- if(DEFINED PROTOBUF_IMPORT_DIRS)
- foreach(DIR ${PROTOBUF_IMPORT_DIRS})
+ 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)
@@ -197,8 +201,8 @@ function(PROTOBUF_GENERATE_PYTHON SRCS)
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py")
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py"
- COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
- DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}
+ COMMAND ${Protobuf_PROTOC_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()
@@ -206,36 +210,60 @@ function(PROTOBUF_GENERATE_PYTHON SRCS)
set(${SRCS} ${${SRCS}} PARENT_SCOPE)
endfunction()
+# Backwards compatibility
+# Define camel case versions of input variables
+foreach(UPPER
+ PROTOBUF_SRC_ROOT_FOLDER
+ PROTOBUF_IMPORT_DIRS
+ PROTOBUF_DEBUG
+ PROTOBUF_LIBRARY
+ PROTOBUF_PROTOC_LIBRARY
+ PROTOBUF_INCLUDE_DIR
+ PROTOBUF_PROTOC_EXECUTABLE
+ PROTOBUF_LIBRARY_DEBUG
+ PROTOBUF_PROTOC_LIBRARY_DEBUG
+ PROTOBUF_LITE_LIBRARY
+ PROTOBUF_LITE_LIBRARY_DEBUG
+ )
+ if (DEFINED ${UPPER})
+ string(REPLACE "PROTOBUF_" "Protobuf_" Camel ${UPPER})
+ if (NOT DEFINED ${Camel})
+ set(${Camel} ${${UPPER}})
+ endif()
+ endif()
+endforeach()
+
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_PROTOBUF_ARCH_DIR x64/)
endif()
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+
# Internal function: search for normal library as well as a debug one
# if the debug one is specified also include debug/optimized keywords
# in *_LIBRARIES variable
function(_protobuf_find_libraries name filename)
- find_library(${name}_LIBRARY
- NAMES ${filename}
- PATHS ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release)
- mark_as_advanced(${name}_LIBRARY)
-
- find_library(${name}_LIBRARY_DEBUG
- NAMES ${filename}
- PATHS ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug)
- mark_as_advanced(${name}_LIBRARY_DEBUG)
-
- if(NOT ${name}_LIBRARY_DEBUG)
- # There is no debug library
- set(${name}_LIBRARY_DEBUG ${${name}_LIBRARY} PARENT_SCOPE)
- set(${name}_LIBRARIES ${${name}_LIBRARY} PARENT_SCOPE)
- else()
- # There IS a debug library
- set(${name}_LIBRARIES
- optimized ${${name}_LIBRARY}
- debug ${${name}_LIBRARY_DEBUG}
- PARENT_SCOPE
- )
- endif()
+ if(${name}_LIBRARIES)
+ # Use result recorded by a previous call.
+ return()
+ elseif(${name}_LIBRARY)
+ # Honor cache entry used by CMake 3.5 and lower.
+ set(${name}_LIBRARIES "${${name}_LIBRARY}" PARENT_SCOPE)
+ else()
+ find_library(${name}_LIBRARY_RELEASE
+ NAMES ${filename}
+ PATHS ${Protobuf_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release)
+ mark_as_advanced(${name}_LIBRARY_RELEASE)
+
+ find_library(${name}_LIBRARY_DEBUG
+ NAMES ${filename}
+ PATHS ${Protobuf_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug)
+ mark_as_advanced(${name}_LIBRARY_DEBUG)
+
+ select_library_configurations(${name})
+ set(${name}_LIBRARY "${${name}_LIBRARY}" PARENT_SCOPE)
+ set(${name}_LIBRARIES "${${name}_LIBRARIES}" PARENT_SCOPE)
+ endif()
endfunction()
# Internal function: find threads library
@@ -243,8 +271,8 @@ function(_protobuf_find_threads)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads)
if(Threads_FOUND)
- list(APPEND PROTOBUF_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
- set(PROTOBUF_LIBRARIES "${PROTOBUF_LIBRARIES}" PARENT_SCOPE)
+ list(APPEND Protobuf_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+ set(Protobuf_LIBRARIES "${Protobuf_LIBRARIES}" PARENT_SCOPE)
endif()
endfunction()
@@ -262,24 +290,24 @@ endif()
# Google's provided vcproj files generate libraries with a "lib"
# prefix on Windows
if(MSVC)
- set(PROTOBUF_ORIG_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
+ set(Protobuf_ORIG_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
- find_path(PROTOBUF_SRC_ROOT_FOLDER protobuf.pc.in)
+ find_path(Protobuf_SRC_ROOT_FOLDER protobuf.pc.in)
endif()
# The Protobuf library
-_protobuf_find_libraries(PROTOBUF protobuf)
+_protobuf_find_libraries(Protobuf protobuf)
#DOC "The Google Protocol Buffers RELEASE Library"
-_protobuf_find_libraries(PROTOBUF_LITE protobuf-lite)
+_protobuf_find_libraries(Protobuf_LITE protobuf-lite)
# The Protobuf Protoc Library
-_protobuf_find_libraries(PROTOBUF_PROTOC protoc)
+_protobuf_find_libraries(Protobuf_PROTOC protoc)
# Restore original find library prefixes
if(MSVC)
- set(CMAKE_FIND_LIBRARY_PREFIXES "${PROTOBUF_ORIG_FIND_LIBRARY_PREFIXES}")
+ set(CMAKE_FIND_LIBRARY_PREFIXES "${Protobuf_ORIG_FIND_LIBRARY_PREFIXES}")
endif()
if(UNIX)
@@ -287,27 +315,101 @@ if(UNIX)
endif()
# Find the include directory
-find_path(PROTOBUF_INCLUDE_DIR
+find_path(Protobuf_INCLUDE_DIR
google/protobuf/service.h
- PATHS ${PROTOBUF_SRC_ROOT_FOLDER}/src
+ PATHS ${Protobuf_SRC_ROOT_FOLDER}/src
)
-mark_as_advanced(PROTOBUF_INCLUDE_DIR)
+mark_as_advanced(Protobuf_INCLUDE_DIR)
# Find the protoc Executable
-find_program(PROTOBUF_PROTOC_EXECUTABLE
+find_program(Protobuf_PROTOC_EXECUTABLE
NAMES protoc
DOC "The Google Protocol Buffers Compiler"
PATHS
- ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release
- ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug
+ ${Protobuf_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release
+ ${Protobuf_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug
)
-mark_as_advanced(PROTOBUF_PROTOC_EXECUTABLE)
+mark_as_advanced(Protobuf_PROTOC_EXECUTABLE)
+
+if(Protobuf_DEBUG)
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "requested version of Google Protobuf is ${Protobuf_FIND_VERSION}")
+endif()
+
+if(Protobuf_INCLUDE_DIR)
+ set(_PROTOBUF_COMMON_HEADER ${Protobuf_INCLUDE_DIR}/google/protobuf/stubs/common.h)
+
+ if(Protobuf_DEBUG)
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "location of common.h: ${_PROTOBUF_COMMON_HEADER}")
+ endif()
+
+ set(Protobuf_VERSION "")
+ set(Protobuf_LIB_VERSION "")
+ file(STRINGS ${_PROTOBUF_COMMON_HEADER} _PROTOBUF_COMMON_H_CONTENTS REGEX "#define[ \t]+GOOGLE_PROTOBUF_VERSION[ \t]+")
+ if(_PROTOBUF_COMMON_H_CONTENTS MATCHES "#define[ \t]+GOOGLE_PROTOBUF_VERSION[ \t]+([0-9]+)")
+ set(Protobuf_LIB_VERSION "${CMAKE_MATCH_1}")
+ endif()
+ unset(_PROTOBUF_COMMON_H_CONTENTS)
+ math(EXPR _PROTOBUF_MAJOR_VERSION "${Protobuf_LIB_VERSION} / 1000000")
+ math(EXPR _PROTOBUF_MINOR_VERSION "${Protobuf_LIB_VERSION} / 1000 % 1000")
+ math(EXPR _PROTOBUF_SUBMINOR_VERSION "${Protobuf_LIB_VERSION} % 1000")
+ set(Protobuf_VERSION "${_PROTOBUF_MAJOR_VERSION}.${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}")
+
+ if(Protobuf_DEBUG)
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "${_PROTOBUF_COMMON_HEADER} reveals protobuf ${Protobuf_VERSION}")
+ endif()
+
+ # Check Protobuf compiler version to be aligned with libraries version
+ execute_process(COMMAND ${Protobuf_PROTOC_EXECUTABLE} --version
+ OUTPUT_VARIABLE _PROTOBUF_PROTOC_EXECUTABLE_VERSION)
+
+ if("${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}" MATCHES "libprotoc ([0-9.]+)")
+ set(_PROTOBUF_PROTOC_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
+ endif()
+
+ if(Protobuf_DEBUG)
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "${Protobuf_PROTOC_EXECUTABLE} reveals version ${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}")
+ endif()
+
+ if(NOT "${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}" VERSION_EQUAL "${Protobuf_VERSION}")
+ message(WARNING "Protobuf compiler version ${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}"
+ " doesn't match library version ${Protobuf_VERSION}")
+ endif()
+endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Protobuf DEFAULT_MSG
- PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Protobuf
+ REQUIRED_VARS Protobuf_LIBRARIES Protobuf_INCLUDE_DIR
+ VERSION_VAR Protobuf_VERSION
+)
-if(PROTOBUF_FOUND)
- set(PROTOBUF_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIR})
+if(Protobuf_FOUND)
+ set(Protobuf_INCLUDE_DIRS ${Protobuf_INCLUDE_DIR})
endif()
+
+# Backwards compatibility
+# Define upper case versions of output variables
+foreach(Camel
+ Protobuf_SRC_ROOT_FOLDER
+ Protobuf_IMPORT_DIRS
+ Protobuf_DEBUG
+ Protobuf_INCLUDE_DIRS
+ Protobuf_LIBRARIES
+ Protobuf_PROTOC_LIBRARIES
+ Protobuf_LITE_LIBRARIES
+ Protobuf_LIBRARY
+ Protobuf_PROTOC_LIBRARY
+ Protobuf_INCLUDE_DIR
+ Protobuf_PROTOC_EXECUTABLE
+ Protobuf_LIBRARY_DEBUG
+ Protobuf_PROTOC_LIBRARY_DEBUG
+ Protobuf_LITE_LIBRARY
+ Protobuf_LITE_LIBRARY_DEBUG
+ )
+ string(TOUPPER ${Camel} UPPER)
+ set(${UPPER} ${${Camel}})
+endforeach()
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 49ce57e..8c07e6c 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -835,6 +835,36 @@ else()
endif()
endif()
+ # When using wx-config in MSYS, the include paths are UNIX style paths which may or may
+ # not work correctly depending on you MSYS/MinGW configuration. CMake expects native
+ # paths internally.
+ if(wxWidgets_FOUND AND MSYS)
+ find_program(_cygpath_exe cygpath ONLY_CMAKE_FIND_ROOT_PATH)
+ DBG_MSG_V("_cygpath_exe: ${_cygpath_exe}")
+ if(_cygpath_exe)
+ set(_tmp_path "")
+ foreach(_path ${wxWidgets_INCLUDE_DIRS})
+ execute_process(
+ COMMAND cygpath -w ${_path}
+ OUTPUT_VARIABLE _native_path
+ RESULT_VARIABLE _retv
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET
+ )
+ if(_retv EQUAL 0)
+ file(TO_CMAKE_PATH ${_native_path} _native_path)
+ DBG_MSG_V("Path ${_path} converted to ${_native_path}")
+ set(_tmp_path "${_tmp_path} ${_native_path}")
+ endif()
+ endforeach()
+ DBG_MSG("Setting wxWidgets_INCLUDE_DIRS = ${_tmp_path}")
+ set(wxWidgets_INCLUDE_DIRS ${_tmp_path})
+ separate_arguments(wxWidgets_INCLUDE_DIRS)
+ list(REMOVE_ITEM wxWidgets_INCLUDE_DIRS "")
+ endif()
+ unset(_cygpath_exe CACHE)
+ endif()
+
#=====================================================================
# Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE
#=====================================================================
diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake
index 70c3fd7..c12dd4c 100644
--- a/Modules/FortranCInterface.cmake
+++ b/Modules/FortranCInterface.cmake
@@ -1,129 +1,190 @@
-#.rst:
-# FortranCInterface
-# -----------------
-#
-# Fortran/C Interface Detection
-#
-# This module automatically detects the API by which C and Fortran
-# languages interact. Variables indicate if the mangling is found:
-#
-# ::
-#
-# FortranCInterface_GLOBAL_FOUND = Global subroutines and functions
-# FortranCInterface_MODULE_FOUND = Module subroutines and functions
-# (declared by "MODULE PROCEDURE")
-#
-# A function is provided to generate a C header file containing macros
-# to mangle symbol names:
-#
-# ::
-#
-# FortranCInterface_HEADER(<file>
-# [MACRO_NAMESPACE <macro-ns>]
-# [SYMBOL_NAMESPACE <ns>]
-# [SYMBOLS [<module>:]<function> ...])
-#
-# It generates in <file> definitions of the following macros:
-#
-# ::
-#
-# #define FortranCInterface_GLOBAL (name,NAME) ...
-# #define FortranCInterface_GLOBAL_(name,NAME) ...
-# #define FortranCInterface_MODULE (mod,name, MOD,NAME) ...
-# #define FortranCInterface_MODULE_(mod,name, MOD,NAME) ...
-#
-# These macros mangle four categories of Fortran symbols, respectively:
-#
-# ::
-#
-# - Global symbols without '_': call mysub()
-# - Global symbols with '_' : call my_sub()
-# - Module symbols without '_': use mymod; call mysub()
-# - Module symbols with '_' : use mymod; call my_sub()
-#
-# If mangling for a category is not known, its macro is left undefined.
-# All macros require raw names in both lower case and upper case. The
-# MACRO_NAMESPACE option replaces the default "FortranCInterface_"
-# prefix with a given namespace "<macro-ns>".
-#
-# The SYMBOLS option lists symbols to mangle automatically with C
-# preprocessor definitions:
-#
-# ::
-#
-# <function> ==> #define <ns><function> ...
-# <module>:<function> ==> #define <ns><module>_<function> ...
-#
-# If the mangling for some symbol is not known then no preprocessor
-# definition is created, and a warning is displayed. The
-# SYMBOL_NAMESPACE option prefixes all preprocessor definitions
-# generated by the SYMBOLS option with a given namespace "<ns>".
-#
-# Example usage:
-#
-# ::
-#
-# include(FortranCInterface)
-# FortranCInterface_HEADER(FC.h MACRO_NAMESPACE "FC_")
-#
-# This creates a "FC.h" header that defines mangling macros FC_GLOBAL(),
-# FC_GLOBAL_(), FC_MODULE(), and FC_MODULE_().
-#
-# Example usage:
-#
-# ::
-#
-# include(FortranCInterface)
-# FortranCInterface_HEADER(FCMangle.h
-# MACRO_NAMESPACE "FC_"
-# SYMBOL_NAMESPACE "FC_"
-# SYMBOLS mysub mymod:my_sub)
-#
-# This creates a "FCMangle.h" header that defines the same FC_*()
-# mangling macros as the previous example plus preprocessor symbols
-# FC_mysub and FC_mymod_my_sub.
-#
-# Another function is provided to verify that the Fortran and C/C++
-# compilers work together:
-#
-# ::
-#
-# FortranCInterface_VERIFY([CXX] [QUIET])
-#
-# It tests whether a simple test executable using Fortran and C (and C++
-# when the CXX option is given) compiles and links successfully. The
-# result is stored in the cache entry FortranCInterface_VERIFIED_C (or
-# FortranCInterface_VERIFIED_CXX if CXX is given) as a boolean. If the
-# check fails and QUIET is not given the function terminates with a
-# FATAL_ERROR message describing the problem. The purpose of this check
-# is to stop a build early for incompatible compiler combinations. The
-# test is built in the Release configuration.
-#
-# FortranCInterface is aware of possible GLOBAL and MODULE manglings for
-# many Fortran compilers, but it also provides an interface to specify
-# new possible manglings. Set the variables
-#
-# ::
-#
-# FortranCInterface_GLOBAL_SYMBOLS
-# FortranCInterface_MODULE_SYMBOLS
-#
-# before including FortranCInterface to specify manglings of the symbols
-# "MySub", "My_Sub", "MyModule:MySub", and "My_Module:My_Sub". For
-# example, the code:
-#
-# ::
-#
-# set(FortranCInterface_GLOBAL_SYMBOLS mysub_ my_sub__ MYSUB_)
-# # ^^^^^ ^^^^^^ ^^^^^
-# set(FortranCInterface_MODULE_SYMBOLS
-# __mymodule_MOD_mysub __my_module_MOD_my_sub)
-# # ^^^^^^^^ ^^^^^ ^^^^^^^^^ ^^^^^^
-# include(FortranCInterface)
-#
-# tells FortranCInterface to try given GLOBAL and MODULE manglings.
-# (The carets point at raw symbol names for clarity in this example but
-# are not needed.)
+#[=======================================================================[.rst:
+FortranCInterface
+-----------------
+
+Fortran/C Interface Detection
+
+This module automatically detects the API by which C and Fortran
+languages interact.
+
+Module Variables
+^^^^^^^^^^^^^^^^
+
+Variables that indicate if the mangling is found:
+
+``FortranCInterface_GLOBAL_FOUND``
+ Global subroutines and functions.
+
+``FortranCInterface_MODULE_FOUND``
+ Module subroutines and functions (declared by "MODULE PROCEDURE").
+
+This module also provides the following variables to specify
+the detected mangling, though a typical use case does not need
+to reference them and can use the `Module Functions`_ below.
+
+``FortranCInterface_GLOBAL_PREFIX``
+ Prefix for a global symbol without an underscore.
+
+``FortranCInterface_GLOBAL_SUFFIX``
+ Suffix for a global symbol without an underscore.
+
+``FortranCInterface_GLOBAL_CASE``
+ The case for a global symbol without an underscore,
+ either ``UPPER`` or ``LOWER``.
+
+``FortranCInterface_GLOBAL__PREFIX``
+ Prefix for a global symbol with an underscore.
+
+``FortranCInterface_GLOBAL__SUFFIX``
+ Suffix for a global symbol with an underscore.
+
+``FortranCInterface_GLOBAL__CASE``
+ The case for a global symbol with an underscore,
+ either ``UPPER`` or ``LOWER``.
+
+``FortranCInterface_MODULE_PREFIX``
+ Prefix for a module symbol without an underscore.
+
+``FortranCInterface_MODULE_MIDDLE``
+ Middle of a module symbol without an underscore that appears
+ between the name of the module and the name of the symbol.
+
+``FortranCInterface_MODULE_SUFFIX``
+ Suffix for a module symbol without an underscore.
+
+``FortranCInterface_MODULE_CASE``
+ The case for a module symbol without an underscore,
+ either ``UPPER`` or ``LOWER``.
+
+``FortranCInterface_MODULE__PREFIX``
+ Prefix for a module symbol with an underscore.
+
+``FortranCInterface_MODULE__MIDDLE``
+ Middle of a module symbol with an underscore that appears
+ between the name of the module and the name of the symbol.
+
+``FortranCInterface_MODULE__SUFFIX``
+ Suffix for a module symbol with an underscore.
+
+``FortranCInterface_MODULE__CASE``
+ The case for a module symbol with an underscore,
+ either ``UPPER`` or ``LOWER``.
+
+Module Functions
+^^^^^^^^^^^^^^^^
+
+.. command:: FortranCInterface_HEADER
+
+ The ``FortranCInterface_HEADER`` function is provided to generate a
+ C header file containing macros to mangle symbol names::
+
+ FortranCInterface_HEADER(<file>
+ [MACRO_NAMESPACE <macro-ns>]
+ [SYMBOL_NAMESPACE <ns>]
+ [SYMBOLS [<module>:]<function> ...])
+
+ It generates in ``<file>`` definitions of the following macros::
+
+ #define FortranCInterface_GLOBAL (name,NAME) ...
+ #define FortranCInterface_GLOBAL_(name,NAME) ...
+ #define FortranCInterface_MODULE (mod,name, MOD,NAME) ...
+ #define FortranCInterface_MODULE_(mod,name, MOD,NAME) ...
+
+ These macros mangle four categories of Fortran symbols, respectively:
+
+ * Global symbols without '_': ``call mysub()``
+ * Global symbols with '_' : ``call my_sub()``
+ * Module symbols without '_': ``use mymod; call mysub()``
+ * Module symbols with '_' : ``use mymod; call my_sub()``
+
+ If mangling for a category is not known, its macro is left undefined.
+ All macros require raw names in both lower case and upper case.
+
+ The options are:
+
+ ``MACRO_NAMESPACE``
+ Replace the default ``FortranCInterface_`` prefix with a given
+ namespace ``<macro-ns>``.
+
+ ``SYMBOLS``
+ List symbols to mangle automatically with C preprocessor definitions::
+
+ <function> ==> #define <ns><function> ...
+ <module>:<function> ==> #define <ns><module>_<function> ...
+
+ If the mangling for some symbol is not known then no preprocessor
+ definition is created, and a warning is displayed.
+
+ ``SYMBOL_NAMESPACE``
+ Prefix all preprocessor definitions generated by the ``SYMBOLS``
+ option with a given namespace ``<ns>``.
+
+.. command:: FortranCInterface_VERIFY
+
+ The ``FortranCInterface_VERIFY`` function is provided to verify
+ that the Fortran and C/C++ compilers work together::
+
+ FortranCInterface_VERIFY([CXX] [QUIET])
+
+ It tests whether a simple test executable using Fortran and C (and C++
+ when the CXX option is given) compiles and links successfully. The
+ result is stored in the cache entry ``FortranCInterface_VERIFIED_C``
+ (or ``FortranCInterface_VERIFIED_CXX`` if ``CXX`` is given) as a boolean.
+ If the check fails and ``QUIET`` is not given the function terminates with a
+ fatal error message describing the problem. The purpose of this check
+ is to stop a build early for incompatible compiler combinations. The
+ test is built in the ``Release`` configuration.
+
+Example Usage
+^^^^^^^^^^^^^
+
+.. code-block:: cmake
+
+ include(FortranCInterface)
+ FortranCInterface_HEADER(FC.h MACRO_NAMESPACE "FC_")
+
+This creates a "FC.h" header that defines mangling macros ``FC_GLOBAL()``,
+``FC_GLOBAL_()``, ``FC_MODULE()``, and ``FC_MODULE_()``.
+
+.. code-block:: cmake
+
+ include(FortranCInterface)
+ FortranCInterface_HEADER(FCMangle.h
+ MACRO_NAMESPACE "FC_"
+ SYMBOL_NAMESPACE "FC_"
+ SYMBOLS mysub mymod:my_sub)
+
+This creates a "FCMangle.h" header that defines the same ``FC_*()``
+mangling macros as the previous example plus preprocessor symbols
+``FC_mysub`` and ``FC_mymod_my_sub``.
+
+Additional Manglings
+^^^^^^^^^^^^^^^^^^^^
+
+FortranCInterface is aware of possible ``GLOBAL`` and ``MODULE`` manglings
+for many Fortran compilers, but it also provides an interface to specify
+new possible manglings. Set the variables::
+
+ FortranCInterface_GLOBAL_SYMBOLS
+ FortranCInterface_MODULE_SYMBOLS
+
+before including FortranCInterface to specify manglings of the symbols
+``MySub``, ``My_Sub``, ``MyModule:MySub``, and ``My_Module:My_Sub``.
+For example, the code:
+
+.. code-block:: cmake
+
+ set(FortranCInterface_GLOBAL_SYMBOLS mysub_ my_sub__ MYSUB_)
+ # ^^^^^ ^^^^^^ ^^^^^
+ set(FortranCInterface_MODULE_SYMBOLS
+ __mymodule_MOD_mysub __my_module_MOD_my_sub)
+ # ^^^^^^^^ ^^^^^ ^^^^^^^^^ ^^^^^^
+ include(FortranCInterface)
+
+tells FortranCInterface to try given ``GLOBAL`` and ``MODULE`` manglings.
+(The carets point at raw symbol names for clarity in this example but
+are not needed.)
+#]=======================================================================]
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 391e7f8..9ea1281 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -500,6 +500,7 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
if(NOT IS_ABSOLUTE "${original_file}")
message(STATUS "warning: gp_resolved_file_type expects absolute full path for first arg original_file")
endif()
+ get_filename_component(original_file "${original_file}" ABSOLUTE) # canonicalize path
set(is_embedded 0)
set(is_local 0)
@@ -515,6 +516,7 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
if(NOT IS_ABSOLUTE "${file}")
gp_resolve_item("${original_file}" "${file}" "${exepath}" "${dirs}" resolved_file "${rpaths}")
endif()
+ get_filename_component(resolved_file "${resolved_file}" ABSOLUTE) # canonicalize path
string(TOLOWER "${original_file}" original_lower)
string(TOLOWER "${resolved_file}" lower)
diff --git a/Modules/Platform/CYGWIN-Clang-C.cmake b/Modules/Platform/CYGWIN-Clang-C.cmake
new file mode 100644
index 0000000..e8343a4
--- /dev/null
+++ b/Modules/Platform/CYGWIN-Clang-C.cmake
@@ -0,0 +1 @@
+include(Platform/CYGWIN-GNU-C)
diff --git a/Modules/Platform/CYGWIN-Clang-CXX.cmake b/Modules/Platform/CYGWIN-Clang-CXX.cmake
new file mode 100644
index 0000000..67775de
--- /dev/null
+++ b/Modules/Platform/CYGWIN-Clang-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/CYGWIN-GNU-CXX)
diff --git a/Modules/Platform/Darwin-Clang.cmake b/Modules/Platform/Darwin-Clang.cmake
index 4cded47..61a5e0c 100644
--- a/Modules/Platform/Darwin-Clang.cmake
+++ b/Modules/Platform/Darwin-Clang.cmake
@@ -24,7 +24,7 @@ macro(__darwin_compiler_clang lang)
set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names")
set(CMAKE_${lang}_SYSROOT_FLAG "-isysroot")
set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=")
- if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.1)
+ if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.2)
set(CMAKE_${lang}_SYSTEM_FRAMEWORK_SEARCH_FLAG "-iframework ")
endif()
endmacro()
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index a61413a..26bf11c 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -47,10 +47,6 @@ else()
endif()
set(CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS 1)
-if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
- set (CMAKE_NO_BUILD_TYPE 1)
- set(CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS 0) # not implemented for VS6
-endif()
if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
set (CMAKE_NO_BUILD_TYPE 1)
endif()
@@ -194,8 +190,14 @@ else()
if(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM")
set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib")
elseif(MSVC_VERSION GREATER 1310)
- set(_RTC1 "/RTC1")
- set(_FLAGS_CXX " /GR /EHsc")
+ if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*")
+ # Clang/C2 in MSVC14 Update 1 seems to not support -fsantinize (yet?)
+ # set(_RTC1 "-fsantinize=memory,safe-stack")
+ set(_FLAGS_CXX " -frtti -fexceptions")
+ else()
+ set(_RTC1 "/RTC1")
+ set(_FLAGS_CXX " /GR /EHsc")
+ endif()
set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
else()
set(_RTC1 "/GZ")
@@ -296,11 +298,21 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_LINK_EXECUTABLE
"${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
- set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3${_FLAGS_${lang}}")
- set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}")
- set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
- set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
- set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+ if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*")
+ # note: MSVC 14 2015 Update 1 sets -fno-ms-compatibility by default, but this does not allow to compile many projects
+ # that include MS's own headers. CMake itself is affected project too.
+ set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} -fms-extensions -fms-compatibility -D_WINDOWS -Wall${_FLAGS_${lang}}")
+ set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-D_DEBUG /MDd -gline-tables-only -fno-inline -O0 ${_RTC1}")
+ set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD -O2 -D NDEBUG")
+ set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD -gline-tables-only -O2 -fno-inline -D NDEBUG")
+ set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD -Os -D NDEBUG")
+ else()
+ set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3${_FLAGS_${lang}}")
+ set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}")
+ set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
+ set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
+ set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+ endif()
set(CMAKE_${lang}_LINKER_SUPPORTS_PDB ON)
set(CMAKE_NINJA_DEPTYPE_${lang} msvc)
diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake
index 0beba73..b31cb11 100644
--- a/Modules/Platform/Windows-df.cmake
+++ b/Modules/Platform/Windows-df.cmake
@@ -30,9 +30,6 @@ set(CMAKE_Fortran_LINK_EXECUTABLE
set(CMAKE_CREATE_WIN32_EXE /winapp)
set(CMAKE_CREATE_CONSOLE_EXE )
-if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
- set (CMAKE_NO_BUILD_TYPE 1)
-endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
set (CMAKE_NO_BUILD_TYPE 1)
endif()
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index ab70568..8dd58af 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -452,8 +452,6 @@ if (WIN32)
cmGlobalNMakeMakefileGenerator.h
cmGlobalJOMMakefileGenerator.cxx
cmGlobalJOMMakefileGenerator.h
- cmGlobalVisualStudio6Generator.cxx
- cmGlobalVisualStudio6Generator.h
cmGlobalVisualStudio71Generator.cxx
cmGlobalVisualStudio71Generator.h
cmGlobalVisualStudio7Generator.cxx
@@ -481,8 +479,6 @@ if (WIN32)
cmIDEFlagTable.h
cmIDEOptions.cxx
cmIDEOptions.h
- cmLocalVisualStudio6Generator.cxx
- cmLocalVisualStudio6Generator.h
cmLocalVisualStudio7Generator.cxx
cmLocalVisualStudio7Generator.h
cmLocalVisualStudioGenerator.cxx
@@ -728,7 +724,7 @@ endif()
add_library(CPackLib ${CPACK_SRCS})
target_link_libraries(CPackLib CMakeLib)
if(APPLE)
- target_link_libraries(CPackLib "-framework Carbon")
+ target_link_libraries(CPackLib "-framework CoreServices")
endif()
if(APPLE)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 129a882..e667257 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 5)
-set(CMake_VERSION_PATCH 0)
-#set(CMake_VERSION_RC 0)
+set(CMake_VERSION_PATCH 20160318)
+#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 7b94ca3..521b395 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -20,21 +20,12 @@
#include <iomanip>
-#include <CoreFoundation/CFBase.h>
-#include <CoreFoundation/CFString.h>
-#include <CoreFoundation/CFLocale.h>
-
-// The carbon framework is deprecated, but the Region codes it supplies are
-// needed for the LPic data structure used for generating multi-lingual SLAs.
-// There does not seem to be a replacement API for these region codes.
-#if defined(__clang__)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif
-#include <Carbon/Carbon.h>
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
+#include <CoreFoundation/CoreFoundation.h>
+
+// For the old LocaleStringToLangAndRegionCodes() function, to convert
+// to the old Script Manager RegionCode values needed for the 'LPic' data
+// structure used for generating multi-lingual SLAs.
+#include <CoreServices/CoreServices.h>
static const char* SLAHeader =
"data 'LPic' (5000) {\n"
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 22d4bf0..3eca280 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -723,10 +723,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmMakefile> mf(
new cmMakefile(&gg, cm.GetCurrentSnapshot()));
- std::string realInstallDirectory = tempInstallDirectory;
if ( !installSubDirectory.empty() && installSubDirectory != "/" )
{
- realInstallDirectory += installSubDirectory;
+ tempInstallDirectory += installSubDirectory;
}
if (componentInstall)
{
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 2c2cd48..fd62696 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -983,7 +983,7 @@ int cmCTestCoverageHandler::HandleDelphiCoverage(
std::string BinDir
= this->CTest->GetBinaryDir();
- std::string coverageFile = BinDir+ "/*.html";
+ std::string coverageFile = BinDir+ "/*(*.pas).html";
g.FindFiles(coverageFile);
@@ -1017,9 +1017,25 @@ int cmCTestCoverageHandler::HandleBlanketJSCoverage(
std::string coverageFile = SourceDir+ "/*.json";
cmsys::Glob g;
std::vector<std::string> files;
+ std::vector<std::string> blanketFiles;
g.FindFiles(coverageFile);
files=g.GetFiles();
- if (!files.empty())
+ // Ensure that the JSON files found are the result of the
+ // Blanket.js output. Check for the "node-jscoverage"
+ // string on the second line
+ std::string line;
+ for(unsigned int fileEntry=0;fileEntry<files.size();fileEntry++)
+ {
+ cmsys::ifstream in(files[fileEntry].c_str());
+ cmSystemTools::GetLineFromStream(in, line);
+ cmSystemTools::GetLineFromStream(in, line);
+ if (line.find("node-jscoverage") != line.npos)
+ {
+ blanketFiles.push_back(files[fileEntry]);
+ }
+ }
+ // Take all files with the node-jscoverage string and parse those
+ if (!blanketFiles.empty())
{
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Found BlanketJS output JSON, Performing Coverage" << std::endl,
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 76ed038..b5688a8 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -426,3 +426,35 @@ std::string cmCommonTargetGenerator::GetManifests()
return cmJoin(manifests, " ");
}
+
+void cmCommonTargetGenerator
+::AppendOSXVerFlag(std::string& flags, const std::string& lang,
+ const char* name, bool so)
+{
+ // Lookup the flag to specify the version.
+ std::string fvar = "CMAKE_";
+ fvar += lang;
+ fvar += "_OSX_";
+ fvar += name;
+ fvar += "_VERSION_FLAG";
+ const char* flag = this->Makefile->GetDefinition(fvar);
+
+ // Skip if no such flag.
+ if(!flag)
+ {
+ return;
+ }
+
+ // Lookup the target version information.
+ int major;
+ int minor;
+ int patch;
+ this->GeneratorTarget->GetTargetVersion(so, major, minor, patch);
+ if(major > 0 || minor > 0 || patch > 0)
+ {
+ // Append the flag since a non-zero version is specified.
+ std::ostringstream vflag;
+ vflag << flag << major << "." << minor << "." << patch;
+ this->LocalGenerator->AppendFlags(flags, vflag.str());
+ }
+}
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index 0c17500..bfb6b79 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -79,6 +79,9 @@ protected:
virtual void AddIncludeFlags(std::string& flags,
std::string const& lang) = 0;
+ void AppendOSXVerFlag(std::string& flags, const std::string& lang,
+ const char* name, bool so);
+
typedef std::map<std::string, std::string> ByLanguageMap;
std::string GetFlags(const std::string &l);
ByLanguageMap FlagsByLanguage;
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 13098ad..2796fdf 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -931,7 +931,7 @@ cmComputeLinkDepends::MakePendingComponent(unsigned int component)
//----------------------------------------------------------------------------
int cmComputeLinkDepends::ComputeComponentCount(NodeList const& nl)
{
- int count = 2;
+ unsigned int count = 2;
for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
{
if(cmGeneratorTarget const* target = this->EntryList[*ni].Target)
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 4a1f770..b639c15 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -19,13 +19,42 @@
#include <assert.h>
-int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
+int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
+ bool isTryRun)
{
this->BinaryDirectory = argv[1].c_str();
this->OutputFile = "";
// which signature were we called with ?
this->SrcFileSignature = true;
+ cmState::TargetType targetType = cmState::EXECUTABLE;
+ const char* tt =
+ this->Makefile->GetDefinition("CMAKE_TRY_COMPILE_TARGET_TYPE");
+ if (!isTryRun && tt && *tt)
+ {
+ if (strcmp(tt, cmState::GetTargetTypeName(cmState::EXECUTABLE)) == 0)
+ {
+ targetType = cmState::EXECUTABLE;
+ }
+ else if (strcmp(tt,
+ cmState::GetTargetTypeName(cmState::STATIC_LIBRARY)) == 0)
+ {
+ targetType = cmState::STATIC_LIBRARY;
+ }
+ else
+ {
+ this->Makefile->IssueMessage(
+ cmake::FATAL_ERROR,
+ std::string("Invalid value '") + tt + "' for "
+ "CMAKE_TRY_COMPILE_TARGET_TYPE. Only "
+ "'" + cmState::GetTargetTypeName(cmState::EXECUTABLE) + "' and "
+ "'" + cmState::GetTargetTypeName(cmState::STATIC_LIBRARY) + "' "
+ "are allowed."
+ );
+ return -1;
+ }
+ }
+
const char* sourceDirectory = argv[2].c_str();
const char* projectName = 0;
std::string targetName;
@@ -486,11 +515,22 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
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());
- /* Create the actual executable. */
- fprintf(fout, "add_executable(%s", targetName.c_str());
+ if (targetType == cmState::EXECUTABLE)
+ {
+ /* Put the executable at a known location (for COPY_FILE). */
+ fprintf(fout, "set(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n",
+ this->BinaryDirectory.c_str());
+ /* Create the actual executable. */
+ fprintf(fout, "add_executable(%s", targetName.c_str());
+ }
+ else // if (targetType == cmState::STATIC_LIBRARY)
+ {
+ /* Put the static library at a known location (for COPY_FILE). */
+ fprintf(fout, "set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY \"%s\")\n",
+ this->BinaryDirectory.c_str());
+ /* Create the actual static library. */
+ fprintf(fout, "add_library(%s STATIC", targetName.c_str());
+ }
for(std::vector<std::string>::iterator si = sources.begin();
si != sources.end(); ++si)
{
@@ -549,7 +589,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
if (this->SrcFileSignature)
{
std::string copyFileErrorMessage;
- this->FindOutputFile(targetName);
+ this->FindOutputFile(targetName, targetType);
if ((res==0) && !copyFile.empty())
{
@@ -651,13 +691,26 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
}
}
-void cmCoreTryCompile::FindOutputFile(const std::string& targetName)
+void cmCoreTryCompile::FindOutputFile(const std::string& targetName,
+ cmState::TargetType targetType)
{
this->FindErrorMessage = "";
this->OutputFile = "";
std::string tmpOutputFile = "/";
- tmpOutputFile += targetName;
- tmpOutputFile +=this->Makefile->GetSafeDefinition("CMAKE_EXECUTABLE_SUFFIX");
+ if (targetType == cmState::EXECUTABLE)
+ {
+ tmpOutputFile += targetName;
+ tmpOutputFile +=
+ this->Makefile->GetSafeDefinition("CMAKE_EXECUTABLE_SUFFIX");
+ }
+ else // if (targetType == cmState::STATIC_LIBRARY)
+ {
+ tmpOutputFile +=
+ this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_PREFIX");
+ tmpOutputFile += targetName;
+ tmpOutputFile +=
+ this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX");
+ }
// a list of directories where to search for the compilation result
// at first directly in the binary dir
diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h
index 3272462..c2beea8 100644
--- a/Source/cmCoreTryCompile.h
+++ b/Source/cmCoreTryCompile.h
@@ -30,7 +30,7 @@ public:
* commands, such as TryRun can access the same logic without
* duplication.
*/
- int TryCompileCode(std::vector<std::string> const& argv);
+ int TryCompileCode(std::vector<std::string> const& argv, bool isTryRun);
/**
* This deletes all the files created by TryCompileCode.
@@ -44,8 +44,8 @@ public:
TryCompileCode. The result is stored in OutputFile. If nothing is found,
the error message is stored in FindErrorMessage.
*/
- void FindOutputFile(const std::string& targetName);
-
+ void FindOutputFile(const std::string& targetName,
+ cmState::TargetType targetType);
cmTypeMacro(cmCoreTryCompile, cmCommand);
diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx
index 54c27d6..e670991 100644
--- a/Source/cmCreateTestSourceList.cxx
+++ b/Source/cmCreateTestSourceList.cxx
@@ -78,8 +78,7 @@ bool cmCreateTestSourceList
driver += *i;
++i;
- std::string configFile =
- this->Makefile->GetRequiredDefinition("CMAKE_ROOT");
+ std::string configFile = cmSystemTools::GetCMakeRoot();
configFile += "/Templates/TestDriver.cxx.in";
// Create the test driver file
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 9348ef2..476d3ac 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -259,13 +259,12 @@ void cmExtraCodeBlocksGenerator
}
// Convert
- const char* cmakeRoot = mf->GetDefinition("CMAKE_ROOT");
for (std::vector<std::string>::const_iterator jt = listFiles.begin();
jt != listFiles.end();
++jt)
{
// don't put cmake's own files into the project (#12110):
- if (jt->find(cmakeRoot) == 0)
+ if (jt->find(cmSystemTools::GetCMakeRoot()) == 0)
{
continue;
}
@@ -300,6 +299,8 @@ void cmExtraCodeBlocksGenerator
// figure out the compiler
std::string compiler = this->GetCBCompilerId(mf);
std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
+ const std::string makeArgs = mf->GetSafeDefinition(
+ "CMAKE_CODEBLOCKS_MAKE_ARGUMENTS");
fout<<"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n"
"<CodeBlocks_project_file>\n"
@@ -311,7 +312,8 @@ void cmExtraCodeBlocksGenerator
" "<<virtualFolders<<"\n"
" <Build>\n";
- this->AppendTarget(fout, "all", 0, make.c_str(), lgs[0], compiler.c_str());
+ this->AppendTarget(fout, "all", 0, make.c_str(), lgs[0], compiler.c_str(),
+ makeArgs);
// add all executable and library targets and some of the GLOBAL
// and UTILITY targets
@@ -333,7 +335,8 @@ void cmExtraCodeBlocksGenerator
(*lg)->GetBinaryDirectory())==0)
{
this->AppendTarget(fout, targetName, 0,
- make.c_str(), *lg, compiler.c_str());
+ make.c_str(), *lg, compiler.c_str(),
+ makeArgs);
}
}
break;
@@ -350,7 +353,7 @@ void cmExtraCodeBlocksGenerator
}
this->AppendTarget(fout, targetName, 0,
- make.c_str(), *lg, compiler.c_str());
+ make.c_str(), *lg, compiler.c_str(),makeArgs);
break;
case cmState::EXECUTABLE:
case cmState::STATIC_LIBRARY:
@@ -360,11 +363,11 @@ void cmExtraCodeBlocksGenerator
{
cmGeneratorTarget* gt = *ti;
this->AppendTarget(fout, targetName, gt,
- make.c_str(), *lg, compiler.c_str());
+ make.c_str(), *lg, compiler.c_str(), makeArgs);
std::string fastTarget = targetName;
fastTarget += "/fast";
this->AppendTarget(fout, fastTarget, gt,
- make.c_str(), *lg, compiler.c_str());
+ make.c_str(), *lg, compiler.c_str(), makeArgs);
}
break;
default:
@@ -555,7 +558,8 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
cmGeneratorTarget* target,
const char* make,
const cmLocalGenerator* lg,
- const char* compiler)
+ const char* compiler,
+ const std::string& makeFlags)
{
cmMakefile const* makefile = lg->GetMakefile();
std::string makefileName = lg->GetCurrentBinaryDirectory();
@@ -663,16 +667,18 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
fout<<" <MakeCommands>\n"
" <Build command=\""
- << this->BuildMakeCommand(make, makefileName.c_str(), targetName)
+ << this->BuildMakeCommand(make, makefileName.c_str(), targetName,
+ makeFlags)
<< "\" />\n"
" <CompileFile command=\""
- << this->BuildMakeCommand(make, makefileName.c_str(),"&quot;$file&quot;")
+ << this->BuildMakeCommand(make, makefileName.c_str(),"&quot;$file&quot;",
+ makeFlags)
<< "\" />\n"
" <Clean command=\""
- << this->BuildMakeCommand(make, makefileName.c_str(), "clean")
+ << this->BuildMakeCommand(make, makefileName.c_str(), "clean", makeFlags)
<< "\" />\n"
" <DistClean command=\""
- << this->BuildMakeCommand(make, makefileName.c_str(), "clean")
+ << this->BuildMakeCommand(make, makefileName.c_str(), "clean", makeFlags)
<< "\" />\n"
" </MakeCommands>\n"
" </Target>\n";
@@ -684,18 +690,38 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf)
{
// figure out which language to use
- // for now care only for C and C++
- std::string compilerIdVar = "CMAKE_CXX_COMPILER_ID";
- if (this->GlobalGenerator->GetLanguageEnabled("CXX") == false)
+ // for now care only for C, C++, and Fortran
+
+ // projects with C/C++ and Fortran are handled as C/C++ projects
+ bool pureFortran = false;
+ std::string compilerIdVar;
+ if (this->GlobalGenerator->GetLanguageEnabled("CXX") == true)
+ {
+ compilerIdVar = "CMAKE_CXX_COMPILER_ID";
+ }
+ else if (this->GlobalGenerator->GetLanguageEnabled("C") == true)
{
compilerIdVar = "CMAKE_C_COMPILER_ID";
}
+ else if (this->GlobalGenerator->GetLanguageEnabled("Fortran") == true)
+ {
+ compilerIdVar = "CMAKE_Fortran_COMPILER_ID";
+ pureFortran = true;
+ }
+
std::string compilerId = mf->GetSafeDefinition(compilerIdVar);
std::string compiler = "gcc"; // default to gcc
if (compilerId == "MSVC")
{
- compiler = "msvc8";
+ if( mf->IsDefinitionSet("MSVC10") == true )
+ {
+ compiler = "msvc10";
+ }
+ else
+ {
+ compiler = "msvc8";
+ }
}
else if (compilerId == "Borland")
{
@@ -707,15 +733,44 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf)
}
else if (compilerId == "Intel")
{
- compiler = "icc";
+ if (pureFortran && mf->IsDefinitionSet("WIN32"))
+ {
+ compiler = "ifcwin"; // Intel Fortran for Windows (known by cbFortran)
+ }
+ else
+ {
+ compiler = "icc";
+ }
}
else if (compilerId == "Watcom" || compilerId == "OpenWatcom")
{
compiler = "ow";
}
+ else if (compilerId == "Clang")
+ {
+ compiler = "clang";
+ }
+ else if (compilerId == "PGI")
+ {
+ if (pureFortran)
+ {
+ compiler = "pgifortran";
+ }
+ else
+ {
+ compiler = "pgi"; // does not exist as default in CodeBlocks 16.01
+ }
+ }
else if (compilerId == "GNU")
{
- compiler = "gcc";
+ if (pureFortran)
+ {
+ compiler = "gfortran";
+ }
+ else
+ {
+ compiler = "gcc";
+ }
}
return compiler;
}
@@ -753,9 +808,15 @@ int cmExtraCodeBlocksGenerator::GetCBTargetType(cmGeneratorTarget* target)
// make
std::string cmExtraCodeBlocksGenerator::BuildMakeCommand(
const std::string& make, const char* makefile,
- const std::string& target)
+ const std::string& target, const std::string& makeFlags)
{
std::string command = make;
+ if (makeFlags.size() > 0)
+ {
+ command += " ";
+ command += makeFlags;
+ }
+
std::string generator = this->GlobalGenerator->GetName();
if (generator == "NMake Makefiles")
{
diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h
index 0c3846d..4abfa7e 100644
--- a/Source/cmExtraCodeBlocksGenerator.h
+++ b/Source/cmExtraCodeBlocksGenerator.h
@@ -54,13 +54,16 @@ private:
std::string GetCBCompilerId(const cmMakefile* mf);
int GetCBTargetType(cmGeneratorTarget* target);
std::string BuildMakeCommand(const std::string& make, const char* makefile,
- const std::string& target);
+ const std::string& target,
+ const std::string& makeFlags);
void AppendTarget(cmGeneratedFileStream& fout,
const std::string& targetName,
cmGeneratorTarget* target,
const char* make,
const cmLocalGenerator* lg,
- const char* compiler);
+ const char* compiler,
+ const std::string& makeFlags
+ );
};
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index aedf6f4..133a85a 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -42,6 +42,8 @@ cmExtraEclipseCDT4Generator
this->GenerateLinkedResources = true;
this->SupportsGmakeErrorParser = true;
this->SupportsMachO64Parser = true;
+ this->CEnabled = false;
+ this->CXXEnabled = false;
}
//----------------------------------------------------------------------------
@@ -64,10 +66,12 @@ void cmExtraEclipseCDT4Generator
{
this->Natures.insert("org.eclipse.cdt.core.ccnature");
this->Natures.insert("org.eclipse.cdt.core.cnature");
+ this->CXXEnabled = true;
}
else if (*lit == "C")
{
this->Natures.insert("org.eclipse.cdt.core.cnature");
+ this->CEnabled = true;
}
else if (*lit == "Java")
{
@@ -890,7 +894,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// add system defined c macros
const char* cDefs=mf->GetDefinition(
"CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS");
- if(cDefs)
+ if(this->CEnabled && cDefs)
{
// Expand the list.
std::vector<std::string> defs;
@@ -925,7 +929,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// add system defined c++ macros
const char* cxxDefs = mf->GetDefinition(
"CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS");
- if(cxxDefs)
+ if(this->CXXEnabled && cxxDefs)
{
// Expand the list.
std::vector<std::string> defs;
@@ -979,7 +983,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// CMakeSystemSpecificInformation.cmake. This makes Eclipse find the
// standard headers.
std::string compiler = mf->GetSafeDefinition("CMAKE_C_COMPILER");
- if (!compiler.empty())
+ if (this->CEnabled && !compiler.empty())
{
std::string systemIncludeDirs = mf->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
@@ -988,7 +992,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
this->AppendIncludeDirectories(fout, dirs, emmited);
}
compiler = mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
- if (!compiler.empty())
+ if (this->CXXEnabled && !compiler.empty())
{
std::string systemIncludeDirs = mf->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index 16675f2..1da2077 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -116,6 +116,8 @@ private:
bool SupportsVirtualFolders;
bool SupportsGmakeErrorParser;
bool SupportsMachO64Parser;
+ bool CEnabled;
+ bool CXXEnabled;
};
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index b3557f9..1fa27eb 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -3300,6 +3300,15 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
<< " status: [" << (int)res << ";\""
<< ::curl_easy_strerror(res) << "\"]" << std::endl
;
+
+ if(!statusVar.empty() && res == 0)
+ {
+ std::string status = "1;HASH mismatch: "
+ "expected: " + expectedHash +
+ " actual: " + actualHash;
+ this->Makefile->AddDefinition(statusVar, status.c_str());
+ }
+
this->SetError(oss.str());
return false;
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index ff12320..d7c2782 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3909,8 +3909,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender,
std::vector<std::string> props;
cmSystemTools::ExpandListArgument(prop, props);
- std::string pdir =
- dependee->Target->GetMakefile()->GetRequiredDefinition("CMAKE_ROOT");
+ std::string pdir = cmSystemTools::GetCMakeRoot();
pdir += "/Help/prop_tgt/";
for(std::vector<std::string>::iterator pi = props.begin();
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index d96a32c..65c29f5 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -599,7 +599,7 @@ private:
{
ImportInfo(): NoSOName(false), Multiplicity(0) {}
bool NoSOName;
- int Multiplicity;
+ unsigned int Multiplicity;
std::string Location;
std::string SOName;
std::string ImportLibrary;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 848028f..1d0ade4 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -398,6 +398,21 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
return;
}
+ std::set<std::string> cur_languages(languages.begin(), languages.end());
+ for (std::set<std::string>::iterator li = cur_languages.begin();
+ li != cur_languages.end(); ++li)
+ {
+ if (!this->LanguagesInProgress.insert(*li).second)
+ {
+ std::ostringstream e;
+ e << "Language '" << *li << "' is currently being enabled. "
+ "Recursive call not allowed.";
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ cmSystemTools::SetFatalErrorOccured();
+ return;
+ }
+ }
+
if(this->TryCompileOuterMakefile)
{
// In a try-compile we can only enable languages provided by caller.
@@ -805,7 +820,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
// Now load files that can override any settings on the platform or for
// the project First load the project compatibility file if it is in
// cmake
- std::string projectCompatibility = mf->GetDefinition("CMAKE_ROOT");
+ std::string projectCompatibility = cmSystemTools::GetCMakeRoot();
projectCompatibility += "/Modules/";
projectCompatibility += mf->GetSafeDefinition("PROJECT_NAME");
projectCompatibility += "Compatibility.cmake";
@@ -823,6 +838,12 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
{
cmSystemTools::SetFatalErrorOccured();
}
+
+ for (std::set<std::string>::iterator li = cur_languages.begin();
+ li != cur_languages.end(); ++li)
+ {
+ this->LanguagesInProgress.erase(*li);
+ }
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 48fa704..14c7d67 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -241,11 +241,6 @@ public:
*/
virtual void FindMakeProgram(cmMakefile*);
-#if defined(_WIN32) && !defined(__CYGWIN__)
- /** Is this the Visual Studio 6 generator? */
- bool IsForVS6() const { return this->GetName() == "Visual Studio 6"; }
-#endif
-
///! Find a target by name by searching the local generators.
cmTarget* FindTarget(const std::string& name,
bool excludeAliases = false) const;
@@ -457,6 +452,7 @@ private:
// in EnableLanguagesFromGenerator
std::map<std::string, bool> IgnoreExtensions;
std::set<std::string> LanguagesReady; // Ready for try_compile
+ std::set<std::string> LanguagesInProgress;
std::map<std::string, std::string> OutputExtensions;
std::map<std::string, std::string> LanguageToOutputExtension;
std::map<std::string, std::string> ExtensionToLanguage;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 0f06e43..83422b7 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -642,7 +642,6 @@ void cmGlobalNinjaGenerator
// cmGlobalUnixMakefileGenerator3
// cmGlobalGhsMultiGenerator
// cmGlobalVisualStudio10Generator
-// cmGlobalVisualStudio6Generator
// cmGlobalVisualStudio7Generator
// cmGlobalXCodeGenerator
// Called by:
@@ -991,6 +990,7 @@ cmGlobalNinjaGenerator
std::set<std::string> const& utils = target->GetUtilities();
std::copy(utils.begin(), utils.end(), std::back_inserter(outputs));
} else {
+ cmNinjaDeps outs;
cmTargetDependSet const& targetDeps = this->GetTargetDirectDepends(target);
for (cmTargetDependSet::const_iterator i = targetDeps.begin();
i != targetDeps.end(); ++i)
@@ -999,8 +999,10 @@ cmGlobalNinjaGenerator
{
continue;
}
- this->AppendTargetOutputs(*i, outputs);
+ this->AppendTargetOutputs(*i, outs);
}
+ std::sort(outs.begin(), outs.end());
+ outputs.insert(outputs.end(), outs.begin(), outs.end());
}
}
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
deleted file mode 100644
index 5866c0e..0000000
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ /dev/null
@@ -1,451 +0,0 @@
-/*============================================================================
- CMake - Cross Platform Makefile Generator
- Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
- Distributed under the OSI-approved BSD License (the "License");
- see accompanying file Copyright.txt for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License for more information.
-============================================================================*/
-#include "cmGlobalVisualStudio6Generator.h"
-#include "cmLocalVisualStudio6Generator.h"
-#include "cmMakefile.h"
-#include "cmake.h"
-#include "cmGeneratedFileStream.h"
-#include <cmsys/FStream.hxx>
-
-// Utility function to make a valid VS6 *.dsp filename out
-// of a CMake target name:
-//
-std::string GetVS6TargetName(const std::string& targetName)
-{
- std::string name(targetName);
-
- // Eliminate hyphens. VS6 cannot handle hyphens in *.dsp filenames...
- // Replace them with underscores.
- //
- cmSystemTools::ReplaceString(name, "-", "_");
-
- return name;
-}
-
-cmGlobalVisualStudio6Generator::cmGlobalVisualStudio6Generator(cmake* cm)
- : cmGlobalVisualStudioGenerator(cm)
-{
- this->MSDevCommandInitialized = false;
- this->Version = VS6;
-}
-
-void cmGlobalVisualStudio6Generator
-::EnableLanguage(std::vector<std::string>const& lang,
- cmMakefile *mf,
- bool optional)
-{
- mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
- mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
- this->GenerateConfigurations(mf);
- this->cmGlobalGenerator::EnableLanguage(lang, mf, optional);
-}
-
-void cmGlobalVisualStudio6Generator::GenerateConfigurations(cmMakefile* mf)
-{
- std::string fname= mf->GetRequiredDefinition("CMAKE_ROOT");
- const char* def= mf->GetDefinition( "MSPROJECT_TEMPLATE_DIRECTORY");
- if(def)
- {
- fname = def;
- }
- else
- {
- fname += "/Templates";
- }
- fname += "/CMakeVisualStudio6Configurations.cmake";
- if(!mf->ReadDependentFile(fname.c_str()))
- {
- cmSystemTools::Error("Cannot open ", fname.c_str(),
- ". Please copy this file from the main "
- "CMake/Templates directory and edit it for "
- "your build configurations.");
- }
- else if(!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::Error("CMAKE_CONFIGURATION_TYPES not set by ",
- fname.c_str(),
- ". Please copy this file from the main "
- "CMake/Templates directory and edit it for "
- "your build configurations.");
- }
-}
-
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio6Generator::FindMakeProgram(cmMakefile* mf)
-{
- this->cmGlobalVisualStudioGenerator::FindMakeProgram(mf);
- mf->AddDefinition("CMAKE_VS_MSDEV_COMMAND",
- this->GetMSDevCommand().c_str());
-}
-
-//----------------------------------------------------------------------------
-std::string const& cmGlobalVisualStudio6Generator::GetMSDevCommand()
-{
- if(!this->MSDevCommandInitialized)
- {
- this->MSDevCommandInitialized = true;
- this->MSDevCommand = this->FindMSDevCommand();
- }
- return this->MSDevCommand;
-}
-
-//----------------------------------------------------------------------------
-std::string cmGlobalVisualStudio6Generator::FindMSDevCommand()
-{
- std::string vscmd;
- std::string vskey = this->GetRegistryBase() + "\\Setup;VsCommonDir";
- if(cmSystemTools::ReadRegistryValue(vskey.c_str(), vscmd,
- cmSystemTools::KeyWOW64_32))
- {
- cmSystemTools::ConvertToUnixSlashes(vscmd);
- vscmd += "/MSDev98/Bin/";
- }
- vscmd += "msdev.exe";
- return vscmd;
-}
-
-//----------------------------------------------------------------------------
-void
-cmGlobalVisualStudio6Generator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand,
- const std::string& makeProgram,
- const std::string& projectName,
- const std::string& /*projectDir*/,
- const std::string& targetName,
- const std::string& config,
- bool /*fast*/, bool /*verbose*/,
- std::vector<std::string> const& makeOptions
- )
-{
- // now build the test
- makeCommand.push_back(
- this->SelectMakeProgram(makeProgram, this->GetMSDevCommand())
- );
-
- makeCommand.push_back(std::string(projectName)+".dsw");
- makeCommand.push_back("/MAKE");
- std::string targetArg;
- bool clean = false;
- std::string realTarget = targetName;
- if ( realTarget == "clean" )
- {
- clean = true;
- realTarget = "ALL_BUILD";
- }
- if (!realTarget.empty())
- {
- targetArg += realTarget;
- }
- else
- {
- targetArg += "ALL_BUILD";
- }
- targetArg += " - ";
- if(!config.empty())
- {
- targetArg += config;
- }
- else
- {
- targetArg += "Debug";
- }
- makeCommand.push_back(targetArg);
- if(clean)
- {
- makeCommand.push_back("/CLEAN");
- }
- else
- {
- makeCommand.push_back("/BUILD");
- }
- makeCommand.insert(makeCommand.end(),
- makeOptions.begin(), makeOptions.end());
-}
-
-///! Create a local generator appropriate to this Global Generator
-cmLocalGenerator *
-cmGlobalVisualStudio6Generator::CreateLocalGenerator(cmMakefile* mf)
-{
- return new cmLocalVisualStudio6Generator(this, mf);
-}
-
-
-void cmGlobalVisualStudio6Generator::Generate()
-{
- // first do the superclass method
- this->cmGlobalVisualStudioGenerator::Generate();
-
- // Now write out the DSW
- this->OutputDSWFile();
-
- if (!this->CMakeInstance->GetIsInTryCompile())
- {
- const char* cmakeWarnVS6 =
- this->CMakeInstance->GetState()->GetCacheEntryValue("CMAKE_WARN_VS6");
- if (!cmakeWarnVS6 || !cmSystemTools::IsOff(cmakeWarnVS6))
- {
- this->CMakeInstance->IssueMessage(
- cmake::WARNING,
- "The \"Visual Studio 6\" generator is deprecated "
- "and will be removed in a future version of CMake."
- "\n"
- "Add CMAKE_WARN_VS6=OFF to the cache to disable this warning."
- );
- }
- }
-}
-
-// Write a DSW file to the stream
-void cmGlobalVisualStudio6Generator
-::WriteDSWFile(std::ostream& fout,cmLocalGenerator* root,
- std::vector<cmLocalGenerator*>& generators)
-{
- // Write out the header for a DSW file
- this->WriteDSWHeader(fout);
-
- // Collect all targets under this root generator and the transitive
- // closure of their dependencies.
- TargetDependSet projectTargets;
- TargetDependSet originalTargets;
- this->GetTargetSets(projectTargets, originalTargets, root, generators);
- OrderedTargetDependSet orderedProjectTargets(projectTargets, "ALL_BUILD");
-
- for(OrderedTargetDependSet::const_iterator
- tt = orderedProjectTargets.begin();
- tt != orderedProjectTargets.end(); ++tt)
- {
- cmGeneratorTarget const* target = *tt;
- if(target->GetType() == cmState::INTERFACE_LIBRARY)
- {
- continue;
- }
- // Write the project into the DSW file
- const char* expath = target->GetProperty("EXTERNAL_MSPROJECT");
- if(expath)
- {
- std::string project = target->GetName();
- std::string location = expath;
- this->WriteExternalProject(fout, project.c_str(),
- location.c_str(), target->GetUtilities());
- }
- else
- {
- std::string dspname = GetVS6TargetName(target->GetName());
- std::string dir =
- target->GetLocalGenerator()->GetCurrentBinaryDirectory();
- dir = root->Convert(dir.c_str(), cmLocalGenerator::START_OUTPUT);
- this->WriteProject(fout, dspname.c_str(), dir.c_str(), target);
- }
- }
-
- // Write the footer for the DSW file
- this->WriteDSWFooter(fout);
-}
-
-void cmGlobalVisualStudio6Generator
-::OutputDSWFile(cmLocalGenerator* root,
- std::vector<cmLocalGenerator*>& generators)
-{
- if(generators.empty())
- {
- return;
- }
- std::string fname = root->GetMakefile()->GetCurrentBinaryDirectory();
- fname += "/";
- fname += root->GetProjectName();
- fname += ".dsw";
- cmsys::ofstream fout(fname.c_str());
- if(!fout)
- {
- cmSystemTools::Error("Error can not open DSW file for write: ",
- fname.c_str());
- cmSystemTools::ReportLastSystemError("");
- return;
- }
- this->WriteDSWFile(fout, root, generators);
-}
-
-// output the DSW file
-void cmGlobalVisualStudio6Generator::OutputDSWFile()
-{
- std::map<std::string, std::vector<cmLocalGenerator*> >::iterator it;
- for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
- {
- this->OutputDSWFile(it->second[0], it->second);
- }
-}
-
-// Write a dsp file into the DSW file,
-// Note, that dependencies from executables to
-// the libraries it uses are also done here
-void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout,
- const std::string& dspname,
- const char* dir,
- const cmGeneratorTarget *target)
-{
- fout << "#########################################################"
- "######################\n\n";
- fout << "Project: \"" << dspname << "\"="
- << dir << "\\" << dspname << ".dsp - Package Owner=<4>\n\n";
- fout << "Package=<5>\n{{{\n}}}\n\n";
- fout << "Package=<4>\n";
- fout << "{{{\n";
- VSDependSet const& depends = this->VSTargetDepends[target];
- for(VSDependSet::const_iterator di = depends.begin();
- di != depends.end(); ++di)
- {
- const char* name = di->c_str();
- fout << "Begin Project Dependency\n";
- fout << "Project_Dep_Name " << GetVS6TargetName(name) << "\n";
- fout << "End Project Dependency\n";
- }
- fout << "}}}\n\n";
-
- UtilityDependsMap::iterator ui = this->UtilityDepends.find(target);
- if(ui != this->UtilityDepends.end())
- {
- const char* uname = ui->second.c_str();
- fout << "Project: \"" << uname << "\"="
- << dir << "\\" << uname << ".dsp - Package Owner=<4>\n\n";
- fout <<
- "Package=<5>\n{{{\n}}}\n\n"
- "Package=<4>\n"
- "{{{\n"
- "Begin Project Dependency\n"
- "Project_Dep_Name " << dspname << "\n"
- "End Project Dependency\n"
- "}}}\n\n";
- ;
- }
-}
-
-
-// Write a dsp file into the DSW file,
-// Note, that dependencies from executables to
-// the libraries it uses are also done here
-void cmGlobalVisualStudio6Generator::WriteExternalProject(std::ostream& fout,
- const std::string& name,
- const char* location,
- const std::set<std::string>& dependencies)
-{
- fout << "#########################################################"
- "######################\n\n";
- fout << "Project: \"" << name << "\"="
- << location << " - Package Owner=<4>\n\n";
- fout << "Package=<5>\n{{{\n}}}\n\n";
- fout << "Package=<4>\n";
- fout << "{{{\n";
-
-
- std::set<std::string>::const_iterator i, end;
- // write dependencies.
- i = dependencies.begin();
- end = dependencies.end();
- for(;i!= end; ++i)
- {
- fout << "Begin Project Dependency\n";
- fout << "Project_Dep_Name " << GetVS6TargetName(*i) << "\n";
- fout << "End Project Dependency\n";
- }
- fout << "}}}\n\n";
-}
-
-
-
-// Standard end of dsw file
-void cmGlobalVisualStudio6Generator::WriteDSWFooter(std::ostream& fout)
-{
- fout << "######################################################"
- "#########################\n\n";
- fout << "Global:\n\n";
- fout << "Package=<5>\n{{{\n}}}\n\n";
- fout << "Package=<3>\n{{{\n}}}\n\n";
- fout << "#####################################################"
- "##########################\n\n";
-}
-
-
-// ouput standard header for dsw file
-void cmGlobalVisualStudio6Generator::WriteDSWHeader(std::ostream& fout)
-{
- fout << "Microsoft Developer Studio Workspace File, Format Version 6.00\n";
- fout << "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n\n";
-}
-
-//----------------------------------------------------------------------------
-std::string
-cmGlobalVisualStudio6Generator::WriteUtilityDepend(
- const cmGeneratorTarget *target)
-{
- std::string pname = target->GetName();
- pname += "_UTILITY";
- pname = GetVS6TargetName(pname.c_str());
- std::string fname =
- target->GetLocalGenerator()->GetCurrentBinaryDirectory();
- fname += "/";
- fname += pname;
- fname += ".dsp";
- cmGeneratedFileStream fout(fname.c_str());
- fout.SetCopyIfDifferent(true);
- fout <<
- "# Microsoft Developer Studio Project File - Name=\""
- << pname << "\" - Package Owner=<4>\n"
- "# Microsoft Developer Studio Generated Build File, Format Version 6.00\n"
- "# ** DO NOT EDIT **\n"
- "\n"
- "# TARGTYPE \"Win32 (x86) Generic Project\" 0x010a\n"
- "\n"
- "CFG=" << pname << " - Win32 Debug\n"
- "!MESSAGE \"" << pname << " - Win32 Debug\""
- " (based on \"Win32 (x86) Generic Project\")\n"
- "!MESSAGE \"" << pname << " - Win32 Release\" "
- "(based on \"Win32 (x86) Generic Project\")\n"
- "!MESSAGE \"" << pname << " - Win32 MinSizeRel\" "
- "(based on \"Win32 (x86) Generic Project\")\n"
- "!MESSAGE \"" << pname << " - Win32 RelWithDebInfo\" "
- "(based on \"Win32 (x86) Generic Project\")\n"
- "\n"
- "# Begin Project\n"
- "# Begin Target\n"
- "# Name \"" << pname << " - Win32 Debug\"\n"
- "# Name \"" << pname << " - Win32 Release\"\n"
- "# Name \"" << pname << " - Win32 MinSizeRel\"\n"
- "# Name \"" << pname << " - Win32 RelWithDebInfo\"\n"
- "# End Target\n"
- "# End Project\n"
- ;
- return pname;
-}
-
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio6Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
- entry.Name = cmGlobalVisualStudio6Generator::GetActualName();
- entry.Brief = "Deprecated. Generates Visual Studio 6 project files.";
-}
-
-//----------------------------------------------------------------------------
-void
-cmGlobalVisualStudio6Generator
-::AppendDirectoryForConfig(const std::string& prefix,
- const std::string& config,
- const std::string& suffix,
- std::string& dir)
-{
- if(!config.empty())
- {
- dir += prefix;
- dir += config;
- dir += suffix;
- }
-}
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
deleted file mode 100644
index ae2988e..0000000
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*============================================================================
- CMake - Cross Platform Makefile Generator
- Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
- Distributed under the OSI-approved BSD License (the "License");
- see accompanying file Copyright.txt for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License for more information.
-============================================================================*/
-#ifndef cmGlobalVisualStudio6Generator_h
-#define cmGlobalVisualStudio6Generator_h
-
-#include "cmGlobalVisualStudioGenerator.h"
-#include "cmGlobalGeneratorFactory.h"
-
-/** \class cmGlobalVisualStudio6Generator
- * \brief Write a Unix makefiles.
- *
- * cmGlobalVisualStudio6Generator manages UNIX build process for a tree
- */
-class cmGlobalVisualStudio6Generator : public cmGlobalVisualStudioGenerator
-{
-public:
- cmGlobalVisualStudio6Generator(cmake* cm);
- static cmGlobalGeneratorFactory* NewFactory() {
- return new cmGlobalGeneratorSimpleFactory
- <cmGlobalVisualStudio6Generator>(); }
-
- ///! Get the name for the generator.
- virtual std::string GetName() const {
- return cmGlobalVisualStudio6Generator::GetActualName();}
- static std::string GetActualName() {return "Visual Studio 6";}
-
- /** Get the documentation entry for this generator. */
- static void GetDocumentation(cmDocumentationEntry& entry);
-
- /**
- * Utilized by the generator factory to determine if this generator
- * supports toolsets.
- */
- static bool SupportsToolset() { return false; }
-
- ///! Create a local generator appropriate to this Global Generator
- virtual cmLocalGenerator *CreateLocalGenerator(cmMakefile* mf);
-
- /**
- * Try to determine system information such as shared library
- * extension, pthreads, byte order etc.
- */
- virtual void EnableLanguage(std::vector<std::string>const& languages,
- cmMakefile *, bool optional);
-
- /**
- * Try running cmake and building a file. This is used for dynalically
- * loaded commands, not as part of the usual build process.
- */
- virtual void GenerateBuildCommand(
- std::vector<std::string>& makeCommand,
- const std::string& makeProgram,
- const std::string& projectName,
- const std::string& projectDir,
- const std::string& targetName,
- const std::string& config,
- bool fast, bool verbose,
- std::vector<std::string> const& makeOptions = std::vector<std::string>()
- );
-
- /**
- * Generate the DSW workspace file.
- */
- virtual void OutputDSWFile();
- virtual void OutputDSWFile(cmLocalGenerator* root,
- std::vector<cmLocalGenerator*>& generators);
- virtual void WriteDSWFile(std::ostream& fout,
- cmLocalGenerator* root,
- std::vector<cmLocalGenerator*>& generators);
-
- /** Append the subdirectory for the given configuration. */
- virtual void AppendDirectoryForConfig(const std::string& prefix,
- const std::string& config,
- const std::string& suffix,
- std::string& dir);
-
- ///! What is the configurations directory variable called?
- virtual const char* GetCMakeCFGIntDir() const { return "$(IntDir)"; }
-
- virtual void FindMakeProgram(cmMakefile*);
-
-protected:
- virtual void Generate();
- virtual const char* GetIDEVersion() { return "6.0"; }
-private:
- virtual std::string GetVSMakeProgram() { return this->GetMSDevCommand(); }
- void GenerateConfigurations(cmMakefile* mf);
- void WriteDSWFile(std::ostream& fout);
- void WriteDSWHeader(std::ostream& fout);
- void WriteProject(std::ostream& fout,
- const std::string& name, const char* path,
- cmGeneratorTarget const* t);
- void WriteExternalProject(std::ostream& fout,
- const std::string& name, const char* path,
- const std::set<std::string>& dependencies);
- void WriteDSWFooter(std::ostream& fout);
- virtual std::string WriteUtilityDepend(const cmGeneratorTarget *target);
- std::string MSDevCommand;
- bool MSDevCommandInitialized;
- std::string const& GetMSDevCommand();
- std::string FindMSDevCommand();
-};
-
-#endif
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index f5848ab..c1c8c77 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -335,23 +335,6 @@ void cmGlobalVisualStudio7Generator::Generate()
{
this->CallVisualStudioMacro(MacroReload);
}
-
- if (!this->CMakeInstance->GetIsInTryCompile() &&
- this->GetName() == "Visual Studio 7")
- {
- const char* cmakeWarnVS70 =
- this->CMakeInstance->GetState()->GetCacheEntryValue("CMAKE_WARN_VS70");
- if (!cmakeWarnVS70 || !cmSystemTools::IsOff(cmakeWarnVS70))
- {
- this->CMakeInstance->IssueMessage(
- cmake::WARNING,
- "The \"Visual Studio 7\" generator is deprecated "
- "and will be removed in a future version of CMake."
- "\n"
- "Add CMAKE_WARN_VS70=OFF to the cache to disable this warning."
- );
- }
- }
}
void cmGlobalVisualStudio7Generator
@@ -551,71 +534,6 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends(
}
//----------------------------------------------------------------------------
-// Write a SLN file to the stream
-void cmGlobalVisualStudio7Generator
-::WriteSLNFile(std::ostream& fout,
- cmLocalGenerator* root,
- std::vector<cmLocalGenerator*>& generators)
-{
- std::vector<std::string> configs;
- root->GetMakefile()->GetConfigurations(configs);
-
- // Write out the header for a SLN file
- this->WriteSLNHeader(fout);
-
- // Collect all targets under this root generator and the transitive
- // closure of their dependencies.
- TargetDependSet projectTargets;
- TargetDependSet originalTargets;
- this->GetTargetSets(projectTargets, originalTargets, root, generators);
- OrderedTargetDependSet orderedProjectTargets(projectTargets, "ALL_BUILD");
-
- this->WriteTargetsToSolution(fout, root, orderedProjectTargets);
-
- bool useFolderProperty = this->UseFolderProperty();
- if (useFolderProperty)
- {
- this->WriteFolders(fout);
- }
-
- // Write out the configurations information for the solution
- fout << "Global\n"
- << "\tGlobalSection(SolutionConfiguration) = preSolution\n";
-
- int c = 0;
- for(std::vector<std::string>::iterator i = configs.begin();
- i != configs.end(); ++i)
- {
- fout << "\t\tConfigName." << c << " = " << *i << "\n";
- c++;
- }
- fout << "\tEndGlobalSection\n";
- // Write out project(target) depends
- fout << "\tGlobalSection(ProjectDependencies) = postSolution\n";
- this->WriteTargetDepends(fout, orderedProjectTargets);
- fout << "\tEndGlobalSection\n";
-
- if (useFolderProperty)
- {
- // Write out project folders
- fout << "\tGlobalSection(NestedProjects) = preSolution\n";
- this->WriteFoldersContent(fout);
- fout << "\tEndGlobalSection\n";
- }
-
- // Write out the configurations for all the targets in the project
- fout << "\tGlobalSection(ProjectConfiguration) = postSolution\n";
- this->WriteTargetConfigurations(fout, configs, orderedProjectTargets);
- fout << "\tEndGlobalSection\n";
-
- // Write out global sections
- this->WriteSLNGlobalSections(fout, root);
-
- // Write the footer for the SLN file
- this->WriteSLNFooter(fout);
-}
-
-//----------------------------------------------------------------------------
void cmGlobalVisualStudio7Generator::WriteFolders(std::ostream& fout)
{
const char *prefix = "CMAKE_FOLDER_GUID_";
@@ -680,134 +598,6 @@ cmGlobalVisualStudio7Generator::ConvertToSolutionPath(const char* path)
return d;
}
-// Write a dsp file into the SLN file,
-// Note, that dependencies from executables to
-// the libraries it uses are also done here
-void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
- const std::string& dspname,
- const char* dir,
- cmGeneratorTarget const* target)
-{
- // check to see if this is a fortran build
- const char* ext = ".vcproj";
- const char* project =
- "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"";
- if(this->TargetIsFortranOnly(target))
- {
- ext = ".vfproj";
- project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \"";
- }
-
- fout << project
- << dspname << "\", \""
- << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"")
- << dspname << ext << "\", \"{"
- << this->GetGUID(dspname) << "}\"\nEndProject\n";
-
- UtilityDependsMap::iterator ui = this->UtilityDepends.find(target);
- if(ui != this->UtilityDepends.end())
- {
- const char* uname = ui->second.c_str();
- fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
- << uname << "\", \""
- << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"")
- << uname << ".vcproj" << "\", \"{"
- << this->GetGUID(uname) << "}\"\n"
- << "EndProject\n";
- }
-}
-
-
-
-// Write a dsp file into the SLN file,
-// Note, that dependencies from executables to
-// the libraries it uses are also done here
-void
-cmGlobalVisualStudio7Generator
-::WriteProjectDepends(std::ostream& fout,
- const std::string& dspname,
- const char*, cmGeneratorTarget const* target)
-{
- int depcount = 0;
- std::string dspguid = this->GetGUID(dspname);
- VSDependSet const& depends = this->VSTargetDepends[target];
- for(VSDependSet::const_iterator di = depends.begin();
- di != depends.end(); ++di)
- {
- const char* name = di->c_str();
- std::string guid = this->GetGUID(name);
- if(guid.empty())
- {
- std::string m = "Target: ";
- m += target->GetName();
- m += " depends on unknown target: ";
- m += name;
- cmSystemTools::Error(m.c_str());
- }
- fout << "\t\t{" << dspguid << "}." << depcount << " = {" << guid << "}\n";
- depcount++;
- }
-
- UtilityDependsMap::iterator ui = this->UtilityDepends.find(target);
- if(ui != this->UtilityDepends.end())
- {
- const char* uname = ui->second.c_str();
- fout << "\t\t{" << this->GetGUID(uname) << "}.0 = {" << dspguid << "}\n";
- }
-}
-
-
-// Write a dsp file into the SLN file, Note, that dependencies from
-// executables to the libraries it uses are also done here
-void cmGlobalVisualStudio7Generator
-::WriteProjectConfigurations(
- std::ostream& fout, const std::string& name, cmState::TargetType,
- std::vector<std::string> const& configs,
- const std::set<std::string>& configsPartOfDefaultBuild,
- const std::string& platformMapping)
-{
- const std::string& platformName =
- !platformMapping.empty() ? platformMapping : this->GetPlatformName();
- std::string guid = this->GetGUID(name);
- for(std::vector<std::string>::const_iterator i = configs.begin();
- i != configs.end(); ++i)
- {
- fout << "\t\t{" << guid << "}." << *i
- << ".ActiveCfg = " << *i << "|" << platformName << "\n";
- std::set<std::string>::const_iterator
- ci = configsPartOfDefaultBuild.find(*i);
- if(!(ci == configsPartOfDefaultBuild.end()))
- {
- fout << "\t\t{" << guid << "}." << *i
- << ".Build.0 = " << *i << "|" << platformName << "\n";
- }
- }
-}
-
-
-
-// Write a dsp file into the SLN file,
-// Note, that dependencies from executables to
-// the libraries it uses are also done here
-void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout,
- const std::string& name,
- const char* location,
- const char* typeGuid,
- const std::set<std::string>&)
-{
- fout << "Project("
- << "\"{"
- << (typeGuid ? typeGuid : this->ExternalProjectType(location))
- << "}\") = \""
- << name << "\", \""
- << this->ConvertToSolutionPath(location) << "\", \"{"
- << this->GetGUID(name)
- << "}\"\n";
- fout << "EndProject\n";
-}
-
-
-
void cmGlobalVisualStudio7Generator
::WriteSLNGlobalSections(std::ostream& fout,
cmLocalGenerator* root)
@@ -871,21 +661,12 @@ void cmGlobalVisualStudio7Generator
<< "\tEndGlobalSection\n";
}
-
-
// Standard end of dsw file
void cmGlobalVisualStudio7Generator::WriteSLNFooter(std::ostream& fout)
{
fout << "EndGlobal\n";
}
-
-// ouput standard header for dsw file
-void cmGlobalVisualStudio7Generator::WriteSLNHeader(std::ostream& fout)
-{
- fout << "Microsoft Visual Studio Solution File, Format Version 7.00\n";
-}
-
//----------------------------------------------------------------------------
std::string
cmGlobalVisualStudio7Generator::WriteUtilityDepend(
@@ -970,14 +751,6 @@ std::string cmGlobalVisualStudio7Generator::GetGUID(std::string const& name)
}
//----------------------------------------------------------------------------
-void cmGlobalVisualStudio7Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
- entry.Name = cmGlobalVisualStudio7Generator::GetActualName();
- entry.Brief = "Deprecated. Generates Visual Studio .NET 2002 project files.";
-}
-
-//----------------------------------------------------------------------------
void
cmGlobalVisualStudio7Generator
::AppendDirectoryForConfig(const std::string& prefix,
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index de2d35e..02f9809 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -30,15 +30,6 @@ public:
const std::string& platformName = "");
~cmGlobalVisualStudio7Generator();
- static cmGlobalGeneratorFactory* NewFactory() {
- return new cmGlobalGeneratorSimpleFactory
- <cmGlobalVisualStudio7Generator>(); }
-
- ///! Get the name for the generator.
- virtual std::string GetName() const {
- return cmGlobalVisualStudio7Generator::GetActualName();}
- static std::string GetActualName() {return "Visual Studio 7";}
-
///! Get the name for the platform.
std::string const& GetPlatformName() const;
@@ -49,9 +40,6 @@ public:
virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
- /** Get the documentation entry for this generator. */
- static void GetDocumentation(cmDocumentationEntry& entry);
-
/**
* Utilized by the generator factory to determine if this generator
* supports toolsets.
@@ -117,7 +105,7 @@ public:
protected:
virtual void Generate();
- virtual const char* GetIDEVersion() { return "7.0"; }
+ virtual const char* GetIDEVersion() = 0;
std::string const& GetDevEnvCommand();
virtual std::string FindDevEnvCommand();
@@ -127,22 +115,22 @@ protected:
virtual void OutputSLNFile(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
- std::vector<cmLocalGenerator*>& generators);
+ std::vector<cmLocalGenerator*>& generators) = 0;
virtual void WriteProject(std::ostream& fout,
const std::string& name, const char* path,
- const cmGeneratorTarget *t);
+ const cmGeneratorTarget *t) = 0;
virtual void WriteProjectDepends(std::ostream& fout,
const std::string& name, const char* path,
- cmGeneratorTarget const* t);
+ cmGeneratorTarget const* t) = 0;
virtual void WriteProjectConfigurations(
std::ostream& fout, const std::string& name, cmState::TargetType type,
std::vector<std::string> const& configs,
const std::set<std::string>& configsPartOfDefaultBuild,
- const std::string& platformMapping = "");
+ const std::string& platformMapping = "") = 0;
virtual void WriteSLNGlobalSections(std::ostream& fout,
cmLocalGenerator* root);
virtual void WriteSLNFooter(std::ostream& fout);
- virtual void WriteSLNHeader(std::ostream& fout);
+ virtual void WriteSLNHeader(std::ostream& fout) = 0;
virtual std::string WriteUtilityDepend(const cmGeneratorTarget *target);
virtual void WriteTargetsToSolution(
@@ -162,7 +150,7 @@ protected:
const char* path,
const char* typeGuid,
const std::set<std::string>&
- dependencies);
+ dependencies) = 0;
std::string ConvertToSolutionPath(const char* path);
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 6a1aa29..00bb511 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -184,12 +184,11 @@ void RegisterVisualStudioMacros(const std::string& macrosFile,
//----------------------------------------------------------------------------
void cmGlobalVisualStudioGenerator::ConfigureCMakeVisualStudioMacros()
{
- cmMakefile* mf = this->LocalGenerators[0]->GetMakefile();
std::string dir = this->GetUserMacrosDirectory();
if (dir != "")
{
- std::string src = mf->GetRequiredDefinition("CMAKE_ROOT");
+ std::string src = cmSystemTools::GetCMakeRoot();
src += "/Templates/" CMAKE_VSMACROS_FILENAME;
std::string dst = dir + "/CMakeMacros/" CMAKE_VSMACROS_FILENAME;
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index f827f26..ac9111e 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -26,7 +26,6 @@ public:
/** Known versions of Visual Studio. */
enum VSVersion
{
- VS6 = 60,
VS7 = 70,
VS71 = 71,
VS8 = 80,
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 526e32f..7c85281 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -593,19 +593,28 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
cmGeneratedFileStream makefileStream
(this->CurrentReRunCMakeMakefile.c_str());
makefileStream.SetCopyIfDifferent(true);
- makefileStream << "# Generated by CMake, DO NOT EDIT\n";
- std::string checkCache = root->GetBinaryDirectory();
- checkCache += "/";
- checkCache += cmake::GetCMakeFilesDirectoryPostSlash();
- checkCache += "cmake.check_cache";
- makefileStream << this->ConvertToRelativeForMake(checkCache.c_str())
- << ": ";
+ makefileStream << "# Generated by CMake, DO NOT EDIT\n\n";
+
+ makefileStream << "empty:= \n";
+ makefileStream << "space:= $(empty) $(empty)\n";
+ makefileStream << "spaceplus:= $(empty)\\ $(empty)\n\n";
+
for(std::vector<std::string>::const_iterator i = lfiles.begin();
i != lfiles.end(); ++i)
{
- makefileStream << "\\\n" << this->ConvertToRelativeForMake(i->c_str());
+ makefileStream << "TARGETS += $(subst $(space),$(spaceplus),$(wildcard "
+ << this->ConvertToRelativeForMake(i->c_str())
+ << "))\n";
}
- makefileStream << "\n\t" <<
+
+ std::string checkCache = root->GetBinaryDirectory();
+ checkCache += "/";
+ checkCache += cmake::GetCMakeFilesDirectoryPostSlash();
+ checkCache += "cmake.check_cache";
+
+ makefileStream << "\n" << this->ConvertToRelativeForMake(checkCache.c_str())
+ << ": $(TARGETS)\n";
+ makefileStream << "\t" <<
this->ConvertToRelativeForMake(cmSystemTools::GetCMakeCommand().c_str())
<< " -H" << this->ConvertToRelativeForMake(
root->GetSourceDirectory())
@@ -2805,7 +2814,10 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmGeneratorTarget* gtgt,
fullName = gtgt->GetFullName(defConfig.c_str());
}
fileRef->AddAttribute("path", this->CreateString(fullName.c_str()));
- fileRef->AddAttribute("refType", this->CreateString("0"));
+ if(this->XcodeVersion == 15)
+ {
+ fileRef->AddAttribute("refType", this->CreateString("0"));
+ }
fileRef->AddAttribute("sourceTree",
this->CreateString("BUILT_PRODUCTS_DIR"));
fileRef->SetComment(gtgt->GetName().c_str());
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 2d78a41..26a1485 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -33,6 +33,7 @@ static cmInstallTargetGenerator* CreateInstallTargetGenerator(cmTarget& target,
impLib, args.GetPermissions().c_str(),
args.GetConfigurations(), args.GetComponent().c_str(),
message,
+ args.GetExcludeFromAll(),
args.GetOptional() || forceOpt);
}
@@ -48,7 +49,8 @@ static cmInstallFilesGenerator* CreateInstallFilesGenerator(
programs, args.GetPermissions().c_str(),
args.GetConfigurations(), args.GetComponent().c_str(),
message,
- args.GetRename().c_str(), args.GetOptional());
+ args.GetExcludeFromAll(), args.GetRename().c_str(),
+ args.GetOptional());
}
@@ -117,6 +119,7 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
int componentCount = 0;
bool doing_script = false;
bool doing_code = false;
+ bool exclude_from_all = false;
// Scan the args once for COMPONENT. Only allow one.
//
@@ -128,6 +131,10 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
++i;
component = args[i];
}
+ if(args[i] == "EXCLUDE_FROM_ALL")
+ {
+ exclude_from_all = true;
+ }
}
if(componentCount>1)
@@ -175,7 +182,7 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
}
this->Makefile->AddInstallGenerator(
new cmInstallScriptGenerator(script.c_str(), false,
- component.c_str()));
+ component.c_str(), exclude_from_all));
}
else if(doing_code)
{
@@ -183,7 +190,7 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
std::string code = args[i];
this->Makefile->AddInstallGenerator(
new cmInstallScriptGenerator(code.c_str(), true,
- component.c_str()));
+ component.c_str(), exclude_from_all));
}
}
@@ -949,6 +956,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
Doing doing = DoingDirs;
bool in_match_mode = false;
bool optional = false;
+ bool exclude_from_all = false;
bool message_never = false;
std::vector<std::string> dirs;
const char* destination = 0;
@@ -1130,6 +1138,19 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
// Switch to setting the component property.
doing = DoingComponent;
}
+ else if(args[i] == "EXCLUDE_FROM_ALL")
+ {
+ if(in_match_mode)
+ {
+ std::ostringstream e;
+ e << args[0] << " does not allow \""
+ << args[i] << "\" after PATTERN or REGEX.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
+ exclude_from_all = true;
+ doing = DoingNone;
+ }
else if(doing == DoingDirs)
{
// Convert this directory to a full path.
@@ -1273,6 +1294,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
configurations,
component.c_str(),
message,
+ exclude_from_all,
literal_args.c_str(),
optional));
@@ -1403,7 +1425,8 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
exportSet,
ica.GetDestination().c_str(),
ica.GetPermissions().c_str(), ica.GetConfigurations(),
- ica.GetComponent().c_str(), message, fname.c_str(),
+ ica.GetComponent().c_str(), message,
+ ica.GetExcludeFromAll(), fname.c_str(),
name_space.GetCString(), exportOld.IsEnabled());
this->Makefile->AddInstallGenerator(exportGenerator);
diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx
index 236ca1f..6ded365 100644
--- a/Source/cmInstallCommandArguments.cxx
+++ b/Source/cmInstallCommandArguments.cxx
@@ -27,14 +27,15 @@ cmInstallCommandArguments::cmInstallCommandArguments(
const std::string& defaultComponent)
:Parser()
,ArgumentGroup()
-,Destination (&Parser, "DESTINATION" , &ArgumentGroup)
-,Component (&Parser, "COMPONENT" , &ArgumentGroup)
-,Rename (&Parser, "RENAME" , &ArgumentGroup)
-,Permissions (&Parser, "PERMISSIONS" , &ArgumentGroup)
-,Configurations(&Parser, "CONFIGURATIONS", &ArgumentGroup)
-,Optional (&Parser, "OPTIONAL" , &ArgumentGroup)
-,NamelinkOnly (&Parser, "NAMELINK_ONLY" , &ArgumentGroup)
-,NamelinkSkip (&Parser, "NAMELINK_SKIP" , &ArgumentGroup)
+,Destination (&Parser, "DESTINATION" , &ArgumentGroup)
+,Component (&Parser, "COMPONENT" , &ArgumentGroup)
+,ExcludeFromAll(&Parser, "EXCLUDE_FROM_ALL", &ArgumentGroup)
+,Rename (&Parser, "RENAME" , &ArgumentGroup)
+,Permissions (&Parser, "PERMISSIONS" , &ArgumentGroup)
+,Configurations(&Parser, "CONFIGURATIONS" , &ArgumentGroup)
+,Optional (&Parser, "OPTIONAL" , &ArgumentGroup)
+,NamelinkOnly (&Parser, "NAMELINK_ONLY" , &ArgumentGroup)
+,NamelinkSkip (&Parser, "NAMELINK_SKIP" , &ArgumentGroup)
,GenericArguments(0)
,DefaultComponentName(defaultComponent)
{
@@ -110,6 +111,19 @@ bool cmInstallCommandArguments::GetOptional() const
return false;
}
+bool cmInstallCommandArguments::GetExcludeFromAll() const
+{
+ if (this->ExcludeFromAll.IsEnabled())
+ {
+ return true;
+ }
+ if (this->GenericArguments!=0)
+ {
+ return this->GenericArguments->GetExcludeFromAll();
+ }
+ return false;
+}
+
bool cmInstallCommandArguments::GetNamelinkOnly() const
{
if (this->NamelinkOnly.IsEnabled())
diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h
index 90347e6..694f1ed 100644
--- a/Source/cmInstallCommandArguments.h
+++ b/Source/cmInstallCommandArguments.h
@@ -30,6 +30,7 @@ class cmInstallCommandArguments
const std::string& GetDestination() const;
const std::string& GetComponent() const;
+ bool GetExcludeFromAll() const;
const std::string& GetRename() const;
const std::string& GetPermissions() const;
const std::vector<std::string>& GetConfigurations() const;
@@ -48,6 +49,7 @@ class cmInstallCommandArguments
cmInstallCommandArguments(); // disabled
cmCAString Destination;
cmCAString Component;
+ cmCAEnabler ExcludeFromAll;
cmCAString Rename;
cmCAStringVector Permissions;
cmCAStringVector Configurations;
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index f2e8609..6ad6c75 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -23,9 +23,11 @@ cmInstallDirectoryGenerator
std::vector<std::string> const& configurations,
const char* component,
MessageLevel message,
+ bool exclude_from_all,
const char* literal_args,
bool optional):
- cmInstallGenerator(dest, configurations, component, message),
+ cmInstallGenerator(dest, configurations, component, message,
+ exclude_from_all),
LocalGenerator(0),
Directories(dirs),
FilePermissions(file_permissions), DirPermissions(dir_permissions),
diff --git a/Source/cmInstallDirectoryGenerator.h b/Source/cmInstallDirectoryGenerator.h
index 9b732d3..b137f44 100644
--- a/Source/cmInstallDirectoryGenerator.h
+++ b/Source/cmInstallDirectoryGenerator.h
@@ -27,6 +27,7 @@ public:
std::vector<std::string> const& configurations,
const char* component,
MessageLevel message,
+ bool exclude_from_all,
const char* literal_args,
bool optional = false);
virtual ~cmInstallDirectoryGenerator();
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index 9570ba3..80fc054 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -33,9 +33,11 @@ cmInstallExportGenerator::cmInstallExportGenerator(
std::vector<std::string> const& configurations,
const char* component,
MessageLevel message,
+ bool exclude_from_all,
const char* filename, const char* name_space,
bool exportOld)
- :cmInstallGenerator(destination, configurations, component, message)
+ :cmInstallGenerator(destination, configurations, component, message,
+ exclude_from_all)
,ExportSet(exportSet)
,FilePermissions(file_permissions)
,FileName(filename)
diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h
index 885ed05..1b1c046 100644
--- a/Source/cmInstallExportGenerator.h
+++ b/Source/cmInstallExportGenerator.h
@@ -31,6 +31,7 @@ public:
const std::vector<std::string>& configurations,
const char* component,
MessageLevel message,
+ bool exclude_from_all,
const char* filename, const char* name_space,
bool exportOld);
~cmInstallExportGenerator();
diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx
index 68557bd..d3d258e 100644
--- a/Source/cmInstallFilesCommand.cxx
+++ b/Source/cmInstallFilesCommand.cxx
@@ -122,6 +122,7 @@ void cmInstallFilesCommand::CreateInstallGenerator() const
// Use a file install generator.
const char* no_permissions = "";
const char* no_rename = "";
+ bool no_exclude_from_all = false;
std::string no_component = this->Makefile->GetSafeDefinition(
"CMAKE_INSTALL_DEFAULT_COMPONENT_NAME");
std::vector<std::string> no_configurations;
@@ -131,7 +132,8 @@ void cmInstallFilesCommand::CreateInstallGenerator() const
new cmInstallFilesGenerator(this->Files,
destination.c_str(), false,
no_permissions, no_configurations,
- no_component.c_str(), message, no_rename));
+ no_component.c_str(), message,
+ no_exclude_from_all, no_rename));
}
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index 383031b..3dd5528 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -24,9 +24,11 @@ cmInstallFilesGenerator
std::vector<std::string> const& configurations,
const char* component,
MessageLevel message,
+ bool exclude_from_all,
const char* rename,
bool optional):
- cmInstallGenerator(dest, configurations, component, message),
+ cmInstallGenerator(dest, configurations, component, message,
+ exclude_from_all),
LocalGenerator(0),
Files(files),
FilePermissions(file_permissions),
diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h
index bfe4039..efaf62b 100644
--- a/Source/cmInstallFilesGenerator.h
+++ b/Source/cmInstallFilesGenerator.h
@@ -26,6 +26,7 @@ public:
std::vector<std::string> const& configurations,
const char* component,
MessageLevel message,
+ bool exclude_from_all,
const char* rename,
bool optional = false);
virtual ~cmInstallFilesGenerator();
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index 2e1c5f0..660e44f 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -19,11 +19,13 @@ cmInstallGenerator
::cmInstallGenerator(const char* destination,
std::vector<std::string> const& configurations,
const char* component,
- MessageLevel message):
+ MessageLevel message,
+ bool exclude_from_all):
cmScriptGenerator("CMAKE_INSTALL_CONFIG_NAME", configurations),
Destination(destination? destination:""),
Component(component? component:""),
- Message(message)
+ Message(message),
+ ExcludeFromAll(exclude_from_all)
{
}
@@ -146,12 +148,16 @@ void cmInstallGenerator
//----------------------------------------------------------------------------
std::string
-cmInstallGenerator::CreateComponentTest(const char* component)
+cmInstallGenerator::CreateComponentTest(const char* component,
+ bool exclude_from_all)
{
- std::string result = "NOT CMAKE_INSTALL_COMPONENT OR "
- "\"${CMAKE_INSTALL_COMPONENT}\" STREQUAL \"";
+ std::string result = "\"${CMAKE_INSTALL_COMPONENT}\" STREQUAL \"";
result += component;
result += "\"";
+ if(!exclude_from_all)
+ {
+ result += " OR NOT CMAKE_INSTALL_COMPONENT";
+ }
return result;
}
@@ -163,7 +169,7 @@ void cmInstallGenerator::GenerateScript(std::ostream& os)
// Begin this block of installation.
std::string component_test =
- this->CreateComponentTest(this->Component.c_str());
+ this->CreateComponentTest(this->Component.c_str(),this->ExcludeFromAll);
os << indent << "if(" << component_test << ")\n";
// Generate the script possibly with per-configuration code.
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index b8e5b53..db895908 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -36,7 +36,8 @@ public:
cmInstallGenerator(const char* destination,
std::vector<std::string> const& configurations,
const char* component,
- MessageLevel message);
+ MessageLevel message,
+ bool exclude_from_all);
virtual ~cmInstallGenerator();
void AddInstallRule(
@@ -67,12 +68,14 @@ public:
protected:
virtual void GenerateScript(std::ostream& os);
- std::string CreateComponentTest(const char* component);
+ std::string CreateComponentTest(const char* component,
+ bool exclude_from_all);
// Information shared by most generator types.
std::string Destination;
std::string Component;
MessageLevel Message;
+ bool ExcludeFromAll;
};
#endif
diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx
index e6fbe88..b6d0c45 100644
--- a/Source/cmInstallProgramsCommand.cxx
+++ b/Source/cmInstallProgramsCommand.cxx
@@ -85,6 +85,7 @@ void cmInstallProgramsCommand::FinalPass()
// Use a file install generator.
const char* no_permissions = "";
const char* no_rename = "";
+ bool no_exclude_from_all = false;
std::string no_component = this->Makefile->GetSafeDefinition(
"CMAKE_INSTALL_DEFAULT_COMPONENT_NAME");
std::vector<std::string> no_configurations;
@@ -94,7 +95,8 @@ void cmInstallProgramsCommand::FinalPass()
new cmInstallFilesGenerator(this->Files,
destination.c_str(), true,
no_permissions, no_configurations,
- no_component.c_str(), message, no_rename));
+ no_component.c_str(), message,
+ no_exclude_from_all, no_rename));
}
/**
diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx
index 933aa07..d58d039 100644
--- a/Source/cmInstallScriptGenerator.cxx
+++ b/Source/cmInstallScriptGenerator.cxx
@@ -14,8 +14,9 @@
//----------------------------------------------------------------------------
cmInstallScriptGenerator
::cmInstallScriptGenerator(const char* script, bool code,
- const char* component) :
- cmInstallGenerator(0, std::vector<std::string>(), component, MessageDefault),
+ const char* component, bool exclude_from_all) :
+ cmInstallGenerator(0, std::vector<std::string>(), component, MessageDefault,
+ exclude_from_all),
Script(script), Code(code)
{
}
@@ -31,7 +32,7 @@ void cmInstallScriptGenerator::GenerateScript(std::ostream& os)
{
Indent indent;
std::string component_test =
- this->CreateComponentTest(this->Component.c_str());
+ this->CreateComponentTest(this->Component.c_str(), this->ExcludeFromAll);
os << indent << "if(" << component_test << ")\n";
if(this->Code)
diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h
index 54a7b21..7e7c0c8 100644
--- a/Source/cmInstallScriptGenerator.h
+++ b/Source/cmInstallScriptGenerator.h
@@ -21,7 +21,7 @@ class cmInstallScriptGenerator: public cmInstallGenerator
{
public:
cmInstallScriptGenerator(const char* script, bool code,
- const char* component);
+ const char* component, bool exclude_from_all);
virtual ~cmInstallScriptGenerator();
protected:
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 5e88fa2..3d44fe2 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -30,8 +30,10 @@ cmInstallTargetGenerator
std::vector<std::string> const& configurations,
const char* component,
MessageLevel message,
+ bool exclude_from_all,
bool optional):
- cmInstallGenerator(dest, configurations, component, message),
+ cmInstallGenerator(dest, configurations, component, message,
+ exclude_from_all),
TargetName(targetName),
Target(0),
FilePermissions(file_permissions),
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index 18b3130..46b4532 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -28,6 +28,7 @@ public:
std::vector<std::string> const& configurations,
const char* component,
MessageLevel message,
+ bool exclude_from_all,
bool optional
);
virtual ~cmInstallTargetGenerator();
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index b603bcc..561293e 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -73,7 +73,7 @@ struct cmLinkInterface: public cmLinkInterfaceLibraries
// Number of repetitions of a strongly connected component of two
// or more static libraries.
- int Multiplicity;
+ unsigned int Multiplicity;
// Libraries listed for other configurations.
// Needed only for OLD behavior of CMP0003.
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 6041fb7..15a1af5 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -14,6 +14,7 @@
#include <cmsys/SystemTools.hxx>
#include "cmAlgorithms.h"
+#include <algorithm>
#include <stdlib.h> // required for atoi
#include <ctype.h>
#include <assert.h>
@@ -68,6 +69,10 @@ bool cmListCommand
{
return this->HandleReverseCommand(args);
}
+ if(subCommand == "FILTER")
+ {
+ return this->HandleFilterCommand(args);
+ }
std::string e = "does not recognize sub-command "+subCommand;
this->SetError(e);
@@ -517,3 +522,107 @@ bool cmListCommand::HandleRemoveAtCommand(
return true;
}
+//----------------------------------------------------------------------------
+bool cmListCommand::HandleFilterCommand(
+ std::vector<std::string> const& args)
+{
+ if(args.size() < 2)
+ {
+ this->SetError("sub-command FILTER requires a list to be specified.");
+ return false;
+ }
+
+ if(args.size() < 3)
+ {
+ this->SetError("sub-command FILTER requires an operator to be specified.");
+ return false;
+ }
+
+ if(args.size() < 4)
+ {
+ this->SetError("sub-command FILTER requires a mode to be specified.");
+ return false;
+ }
+
+ const std::string& listName = args[1];
+ // expand the variable
+ std::vector<std::string> varArgsExpanded;
+ if ( !this->GetList(varArgsExpanded, listName) )
+ {
+ this->SetError("sub-command FILTER requires list to be present.");
+ return false;
+ }
+
+ const std::string& op = args[2];
+ bool includeMatches;
+ if(op == "INCLUDE")
+ {
+ includeMatches = true;
+ }
+ else if(op == "EXCLUDE")
+ {
+ includeMatches = false;
+ }
+ else
+ {
+ this->SetError("sub-command FILTER does not recognize operator " + op);
+ return false;
+ }
+
+ const std::string& mode = args[3];
+ if(mode == "REGEX")
+ {
+ if(args.size() != 5)
+ {
+ this->SetError("sub-command FILTER, mode REGEX "
+ "requires five arguments.");
+ return false;
+ }
+ return this->FilterRegex(args, includeMatches, listName, varArgsExpanded);
+ }
+
+ this->SetError("sub-command FILTER does not recognize mode " + mode);
+ return false;
+}
+
+//----------------------------------------------------------------------------
+class MatchesRegex {
+public:
+ MatchesRegex(cmsys::RegularExpression& in_regex, bool in_includeMatches)
+ : regex(in_regex), includeMatches(in_includeMatches) {}
+
+ bool operator()(const std::string& target) {
+ return regex.find(target) ^ includeMatches;
+ }
+
+private:
+ cmsys::RegularExpression& regex;
+ const bool includeMatches;
+};
+
+bool cmListCommand::FilterRegex(std::vector<std::string> const& args,
+ bool includeMatches,
+ std::string const& listName,
+ std::vector<std::string>& varArgsExpanded)
+{
+ const std::string& pattern = args[4];
+ cmsys::RegularExpression regex(pattern);
+ if(!regex.is_valid())
+ {
+ std::string error = "sub-command FILTER, mode REGEX ";
+ error += "failed to compile regex \"";
+ error += pattern;
+ error += "\".";
+ this->SetError(error);
+ return false;
+ }
+
+ std::vector<std::string>::iterator argsBegin = varArgsExpanded.begin();
+ std::vector<std::string>::iterator argsEnd = varArgsExpanded.end();
+ std::vector<std::string>::iterator newArgsEnd =
+ std::remove_if(argsBegin, argsEnd, MatchesRegex(regex, includeMatches));
+
+ std::string value = cmJoin(cmMakeRange(argsBegin, newArgsEnd), ";");
+ this->Makefile->AddDefinition(listName, value.c_str());
+ return true;
+}
diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h
index 5ea1d9f..25edee8 100644
--- a/Source/cmListCommand.h
+++ b/Source/cmListCommand.h
@@ -58,6 +58,12 @@ protected:
bool HandleRemoveDuplicatesCommand(std::vector<std::string> const& args);
bool HandleSortCommand(std::vector<std::string> const& args);
bool HandleReverseCommand(std::vector<std::string> const& args);
+ bool HandleFilterCommand(std::vector<std::string> const& args);
+ bool FilterRegex(std::vector<std::string> const& args,
+ bool includeMatches,
+ std::string const& listName,
+ std::vector<std::string>& varArgsExpanded
+ );
bool GetList(std::vector<std::string>& list, const std::string& var);
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 03e0abe..4d3055f 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -58,8 +58,9 @@ struct cmListFileArgument
long Line;
};
-struct cmListFileContext
+class cmListFileContext
{
+public:
std::string Name;
std::string FilePath;
long Line;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 912be0c..1be39a9 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2455,7 +2455,7 @@ void cmLocalGenerator::JoinDefines(const std::set<std::string>& defines,
else
{
// Make the definition appear properly on the command line. Use
- // -DNAME="value" instead of -D"NAME=value" to help VS6 parser.
+ // -DNAME="value" instead of -D"NAME=value" for historical reasons.
std::string::size_type eq = defineIt->find("=");
def += defineIt->substr(0, eq);
if(eq != defineIt->npos)
@@ -2559,7 +2559,7 @@ public:
cmInstallTargetGenerator(
t, dest, implib, "", std::vector<std::string>(), "Unspecified",
cmInstallGenerator::SelectMessageLevel(lg->GetMakefile()),
- false)
+ false, false)
{
this->Compute(lg);
}
@@ -2586,7 +2586,7 @@ cmLocalGenerator
// Include the user-specified pre-install script for this target.
if(const char* preinstall = (*l)->GetProperty("PRE_INSTALL_SCRIPT"))
{
- cmInstallScriptGenerator g(preinstall, false, 0);
+ cmInstallScriptGenerator g(preinstall, false, 0, false);
g.Generate(os, config, configurationTypes);
}
@@ -2647,7 +2647,7 @@ cmLocalGenerator
// Include the user-specified post-install script for this target.
if(const char* postinstall = (*l)->GetProperty("POST_INSTALL_SCRIPT"))
{
- cmInstallScriptGenerator g(postinstall, false, 0);
+ cmInstallScriptGenerator g(postinstall, false, 0, false);
g.Generate(os, config, configurationTypes);
}
}
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index b2927a9..8a68af6 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -454,13 +454,24 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
void cmLocalNinjaGenerator::AddCustomCommandTarget(cmCustomCommand const* cc,
cmGeneratorTarget* target)
{
- this->CustomCommandTargets[cc].insert(target);
+ CustomCommandTargetMap::value_type v(cc, std::set<cmGeneratorTarget*>());
+ std::pair<CustomCommandTargetMap::iterator, bool>
+ ins = this->CustomCommandTargets.insert(v);
+ if (ins.second)
+ {
+ this->CustomCommands.push_back(cc);
+ }
+ ins.first->second.insert(target);
}
void cmLocalNinjaGenerator::WriteCustomCommandBuildStatements()
{
- for (CustomCommandTargetMap::iterator i = this->CustomCommandTargets.begin();
- i != this->CustomCommandTargets.end(); ++i) {
+ for (std::vector<cmCustomCommand const*>::iterator vi =
+ this->CustomCommands.begin(); vi != this->CustomCommands.end(); ++vi)
+ {
+ CustomCommandTargetMap::iterator i = this->CustomCommandTargets.find(*vi);
+ assert(i != this->CustomCommandTargets.end());
+
// A custom command may appear on multiple targets. However, some build
// systems exist where the target dependencies on some of the targets are
// overspecified, leading to a dependency cycle. If we assume all target
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index b6987ef..5e1d6f2 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -106,6 +106,7 @@ private:
typedef std::map<cmCustomCommand const*, std::set<cmGeneratorTarget*> >
CustomCommandTargetMap;
CustomCommandTargetMap CustomCommandTargets;
+ std::vector<cmCustomCommand const*> CustomCommands;
};
#endif // ! cmLocalNinjaGenerator_h
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
deleted file mode 100644
index cdacb9e..0000000
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ /dev/null
@@ -1,2002 +0,0 @@
-/*============================================================================
- CMake - Cross Platform Makefile Generator
- Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
- Distributed under the OSI-approved BSD License (the "License");
- see accompanying file Copyright.txt for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License for more information.
-============================================================================*/
-#include "cmGlobalGenerator.h"
-#include "cmLocalVisualStudio6Generator.h"
-#include "cmMakefile.h"
-#include "cmSystemTools.h"
-#include "cmSourceFile.h"
-#include "cmGeneratorTarget.h"
-#include "cmCustomCommandGenerator.h"
-#include "cmake.h"
-
-#include "cmComputeLinkInformation.h"
-
-#include <cmsys/RegularExpression.hxx>
-#include <cmsys/FStream.hxx>
-
-cmLocalVisualStudio6Generator
-::cmLocalVisualStudio6Generator(cmGlobalGenerator* gg, cmMakefile* mf):
- cmLocalVisualStudioGenerator(gg, mf)
-{
-}
-
-cmLocalVisualStudio6Generator::~cmLocalVisualStudio6Generator()
-{
-}
-
-//----------------------------------------------------------------------------
-// Helper class to write build events.
-class cmLocalVisualStudio6Generator::EventWriter
-{
-public:
- EventWriter(cmLocalVisualStudio6Generator* lg,
- const std::string& config, std::string& code):
- LG(lg), Config(config), Code(code), First(true) {}
- void Start(const char* event)
- {
- this->First = true;
- this->Event = event;
- }
- void Finish()
- {
- this->Code += (this->First? "" : "\n");
- }
- void Write(std::vector<cmCustomCommand> const& ccs)
- {
- for(std::vector<cmCustomCommand>::const_iterator ci = ccs.begin();
- ci != ccs.end(); ++ci)
- {
- this->Write(*ci);
- }
- }
- void Write(cmCustomCommand const& cc)
- {
- cmCustomCommandGenerator ccg(cc, this->Config, this->LG);
- if(this->First)
- {
- this->Code += this->Event + "_Cmds=";
- this->First = false;
- }
- else
- {
- this->Code += "\\\n\t";
- }
- this->Code += this->LG->ConstructScript(ccg, "\\\n\t");
- }
-private:
- cmLocalVisualStudio6Generator* LG;
- std::string Config;
- std::string& Code;
- bool First;
- std::string Event;
-};
-
-void cmLocalVisualStudio6Generator::AddCMakeListsRules()
-{
- std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
- for(std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
- l != tgts.end(); ++l)
- {
- if ((*l)->GetType() == cmState::INTERFACE_LIBRARY
- || (*l)->GetType() == cmState::GLOBAL_TARGET)
- {
- continue;
- }
-
- // Add a rule to regenerate the build system when the target
- // specification source changes.
- const char* suppRegenRule =
- this->Makefile->GetDefinition("CMAKE_SUPPRESS_REGENERATION");
- if (!cmSystemTools::IsOn(suppRegenRule))
- {
- this->AddDSPBuildRule(*l);
- }
- }
-}
-
-void cmLocalVisualStudio6Generator::Generate()
-{
- this->OutputDSPFile();
-}
-
-void cmLocalVisualStudio6Generator::OutputDSPFile()
-{
- // If not an in source build, then create the output directory
- if(strcmp(this->GetCurrentBinaryDirectory(),
- this->GetSourceDirectory()) != 0)
- {
- if(!cmSystemTools::MakeDirectory
- (this->GetCurrentBinaryDirectory()))
- {
- cmSystemTools::Error("Error creating directory ",
- this->GetCurrentBinaryDirectory());
- }
- }
-
- // Create the DSP or set of DSP's for libraries and executables
-
- std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
- for(std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
- l != tgts.end(); ++l)
- {
- switch((*l)->GetType())
- {
- case cmState::STATIC_LIBRARY:
- case cmState::OBJECT_LIBRARY:
- this->SetBuildType(STATIC_LIBRARY,
- (*l)->GetName().c_str(), *l);
- break;
- case cmState::SHARED_LIBRARY:
- case cmState::MODULE_LIBRARY:
- this->SetBuildType(DLL,
- (*l)->GetName().c_str(), *l);
- break;
- case cmState::EXECUTABLE:
- this->SetBuildType(EXECUTABLE,
- (*l)->GetName().c_str(), *l);
- break;
- case cmState::UTILITY:
- case cmState::GLOBAL_TARGET:
- this->SetBuildType(UTILITY,
- (*l)->GetName().c_str(), *l);
- break;
- case cmState::INTERFACE_LIBRARY:
- continue;
- default:
- cmSystemTools::Error("Bad target type: ", (*l)->GetName().c_str());
- break;
- }
- // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
- // so don't build a projectfile for it
- const char* path =
- (*l)->GetProperty("EXTERNAL_MSPROJECT");
- if(!path)
- {
- // check to see if the dsp is going into a sub-directory
- std::string::size_type pos = (*l)->GetName().rfind('/');
- if(pos != std::string::npos)
- {
- std::string dir = this->GetCurrentBinaryDirectory();
- dir += "/";
- dir += (*l)->GetName().substr(0, pos);
- if(!cmSystemTools::MakeDirectory(dir.c_str()))
- {
- cmSystemTools::Error("Error creating directory: ", dir.c_str());
- }
- }
- this->CreateSingleDSP((*l)->GetName().c_str(), *l);
- }
- }
-}
-
-// Utility function to make a valid VS6 *.dsp filename out
-// of a CMake target name:
-//
-extern std::string GetVS6TargetName(const std::string& targetName);
-
-void cmLocalVisualStudio6Generator::CreateSingleDSP(const std::string& lname,
- cmGeneratorTarget* target)
-{
- // add to the list of projects
- std::string pname = GetVS6TargetName(lname);
-
- // create the dsp.cmake file
- std::string fname;
- fname = this->GetCurrentBinaryDirectory();
- fname += "/";
- fname += pname;
- fname += ".dsp";
- // save the name of the real dsp file
- std::string realDSP = fname;
- fname += ".cmake";
- cmsys::ofstream fout(fname.c_str());
- if(!fout)
- {
- cmSystemTools::Error("Error Writing ", fname.c_str());
- cmSystemTools::ReportLastSystemError("");
- }
- this->WriteDSPFile(fout,pname.c_str(),target);
- fout.close();
- // if the dsp file has changed, then write it.
- cmSystemTools::CopyFileIfDifferent(fname.c_str(), realDSP.c_str());
-}
-
-
-void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmGeneratorTarget *tgt)
-{
- std::string dspname = GetVS6TargetName(tgt->GetName());
- dspname += ".dsp.cmake";
- cmCustomCommandLine commandLine;
- commandLine.push_back(cmSystemTools::GetCMakeCommand());
- std::string makefileIn = this->GetCurrentSourceDirectory();
- makefileIn += "/";
- makefileIn += "CMakeLists.txt";
- if(!cmSystemTools::FileExists(makefileIn.c_str()))
- {
- return;
- }
- std::string comment = "Building Custom Rule ";
- comment += makefileIn;
- std::string args;
- args = "-H";
- args += this->GetSourceDirectory();
- commandLine.push_back(args);
- args = "-B";
- args += this->GetBinaryDirectory();
- commandLine.push_back(args);
-
- std::vector<std::string> const& listFiles = this->Makefile->GetListFiles();
-
- cmCustomCommandLines commandLines;
- commandLines.push_back(commandLine);
- const char* no_working_directory = 0;
- this->Makefile->AddCustomCommandToOutput(dspname.c_str(), listFiles,
- makefileIn.c_str(), commandLines,
- comment.c_str(),
- no_working_directory, true);
- if(this->Makefile->GetSource(makefileIn.c_str()))
- {
- tgt->AddSource(makefileIn);
- }
- else
- {
- cmSystemTools::Error("Error adding rule for ", makefileIn.c_str());
- }
-}
-
-
-void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
- const std::string& libName,
- cmGeneratorTarget *target)
-{
- // For utility targets need custom command since pre- and post-
- // build does not do anything in Visual Studio 6. In order for the
- // rules to run in the correct order as custom commands, we need
- // special care for dependencies. The first rule must depend on all
- // the dependencies of all the rules. The later rules must each
- // depend only on the previous rule.
- if ((target->GetType() == cmState::UTILITY ||
- target->GetType() == cmState::GLOBAL_TARGET) &&
- (!target->GetPreBuildCommands().empty() ||
- !target->GetPostBuildCommands().empty()))
- {
- // Accumulate the dependencies of all the commands.
- std::vector<std::string> depends;
- for (std::vector<cmCustomCommand>::const_iterator cr =
- target->GetPreBuildCommands().begin();
- cr != target->GetPreBuildCommands().end(); ++cr)
- {
- depends.insert(depends.end(),
- cr->GetDepends().begin(), cr->GetDepends().end());
- }
- for (std::vector<cmCustomCommand>::const_iterator cr =
- target->GetPostBuildCommands().begin();
- cr != target->GetPostBuildCommands().end(); ++cr)
- {
- depends.insert(depends.end(),
- cr->GetDepends().begin(), cr->GetDepends().end());
- }
-
- // Add the pre- and post-build commands in order.
- int count = 1;
- for (std::vector<cmCustomCommand>::const_iterator cr =
- target->GetPreBuildCommands().begin();
- cr != target->GetPreBuildCommands().end(); ++cr)
- {
- this->AddUtilityCommandHack(target, count++, depends, *cr);
- }
- for (std::vector<cmCustomCommand>::const_iterator cr =
- target->GetPostBuildCommands().begin();
- cr != target->GetPostBuildCommands().end(); ++cr)
- {
- this->AddUtilityCommandHack(target, count++, depends, *cr);
- }
- }
-
- // We may be modifying the source groups temporarily, so make a copy.
- std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups();
-
- // get the classes from the source lists then add them to the groups
- std::vector<cmSourceFile*> classes;
- if (!target->GetConfigCommonSourceFiles(classes))
- {
- return;
- }
-
- // now all of the source files have been properly assigned to the target
- // now stick them into source groups using the reg expressions
- for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
- i != classes.end(); i++)
- {
- if (!(*i)->GetObjectLibrary().empty())
- {
- continue;
- }
-
- // Add the file to the list of sources.
- std::string source = (*i)->GetFullPath();
- cmSourceGroup* sourceGroup =
- this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
- sourceGroup->AssignSource(*i);
- // while we are at it, if it is a .rule file then for visual studio 6 we
- // must generate it
- if ((*i)->GetPropertyAsBool("__CMAKE_RULE"))
- {
- if(!cmSystemTools::FileExists(source.c_str()))
- {
- cmSystemTools::ReplaceString(source, "$(IntDir)/", "");
- // Make sure the path exists for the file
- std::string path = cmSystemTools::GetFilenamePath(source);
- cmSystemTools::MakeDirectory(path.c_str());
-#if defined(_WIN32) || defined(__CYGWIN__)
- cmsys::ofstream sourceFout(source.c_str(),
- std::ios::binary | std::ios::out
- | std::ios::trunc);
-#else
- cmsys::ofstream sourceFout(source.c_str(),
- std::ios::out | std::ios::trunc);
-#endif
- if(sourceFout)
- {
- sourceFout.write("# generated from CMake",22);
- sourceFout.flush();
- sourceFout.close();
- }
- }
- }
- }
-
- // Write the DSP file's header.
- this->WriteDSPHeader(fout, libName, target, sourceGroups);
-
-
- // Loop through every source group.
- for(std::vector<cmSourceGroup>::const_iterator sg = sourceGroups.begin();
- sg != sourceGroups.end(); ++sg)
- {
- this->WriteGroup(&(*sg), target, fout, libName);
- }
-
- // Write the DSP file's footer.
- this->WriteDSPFooter(fout);
-}
-
-void cmLocalVisualStudio6Generator
-::WriteGroup(const cmSourceGroup *sg, cmGeneratorTarget* target,
- std::ostream &fout, const std::string& libName)
-{
- const std::vector<const cmSourceFile *> &sourceFiles =
- sg->GetSourceFiles();
- // If the group is empty, don't write it at all.
-
- if(sourceFiles.empty() && sg->GetGroupChildren().empty())
- {
- return;
- }
-
- // If the group has a name, write the header.
- std::string name = sg->GetName();
- if(name != "")
- {
- this->WriteDSPBeginGroup(fout, name.c_str(), "");
- }
-
- // Loop through each source in the source group.
- for(std::vector<const cmSourceFile *>::const_iterator sf =
- sourceFiles.begin(); sf != sourceFiles.end(); ++sf)
- {
- if (!(*sf)->GetObjectLibrary().empty())
- {
- continue;
- }
-
- std::string source = (*sf)->GetFullPath();
- const cmCustomCommand *command =
- (*sf)->GetCustomCommand();
- std::string compileFlags;
- std::vector<std::string> depends;
- std::string objectNameDir;
- if(target->HasExplicitObjectName(*sf))
- {
- objectNameDir =
- cmSystemTools::GetFilenamePath(target->GetObjectName(*sf));
- }
-
- // Add per-source file flags.
- if(const char* cflags = (*sf)->GetProperty("COMPILE_FLAGS"))
- {
- compileFlags += cflags;
- }
-
- const std::string& lang = this->GetSourceFileLanguage(*(*sf));
- if(lang == "CXX")
- {
- // force a C++ file type
- compileFlags += " /TP ";
- }
- else if(lang == "C")
- {
- // force to c file type
- compileFlags += " /TC ";
- }
-
- // Add per-source and per-configuration preprocessor definitions.
- std::map<std::string, std::string> cdmap;
-
- {
- std::set<std::string> targetCompileDefinitions;
-
- this->AppendDefines(targetCompileDefinitions,
- (*sf)->GetProperty("COMPILE_DEFINITIONS"));
- this->JoinDefines(targetCompileDefinitions, compileFlags, lang);
- }
-
- if(const char* cdefs = (*sf)->GetProperty("COMPILE_DEFINITIONS_DEBUG"))
- {
- std::set<std::string> debugCompileDefinitions;
- this->AppendDefines(debugCompileDefinitions, cdefs);
- this->JoinDefines(debugCompileDefinitions, cdmap["DEBUG"], lang);
- }
- if(const char* cdefs = (*sf)->GetProperty("COMPILE_DEFINITIONS_RELEASE"))
- {
- std::set<std::string> releaseCompileDefinitions;
- this->AppendDefines(releaseCompileDefinitions, cdefs);
- this->JoinDefines(releaseCompileDefinitions, cdmap["RELEASE"], lang);
- }
- if(const char* cdefs =
- (*sf)->GetProperty("COMPILE_DEFINITIONS_MINSIZEREL"))
- {
- std::set<std::string> minsizerelCompileDefinitions;
- this->AppendDefines(minsizerelCompileDefinitions, cdefs);
- this->JoinDefines(minsizerelCompileDefinitions, cdmap["MINSIZEREL"],
- lang);
- }
- if(const char* cdefs =
- (*sf)->GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO"))
- {
- std::set<std::string> relwithdebinfoCompileDefinitions;
- this->AppendDefines(relwithdebinfoCompileDefinitions, cdefs);
- this->JoinDefines(relwithdebinfoCompileDefinitions,
- cdmap["RELWITHDEBINFO"], lang);
- }
-
- bool excludedFromBuild =
- (!lang.empty() && (*sf)->GetPropertyAsBool("HEADER_FILE_ONLY"));
-
- // Check for extra object-file dependencies.
- const char* dependsValue = (*sf)->GetProperty("OBJECT_DEPENDS");
- if(dependsValue)
- {
- cmSystemTools::ExpandListArgument(dependsValue, depends);
- }
- if (GetVS6TargetName(source) != libName ||
- target->GetType() == cmState::UTILITY ||
- target->GetType() == cmState::GLOBAL_TARGET)
- {
- fout << "# Begin Source File\n\n";
-
- // Tell MS-Dev what the source is. If the compiler knows how to
- // build it, then it will.
- fout << "SOURCE=" <<
- this->ConvertToOutputFormat(source.c_str(), SHELL) << "\n\n";
- if(!depends.empty())
- {
- // Write out the dependencies for the rule.
- fout << "USERDEP__HACK=";
- for(std::vector<std::string>::const_iterator d = depends.begin();
- d != depends.end(); ++d)
- {
- fout << "\\\n\t" <<
- this->ConvertToOutputFormat(d->c_str(), SHELL);
- }
- fout << "\n";
- }
- if (command)
- {
- const char* flags = compileFlags.size() ? compileFlags.c_str(): 0;
- this->WriteCustomRule(fout, source.c_str(), *command, flags);
- }
- else if(!compileFlags.empty() || !objectNameDir.empty() ||
- excludedFromBuild || !cdmap.empty())
- {
- for(std::vector<std::string>::iterator i
- = this->Configurations.begin();
- i != this->Configurations.end(); ++i)
- {
- // Strip the subdirectory name out of the configuration name.
- std::string config = this->GetConfigName(*i);
- if (i == this->Configurations.begin())
- {
- fout << "!IF \"$(CFG)\" == " << i->c_str() << std::endl;
- }
- else
- {
- fout << "!ELSEIF \"$(CFG)\" == " << i->c_str() << std::endl;
- }
- if(excludedFromBuild)
- {
- fout << "# PROP Exclude_From_Build 1\n";
- }
- if(!compileFlags.empty())
- {
- fout << "\n# ADD CPP " << compileFlags << "\n\n";
- }
- std::map<std::string, std::string>::iterator cdi =
- cdmap.find(cmSystemTools::UpperCase(config));
- if(cdi != cdmap.end() && !cdi->second.empty())
- {
- fout << "\n# ADD CPP " << cdi->second << "\n\n";
- }
- if(!objectNameDir.empty())
- {
- // Setup an alternate object file directory.
- fout << "\n# PROP Intermediate_Dir \""
- << config << "/" << objectNameDir << "\"\n\n";
- }
- }
- fout << "!ENDIF\n\n";
- }
- fout << "# End Source File\n";
- }
- }
-
- std::vector<cmSourceGroup> const& children = sg->GetGroupChildren();
-
- for(unsigned int i=0;i<children.size();++i)
- {
- this->WriteGroup(&children[i], target, fout, libName);
- }
-
-
-
-
- // If the group has a name, write the footer.
- if(name != "")
- {
- this->WriteDSPEndGroup(fout);
- }
-
-}
-
-
-void
-cmLocalVisualStudio6Generator
-::AddUtilityCommandHack(cmGeneratorTarget *target, int count,
- std::vector<std::string>& depends,
- const cmCustomCommand& origCommand)
-{
- // Create a fake output that forces the rule to run.
- char* output = new char[(strlen(this->GetCurrentBinaryDirectory())
- + target->GetName().size() + 30)];
- sprintf(output,"%s/%s_force_%i", this->GetCurrentBinaryDirectory(),
- target->GetName().c_str(), count);
- const char* comment = origCommand.GetComment();
- if(!comment && origCommand.GetOutputs().empty())
- {
- comment = "<hack>";
- }
-
- // Add the rule with the given dependencies and commands.
- std::string no_main_dependency = "";
- if(cmSourceFile* outsf =
- this->Makefile->AddCustomCommandToOutput(
- output, depends, no_main_dependency,
- origCommand.GetCommandLines(), comment,
- origCommand.GetWorkingDirectory().c_str()))
- {
- target->AddSource(outsf->GetFullPath());
- }
-
- // Replace the dependencies with the output of this rule so that the
- // next rule added will run after this one.
- depends.clear();
- depends.push_back(output);
-
- // Free the fake output name.
- delete [] output;
-}
-
-void
-cmLocalVisualStudio6Generator
-::WriteCustomRule(std::ostream& fout,
- const char* source,
- const cmCustomCommand& command,
- const char* flags)
-{
- // Write the rule for each configuration.
- std::vector<std::string>::iterator i;
- for(i = this->Configurations.begin(); i != this->Configurations.end(); ++i)
- {
- std::string config = this->GetConfigName(*i);
- cmCustomCommandGenerator ccg(command, config, this);
- std::string comment =
- this->ConstructComment(ccg, "Building Custom Rule $(InputPath)");
- if(comment == "<hack>")
- {
- comment = "";
- }
-
- std::string script =
- this->ConstructScript(ccg, "\\\n\t");
-
- if (i == this->Configurations.begin())
- {
- fout << "!IF \"$(CFG)\" == " << i->c_str() << std::endl;
- }
- else
- {
- fout << "!ELSEIF \"$(CFG)\" == " << i->c_str() << std::endl;
- }
- if(flags)
- {
- fout << "\n# ADD CPP " << flags << "\n\n";
- }
- // Write out the dependencies for the rule.
- fout << "USERDEP__HACK=";
- for(std::vector<std::string>::const_iterator d =
- ccg.GetDepends().begin();
- d != ccg.GetDepends().end();
- ++d)
- {
- // Lookup the real name of the dependency in case it is a CMake target.
- std::string dep;
- if(this->GetRealDependency(d->c_str(), config.c_str(), dep))
- {
- fout << "\\\n\t" <<
- this->ConvertToOutputFormat(dep.c_str(), SHELL);
- }
- }
- fout << "\n";
-
- fout << "# PROP Ignore_Default_Tool 1\n";
- fout << "# Begin Custom Build -";
- if(!comment.empty())
- {
- fout << " " << comment.c_str();
- }
- fout << "\n\n";
- if(ccg.GetOutputs().empty())
- {
- fout << source
- << "_force : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"\n\t";
- fout << script.c_str() << "\n\n";
- }
- else
- {
- for(std::vector<std::string>::const_iterator o =
- ccg.GetOutputs().begin();
- o != ccg.GetOutputs().end();
- ++o)
- {
- // Write a rule for every output generated by this command.
- fout << this->ConvertToOutputFormat(o->c_str(), SHELL)
- << " : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"\n\t";
- fout << script.c_str() << "\n\n";
- }
- }
- fout << "# End Custom Build\n\n";
- }
-
- fout << "!ENDIF\n\n";
-}
-
-
-void cmLocalVisualStudio6Generator::WriteDSPBeginGroup(std::ostream& fout,
- const char* group,
- const char* filter)
-{
- fout << "# Begin Group \"" << group << "\"\n"
- "# PROP Default_Filter \"" << filter << "\"\n";
-}
-
-
-void cmLocalVisualStudio6Generator::WriteDSPEndGroup(std::ostream& fout)
-{
- fout << "# End Group\n";
-}
-
-
-
-
-void cmLocalVisualStudio6Generator::SetBuildType(BuildType b,
- const std::string& libName,
- cmGeneratorTarget *target)
-{
- std::string root= this->Makefile->GetRequiredDefinition("CMAKE_ROOT");
- const char *def=
- this->Makefile->GetDefinition( "MSPROJECT_TEMPLATE_DIRECTORY");
-
- if( def)
- {
- root = def;
- }
- else
- {
- root += "/Templates";
- }
-
- switch(b)
- {
- case WIN32_EXECUTABLE:
- break;
- case STATIC_LIBRARY:
- this->DSPHeaderTemplate = root;
- this->DSPHeaderTemplate += "/staticLibHeader.dsptemplate";
- this->DSPFooterTemplate = root;
- this->DSPFooterTemplate += "/staticLibFooter.dsptemplate";
- break;
- case DLL:
- this->DSPHeaderTemplate = root;
- this->DSPHeaderTemplate += "/DLLHeader.dsptemplate";
- this->DSPFooterTemplate = root;
- this->DSPFooterTemplate += "/DLLFooter.dsptemplate";
- break;
- case EXECUTABLE:
- if ( target->GetPropertyAsBool("WIN32_EXECUTABLE") )
- {
- this->DSPHeaderTemplate = root;
- this->DSPHeaderTemplate += "/EXEWinHeader.dsptemplate";
- this->DSPFooterTemplate = root;
- this->DSPFooterTemplate += "/EXEFooter.dsptemplate";
- }
- else
- {
- this->DSPHeaderTemplate = root;
- this->DSPHeaderTemplate += "/EXEHeader.dsptemplate";
- this->DSPFooterTemplate = root;
- this->DSPFooterTemplate += "/EXEFooter.dsptemplate";
- }
- break;
- case UTILITY:
- this->DSPHeaderTemplate = root;
- this->DSPHeaderTemplate += "/UtilityHeader.dsptemplate";
- this->DSPFooterTemplate = root;
- this->DSPFooterTemplate += "/UtilityFooter.dsptemplate";
- break;
- }
-
- // once the build type is set, determine what configurations are
- // possible
- cmsys::ifstream fin(this->DSPHeaderTemplate.c_str());
-
- cmsys::RegularExpression reg("# Name ");
- if(!fin)
- {
- cmSystemTools::Error("Error Reading ", this->DSPHeaderTemplate.c_str());
- }
-
- // reset this->Configurations
- this->Configurations.erase(this->Configurations.begin(),
- this->Configurations.end());
-
- // now add all the configurations possible
- std::string vs6name = GetVS6TargetName(libName);
- std::string line;
- while(cmSystemTools::GetLineFromStream(fin, line))
- {
- cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME", vs6name.c_str());
- if (reg.find(line))
- {
- this->Configurations.push_back(line.substr(reg.end()));
- }
- }
-}
-
-//----------------------------------------------------------------------------
-cmsys::auto_ptr<cmCustomCommand>
-cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmGeneratorTarget* target,
- const std::string& config)
-{
- cmsys::auto_ptr<cmCustomCommand> pcc;
-
- // VS6 forgets to create the output directory for archives if it
- // differs from the intermediate directory.
- if(target->GetType() != cmState::STATIC_LIBRARY) { return pcc; }
-
- std::string outDir = target->GetDirectory(config, false);
-
- // Add a pre-link event to create the directory.
- cmCustomCommandLine command;
- command.push_back(cmSystemTools::GetCMakeCommand());
- command.push_back("-E");
- command.push_back("make_directory");
- command.push_back(outDir);
- std::vector<std::string> no_output;
- std::vector<std::string> no_byproducts;
- std::vector<std::string> no_depends;
- cmCustomCommandLines commands;
- commands.push_back(command);
- pcc.reset(new cmCustomCommand(0, no_output, no_byproducts,
- no_depends, commands, 0, 0));
- pcc->SetEscapeOldStyle(false);
- pcc->SetEscapeAllowMakeVars(true);
- return pcc;
-}
-
-// look for custom rules on a target and collect them together
-std::string
-cmLocalVisualStudio6Generator::CreateTargetRules(cmGeneratorTarget *target,
- const std::string& configName,
- const std::string& /* libName */)
-{
- if (target->GetType() >= cmState::UTILITY )
- {
- return "";
- }
-
- std::string customRuleCode = "# Begin Special Build Tool\n";
- EventWriter event(this, configName, customRuleCode);
-
- // Write the pre-build and pre-link together (VS6 does not support both).
- event.Start("PreLink");
- event.Write(target->GetPreBuildCommands());
- event.Write(target->GetPreLinkCommands());
- cmsys::auto_ptr<cmCustomCommand> pcc(
- this->MaybeCreateImplibDir(target, configName, false));
- if(pcc.get())
- {
- event.Write(*pcc);
- }
- pcc = this->MaybeCreateOutputDir(target, configName);
- if(pcc.get())
- {
- event.Write(*pcc);
- }
- event.Finish();
-
- // Write the post-build rules.
- event.Start("PostBuild");
- event.Write(target->GetPostBuildCommands());
- event.Finish();
-
- customRuleCode += "# End Special Build Tool\n";
- return customRuleCode;
-}
-
-
-inline std::string removeQuotes(const std::string& s)
-{
- if(s[0] == '\"' && s[s.size()-1] == '\"')
- {
- return s.substr(1, s.size()-2);
- }
- return s;
-}
-
-
-std::string
-cmLocalVisualStudio6Generator::GetTargetIncludeOptions(
- cmGeneratorTarget *target,
- const std::string& config)
-{
- std::string includeOptions;
-
- // Setup /I and /LIBPATH options for the resulting DSP file. VS 6
- // truncates long include paths so make it as short as possible if
- // the length threatens this problem.
- unsigned int maxIncludeLength = 3000;
- bool useShortPath = false;
-
- for(int j=0; j < 2; ++j)
- {
- std::vector<std::string> includes;
- this->GetIncludeDirectories(includes, target, "C", config);
-
- std::vector<std::string>::iterator i;
- for(i = includes.begin(); i != includes.end(); ++i)
- {
- std::string tmp =
- this->ConvertToOutputFormat(i->c_str(), SHELL);
- if(useShortPath)
- {
- cmSystemTools::GetShortPath(tmp.c_str(), tmp);
- }
- includeOptions += " /I ";
-
- // quote if not already quoted
- if (tmp[0] != '"')
- {
- includeOptions += "\"";
- includeOptions += tmp;
- includeOptions += "\"";
- }
- else
- {
- includeOptions += tmp;
- }
- }
-
- if(j == 0 && includeOptions.size() > maxIncludeLength)
- {
- includeOptions = "";
- useShortPath = true;
- }
- else
- {
- break;
- }
- }
-
- return includeOptions;
-}
-
-
-// Code in blocks surrounded by a test for this definition is needed
-// only for compatibility with user project's replacement DSP
-// templates. The CMake templates no longer use them.
-#define CM_USE_OLD_VS6
-
-void cmLocalVisualStudio6Generator
-::WriteDSPHeader(std::ostream& fout,
- const std::string& libName, cmGeneratorTarget* target,
- std::vector<cmSourceGroup> &)
-{
- bool targetBuilds = (target->GetType() >= cmState::EXECUTABLE &&
- target->GetType() <= cmState::MODULE_LIBRARY);
-#ifdef CM_USE_OLD_VS6
- // Lookup the library and executable output directories.
- std::string libPath;
- if(this->Makefile->GetDefinition("LIBRARY_OUTPUT_PATH"))
- {
- libPath = this->Makefile->GetDefinition("LIBRARY_OUTPUT_PATH");
- }
- std::string exePath;
- if(this->Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"))
- {
- exePath = this->Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH");
- }
-
- // Make sure there are trailing slashes.
- if(!libPath.empty())
- {
- if(libPath[libPath.size()-1] != '/')
- {
- libPath += "/";
- }
- }
- if(!exePath.empty())
- {
- if(exePath[exePath.size()-1] != '/')
- {
- exePath += "/";
- }
- }
-
- std::set<std::string> pathEmitted;
-
- // determine the link directories
- std::string libOptions;
- std::string libDebugOptions;
- std::string libOptimizedOptions;
-
- std::string libMultiLineOptions;
- std::string libMultiLineOptionsForDebug;
- std::string libMultiLineDebugOptions;
- std::string libMultiLineOptimizedOptions;
-
- if(!libPath.empty())
- {
- std::string lpath =
- this->ConvertToOutputFormat(libPath.c_str(), SHELL);
- if(lpath.empty())
- {
- lpath = ".";
- }
- std::string lpathIntDir = libPath + "$(INTDIR)";
- lpathIntDir =
- this->ConvertToOutputFormat(lpathIntDir.c_str(), SHELL);
- if(pathEmitted.insert(lpath).second)
- {
- libOptions += " /LIBPATH:";
- libOptions += lpathIntDir;
- libOptions += " ";
- libOptions += " /LIBPATH:";
- libOptions += lpath;
- libOptions += " ";
- libMultiLineOptions += "# ADD LINK32 /LIBPATH:";
- libMultiLineOptions += lpathIntDir;
- libMultiLineOptions += " ";
- libMultiLineOptions += " /LIBPATH:";
- libMultiLineOptions += lpath;
- libMultiLineOptions += " \n";
- libMultiLineOptionsForDebug += "# ADD LINK32 /LIBPATH:";
- libMultiLineOptionsForDebug += lpathIntDir;
- libMultiLineOptionsForDebug += " ";
- libMultiLineOptionsForDebug += " /LIBPATH:";
- libMultiLineOptionsForDebug += lpath;
- libMultiLineOptionsForDebug += " \n";
- }
- }
- if(!exePath.empty())
- {
- std::string lpath =
- this->ConvertToOutputFormat(exePath.c_str(), SHELL);
- if(lpath.empty())
- {
- lpath = ".";
- }
- std::string lpathIntDir = exePath + "$(INTDIR)";
- lpathIntDir =
- this->ConvertToOutputFormat(lpathIntDir.c_str(), SHELL);
-
- if(pathEmitted.insert(lpath).second)
- {
- libOptions += " /LIBPATH:";
- libOptions += lpathIntDir;
- libOptions += " ";
- libOptions += " /LIBPATH:";
- libOptions += lpath;
- libOptions += " ";
- libMultiLineOptions += "# ADD LINK32 /LIBPATH:";
- libMultiLineOptions += lpathIntDir;
- libMultiLineOptions += " ";
- libMultiLineOptions += " /LIBPATH:";
- libMultiLineOptions += lpath;
- libMultiLineOptions += " \n";
- libMultiLineOptionsForDebug += "# ADD LINK32 /LIBPATH:";
- libMultiLineOptionsForDebug += lpathIntDir;
- libMultiLineOptionsForDebug += " ";
- libMultiLineOptionsForDebug += " /LIBPATH:";
- libMultiLineOptionsForDebug += lpath;
- libMultiLineOptionsForDebug += " \n";
- }
- }
- std::vector<std::string>::const_iterator i;
- const std::vector<std::string>& libdirs =
- target->GetLinkDirectories();
- for(i = libdirs.begin(); i != libdirs.end(); ++i)
- {
- std::string path = *i;
- if(path[path.size()-1] != '/')
- {
- path += "/";
- }
- std::string lpath =
- this->ConvertToOutputFormat(path.c_str(), SHELL);
- if(lpath.empty())
- {
- lpath = ".";
- }
- std::string lpathIntDir = path + "$(INTDIR)";
- lpathIntDir =
- this->ConvertToOutputFormat(lpathIntDir.c_str(), SHELL);
- if(pathEmitted.insert(lpath).second)
- {
- libOptions += " /LIBPATH:";
- libOptions += lpathIntDir;
- libOptions += " ";
- libOptions += " /LIBPATH:";
- libOptions += lpath;
- libOptions += " ";
-
- libMultiLineOptions += "# ADD LINK32 /LIBPATH:";
- libMultiLineOptions += lpathIntDir;
- libMultiLineOptions += " ";
- libMultiLineOptions += " /LIBPATH:";
- libMultiLineOptions += lpath;
- libMultiLineOptions += " \n";
- libMultiLineOptionsForDebug += "# ADD LINK32 /LIBPATH:";
- libMultiLineOptionsForDebug += lpathIntDir;
- libMultiLineOptionsForDebug += " ";
- libMultiLineOptionsForDebug += " /LIBPATH:";
- libMultiLineOptionsForDebug += lpath;
- libMultiLineOptionsForDebug += " \n";
- }
- }
- // find link libraries
- const cmTarget::LinkLibraryVectorType& libs =
- target->Target->GetLinkLibrariesForVS6();
- cmTarget::LinkLibraryVectorType::const_iterator j;
- for(j = libs.begin(); j != libs.end(); ++j)
- {
- // add libraries to executables and dlls (but never include
- // a library in a library, bad recursion)
- // NEVER LINK STATIC LIBRARIES TO OTHER STATIC LIBRARIES
- if ((target->GetType() != cmState::SHARED_LIBRARY
- && target->GetType() != cmState::STATIC_LIBRARY
- && target->GetType() != cmState::MODULE_LIBRARY) ||
- (target->GetType()==cmState::SHARED_LIBRARY
- && libName != GetVS6TargetName(j->first)) ||
- (target->GetType()==cmState::MODULE_LIBRARY
- && libName != GetVS6TargetName(j->first)))
- {
- // Compute the proper name to use to link this library.
- std::string lib;
- std::string libDebug;
- cmGeneratorTarget* tgt =
- this->GlobalGenerator->FindGeneratorTarget(j->first.c_str());
- if(tgt)
- {
- lib = cmSystemTools::GetFilenameWithoutExtension
- (tgt->GetFullName().c_str());
- libDebug = cmSystemTools::GetFilenameWithoutExtension
- (tgt->GetFullName("Debug").c_str());
- lib += ".lib";
- libDebug += ".lib";
- }
- else
- {
- lib = j->first.c_str();
- libDebug = j->first.c_str();
- if(j->first.find(".lib") == std::string::npos)
- {
- lib += ".lib";
- libDebug += ".lib";
- }
- }
- lib = this->ConvertToOutputFormat(lib.c_str(), SHELL);
- libDebug =
- this->ConvertToOutputFormat(libDebug.c_str(), SHELL);
-
- if (j->second == GENERAL_LibraryType)
- {
- libOptions += " ";
- libOptions += lib;
- libMultiLineOptions += "# ADD LINK32 ";
- libMultiLineOptions += lib;
- libMultiLineOptions += "\n";
- libMultiLineOptionsForDebug += "# ADD LINK32 ";
- libMultiLineOptionsForDebug += libDebug;
- libMultiLineOptionsForDebug += "\n";
- }
- if (j->second == DEBUG_LibraryType)
- {
- libDebugOptions += " ";
- libDebugOptions += lib;
-
- libMultiLineDebugOptions += "# ADD LINK32 ";
- libMultiLineDebugOptions += libDebug;
- libMultiLineDebugOptions += "\n";
- }
- if (j->second == OPTIMIZED_LibraryType)
- {
- libOptimizedOptions += " ";
- libOptimizedOptions += lib;
-
- libMultiLineOptimizedOptions += "# ADD LINK32 ";
- libMultiLineOptimizedOptions += lib;
- libMultiLineOptimizedOptions += "\n";
- }
- }
- }
-#endif
-
- // Get include options for this target.
- std::string includeOptionsDebug = this->GetTargetIncludeOptions(target,
- "DEBUG");
- std::string includeOptionsRelease = this->GetTargetIncludeOptions(target,
- "RELEASE");
- std::string includeOptionsRelWithDebInfo = this->GetTargetIncludeOptions(
- target,
- "RELWITHDEBINFO");
- std::string includeOptionsMinSizeRel = this->GetTargetIncludeOptions(target,
- "MINSIZEREL");
-
- // Get extra linker options for this target type.
- std::string extraLinkOptions;
- std::string extraLinkOptionsDebug;
- std::string extraLinkOptionsRelease;
- std::string extraLinkOptionsMinSizeRel;
- std::string extraLinkOptionsRelWithDebInfo;
- if(target->GetType() == cmState::EXECUTABLE)
- {
- extraLinkOptions = this->Makefile->
- GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS");
- extraLinkOptionsDebug = this->Makefile->
- GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS_DEBUG");
- extraLinkOptionsRelease = this->Makefile->
- GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS_RELEASE");
- extraLinkOptionsMinSizeRel = this->Makefile->
- GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS_MINSIZEREL");
- extraLinkOptionsRelWithDebInfo = this->Makefile->
- GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO");
- }
- if(target->GetType() == cmState::SHARED_LIBRARY)
- {
- extraLinkOptions = this->Makefile->
- GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS");
- extraLinkOptionsDebug = this->Makefile->
- GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS_DEBUG");
- extraLinkOptionsRelease = this->Makefile->
- GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS_RELEASE");
- extraLinkOptionsMinSizeRel = this->Makefile->
- GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL");
- extraLinkOptionsRelWithDebInfo = this->Makefile->
- GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO");
- }
- if(target->GetType() == cmState::MODULE_LIBRARY)
- {
- extraLinkOptions = this->Makefile->
- GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS");
- extraLinkOptionsDebug = this->Makefile->
- GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS_DEBUG");
- extraLinkOptionsRelease = this->Makefile->
- GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS_RELEASE");
- extraLinkOptionsMinSizeRel = this->Makefile->
- GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL");
- extraLinkOptionsRelWithDebInfo = this->Makefile->
- GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO");
- }
-
- // Get extra linker options for this target.
- if(const char* targetLinkFlags = target->GetProperty("LINK_FLAGS"))
- {
- extraLinkOptions += " ";
- extraLinkOptions += targetLinkFlags;
- }
-
- if(const char* targetLinkFlags = target->GetProperty("LINK_FLAGS_DEBUG"))
- {
- extraLinkOptionsDebug += " ";
- extraLinkOptionsDebug += targetLinkFlags;
- }
-
- if(const char* targetLinkFlags = target->GetProperty("LINK_FLAGS_RELEASE"))
- {
- extraLinkOptionsRelease += " ";
- extraLinkOptionsRelease += targetLinkFlags;
- }
-
- if(const char* targetLinkFlags =
- target->GetProperty("LINK_FLAGS_MINSIZEREL"))
- {
- extraLinkOptionsMinSizeRel += " ";
- extraLinkOptionsMinSizeRel += targetLinkFlags;
- }
-
- if(const char* targetLinkFlags =
- target->GetProperty("LINK_FLAGS_RELWITHDEBINFO"))
- {
- extraLinkOptionsRelWithDebInfo += " ";
- extraLinkOptionsRelWithDebInfo += targetLinkFlags;
- }
-
- // Get standard libraries for this language.
- if(targetBuilds)
- {
- // Get the language to use for linking.
- std::vector<std::string> configs;
- target->Target->GetMakefile()->GetConfigurations(configs);
- std::vector<std::string>::const_iterator it = configs.begin();
- const std::string& linkLanguage = target->GetLinkerLanguage(*it);
- for ( ; it != configs.end(); ++it)
- {
- const std::string& configLinkLanguage = target->GetLinkerLanguage(*it);
- if (configLinkLanguage != linkLanguage)
- {
- cmSystemTools::Error
- ("Linker language must not vary by configuration for target: ",
- target->GetName().c_str());
- }
- }
- if(linkLanguage.empty())
- {
- cmSystemTools::Error
- ("CMake can not determine linker language for target: ",
- target->GetName().c_str());
- return;
- }
-
- // Compute the variable name to lookup standard libraries for this
- // language.
- std::string standardLibsVar = "CMAKE_";
- standardLibsVar += linkLanguage;
- standardLibsVar += "_STANDARD_LIBRARIES";
-
- // Add standard libraries.
- if(const char* stdLibs =
- this->Makefile->GetDefinition(standardLibsVar.c_str()))
- {
- extraLinkOptions += " ";
- extraLinkOptions += stdLibs;
- }
- }
-
- // Compute version number information.
- std::string targetVersionFlag;
- if(target->GetType() == cmState::EXECUTABLE ||
- target->GetType() == cmState::SHARED_LIBRARY ||
- target->GetType() == cmState::MODULE_LIBRARY)
- {
- int major;
- int minor;
- target->GetTargetVersion(major, minor);
- std::ostringstream targetVersionStream;
- targetVersionStream << "/version:" << major << "." << minor;
- targetVersionFlag = targetVersionStream.str();
- }
-
- // Compute the real name of the target.
- std::string outputName =
- "(OUTPUT_NAME is for libraries and executables only)";
- std::string outputNameDebug = outputName;
- std::string outputNameRelease = outputName;
- std::string outputNameMinSizeRel = outputName;
- std::string outputNameRelWithDebInfo = outputName;
- if(target->GetType() == cmState::EXECUTABLE ||
- target->GetType() == cmState::STATIC_LIBRARY ||
- target->GetType() == cmState::SHARED_LIBRARY ||
- target->GetType() == cmState::MODULE_LIBRARY)
- {
- outputName = target->GetFullName();
- outputNameDebug = target->GetFullName("Debug");
- outputNameRelease = target->GetFullName("Release");
- outputNameMinSizeRel = target->GetFullName("MinSizeRel");
- outputNameRelWithDebInfo = target->GetFullName("RelWithDebInfo");
- }
- else if(target->GetType() == cmState::OBJECT_LIBRARY)
- {
- outputName = target->GetName();
- outputName += ".lib";
- outputNameDebug = outputName;
- outputNameRelease = outputName;
- outputNameMinSizeRel = outputName;
- outputNameRelWithDebInfo = outputName;
- }
-
- // Compute the output directory for the target.
- std::string outputDirOld;
- std::string outputDirDebug;
- std::string outputDirRelease;
- std::string outputDirMinSizeRel;
- std::string outputDirRelWithDebInfo;
- if(target->GetType() == cmState::EXECUTABLE ||
- target->GetType() == cmState::STATIC_LIBRARY ||
- target->GetType() == cmState::SHARED_LIBRARY ||
- target->GetType() == cmState::MODULE_LIBRARY)
- {
-#ifdef CM_USE_OLD_VS6
- outputDirOld =
- removeQuotes(this->ConvertToOutputFormat
- (target->GetDirectory().c_str(), SHELL));
-#endif
- outputDirDebug =
- removeQuotes(this->ConvertToOutputFormat(
- target->GetDirectory("Debug").c_str(), SHELL));
- outputDirRelease =
- removeQuotes(this->ConvertToOutputFormat(
- target->GetDirectory("Release").c_str(), SHELL));
- outputDirMinSizeRel =
- removeQuotes(this->ConvertToOutputFormat(
- target->GetDirectory("MinSizeRel").c_str(), SHELL));
- outputDirRelWithDebInfo =
- removeQuotes(this->ConvertToOutputFormat(
- target->GetDirectory("RelWithDebInfo").c_str(), SHELL));
- }
- else if(target->GetType() == cmState::OBJECT_LIBRARY)
- {
- std::string outputDir = cmake::GetCMakeFilesDirectoryPostSlash();
- outputDirDebug = outputDir + "Debug";
- outputDirRelease = outputDir + "Release";
- outputDirMinSizeRel = outputDir + "MinSizeRel";
- outputDirRelWithDebInfo = outputDir + "RelWithDebInfo";
- }
-
- // Compute the proper link information for the target.
- std::string optionsDebug;
- std::string optionsRelease;
- std::string optionsMinSizeRel;
- std::string optionsRelWithDebInfo;
- if(target->GetType() == cmState::EXECUTABLE ||
- target->GetType() == cmState::SHARED_LIBRARY ||
- target->GetType() == cmState::MODULE_LIBRARY)
- {
- extraLinkOptionsDebug =
- extraLinkOptions + " " + extraLinkOptionsDebug;
- extraLinkOptionsRelease =
- extraLinkOptions + " " + extraLinkOptionsRelease;
- extraLinkOptionsMinSizeRel =
- extraLinkOptions + " " + extraLinkOptionsMinSizeRel;
- extraLinkOptionsRelWithDebInfo =
- extraLinkOptions + " " + extraLinkOptionsRelWithDebInfo;
- this->ComputeLinkOptions(target, "Debug", extraLinkOptionsDebug,
- optionsDebug);
- this->ComputeLinkOptions(target, "Release", extraLinkOptionsRelease,
- optionsRelease);
- this->ComputeLinkOptions(target, "MinSizeRel", extraLinkOptionsMinSizeRel,
- optionsMinSizeRel);
- this->ComputeLinkOptions(target, "RelWithDebInfo",
- extraLinkOptionsRelWithDebInfo,
- optionsRelWithDebInfo);
- }
-
- // Compute the path of the import library.
- std::string targetImplibFlagDebug;
- std::string targetImplibFlagRelease;
- std::string targetImplibFlagMinSizeRel;
- std::string targetImplibFlagRelWithDebInfo;
- if(target->GetType() == cmState::SHARED_LIBRARY ||
- target->GetType() == cmState::MODULE_LIBRARY ||
- target->GetType() == cmState::EXECUTABLE)
- {
- std::string fullPathImpDebug = target->GetDirectory("Debug", true);
- std::string fullPathImpRelease = target->GetDirectory("Release", true);
- std::string fullPathImpMinSizeRel =
- target->GetDirectory("MinSizeRel", true);
- std::string fullPathImpRelWithDebInfo =
- target->GetDirectory("RelWithDebInfo", true);
- fullPathImpDebug += "/";
- fullPathImpRelease += "/";
- fullPathImpMinSizeRel += "/";
- fullPathImpRelWithDebInfo += "/";
- fullPathImpDebug += target->GetFullName("Debug", true);
- fullPathImpRelease += target->GetFullName("Release", true);
- fullPathImpMinSizeRel += target->GetFullName("MinSizeRel", true);
- fullPathImpRelWithDebInfo += target->GetFullName("RelWithDebInfo", true);
-
- targetImplibFlagDebug = "/implib:";
- targetImplibFlagRelease = "/implib:";
- targetImplibFlagMinSizeRel = "/implib:";
- targetImplibFlagRelWithDebInfo = "/implib:";
- targetImplibFlagDebug +=
- this->ConvertToOutputFormat(fullPathImpDebug.c_str(), SHELL);
- targetImplibFlagRelease +=
- this->ConvertToOutputFormat(fullPathImpRelease.c_str(), SHELL);
- targetImplibFlagMinSizeRel +=
- this->ConvertToOutputFormat(fullPathImpMinSizeRel.c_str(), SHELL);
- targetImplibFlagRelWithDebInfo +=
- this->ConvertToOutputFormat(fullPathImpRelWithDebInfo.c_str(), SHELL);
- }
-
-#ifdef CM_USE_OLD_VS6
- // Compute link information for the target.
- if(!extraLinkOptions.empty())
- {
- libOptions += " ";
- libOptions += extraLinkOptions;
- libOptions += " ";
- libMultiLineOptions += "# ADD LINK32 ";
- libMultiLineOptions += extraLinkOptions;
- libMultiLineOptions += " \n";
- libMultiLineOptionsForDebug += "# ADD LINK32 ";
- libMultiLineOptionsForDebug += extraLinkOptions;
- libMultiLineOptionsForDebug += " \n";
- }
-#endif
-
- // are there any custom rules on the target itself
- // only if the target is a lib or exe
- std::string customRuleCodeRelease
- = this->CreateTargetRules(target, "RELEASE", libName);
- std::string customRuleCodeDebug
- = this->CreateTargetRules(target, "DEBUG", libName);
- std::string customRuleCodeMinSizeRel
- = this->CreateTargetRules(target, "MINSIZEREL", libName);
- std::string customRuleCodeRelWithDebInfo
- = this->CreateTargetRules(target, "RELWITHDEBINFO", libName);
-
- cmsys::ifstream fin(this->DSPHeaderTemplate.c_str());
- if(!fin)
- {
- cmSystemTools::Error("Error Reading ", this->DSPHeaderTemplate.c_str());
- }
- std::string staticLibOptions;
- std::string staticLibOptionsDebug;
- std::string staticLibOptionsRelease;
- std::string staticLibOptionsMinSizeRel;
- std::string staticLibOptionsRelWithDebInfo;
- if(target->GetType() == cmState::STATIC_LIBRARY )
- {
- const char *libflagsGlobal =
- this->Makefile->GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS");
- this->AppendFlags(staticLibOptions, libflagsGlobal);
- this->AppendFlags(staticLibOptionsDebug, libflagsGlobal);
- this->AppendFlags(staticLibOptionsRelease, libflagsGlobal);
- this->AppendFlags(staticLibOptionsMinSizeRel, libflagsGlobal);
- this->AppendFlags(staticLibOptionsRelWithDebInfo, libflagsGlobal);
-
- this->AppendFlags(staticLibOptionsDebug, this->Makefile->
- GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS_DEBUG"));
- this->AppendFlags(staticLibOptionsRelease, this->Makefile->
- GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS_RELEASE"));
- this->AppendFlags(staticLibOptionsMinSizeRel, this->Makefile->
- GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL"));
- this->AppendFlags(staticLibOptionsRelWithDebInfo, this->Makefile->
- GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO"));
-
- const char *libflags = target->GetProperty("STATIC_LIBRARY_FLAGS");
- this->AppendFlags(staticLibOptions, libflags);
- this->AppendFlags(staticLibOptionsDebug, libflags);
- this->AppendFlags(staticLibOptionsRelease, libflags);
- this->AppendFlags(staticLibOptionsMinSizeRel, libflags);
- this->AppendFlags(staticLibOptionsRelWithDebInfo, libflags);
-
- this->AppendFlags(staticLibOptionsDebug,
- target->GetProperty("STATIC_LIBRARY_FLAGS_DEBUG"));
- this->AppendFlags(staticLibOptionsRelease,
- target->GetProperty("STATIC_LIBRARY_FLAGS_RELEASE"));
- this->AppendFlags(staticLibOptionsMinSizeRel,
- target->GetProperty("STATIC_LIBRARY_FLAGS_MINSIZEREL"));
- this->AppendFlags(staticLibOptionsRelWithDebInfo,
- target->GetProperty("STATIC_LIBRARY_FLAGS_RELWITHDEBINFO"));
-
- std::string objects;
- this->OutputObjects(target, "LIB", objects);
- if(!objects.empty())
- {
- objects = "\n" + objects;
- staticLibOptionsDebug += objects;
- staticLibOptionsRelease += objects;
- staticLibOptionsMinSizeRel += objects;
- staticLibOptionsRelWithDebInfo += objects;
- }
- }
-
- // Add the export symbol definition for shared library objects.
- std::string exportSymbol;
- if(const char* exportMacro = target->GetExportMacro())
- {
- exportSymbol = exportMacro;
- }
-
- std::string line;
- std::string libnameExports;
- if(!exportSymbol.empty())
- {
- libnameExports = "/D \"";
- libnameExports += exportSymbol;
- libnameExports += "\"";
- }
- while(cmSystemTools::GetLineFromStream(fin, line))
- {
- const char* mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG");
- if(!mfcFlag)
- {
- mfcFlag = "0";
- }
- cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME_EXPORTS",
- libnameExports.c_str());
- cmSystemTools::ReplaceString(line, "CMAKE_MFC_FLAG",
- mfcFlag);
- if(target->GetType() == cmState::STATIC_LIBRARY ||
- target->GetType() == cmState::OBJECT_LIBRARY)
- {
- cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS_DEBUG",
- staticLibOptionsDebug.c_str());
- cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS_RELEASE",
- staticLibOptionsRelease.c_str());
- cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS_MINSIZEREL",
- staticLibOptionsMinSizeRel.c_str());
- cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS_RELWITHDEBINFO",
- staticLibOptionsRelWithDebInfo.c_str());
- cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS",
- staticLibOptions.c_str());
- }
- if(this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
- {
- cmSystemTools::ReplaceString(line, "/nologo", "");
- }
-
-#ifdef CM_USE_OLD_VS6
- cmSystemTools::ReplaceString(line, "CM_LIBRARIES",
- libOptions.c_str());
- cmSystemTools::ReplaceString(line, "CM_DEBUG_LIBRARIES",
- libDebugOptions.c_str());
- cmSystemTools::ReplaceString(line, "CM_OPTIMIZED_LIBRARIES",
- libOptimizedOptions.c_str());
- cmSystemTools::ReplaceString(line, "CM_MULTILINE_LIBRARIES_FOR_DEBUG",
- libMultiLineOptionsForDebug.c_str());
- cmSystemTools::ReplaceString(line, "CM_MULTILINE_LIBRARIES",
- libMultiLineOptions.c_str());
- cmSystemTools::ReplaceString(line, "CM_MULTILINE_DEBUG_LIBRARIES",
- libMultiLineDebugOptions.c_str());
- cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIMIZED_LIBRARIES",
- libMultiLineOptimizedOptions.c_str());
-#endif
-
- // Substitute the rules for custom command. When specifying just the
- // target name for the command the command can be different for
- // different configs
- cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE_RELEASE",
- customRuleCodeRelease.c_str());
- cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE_DEBUG",
- customRuleCodeDebug.c_str());
- cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE_MINSIZEREL",
- customRuleCodeMinSizeRel.c_str());
- cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE_RELWITHDEBINFO",
- customRuleCodeRelWithDebInfo.c_str());
-
- // Substitute the real output name into the template.
- cmSystemTools::ReplaceString(line, "OUTPUT_NAME_DEBUG",
- outputNameDebug.c_str());
- cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELEASE",
- outputNameRelease.c_str());
- cmSystemTools::ReplaceString(line, "OUTPUT_NAME_MINSIZEREL",
- outputNameMinSizeRel.c_str());
- cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELWITHDEBINFO",
- outputNameRelWithDebInfo.c_str());
- cmSystemTools::ReplaceString(line, "OUTPUT_NAME", outputName.c_str());
-
- // Substitute the proper link information into the template.
- cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_DEBUG",
- optionsDebug.c_str());
- cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELEASE",
- optionsRelease.c_str());
- cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_MINSIZEREL",
- optionsMinSizeRel.c_str());
- cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELWITHDEBINFO",
- optionsRelWithDebInfo.c_str());
-
- cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_DEBUG",
- includeOptionsDebug.c_str());
- cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_RELEASE",
- includeOptionsRelease.c_str());
- cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_MINSIZEREL",
- includeOptionsMinSizeRel.c_str());
- cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_RELWITHDEBINFO",
- includeOptionsRelWithDebInfo.c_str());
-
- cmSystemTools::ReplaceString(line, "TARGET_VERSION_FLAG",
- targetVersionFlag.c_str());
- cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_DEBUG",
- targetImplibFlagDebug.c_str());
- cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_RELEASE",
- targetImplibFlagRelease.c_str());
- cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_MINSIZEREL",
- targetImplibFlagMinSizeRel.c_str());
- cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_RELWITHDEBINFO",
- targetImplibFlagRelWithDebInfo.c_str());
-
- std::string vs6name = GetVS6TargetName(libName);
- cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME", vs6name.c_str());
-
-#ifdef CM_USE_OLD_VS6
- // because LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH
- // are already quoted in the template file,
- // we need to remove the quotes here, we still need
- // to convert to output path for unix to win32 conversion
- cmSystemTools::ReplaceString
- (line, "LIBRARY_OUTPUT_PATH",
- removeQuotes(this->ConvertToOutputFormat
- (libPath.c_str(), SHELL)).c_str());
- cmSystemTools::ReplaceString
- (line, "EXECUTABLE_OUTPUT_PATH",
- removeQuotes(this->ConvertToOutputFormat
- (exePath.c_str(), SHELL)).c_str());
-#endif
-
- if(targetBuilds || target->GetType() == cmState::OBJECT_LIBRARY)
- {
- cmSystemTools::ReplaceString(line, "OUTPUT_DIRECTORY_DEBUG",
- outputDirDebug.c_str());
- cmSystemTools::ReplaceString(line, "OUTPUT_DIRECTORY_RELEASE",
- outputDirRelease.c_str());
- cmSystemTools::ReplaceString(line, "OUTPUT_DIRECTORY_MINSIZEREL",
- outputDirMinSizeRel.c_str());
- cmSystemTools::ReplaceString(line, "OUTPUT_DIRECTORY_RELWITHDEBINFO",
- outputDirRelWithDebInfo.c_str());
- if(!outputDirOld.empty())
- {
- cmSystemTools::ReplaceString(line, "OUTPUT_DIRECTORY",
- outputDirOld.c_str());
- }
- }
-
- cmSystemTools::ReplaceString(line,
- "EXTRA_DEFINES",
- this->Makefile->GetDefineFlags());
- const char* debugPostfix
- = this->Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
- cmSystemTools::ReplaceString(line, "DEBUG_POSTFIX",
- debugPostfix?debugPostfix:"");
- if(target->GetType() >= cmState::EXECUTABLE &&
- target->GetType() <= cmState::OBJECT_LIBRARY)
- {
- // store flags for each configuration
- std::string flags = " ";
- std::string flagsRelease = " ";
- std::string flagsMinSizeRel = " ";
- std::string flagsDebug = " ";
- std::string flagsRelWithDebInfo = " ";
- std::vector<std::string> configs;
- target->Target->GetMakefile()->GetConfigurations(configs);
- std::vector<std::string>::const_iterator it = configs.begin();
- const std::string& linkLanguage = target->GetLinkerLanguage(*it);
- for ( ; it != configs.end(); ++it)
- {
- const std::string& configLinkLanguage = target->GetLinkerLanguage(*it);
- if (configLinkLanguage != linkLanguage)
- {
- cmSystemTools::Error
- ("Linker language must not vary by configuration for target: ",
- target->GetName().c_str());
- }
- }
- if(linkLanguage.empty())
- {
- cmSystemTools::Error
- ("CMake can not determine linker language for target: ",
- target->GetName().c_str());
- return;
- }
- // if CXX is on and the target contains cxx code then add the cxx flags
- std::string baseFlagVar = "CMAKE_";
- baseFlagVar += linkLanguage;
- baseFlagVar += "_FLAGS";
- flags = this->Makefile->GetSafeDefinition(baseFlagVar.c_str());
-
- std::string flagVar = baseFlagVar + "_RELEASE";
- flagsRelease = this->Makefile->GetSafeDefinition(flagVar.c_str());
- flagsRelease += " -DCMAKE_INTDIR=\\\"Release\\\" ";
-
- flagVar = baseFlagVar + "_MINSIZEREL";
- flagsMinSizeRel = this->Makefile->GetSafeDefinition(flagVar.c_str());
- flagsMinSizeRel += " -DCMAKE_INTDIR=\\\"MinSizeRel\\\" ";
-
- flagVar = baseFlagVar + "_DEBUG";
- flagsDebug = this->Makefile->GetSafeDefinition(flagVar.c_str());
- flagsDebug += " -DCMAKE_INTDIR=\\\"Debug\\\" ";
-
- flagVar = baseFlagVar + "_RELWITHDEBINFO";
- flagsRelWithDebInfo = this->Makefile->GetSafeDefinition(flagVar.c_str());
- flagsRelWithDebInfo += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" ";
-
- this->AddCompileOptions(flags, target, linkLanguage, "");
- this->AddCompileOptions(flagsDebug, target, linkLanguage, "Debug");
- this->AddCompileOptions(flagsRelease, target, linkLanguage, "Release");
- this->AddCompileOptions(flagsMinSizeRel, target, linkLanguage,
- "MinSizeRel");
- this->AddCompileOptions(flagsRelWithDebInfo, target, linkLanguage,
- "RelWithDebInfo");
-
- // if _UNICODE and _SBCS are not found, then add -D_MBCS
- std::string defs = this->Makefile->GetDefineFlags();
- if(flags.find("D_UNICODE") == flags.npos &&
- defs.find("D_UNICODE") == flags.npos &&
- flags.find("D_SBCS") == flags.npos &&
- defs.find("D_SBCS") == flags.npos)
- {
- flags += " /D \"_MBCS\"";
- }
-
- // Add per-target and per-configuration preprocessor definitions.
- std::set<std::string> definesSet;
- std::set<std::string> debugDefinesSet;
- std::set<std::string> releaseDefinesSet;
- std::set<std::string> minsizeDefinesSet;
- std::set<std::string> debugrelDefinesSet;
-
- this->AddCompileDefinitions(definesSet, target, "", linkLanguage);
- this->AddCompileDefinitions(debugDefinesSet, target,
- "DEBUG", linkLanguage);
- this->AddCompileDefinitions(releaseDefinesSet, target,
- "RELEASE", linkLanguage);
- this->AddCompileDefinitions(minsizeDefinesSet, target,
- "MINSIZEREL", linkLanguage);
- this->AddCompileDefinitions(debugrelDefinesSet, target,
- "RELWITHDEBINFO", linkLanguage);
-
- std::string defines = " ";
- std::string debugDefines = " ";
- std::string releaseDefines = " ";
- std::string minsizeDefines = " ";
- std::string debugrelDefines = " ";
-
- this->JoinDefines(definesSet, defines, "");
- this->JoinDefines(debugDefinesSet, debugDefines, "");
- this->JoinDefines(releaseDefinesSet, releaseDefines, "");
- this->JoinDefines(minsizeDefinesSet, minsizeDefines, "");
- this->JoinDefines(debugrelDefinesSet, debugrelDefines, "");
-
- flags += defines;
- flagsDebug += debugDefines;
- flagsRelease += releaseDefines;
- flagsMinSizeRel += minsizeDefines;
- flagsRelWithDebInfo += debugrelDefines;
-
- // The template files have CXX FLAGS in them, that need to be replaced.
- // There are not separate CXX and C template files, so we use the same
- // variable names. The previous code sets up flags* variables to
- // contain the correct C or CXX flags
- cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_MINSIZEREL",
- flagsMinSizeRel.c_str());
- cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_DEBUG",
- flagsDebug.c_str());
- cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELWITHDEBINFO",
- flagsRelWithDebInfo.c_str());
- cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELEASE",
- flagsRelease.c_str());
- cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS", flags.c_str());
-
- cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_MINSIZEREL",
- minsizeDefines.c_str());
- cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_DEBUG",
- debugDefines.c_str());
- cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_RELWITHDEBINFO",
- debugrelDefines.c_str());
- cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_RELEASE",
- releaseDefines.c_str());
- cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS",
- defines.c_str());
- }
-
- fout << line.c_str() << std::endl;
- }
-}
-
-void cmLocalVisualStudio6Generator::WriteDSPFooter(std::ostream& fout)
-{
- cmsys::ifstream fin(this->DSPFooterTemplate.c_str());
- if(!fin)
- {
- cmSystemTools::Error("Error Reading ",
- this->DSPFooterTemplate.c_str());
- }
- std::string line;
- while(cmSystemTools::GetLineFromStream(fin, line))
- {
- fout << line << std::endl;
- }
-}
-
-//----------------------------------------------------------------------------
-void cmLocalVisualStudio6Generator
-::ComputeLinkOptions(cmGeneratorTarget *target,
- const std::string& configName,
- const std::string extraOptions,
- std::string& options)
-{
- // Compute the link information for this configuration.
- cmComputeLinkInformation* pcli = target->GetLinkInformation(configName);
- if(!pcli)
- {
- return;
- }
- cmComputeLinkInformation& cli = *pcli;
- typedef cmComputeLinkInformation::ItemVector ItemVector;
- ItemVector const& linkLibs = cli.GetItems();
- std::vector<std::string> const& linkDirs = cli.GetDirectories();
-
- this->OutputObjects(target, "LINK", options);
-
- // Build the link options code.
- for(std::vector<std::string>::const_iterator d = linkDirs.begin();
- d != linkDirs.end(); ++d)
- {
- std::string dir = *d;
- if(!dir.empty())
- {
- if(dir[dir.size()-1] != '/')
- {
- dir += "/";
- }
- dir += "$(IntDir)";
- options += "# ADD LINK32 /LIBPATH:";
- options += this->ConvertToOutputFormat(dir.c_str(), SHELL);
- options += " /LIBPATH:";
- options += this->ConvertToOutputFormat(d->c_str(), SHELL);
- options += "\n";
- }
- }
- for(ItemVector::const_iterator l = linkLibs.begin();
- l != linkLibs.end(); ++l)
- {
- options += "# ADD LINK32 ";
- if(l->IsPath)
- {
- options +=
- this->ConvertToOutputFormat(l->Value.c_str(), SHELL);
- }
- else if (!l->Target
- || l->Target->GetType() != cmState::INTERFACE_LIBRARY)
- {
- options += l->Value;
- }
- options += "\n";
- }
-
- // Add extra options if any.
- if(!extraOptions.empty())
- {
- options += "# ADD LINK32 ";
- options += extraOptions;
- options += "\n";
- }
-}
-
-//----------------------------------------------------------------------------
-void cmLocalVisualStudio6Generator
-::OutputObjects(cmGeneratorTarget* target, const char* tool,
- std::string& options)
-{
- // VS 6 does not support per-config source locations so we
- // list object library content on the link line instead.
- std::vector<std::string> objs;
- target->UseObjectLibraries(objs, "");
- for(std::vector<std::string>::const_iterator
- oi = objs.begin(); oi != objs.end(); ++oi)
- {
- options += "# ADD ";
- options += tool;
- options += "32 ";
- options += this->ConvertToOutputFormat(oi->c_str(), SHELL);
- options += "\n";
- }
-}
-
-std::string
-cmLocalVisualStudio6Generator
-::GetTargetDirectory(cmGeneratorTarget const*) const
-{
- // No per-target directory for this generator (yet).
- return "";
-}
-
-//----------------------------------------------------------------------------
-std::string
-cmLocalVisualStudio6Generator
-::ComputeLongestObjectDirectory(cmGeneratorTarget const*) const
-{
- // Compute the maximum length configuration name.
- std::string config_max;
- for(std::vector<std::string>::const_iterator
- i = this->Configurations.begin();
- i != this->Configurations.end(); ++i)
- {
- // Strip the subdirectory name out of the configuration name.
- std::string config = this->GetConfigName(*i);
- if(config.size() > config_max.size())
- {
- config_max = config;
- }
- }
-
- // Compute the maximum length full path to the intermediate
- // files directory for any configuration. This is used to construct
- // object file names that do not produce paths that are too long.
- std::string dir_max;
- dir_max += this->GetCurrentBinaryDirectory();
- dir_max += "/";
- dir_max += config_max;
- dir_max += "/";
- return dir_max;
-}
-
-std::string
-cmLocalVisualStudio6Generator
-::GetConfigName(std::string const& configuration) const
-{
- // Strip the subdirectory name out of the configuration name.
- std::string config = configuration;
- std::string::size_type pos = config.find_last_of(" ");
- config = config.substr(pos+1, std::string::npos);
- config = config.substr(0, config.size()-1);
- return config;
-}
-
-//----------------------------------------------------------------------------
-bool
-cmLocalVisualStudio6Generator
-::CheckDefinition(std::string const& define) const
-{
- // Perform the standard check first.
- if(!this->cmLocalGenerator::CheckDefinition(define))
- {
- return false;
- }
-
- // Now do the VS6-specific check.
- if(define.find_first_of(" ") != define.npos &&
- define.find_first_of("\"$;") != define.npos)
- {
- std::ostringstream e;
- e << "WARNING: The VS6 IDE does not support preprocessor definition "
- << "values with spaces and '\"', '$', or ';'.\n"
- << "CMake is dropping a preprocessor definition: " << define << "\n"
- << "Consider defining the macro in a (configured) header file.\n";
- cmSystemTools::Message(e.str().c_str());
- return false;
- }
-
- // Assume it is supported.
- return true;
-}
diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h
deleted file mode 100644
index dab32a5..0000000
--- a/Source/cmLocalVisualStudio6Generator.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*============================================================================
- CMake - Cross Platform Makefile Generator
- Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
- Distributed under the OSI-approved BSD License (the "License");
- see accompanying file Copyright.txt for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License for more information.
-============================================================================*/
-#ifndef cmLocalVisualStudio6Generator_h
-#define cmLocalVisualStudio6Generator_h
-
-#include "cmLocalVisualStudioGenerator.h"
-
-class cmSourceFile;
-class cmSourceGroup;
-class cmCustomCommand;
-
-/** \class cmLocalVisualStudio6Generator
- * \brief Write a LocalUnix makefiles.
- *
- * cmLocalVisualStudio6Generator produces a LocalUnix makefile from its
- * member this->Makefile.
- */
-class cmLocalVisualStudio6Generator : public cmLocalVisualStudioGenerator
-{
-public:
- ///! Set cache only and recurse to false by default.
- cmLocalVisualStudio6Generator(cmGlobalGenerator* gg, cmMakefile* mf);
-
- virtual ~cmLocalVisualStudio6Generator();
-
- virtual void AddCMakeListsRules();
-
- /**
- * Generate the makefile for this directory.
- */
- virtual void Generate();
-
- void OutputDSPFile();
-
- enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE, WIN32_EXECUTABLE, UTILITY};
-
- /**
- * Specify the type of the build: static, dll, or executable.
- */
- void SetBuildType(BuildType, const std::string& libName, cmGeneratorTarget*);
-
- virtual
- std::string GetTargetDirectory(cmGeneratorTarget const* target) const;
- virtual std::string
- ComputeLongestObjectDirectory(cmGeneratorTarget const*) const;
-private:
- std::string DSPHeaderTemplate;
- std::string DSPFooterTemplate;
-
- void CreateSingleDSP(const std::string& lname, cmGeneratorTarget* tgt);
- void WriteDSPFile(std::ostream& fout, const std::string& libName,
- cmGeneratorTarget* tgt);
- void WriteDSPBeginGroup(std::ostream& fout,
- const char* group,
- const char* filter);
- void WriteDSPEndGroup(std::ostream& fout);
-
- void WriteDSPHeader(std::ostream& fout, const std::string& libName,
- cmGeneratorTarget* tgt, std::vector<cmSourceGroup> &sgs);
-
- void WriteDSPFooter(std::ostream& fout);
- void AddDSPBuildRule(cmGeneratorTarget* tgt);
- void WriteCustomRule(std::ostream& fout,
- const char* source,
- const cmCustomCommand& command,
- const char* flags);
- void AddUtilityCommandHack(cmGeneratorTarget* target, int count,
- std::vector<std::string>& depends,
- const cmCustomCommand& origCommand);
- void WriteGroup(const cmSourceGroup *sg, cmGeneratorTarget* target,
- std::ostream &fout, const std::string& libName);
- class EventWriter;
- friend class EventWriter;
- cmsys::auto_ptr<cmCustomCommand>
- MaybeCreateOutputDir(cmGeneratorTarget *target, const std::string& config);
- std::string CreateTargetRules(cmGeneratorTarget* target,
- const std::string& configName,
- const std::string& libName);
- void ComputeLinkOptions(cmGeneratorTarget* target,
- const std::string& configName,
- const std::string extraOptions,
- std::string& options);
- void OutputObjects(cmGeneratorTarget* target, const char* tool,
- std::string& options);
- std::string GetTargetIncludeOptions(cmGeneratorTarget* target,
- const std::string& config);
- std::vector<std::string> Configurations;
-
- std::string GetConfigName(std::string const& configuration) const;
-
- // Special definition check for VS6.
- virtual bool CheckDefinition(std::string const& define) const;
-};
-
-#endif
-
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index ae6a24e..abae564 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -25,7 +25,7 @@
#include <ctype.h> // for isspace
-static bool cmLVS6G_IsFAT(const char* dir);
+static bool cmLVS7G_IsFAT(const char* dir);
class cmLocalVisualStudio7GeneratorInternals
{
@@ -999,7 +999,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& 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 (cmLVS7G_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
@@ -1012,6 +1012,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
this->OutputTargetRules(fout, configName, target, libName);
this->OutputBuildTool(fout, configName, target, targetOptions);
+ this->OutputDeploymentDebuggerTool(fout, configName, target);
fout << "\t\t</Configuration>\n";
}
@@ -1374,6 +1375,32 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
}
}
+void cmLocalVisualStudio7Generator::OutputDeploymentDebuggerTool(
+ std::ostream& fout, std::string const& config, cmGeneratorTarget* target)
+{
+ if (this->WindowsCEProject)
+ {
+ if (const char* dir = target->GetProperty("DEPLOYMENT_REMOTE_DIRECTORY"))
+ {
+ fout <<
+ "\t\t\t<DeploymentTool\n"
+ "\t\t\t\tForceDirty=\"-1\"\n"
+ "\t\t\t\tRemoteDirectory=\"" << this->EscapeForXML(dir) << "\"\n"
+ "\t\t\t\tRegisterOutput=\"0\"\n"
+ "\t\t\t\tAdditionalFiles=\"\"/>\n"
+ ;
+ std::string const exe =
+ dir + std::string("\\") + target->GetFullName(config);
+ fout <<
+ "\t\t\t<DebuggerTool\n"
+ "\t\t\t\tRemoteExecutable=\"" << this->EscapeForXML(exe) << "\"\n"
+ "\t\t\t\tArguments=\"\"\n"
+ "\t\t\t/>\n"
+ ;
+ }
+ }
+}
+
//----------------------------------------------------------------------------
void
cmLocalVisualStudio7Generator
@@ -2365,7 +2392,7 @@ std::string cmLocalVisualStudio7Generator
//----------------------------------------------------------------------------
#include <windows.h>
-static bool cmLVS6G_IsFAT(const char* dir)
+static bool cmLVS7G_IsFAT(const char* dir)
{
if(dir[0] && dir[1] == ':')
{
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 7bb9cc6..562f485 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -92,6 +92,9 @@ private:
const std::string& libName);
void OutputBuildTool(std::ostream& fout, const std::string& configName,
cmGeneratorTarget* t, const Options& targetOptions);
+ void OutputDeploymentDebuggerTool(std::ostream& fout,
+ std::string const& config,
+ cmGeneratorTarget* target);
void OutputLibraryDirectories(std::ostream& fout,
std::vector<std::string> const& dirs);
void WriteProjectSCC(std::ostream& fout, cmGeneratorTarget *target);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 950b247..1df5cec 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -733,26 +733,6 @@ void cmMakefile::ConfigureFinalPass()
"with CMake 2.4 or later. For compatibility with older versions please "
"use any CMake 2.8.x release or lower.");
}
-#if defined(_WIN32) && !defined(__CYGWIN__)
- // Do old-style link dependency analysis only for CM_USE_OLD_VS6.
- if(this->GetGlobalGenerator()->IsForVS6())
- {
- for (cmTargets::iterator l = this->Targets.begin();
- l != this->Targets.end(); l++)
- {
- if (l->second.GetType() == cmState::INTERFACE_LIBRARY)
- {
- continue;
- }
- // Erase any cached link information that might have been comptued
- // on-demand during the configuration. This ensures that build
- // system generation uses up-to-date information even if other cache
- // invalidation code in this source file is buggy.
-
- l->second.AnalyzeLibDependenciesForVS6(*this);
- }
- }
-#endif
}
//----------------------------------------------------------------------------
@@ -1334,14 +1314,6 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
return false;
}
- // VS6 IDE does not support definition values with spaces in
- // combination with '"', '$', or ';'.
- if((this->GetGlobalGenerator()->GetName() == "Visual Studio 6") &&
- (def.find(" ") != def.npos && def.find_first_of("\"$;") != def.npos))
- {
- return false;
- }
-
// Definitions with non-trivial values require a policy check.
static cmsys::RegularExpression
trivial("^[-/]D[A-Za-z_][A-Za-z0-9_]*(=[A-Za-z0-9_.]+)?$");
@@ -3766,17 +3738,13 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
}
// Always search in the standard modules location.
- const char* cmakeRoot = this->GetDefinition("CMAKE_ROOT");
- if(cmakeRoot)
- {
- moduleInCMakeRoot = cmakeRoot;
- moduleInCMakeRoot += "/Modules/";
- moduleInCMakeRoot += filename;
- cmSystemTools::ConvertToUnixSlashes(moduleInCMakeRoot);
- if(!cmSystemTools::FileExists(moduleInCMakeRoot.c_str()))
- {
- moduleInCMakeRoot = "";
- }
+ moduleInCMakeRoot = cmSystemTools::GetCMakeRoot();
+ moduleInCMakeRoot += "/Modules/";
+ moduleInCMakeRoot += filename;
+ cmSystemTools::ConvertToUnixSlashes(moduleInCMakeRoot);
+ if(!cmSystemTools::FileExists(moduleInCMakeRoot.c_str()))
+ {
+ moduleInCMakeRoot = "";
}
// Normally, prefer the files found in CMAKE_MODULE_PATH. Only when the file
@@ -3791,7 +3759,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
if (!moduleInCMakeModulePath.empty() && !moduleInCMakeRoot.empty())
{
const char* currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE");
- std::string mods = cmakeRoot + std::string("/Modules/");
+ std::string mods = cmSystemTools::GetCMakeRoot() + "/Modules/";
if (currentFile && strncmp(currentFile, mods.c_str(), mods.size()) == 0)
{
switch (this->GetPolicyStatus(cmPolicies::CMP0017))
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 1923ea4..435844e 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -841,37 +841,3 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
this->CleanFiles.insert(this->CleanFiles.end(),
libCleanFiles.begin(),libCleanFiles.end());
}
-
-//----------------------------------------------------------------------------
-void
-cmMakefileLibraryTargetGenerator
-::AppendOSXVerFlag(std::string& flags, const std::string& lang,
- const char* name, bool so)
-{
- // Lookup the flag to specify the version.
- std::string fvar = "CMAKE_";
- fvar += lang;
- fvar += "_OSX_";
- fvar += name;
- fvar += "_VERSION_FLAG";
- const char* flag = this->Makefile->GetDefinition(fvar);
-
- // Skip if no such flag.
- if(!flag)
- {
- return;
- }
-
- // Lookup the target version information.
- int major;
- int minor;
- int patch;
- this->GeneratorTarget->GetTargetVersion(so, major, minor, patch);
- if(major > 0 || minor > 0 || patch > 0)
- {
- // Append the flag since a non-zero version is specified.
- std::ostringstream vflag;
- vflag << flag << major << "." << minor << "." << patch;
- this->LocalGenerator->AppendFlags(flags, vflag.str());
- }
-}
diff --git a/Source/cmMakefileLibraryTargetGenerator.h b/Source/cmMakefileLibraryTargetGenerator.h
index 68980c3..009f15d 100644
--- a/Source/cmMakefileLibraryTargetGenerator.h
+++ b/Source/cmMakefileLibraryTargetGenerator.h
@@ -38,9 +38,6 @@ protected:
// Store the computd framework version for OS X Frameworks.
std::string FrameworkVersion;
-
- void AppendOSXVerFlag(std::string& flags, const std::string& lang,
- const char* name, bool so);
};
#endif
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 17561b5..c34df3c 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -504,6 +504,16 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
}
}
+ // Add OS X version flags, if any.
+ if(this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
+ this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
+ {
+ this->AppendOSXVerFlag(vars["LINK_FLAGS"], this->TargetLinkLanguage,
+ "COMPATIBILITY", true);
+ this->AppendOSXVerFlag(vars["LINK_FLAGS"], this->TargetLinkLanguage,
+ "CURRENT", false);
+ }
+
this->addPoolNinjaVariable("JOB_POOL_LINK", &gt, vars);
this->AddModuleDefinitionFlag(vars["LINK_FLAGS"]);
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 08caea3..4cab81f 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -1003,8 +1003,7 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
SetupAutoRccTarget(target);
}
- const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
- std::string inputFile = cmakeRoot;
+ std::string inputFile = cmSystemTools::GetCMakeRoot();
inputFile += "/Modules/AutogenInfo.cmake.in";
std::string outputFile = targetDir;
outputFile += "/AutogenInfo.cmake";
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 3ba7287..9af54bf 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -60,8 +60,7 @@
#endif
#if defined(CMAKE_BUILD_WITH_CMAKE)
-# include <fcntl.h>
-# include "cmCryptoHash.h"
+# include "cmCryptoHash.h"
#endif
#if defined(CMAKE_USE_ELF_PARSER)
@@ -2184,8 +2183,10 @@ unsigned int cmSystemTools::RandomSeed()
} seed;
// Try using a real random source.
- cmsys::ifstream fin("/dev/urandom");
- if(fin && fin.read(seed.bytes, sizeof(seed)) &&
+ cmsys::ifstream fin;
+ fin.rdbuf()->pubsetbuf(0, 0); // Unbuffered read.
+ fin.open("/dev/urandom");
+ if(fin.good() && fin.read(seed.bytes, sizeof(seed)) &&
fin.gcount() == sizeof(seed))
{
return seed.integer;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1986e5f..576189f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -55,9 +55,6 @@ public:
cmTarget::cmTarget()
{
this->Makefile = 0;
-#if defined(_WIN32) && !defined(__CYGWIN__)
- this->LinkLibrariesForVS6Analyzed = false;
-#endif
this->HaveInstallRule = false;
this->DLLPlatform = false;
this->IsAndroid = false;
@@ -699,9 +696,6 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
cmTarget::LibraryID tmp;
tmp.first = lib;
tmp.second = llt;
-#if defined(_WIN32) && !defined(__CYGWIN__)
- this->LinkLibrariesForVS6.push_back( tmp );
-#endif
this->OriginalLinkLibraries.push_back(tmp);
// Add the explicit dependency information for this target. This is
@@ -811,298 +805,6 @@ cmBacktraceRange cmTarget::GetLinkImplementationBacktraces() const
return cmMakeRange(this->Internal->LinkImplementationPropertyBacktraces);
}
-#if defined(_WIN32) && !defined(__CYGWIN__)
-//----------------------------------------------------------------------------
-void
-cmTarget::AnalyzeLibDependenciesForVS6( const cmMakefile& mf )
-{
- // There are two key parts of the dependency analysis: (1)
- // determining the libraries in the link line, and (2) constructing
- // the dependency graph for those libraries.
- //
- // The latter is done using the cache entries that record the
- // dependencies of each library.
- //
- // The former is a more thorny issue, since it is not clear how to
- // determine if two libraries listed on the link line refer to the a
- // single library or not. For example, consider the link "libraries"
- // /usr/lib/libtiff.so -ltiff
- // Is this one library or two? The solution implemented here is the
- // simplest (and probably the only practical) one: two libraries are
- // the same if their "link strings" are identical. Thus, the two
- // libraries above are considered distinct. This also means that for
- // dependency analysis to be effective, the CMake user must specify
- // libraries build by his project without using any linker flags or
- // file extensions. That is,
- // LINK_LIBRARIES( One Two )
- // instead of
- // LINK_LIBRARIES( -lOne ${binarypath}/libTwo.a )
- // The former is probably what most users would do, but it never
- // hurts to document the assumptions. :-) Therefore, in the analysis
- // code, the "canonical name" of a library is simply its name as
- // given to a LINK_LIBRARIES command.
- //
- // Also, we will leave the original link line intact; we will just add any
- // dependencies that were missing.
- //
- // There is a problem with recursive external libraries
- // (i.e. libraries with no dependency information that are
- // recursively dependent). We must make sure that the we emit one of
- // the libraries twice to satisfy the recursion, but we shouldn't
- // emit it more times than necessary. In particular, we must make
- // sure that handling this improbable case doesn't cost us when
- // dealing with the common case of non-recursive libraries. The
- // solution is to assume that the recursion is satisfied at one node
- // of the dependency tree. To illustrate, assume libA and libB are
- // extrenal and mutually dependent. Suppose libX depends on
- // libA, and libY on libA and libX. Then
- // TARGET_LINK_LIBRARIES( Y X A B A )
- // TARGET_LINK_LIBRARIES( X A B A )
- // TARGET_LINK_LIBRARIES( Exec Y )
- // would result in "-lY -lX -lA -lB -lA". This is the correct way to
- // specify the dependencies, since the mutual dependency of A and B
- // is resolved *every time libA is specified*.
- //
- // Something like
- // TARGET_LINK_LIBRARIES( Y X A B A )
- // TARGET_LINK_LIBRARIES( X A B )
- // TARGET_LINK_LIBRARIES( Exec Y )
- // would result in "-lY -lX -lA -lB", and the mutual dependency
- // information is lost. This is because in some case (Y), the mutual
- // dependency of A and B is listed, while in another other case (X),
- // it is not. Depending on which line actually emits A, the mutual
- // dependency may or may not be on the final link line. We can't
- // handle this pathalogical case cleanly without emitting extra
- // libraries for the normal cases. Besides, the dependency
- // information for X is wrong anyway: if we build an executable
- // depending on X alone, we would not have the mutual dependency on
- // A and B resolved.
- //
- // IMPROVEMENTS:
- // -- The current algorithm will not always pick the "optimal" link line
- // when recursive dependencies are present. It will instead break the
- // cycles at an aribtrary point. The majority of projects won't have
- // cyclic dependencies, so this is probably not a big deal. Note that
- // the link line is always correct, just not necessary optimal.
-
- {
- // Expand variables in link library names. This is for backwards
- // compatibility with very early CMake versions and should
- // eventually be removed. This code was moved here from the end of
- // old source list processing code which was called just before this
- // method.
- for(LinkLibraryVectorType::iterator p = this->LinkLibrariesForVS6.begin();
- p != this->LinkLibrariesForVS6.end(); ++p)
- {
- this->Makefile->ExpandVariablesInString(p->first, true, true);
- }
- }
-
- // The dependency map.
- DependencyMap dep_map;
-
- // 1. Build the dependency graph
- //
- for(LinkLibraryVectorType::reverse_iterator lib
- = this->LinkLibrariesForVS6.rbegin();
- lib != this->LinkLibrariesForVS6.rend(); ++lib)
- {
- this->GatherDependenciesForVS6( mf, *lib, dep_map);
- }
-
- // 2. Remove any dependencies that are already satisfied in the original
- // link line.
- //
- for(LinkLibraryVectorType::iterator lib = this->LinkLibrariesForVS6.begin();
- lib != this->LinkLibrariesForVS6.end(); ++lib)
- {
- for( LinkLibraryVectorType::iterator lib2 = lib;
- lib2 != this->LinkLibrariesForVS6.end(); ++lib2)
- {
- this->DeleteDependencyForVS6( dep_map, *lib, *lib2);
- }
- }
-
-
- // 3. Create the new link line by simply emitting any dependencies that are
- // missing. Start from the back and keep adding.
- //
- std::set<DependencyMap::key_type> done, visited;
- std::vector<DependencyMap::key_type> newLinkLibrariesForVS6;
- for(LinkLibraryVectorType::reverse_iterator lib =
- this->LinkLibrariesForVS6.rbegin();
- lib != this->LinkLibrariesForVS6.rend(); ++lib)
- {
- // skip zero size library entries, this may happen
- // if a variable expands to nothing.
- if (!lib->first.empty())
- {
- this->EmitForVS6( *lib, dep_map, done, visited, newLinkLibrariesForVS6 );
- }
- }
-
- // 4. Add the new libraries to the link line.
- //
- for( std::vector<DependencyMap::key_type>::reverse_iterator k =
- newLinkLibrariesForVS6.rbegin();
- k != newLinkLibrariesForVS6.rend(); ++k )
- {
- // get the llt from the dep_map
- this->LinkLibrariesForVS6.push_back( std::make_pair(k->first,k->second) );
- }
- this->LinkLibrariesForVS6Analyzed = true;
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::InsertDependencyForVS6( DependencyMap& depMap,
- const LibraryID& lib,
- const LibraryID& dep)
-{
- depMap[lib].push_back(dep);
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::DeleteDependencyForVS6( DependencyMap& depMap,
- const LibraryID& lib,
- const LibraryID& dep)
-{
- // Make sure there is an entry in the map for lib. If so, delete all
- // dependencies to dep. There may be repeated entries because of
- // external libraries that are specified multiple times.
- DependencyMap::iterator map_itr = depMap.find( lib );
- if( map_itr != depMap.end() )
- {
- DependencyList& depList = map_itr->second;
- DependencyList::iterator begin =
- std::remove(depList.begin(), depList.end(), dep);
- depList.erase(begin, depList.end());
- }
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::EmitForVS6(const LibraryID lib,
- const DependencyMap& dep_map,
- std::set<LibraryID>& emitted,
- std::set<LibraryID>& visited,
- DependencyList& link_line )
-{
- // It's already been emitted
- if( emitted.find(lib) != emitted.end() )
- {
- return;
- }
-
- // Emit the dependencies only if this library node hasn't been
- // visited before. If it has, then we have a cycle. The recursion
- // that got us here should take care of everything.
-
- if( visited.insert(lib).second )
- {
- if( dep_map.find(lib) != dep_map.end() ) // does it have dependencies?
- {
- const DependencyList& dep_on = dep_map.find( lib )->second;
- DependencyList::const_reverse_iterator i;
-
- // To cater for recursive external libraries, we must emit
- // duplicates on this link line *unless* they were emitted by
- // some other node, in which case we assume that the recursion
- // was resolved then. We making the simplifying assumption that
- // any duplicates on a single link line are on purpose, and must
- // be preserved.
-
- // This variable will keep track of the libraries that were
- // emitted directly from the current node, and not from a
- // recursive call. This way, if we come across a library that
- // has already been emitted, we repeat it iff it has been
- // emitted here.
- std::set<DependencyMap::key_type> emitted_here;
- for( i = dep_on.rbegin(); i != dep_on.rend(); ++i )
- {
- if( emitted_here.find(*i) != emitted_here.end() )
- {
- // a repeat. Must emit.
- emitted.insert(*i);
- link_line.push_back( *i );
- }
- else
- {
- // Emit only if no-one else has
- if( emitted.find(*i) == emitted.end() )
- {
- // emit dependencies
- this->EmitForVS6( *i, dep_map, emitted, visited, link_line );
- // emit self
- emitted.insert(*i);
- emitted_here.insert(*i);
- link_line.push_back( *i );
- }
- }
- }
- }
- }
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::GatherDependenciesForVS6( const cmMakefile& mf,
- const LibraryID& lib,
- DependencyMap& dep_map)
-{
- // If the library is already in the dependency map, then it has
- // already been fully processed.
- if( dep_map.find(lib) != dep_map.end() )
- {
- return;
- }
-
- const char* deps = mf.GetDefinition( lib.first+"_LIB_DEPENDS" );
- if( deps && strcmp(deps,"") != 0 )
- {
- // Make sure this library is in the map, even if it has an empty
- // set of dependencies. This distinguishes the case of explicitly
- // no dependencies with that of unspecified dependencies.
- dep_map[lib];
-
- // Parse the dependency information, which is a set of
- // type, library pairs separated by ";". There is always a trailing ";".
- cmTargetLinkLibraryType llt = GENERAL_LibraryType;
- std::string depline = deps;
- std::string::size_type start = 0;
- std::string::size_type end;
- end = depline.find( ";", start );
- while( end != std::string::npos )
- {
- std::string l = depline.substr( start, end-start );
- if(!l.empty())
- {
- if (l == "debug")
- {
- llt = DEBUG_LibraryType;
- }
- else if (l == "optimized")
- {
- llt = OPTIMIZED_LibraryType;
- }
- else if (l == "general")
- {
- llt = GENERAL_LibraryType;
- }
- else
- {
- LibraryID lib2(l,llt);
- this->InsertDependencyForVS6( dep_map, lib, lib2);
- this->GatherDependenciesForVS6( mf, lib2, dep_map);
- llt = GENERAL_LibraryType;
- }
- }
- start = end+1; // skip the ;
- end = depline.find( ";", start );
- }
- // cannot depend on itself
- this->DeleteDependencyForVS6( dep_map, lib, lib);
- }
-}
-#endif
-
//----------------------------------------------------------------------------
static bool whiteListedInterfaceProperty(const std::string& prop)
{
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 97b0871..4e97c2c 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -245,13 +245,6 @@ public:
cmStringRange GetLinkImplementationEntries() const;
cmBacktraceRange GetLinkImplementationBacktraces() const;
-#if defined(_WIN32) && !defined(__CYGWIN__)
- const LinkLibraryVectorType &GetLinkLibrariesForVS6() const {
- return this->LinkLibrariesForVS6;}
-
- void AnalyzeLibDependenciesForVS6( const cmMakefile& mf );
-#endif
-
struct StrictTargetComparison {
bool operator()(cmTarget const* t1, cmTarget const* t2) const;
};
@@ -259,57 +252,6 @@ public:
private:
bool HandleLocationPropertyPolicy(cmMakefile* context) const;
-#if defined(_WIN32) && !defined(__CYGWIN__)
- /**
- * A list of direct dependencies. Use in conjunction with DependencyMap.
- */
- typedef std::vector< LibraryID > DependencyList;
-
- /**
- * This map holds the dependency graph. map[x] returns a set of
- * direct dependencies of x. Note that the direct depenencies are
- * ordered. This is necessary to handle direct dependencies that
- * themselves have no dependency information.
- */
- typedef std::map< LibraryID, DependencyList > DependencyMap;
-
- /**
- * Inserts \a dep at the end of the dependency list of \a lib.
- */
- void InsertDependencyForVS6( DependencyMap& depMap,
- const LibraryID& lib,
- const LibraryID& dep);
-
- /*
- * Deletes \a dep from the dependency list of \a lib.
- */
- void DeleteDependencyForVS6( DependencyMap& depMap,
- const LibraryID& lib,
- const LibraryID& dep);
-
- /**
- * Emits the library \a lib and all its dependencies into link_line.
- * \a emitted keeps track of the libraries that have been emitted to
- * avoid duplicates--it is more efficient than searching
- * link_line. \a visited is used detect cycles. Note that \a
- * link_line is in reverse order, in that the dependencies of a
- * library are listed before the library itself.
- */
- void EmitForVS6( const LibraryID lib,
- const DependencyMap& dep_map,
- std::set<LibraryID>& emitted,
- std::set<LibraryID>& visited,
- DependencyList& link_line);
-
- /**
- * Finds the dependencies for \a lib and inserts them into \a
- * dep_map.
- */
- void GatherDependenciesForVS6( const cmMakefile& mf,
- const LibraryID& lib,
- DependencyMap& dep_map);
-#endif
-
const char* GetSuffixVariableInternal(bool implib) const;
const char* GetPrefixVariableInternal(bool implib) const;
@@ -338,9 +280,6 @@ private:
std::vector<std::pair<TLLSignature, cmListFileContext> > TLLCommands;
LinkLibraryVectorType PrevLinkedLibraries;
LinkLibraryVectorType OriginalLinkLibraries;
-#if defined(_WIN32) && !defined(__CYGWIN__)
- LinkLibraryVectorType LinkLibrariesForVS6;
-#endif
cmMakefile* Makefile;
cmTargetInternalPointer Internal;
cmState::TargetType TargetTypeValue;
@@ -351,9 +290,6 @@ private:
bool IsImportedTarget;
bool ImportedGloballyVisible;
bool BuildInterfaceIncludesAppended;
-#if defined(_WIN32) && !defined(__CYGWIN__)
- bool LinkLibrariesForVS6Analyzed;
-#endif
std::string ProcessSourceItemCMP0049(const std::string& s);
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index 6fd6ab7..1c795c4 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -12,9 +12,11 @@
#include "cmTimestamp.h"
#include <cstring>
+#include <cstdlib>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sstream>
//----------------------------------------------------------------------------
std::string cmTimestamp::CurrentTime(
@@ -44,7 +46,7 @@ std::string cmTimestamp::FileModificationTime(const char* path,
//----------------------------------------------------------------------------
std::string cmTimestamp::CreateTimestampFromTimeT(time_t timeT,
- std::string formatString, bool utcFlag)
+ std::string formatString, bool utcFlag) const
{
if(formatString.empty())
{
@@ -79,12 +81,12 @@ std::string cmTimestamp::CreateTimestampFromTimeT(time_t timeT,
for(std::string::size_type i = 0; i < formatString.size(); ++i)
{
char c1 = formatString[i];
- char c2 = (i+1 < formatString.size()) ?
- formatString[i+1] : static_cast<char>(0);
+ char c2 = (i + 1 < formatString.size()) ?
+ formatString[i + 1] : static_cast<char>(0);
if(c1 == '%' && c2 != 0)
{
- result += AddTimestampComponent(c2, timeStruct);
+ result += AddTimestampComponent(c2, timeStruct, timeT);
++i;
}
else
@@ -97,8 +99,40 @@ std::string cmTimestamp::CreateTimestampFromTimeT(time_t timeT,
}
//----------------------------------------------------------------------------
+time_t cmTimestamp::CreateUtcTimeTFromTm(struct tm &tm) const
+{
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ return _mkgmtime(&tm);
+#else
+ // From Linux timegm() manpage.
+
+ std::string tz_old = "TZ=";
+ if (const char* tz = cmSystemTools::GetEnv("TZ"))
+ {
+ tz_old += tz;
+ }
+
+ // The standard says that "TZ=" or "TZ=[UNRECOGNIZED_TZ]" means UTC.
+ // It seems that "TZ=" does NOT work, at least under Windows
+ // with neither MSVC nor MinGW, so let's use explicit "TZ=UTC"
+
+ cmSystemTools::PutEnv("TZ=UTC");
+
+ tzset();
+
+ time_t result = mktime(&tm);
+
+ cmSystemTools::PutEnv(tz_old);
+
+ tzset();
+
+ return result;
+#endif
+}
+
+//----------------------------------------------------------------------------
std::string cmTimestamp::AddTimestampComponent(
- char flag, struct tm& timeStruct)
+ char flag, struct tm& timeStruct, const time_t timeT) const
{
std::string formatString = "%";
formatString += flag;
@@ -117,6 +151,26 @@ std::string cmTimestamp::AddTimestampComponent(
case 'y':
case 'Y':
break;
+ case 's': // Seconds since UNIX epoch (midnight 1-jan-1970)
+ {
+ // Build a time_t for UNIX epoch and substract from the input "timeT":
+ struct tm tmUnixEpoch;
+ memset(&tmUnixEpoch, 0, sizeof(tmUnixEpoch));
+ tmUnixEpoch.tm_mday = 1;
+ tmUnixEpoch.tm_year = 1970-1900;
+
+ const time_t unixEpoch = this->CreateUtcTimeTFromTm(tmUnixEpoch);
+ if (unixEpoch == -1)
+ {
+ cmSystemTools::Error("Error generating UNIX epoch in "
+ "STRING(TIMESTAMP ...). Please, file a bug report aginst CMake");
+ return std::string();
+ }
+
+ std::stringstream ss;
+ ss << static_cast<long int>(difftime(timeT, unixEpoch));
+ return ss.str();
+ }
default:
{
return formatString;
diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h
index 24c1869..7c4b216 100644
--- a/Source/cmTimestamp.h
+++ b/Source/cmTimestamp.h
@@ -16,7 +16,7 @@
#include <time.h>
/** \class cmTimestamp
- * \brief Utility class to generate sting representation of a timestamp
+ * \brief Utility class to generate string representation of a timestamp
*
*/
class cmTimestamp
@@ -30,10 +30,13 @@ public:
const std::string& formatString, bool utcFlag);
private:
- std::string CreateTimestampFromTimeT(time_t timeT,
- std::string formatString, bool utcFlag);
+ time_t CreateUtcTimeTFromTm(struct tm& timeStruct) const;
- std::string AddTimestampComponent(char flag, struct tm& timeStruct);
+ std::string CreateTimestampFromTimeT(
+ time_t timeT, std::string formatString, bool utcFlag) const;
+
+ std::string AddTimestampComponent(
+ char flag, struct tm& timeStruct, time_t timeT) const;
};
diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx
index 12ce015..87fbbdf 100644
--- a/Source/cmTryCompileCommand.cxx
+++ b/Source/cmTryCompileCommand.cxx
@@ -28,7 +28,7 @@ bool cmTryCompileCommand
return false;
}
- this->TryCompileCode(argv);
+ this->TryCompileCode(argv, false);
// if They specified clean then we clean up what we can
if (this->SrcFileSignature)
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index b9ffe5e..d4a36c9 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -135,7 +135,7 @@ bool cmTryRunCommand
this->CompileResultVariable = argv[1];
// do the try compile
- int res = this->TryCompileCode(tryCompile);
+ int res = this->TryCompileCode(tryCompile, true);
// now try running the command if it compiled
if (!res)
diff --git a/Source/cmVS14CLFlagTable.h b/Source/cmVS14CLFlagTable.h
index 422f47b..173f624 100644
--- a/Source/cmVS14CLFlagTable.h
+++ b/Source/cmVS14CLFlagTable.h
@@ -28,6 +28,8 @@ static cmVS7FlagTable cmVS14CLFlagTable[] =
"Custom", "Custom", 0},
{"Optimization", "Od",
"Disabled", "Disabled", 0},
+ {"Optimization", "Os",
+ "Minimize Size", "MinSize", 0},
{"Optimization", "O1",
"Minimize Size", "MinSpace", 0},
{"Optimization", "O2",
@@ -172,6 +174,24 @@ static cmVS7FlagTable cmVS14CLFlagTable[] =
{"CompileAsManaged", "clr:oldSyntax",
"Common Language RunTime Support, Old Syntax", "OldSyntax", 0},
+ {"CppLanguageStandard", "",
+ "Default", "Default", 0},
+ {"CppLanguageStandard", "std=c++98",
+ "C++03", "c++98", 0},
+ {"CppLanguageStandard", "std=c++11",
+ "C++11", "c++11", 0},
+ {"CppLanguageStandard", "std=c++1y",
+ "C++14", "c++1y", 0 },
+ {"CppLanguageStandard", "std=c++14",
+ "C++14", "c++1y", 0 },
+ {"CppLanguageStandard", "std=gnu++98",
+ "C++03 (GNU Dialect)", "gnu++98", 0},
+ {"CppLanguageStandard", "std=gnu++11",
+ "C++11 (GNU Dialect)", "gnu++11", 0},
+ {"CppLanguageStandard", "std=gnu++1y",
+ "C++14 (GNU Dialect)", "gnu++1y", 0},
+ {"CppLanguageStandard", "std=gnu++14",
+ "C++14 (GNU Dialect)", "gnu++1y", 0},
//Bool Properties
{"CompileAsWinRT", "ZW", "", "true", 0},
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index da950be..31873b5 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -696,43 +696,51 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
i->c_str(),
1, " Label=\"Configuration\"", "\n");
std::string configType = "<ConfigurationType>";
- switch(this->GeneratorTarget->GetType())
- {
- case cmState::SHARED_LIBRARY:
- case cmState::MODULE_LIBRARY:
- configType += "DynamicLibrary";
- break;
- case cmState::OBJECT_LIBRARY:
- case cmState::STATIC_LIBRARY:
- configType += "StaticLibrary";
- break;
- case cmState::EXECUTABLE:
- if(this->NsightTegra &&
- !this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI"))
- {
- // Android executables are .so too.
+ if (const char* vsConfigurationType =
+ this->GeneratorTarget->GetProperty("VS_CONFIGURATION_TYPE"))
+ {
+ configType += cmVS10EscapeXML(vsConfigurationType);
+ }
+ else
+ {
+ switch(this->GeneratorTarget->GetType())
+ {
+ case cmState::SHARED_LIBRARY:
+ case cmState::MODULE_LIBRARY:
configType += "DynamicLibrary";
- }
- else
- {
- configType += "Application";
- }
- break;
- case cmState::UTILITY:
- case cmState::GLOBAL_TARGET:
- if(this->NsightTegra)
- {
- // Tegra-Android platform does not understand "Utility".
+ break;
+ case cmState::OBJECT_LIBRARY:
+ case cmState::STATIC_LIBRARY:
configType += "StaticLibrary";
- }
- else
- {
- configType += "Utility";
- }
- break;
- case cmState::UNKNOWN_LIBRARY:
- case cmState::INTERFACE_LIBRARY:
- break;
+ break;
+ case cmState::EXECUTABLE:
+ if(this->NsightTegra &&
+ !this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI"))
+ {
+ // Android executables are .so too.
+ configType += "DynamicLibrary";
+ }
+ else
+ {
+ configType += "Application";
+ }
+ break;
+ case cmState::UTILITY:
+ case cmState::GLOBAL_TARGET:
+ if(this->NsightTegra)
+ {
+ // Tegra-Android platform does not understand "Utility".
+ configType += "StaticLibrary";
+ }
+ else
+ {
+ configType += "Utility";
+ }
+ break;
+ case cmState::UNKNOWN_LIBRARY:
+ case cmState::INTERFACE_LIBRARY:
+ break;
+ }
}
configType += "</ConfigurationType>\n";
this->WriteString(configType.c_str(), 2);
@@ -2070,7 +2078,18 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
if(this->MSTools)
{
- this->WriteString("<ObjectFileName>$(IntDir)</ObjectFileName>\n", 3);
+ cmsys::RegularExpression clangToolset("v[0-9]+_clang_.*");
+ const char* toolset = this->GlobalGenerator->GetPlatformToolset();
+ if (toolset && clangToolset.find(toolset))
+ {
+ this->WriteString("<ObjectFileName>"
+ "$(IntDir)%(filename).obj"
+ "</ObjectFileName>\n", 3);
+ }
+ else
+ {
+ this->WriteString("<ObjectFileName>$(IntDir)</ObjectFileName>\n", 3);
+ }
// If not in debug mode, write the DebugInformationFormat field
// without value so PDBs don't get generated uselessly.
diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index 5bc34c1..911e154 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -111,102 +111,102 @@ void cmXCodeObject::Print(std::ostream& out)
for(i = this->ObjectAttributes.begin();
i != this->ObjectAttributes.end(); ++i)
{
- cmXCodeObject* object = i->second;
- if(i->first != "isa")
- {
- cmXCodeObject::Indent(3*indentFactor, out);
- }
- else
- {
+ if(i->first == "isa")
continue;
- }
- if(object->TypeValue == OBJECT_LIST)
- {
- out << i->first << " = (" << separator;
- for(unsigned int k = 0; k < i->second->List.size(); k++)
- {
- cmXCodeObject::Indent(4*indentFactor, out);
- out << i->second->List[k]->Id;
- i->second->List[k]->PrintComment(out);
- out << "," << separator;
- }
- cmXCodeObject::Indent(3*indentFactor, out);
- out << ");" << separator;
- }
- else if(object->TypeValue == ATTRIBUTE_GROUP)
+
+ PrintAttribute(out, 3, separator, indentFactor, i->first, i->second, this);
+ }
+ cmXCodeObject::Indent(2*indentFactor, out);
+ out << "};\n";
+}
+
+void cmXCodeObject::PrintAttribute(std::ostream& out, const int level,
+ const std::string separator,
+ const int factor, const std::string& name,
+ const cmXCodeObject* object,
+ const cmXCodeObject* parent)
+{
+ cmXCodeObject::Indent(level * factor, out);
+ switch(object->TypeValue)
+ {
+ case OBJECT_LIST:
{
- std::map<std::string, cmXCodeObject*>::iterator j;
- out << i->first << " = {";
- if(separator == "\n")
+ out << name << " = (";
+ if(parent->TypeValue != ATTRIBUTE_GROUP)
{
out << separator;
}
- for(j = object->ObjectAttributes.begin(); j !=
- object->ObjectAttributes.end(); ++j)
+ for(unsigned int i = 0; i < object->List.size(); ++i)
{
- cmXCodeObject::Indent(4 *indentFactor, out);
-
- if(j->second->TypeValue == STRING)
- {
- cmXCodeObject::PrintString(out,j->first);
- out << " = ";
- j->second->PrintString(out);
- out << ";";
- }
- else if(j->second->TypeValue == OBJECT_LIST)
+ if(object->List[i]->TypeValue == STRING)
{
- cmXCodeObject::PrintString(out,j->first);
- out << " = (";
- for(unsigned int k = 0; k < j->second->List.size(); k++)
+ object->List[i]->PrintString(out);
+ if(i+1 < object->List.size())
{
- if(j->second->List[k]->TypeValue == STRING)
- {
- j->second->List[k]->PrintString(out);
- out << ", ";
- }
- else
- {
- out << "List_" << k << "_TypeValue_IS_NOT_STRING, ";
- }
+ out << ",";
}
- out << ");";
}
else
{
- cmXCodeObject::PrintString(out,j->first);
- out << " = error_unexpected_TypeValue_" <<
- j->second->TypeValue << ";";
+ cmXCodeObject::Indent((level + 1) * factor, out);
+ out << object->List[i]->Id;
+ object->List[i]->PrintComment(out);
+ out << "," << separator;
}
+ }
+ if(parent->TypeValue != ATTRIBUTE_GROUP)
+ {
+ cmXCodeObject::Indent(level * factor, out);
+ }
+ out << ");" << separator;
+ }
+ break;
+ case ATTRIBUTE_GROUP:
+ {
+ out << name << " = {";
+ if(separator == "\n")
+ {
out << separator;
}
- cmXCodeObject::Indent(3 *indentFactor, out);
+ std::map<std::string, cmXCodeObject*>::const_iterator i;
+ for(i = object->ObjectAttributes.begin();
+ i != object->ObjectAttributes.end(); ++i)
+ {
+ PrintAttribute(out, (level + 1) * factor, separator, factor,
+ i->first, i->second, object);
+ }
+ cmXCodeObject::Indent(level * factor, out);
out << "};" << separator;
}
- else if(object->TypeValue == OBJECT_REF)
+ break;
+
+ case OBJECT_REF:
{
- cmXCodeObject::PrintString(out,i->first);
+ cmXCodeObject::PrintString(out, name);
out << " = " << object->Object->Id;
- if(object->Object->HasComment() && i->first != "remoteGlobalIDString")
+ if(object->Object->HasComment() && name != "remoteGlobalIDString")
{
object->Object->PrintComment(out);
}
out << ";" << separator;
}
- else if(object->TypeValue == STRING)
+ break;
+
+ case STRING:
{
- cmXCodeObject::PrintString(out,i->first);
+ cmXCodeObject::PrintString(out, name);
out << " = ";
object->PrintString(out);
out << ";" << separator;
}
- else
+ break;
+
+ default:
{
- out << "what is this?? " << i->first << "\n";
+ break;
}
}
- cmXCodeObject::Indent(2*indentFactor, out);
- out << "};\n";
}
//----------------------------------------------------------------------------
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h
index bd0f43f..2d876da 100644
--- a/Source/cmXCodeObject.h
+++ b/Source/cmXCodeObject.h
@@ -75,6 +75,10 @@ public:
}
static void Indent(int level, std::ostream& out);
void Print(std::ostream& out);
+ void PrintAttribute(std::ostream& out, const int level,
+ const std::string separator, const int factor,
+ const std::string& name, const cmXCodeObject* object,
+ const cmXCodeObject* parent);
virtual void PrintComment(std::ostream&) {}
static void PrintList(std::vector<cmXCodeObject*> const&,
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 8f6b952..dcc95af 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -51,8 +51,6 @@
// include the generator
#if defined(_WIN32) && !defined(__CYGWIN__)
# if !defined(CMAKE_BOOT_MINGW)
-# include "cmGlobalVisualStudio6Generator.h"
-# include "cmGlobalVisualStudio7Generator.h"
# include "cmGlobalVisualStudio71Generator.h"
# include "cmGlobalVisualStudio8Generator.h"
# include "cmGlobalVisualStudio9Generator.h"
@@ -1429,8 +1427,6 @@ int cmake::ActualConfigure()
const char* GeneratorName;
};
VSRegistryEntryName version[] = {
- {"6.0", "Visual Studio 6"},
- {"7.0", "Visual Studio 7"},
{"7.1", "Visual Studio 7 .NET 2003"},
{"8.0", "Visual Studio 8 2005"},
{"9.0", "Visual Studio 9 2008"},
@@ -1837,10 +1833,6 @@ void cmake::AddDefaultGenerators()
this->Generators.push_back(
cmGlobalVisualStudio71Generator::NewFactory());
this->Generators.push_back(
- cmGlobalVisualStudio7Generator::NewFactory());
- this->Generators.push_back(
- cmGlobalVisualStudio6Generator::NewFactory());
- this->Generators.push_back(
cmGlobalBorlandMakefileGenerator::NewFactory());
this->Generators.push_back(
cmGlobalNMakeMakefileGenerator::NewFactory());
@@ -2417,8 +2409,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
// we have to find the module directory, so we can copy the files
this->AddCMakePaths();
- std::string modulesPath =
- this->State->GetInitializedCacheValue("CMAKE_ROOT");
+ std::string modulesPath = cmSystemTools::GetCMakeRoot();
modulesPath += "/Modules";
std::string inFile = modulesPath;
inFile += "/SystemInformation.cmake";
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index a06b26f..600cc1a 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -60,6 +60,7 @@ static const char * cmDocumentationUsageNote[][2] =
#define CMAKE_BUILD_OPTIONS \
" <dir> = Project binary directory to be built.\n" \
" --target <tgt> = Build <tgt> instead of default targets.\n" \
+ " May only be specified once.\n" \
" --config <cfg> = For multi-configuration tools, choose <cfg>.\n" \
" --clean-first = Build target 'clean' first, then build.\n" \
" (To clean only, use --target 'clean'.)\n" \
@@ -386,6 +387,7 @@ static int do_build(int ac, char const* const* av)
std::string dir;
std::vector<std::string> nativeOptions;
bool clean = false;
+ bool hasTarget = false;
enum Doing { DoingNone, DoingDir, DoingTarget, DoingConfig, DoingNative};
Doing doing = DoingDir;
@@ -397,7 +399,17 @@ static int do_build(int ac, char const* const* av)
}
else if(strcmp(av[i], "--target") == 0)
{
- doing = DoingTarget;
+ if (!hasTarget)
+ {
+ doing = DoingTarget;
+ hasTarget = true;
+ }
+ else
+ {
+ std::cerr << "'--target' may not be specified more than once.\n\n";
+ dir = "";
+ break;
+ }
}
else if(strcmp(av[i], "--config") == 0)
{
@@ -449,13 +461,6 @@ static int do_build(int ac, char const* const* av)
return 1;
}
- // Hack for vs6 that passes ".\Debug" as "$(IntDir)" value:
- //
- if (cmSystemTools::StringStartsWith(config.c_str(), ".\\"))
- {
- config = config.substr(2);
- }
-
cmake cm;
return cm.Build(dir, target, config, nativeOptions, clean);
#endif
diff --git a/Source/kwsys/CommandLineArguments.cxx b/Source/kwsys/CommandLineArguments.cxx
index 3636836..f713294 100644
--- a/Source/kwsys/CommandLineArguments.cxx
+++ b/Source/kwsys/CommandLineArguments.cxx
@@ -20,6 +20,7 @@
#if 0
# include "CommandLineArguments.hxx.in"
# include "Configure.hxx.in"
+# include "String.hxx.in"
#endif
#include <vector>
diff --git a/Source/kwsys/MD5.c b/Source/kwsys/MD5.c
index b9d25a8..b75acb2 100644
--- a/Source/kwsys/MD5.c
+++ b/Source/kwsys/MD5.c
@@ -254,7 +254,7 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */
#define F(x, y, z) (((x) & (y)) | (~(x) & (z)))
#define SET(a, b, c, d, k, s, Ti)\
- t = a + F(b,c,d) + X[k] + Ti;\
+ t = a + F(b,c,d) + X[k] + (Ti);\
a = ROTATE_LEFT(t, s) + b
/* Do the following 16 operations. */
SET(a, b, c, d, 0, 7, T1);
@@ -280,7 +280,7 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */
#define G(x, y, z) (((x) & (z)) | ((y) & ~(z)))
#define SET(a, b, c, d, k, s, Ti)\
- t = a + G(b,c,d) + X[k] + Ti;\
+ t = a + G(b,c,d) + X[k] + (Ti);\
a = ROTATE_LEFT(t, s) + b
/* Do the following 16 operations. */
SET(a, b, c, d, 1, 5, T17);
@@ -306,7 +306,7 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */
#define H(x, y, z) ((x) ^ (y) ^ (z))
#define SET(a, b, c, d, k, s, Ti)\
- t = a + H(b,c,d) + X[k] + Ti;\
+ t = a + H(b,c,d) + X[k] + (Ti);\
a = ROTATE_LEFT(t, s) + b
/* Do the following 16 operations. */
SET(a, b, c, d, 5, 4, T33);
@@ -332,7 +332,7 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */
#define I(x, y, z) ((y) ^ ((x) | ~(z)))
#define SET(a, b, c, d, k, s, Ti)\
- t = a + I(b,c,d) + X[k] + Ti;\
+ t = a + I(b,c,d) + X[k] + (Ti);\
a = ROTATE_LEFT(t, s) + b
/* Do the following 16 operations. */
SET(a, b, c, d, 0, 6, T49);
diff --git a/Source/kwsys/Process.h.in b/Source/kwsys/Process.h.in
index c5ebc97..96563a2 100644
--- a/Source/kwsys/Process.h.in
+++ b/Source/kwsys/Process.h.in
@@ -77,6 +77,7 @@
# define kwsysProcess_WaitForExit kwsys_ns(Process_WaitForExit)
# define kwsysProcess_Interrupt kwsys_ns(Process_Interrupt)
# define kwsysProcess_Kill kwsys_ns(Process_Kill)
+# define kwsysProcess_ResetStartTime kwsys_ns(Process_ResetStartTime)
#endif
#if defined(__cplusplus)
@@ -392,6 +393,11 @@ kwsysEXPORT void kwsysProcess_Interrupt(kwsysProcess* cp);
*/
kwsysEXPORT void kwsysProcess_Kill(kwsysProcess* cp);
+/**
+ * Reset the start time of the child process to the current time.
+ */
+kwsysEXPORT void kwsysProcess_ResetStartTime(kwsysProcess* cp);
+
#if defined(__cplusplus)
} /* extern "C" */
#endif
@@ -456,6 +462,7 @@ kwsysEXPORT void kwsysProcess_Kill(kwsysProcess* cp);
# undef kwsysProcess_WaitForExit
# undef kwsysProcess_Interrupt
# undef kwsysProcess_Kill
+# undef kwsysProcess_ResetStartTime
# endif
#endif
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index 07c644b..b577982 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -505,6 +505,8 @@ void kwsysProcess_SetTimeout(kwsysProcess* cp, double timeout)
{
cp->Timeout = 0;
}
+ // Force recomputation of TimeoutTime.
+ cp->TimeoutTime.tv_sec = -1;
}
/*--------------------------------------------------------------------------*/
@@ -3056,3 +3058,14 @@ static void kwsysProcessesSignalHandler(int signum
errno = old_errno;
}
+
+/*--------------------------------------------------------------------------*/
+void kwsysProcess_ResetStartTime(kwsysProcess* cp)
+{
+ if(!cp)
+ {
+ return;
+ }
+ /* Reset start time. */
+ cp->StartTime = kwsysProcessTimeGetCurrent();
+}
diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c
index 1f8749f..2b93e69 100644
--- a/Source/kwsys/ProcessWin32.c
+++ b/Source/kwsys/ProcessWin32.c
@@ -17,7 +17,7 @@
duplicate the above list of headers. */
#if 0
# include "Process.h.in"
-# include "Encoding_c.h.in"
+# include "Encoding.h.in"
#endif
/*
@@ -698,6 +698,8 @@ void kwsysProcess_SetTimeout(kwsysProcess* cp, double timeout)
{
cp->Timeout = 0;
}
+ // Force recomputation of TimeoutTime.
+ cp->TimeoutTime.QuadPart = -1;
}
/*--------------------------------------------------------------------------*/
@@ -3015,3 +3017,14 @@ static BOOL WINAPI kwsysCtrlHandler(DWORD dwCtrlType)
/* Continue on to default Ctrl handler (which calls ExitProcess). */
return FALSE;
}
+
+/*--------------------------------------------------------------------------*/
+void kwsysProcess_ResetStartTime(kwsysProcess* cp)
+{
+ if(!cp)
+ {
+ return;
+ }
+ /* Reset start time. */
+ cp->StartTime = kwsysProcessTimeGetCurrent();
+}
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index cddcc8d..512d5fb 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -43,7 +43,6 @@
#if 0
# include "SystemInformation.hxx.in"
# include "Process.h.in"
-# include "Configure.hxx.in"
#endif
#include <iostream>
@@ -177,13 +176,13 @@ typedef struct rlimit ResourceLimitType;
# if defined(KWSYS_IOS_HAS_OSTREAM_LONG_LONG)
# define iostreamLongLong(x) (x)
# else
-# define iostreamLongLong(x) ((long)x)
+# define iostreamLongLong(x) ((long)(x))
# endif
#elif defined(KWSYS_USE___INT64)
# if defined(KWSYS_IOS_HAS_OSTREAM___INT64)
# define iostreamLongLong(x) (x)
# else
-# define iostreamLongLong(x) ((long)x)
+# define iostreamLongLong(x) ((long)(x))
# endif
#else
# error "No Long Long"
@@ -201,13 +200,13 @@ typedef struct rlimit ResourceLimitType;
# endif
#endif
-#if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(_WIN64)
+#if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(_WIN64) && !defined(__clang__)
#define USE_ASM_INSTRUCTIONS 1
#else
#define USE_ASM_INSTRUCTIONS 0
#endif
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__clang__)
#include <intrin.h>
#define USE_CPUID_INTRINSICS 1
#else
@@ -861,7 +860,7 @@ void SystemInformation::RunMemoryCheck()
// --------------------------------------------------------------
// SystemInformationImplementation starts here
-#define STORE_TLBCACHE_INFO(x,y) x = (x < y) ? y : x
+#define STORE_TLBCACHE_INFO(x,y) x = (x < (y)) ? (y) : x
#define TLBCACHE_INFO_UNITS (15)
#define CLASSICAL_CPU_FREQ_LOOP 10000000
#define RDTSC_INSTRUCTION _asm _emit 0x0f _asm _emit 0x31
@@ -3570,33 +3569,44 @@ SystemInformationImplementation::GetHostMemoryUsed()
return (statex.ullTotalPhys - statex.ullAvailPhys)/1024;
# endif
#elif defined(__linux)
- const char *names[3]={"MemTotal:","MemFree:",NULL};
- SystemInformation::LongLong values[2]={SystemInformation::LongLong(0)};
- int ierr=GetFieldsFromFile("/proc/meminfo",names,values);
+ // First try to use MemAvailable, but it only works on newer kernels
+ const char *names2[3]={"MemTotal:","MemAvailable:",NULL};
+ SystemInformation::LongLong values2[2]={SystemInformation::LongLong(0)};
+ int ierr=GetFieldsFromFile("/proc/meminfo",names2,values2);
if (ierr)
{
- return ierr;
- }
- SystemInformation::LongLong &memTotal=values[0];
- SystemInformation::LongLong &memFree=values[1];
- return memTotal - memFree;
+ const char *names4[5]={"MemTotal:","MemFree:","Buffers:","Cached:",NULL};
+ SystemInformation::LongLong values4[4]={SystemInformation::LongLong(0)};
+ ierr=GetFieldsFromFile("/proc/meminfo",names4,values4);
+ if(ierr)
+ {
+ return ierr;
+ }
+ SystemInformation::LongLong &memTotal=values4[0];
+ SystemInformation::LongLong &memFree=values4[1];
+ SystemInformation::LongLong &memBuffers=values4[2];
+ SystemInformation::LongLong &memCached=values4[3];
+ return memTotal - memFree - memBuffers - memCached;
+ }
+ SystemInformation::LongLong &memTotal=values2[0];
+ SystemInformation::LongLong &memAvail=values2[1];
+ return memTotal - memAvail;
#elif defined(__APPLE__)
SystemInformation::LongLong psz=getpagesize();
if (psz<1)
{
return -1;
}
- const char *names[4]={"Pages active:","Pages inactive:","Pages wired down:",NULL};
- SystemInformation::LongLong values[3]={SystemInformation::LongLong(0)};
+ const char *names[3]={"Pages wired down:","Pages active:",NULL};
+ SystemInformation::LongLong values[2]={SystemInformation::LongLong(0)};
int ierr=GetFieldsFromCommand("vm_stat", names, values);
if (ierr)
{
return -1;
}
- SystemInformation::LongLong &vmActive=values[0];
- SystemInformation::LongLong &vmInactive=values[1];
- SystemInformation::LongLong &vmWired=values[2];
- return ((vmActive+vmInactive+vmWired)*psz)/1024;
+ SystemInformation::LongLong &vmWired=values[0];
+ SystemInformation::LongLong &vmActive=values[1];
+ return ((vmActive+vmWired)*psz)/1024;
#else
return 0;
#endif
@@ -4622,7 +4632,7 @@ std::string SystemInformationImplementation::RunProcess(std::vector<const char*>
double timeout = 255;
int pipe; // pipe id as returned by kwsysProcess_WaitForData()
- while( ( pipe = kwsysProcess_WaitForData(gp,&data,&length,&timeout),
+ while( ( static_cast<void>(pipe = kwsysProcess_WaitForData(gp,&data,&length,&timeout)),
(pipe == kwsysProcess_Pipe_STDOUT || pipe == kwsysProcess_Pipe_STDERR) ) ) // wait for 1s
{
buffer.append(data, length);
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index e3428f8..0c7f419 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -35,10 +35,12 @@
#include <fstream>
#include <sstream>
#include <set>
+#include <vector>
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
+# include "RegularExpression.hxx.in"
# include "SystemTools.hxx.in"
# include "Directory.hxx.in"
# include "FStream.hxx.in"
@@ -87,6 +89,7 @@
// Windows API.
#if defined(_WIN32)
# include <windows.h>
+# include <winioctl.h>
# ifndef INVALID_FILE_ATTRIBUTES
# define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
# endif
@@ -2754,6 +2757,106 @@ std::string SystemTools::GetLastSystemError()
return strerror(e);
}
+#ifdef _WIN32
+
+static bool IsJunction(const std::wstring& source)
+{
+#ifdef FSCTL_GET_REPARSE_POINT
+ const DWORD JUNCTION_ATTRS = FILE_ATTRIBUTE_DIRECTORY |
+ FILE_ATTRIBUTE_REPARSE_POINT;
+ DWORD attrs = GetFileAttributesW(source.c_str());
+ if (attrs == INVALID_FILE_ATTRIBUTES)
+ {
+ return false;
+ }
+ if ((attrs & JUNCTION_ATTRS) != JUNCTION_ATTRS)
+ {
+ return false;
+ }
+
+ // Adjust privileges so that we can succefully open junction points.
+ HANDLE token;
+ TOKEN_PRIVILEGES privs;
+ OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token);
+ LookupPrivilegeValue(NULL, SE_BACKUP_NAME, &privs.Privileges[0].Luid);
+ privs.PrivilegeCount = 1;
+ privs.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+ AdjustTokenPrivileges(token, FALSE, &privs, sizeof(TOKEN_PRIVILEGES), NULL, NULL);
+ CloseHandle(token);
+
+ HANDLE dir = CreateFileW(source.c_str(), GENERIC_READ,
+ 0, NULL, OPEN_EXISTING,
+ FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (dir == INVALID_HANDLE_VALUE)
+ {
+ return false;
+ }
+
+ // Query whether this is a reparse point or not.
+ BYTE buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
+ REPARSE_GUID_DATA_BUFFER *reparse_buffer =
+ (REPARSE_GUID_DATA_BUFFER*) buffer;
+ DWORD sentinel;
+
+ BOOL success = DeviceIoControl(
+ dir, FSCTL_GET_REPARSE_POINT,
+ NULL, 0,
+ reparse_buffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE,
+ &sentinel, NULL);
+
+ CloseHandle(dir);
+
+ return (success && (reparse_buffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT));
+#else
+ return false;
+#endif
+}
+
+static bool DeleteJunction(const std::wstring& source)
+{
+#ifdef FSCTL_DELETE_REPARSE_POINT
+ // Adjust privileges so that we can succefully open junction points as
+ // read/write.
+ HANDLE token;
+ TOKEN_PRIVILEGES privs;
+ OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token);
+ LookupPrivilegeValue(NULL, SE_RESTORE_NAME, &privs.Privileges[0].Luid);
+ privs.PrivilegeCount = 1;
+ privs.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+ AdjustTokenPrivileges(token, FALSE, &privs, sizeof(TOKEN_PRIVILEGES), NULL, NULL);
+ CloseHandle(token);
+
+ HANDLE dir = CreateFileW(source.c_str(), GENERIC_READ | GENERIC_WRITE,
+ 0, NULL, OPEN_EXISTING,
+ FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (dir == INVALID_HANDLE_VALUE)
+ {
+ return false;
+ }
+
+ // Set up the structure so that we can delete the junction.
+ std::vector<BYTE> buffer(REPARSE_GUID_DATA_BUFFER_HEADER_SIZE, 0);
+ REPARSE_GUID_DATA_BUFFER *reparse_buffer =
+ (REPARSE_GUID_DATA_BUFFER*) &buffer[0];
+ DWORD sentinel;
+
+ reparse_buffer->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
+
+ BOOL success = DeviceIoControl(
+ dir, FSCTL_DELETE_REPARSE_POINT,
+ reparse_buffer, REPARSE_GUID_DATA_BUFFER_HEADER_SIZE,
+ NULL, 0,
+ &sentinel, NULL);
+
+ CloseHandle(dir);
+
+ return !!success;
+#else
+ return false;
+#endif
+}
+#endif
+
bool SystemTools::RemoveFile(const std::string& source)
{
#ifdef _WIN32
@@ -2781,6 +2884,10 @@ bool SystemTools::RemoveFile(const std::string& source)
SetLastError(err);
return false;
}
+ if (IsJunction(ws) && !DeleteJunction(ws))
+ {
+ return false;
+ }
if (DeleteFileW(ws.c_str()) ||
GetLastError() == ERROR_FILE_NOT_FOUND ||
GetLastError() == ERROR_PATH_NOT_FOUND)
@@ -4651,8 +4758,9 @@ bool SystemTools::GetLineFromStream(std::istream& is,
// been reached. Clear the fail bit just before reading.
while(!haveNewline &&
leftToRead != 0 &&
- (is.clear(is.rdstate() & ~std::ios::failbit),
- is.getline(buffer, bufferSize), is.gcount() > 0))
+ (static_cast<void>(is.clear(is.rdstate() & ~std::ios::failbit)),
+ static_cast<void>(is.getline(buffer, bufferSize)),
+ is.gcount() > 0))
{
// We have read at least one byte.
haveData = true;
diff --git a/Source/kwsys/testDynamicLoader.cxx b/Source/kwsys/testDynamicLoader.cxx
index 695a134..7c58769 100644
--- a/Source/kwsys/testDynamicLoader.cxx
+++ b/Source/kwsys/testDynamicLoader.cxx
@@ -53,7 +53,7 @@ static std::string GetLibName(const char* lname)
* r2: should GetSymbolAddress succeed ?
* r3: should CloseLibrary succeed ?
*/
-int TestDynamicLoader(const char* libname, const char* symbol, int r1, int r2, int r3)
+static int TestDynamicLoader(const char* libname, const char* symbol, int r1, int r2, int r3)
{
std::cerr << "Testing: " << libname << std::endl;
kwsys::DynamicLoader::LibraryHandle l
diff --git a/Source/kwsys/testHashSTL.cxx b/Source/kwsys/testHashSTL.cxx
index ab1f83e..ae66ceb 100644
--- a/Source/kwsys/testHashSTL.cxx
+++ b/Source/kwsys/testHashSTL.cxx
@@ -18,7 +18,6 @@
#if 0
# include "hash_map.hxx.in"
# include "hash_set.hxx.in"
-# include "hashtable.hxx.in"
#endif
#include <iostream>
diff --git a/Source/kwsys/testIOS.cxx b/Source/kwsys/testIOS.cxx
index 396a09d..5ff7955 100644
--- a/Source/kwsys/testIOS.cxx
+++ b/Source/kwsys/testIOS.cxx
@@ -18,6 +18,12 @@
#include <vector>
#include <string.h> /* strlen */
+// Work-around CMake dependency scanning limitation. This must
+// duplicate the above list of headers.
+#if 0
+# include "Configure.hxx.in"
+#endif
+
int testIOS(int, char*[])
{
std::ostringstream ostr;
diff --git a/Templates/CMakeVisualStudio6Configurations.cmake b/Templates/CMakeVisualStudio6Configurations.cmake
deleted file mode 100644
index 6355969..0000000
--- a/Templates/CMakeVisualStudio6Configurations.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-# When the dll templates are changed, this list should be
-# updated with the list of possible configurations.
-set(CMAKE_CONFIGURATION_TYPES Debug Release MinSizeRel RelWithDebInfo)
diff --git a/Templates/DLLFooter.dsptemplate b/Templates/DLLFooter.dsptemplate
deleted file mode 100644
index 0d0682a..0000000
--- a/Templates/DLLFooter.dsptemplate
+++ /dev/null
@@ -1,4 +0,0 @@
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/Templates/DLLHeader.dsptemplate b/Templates/DLLHeader.dsptemplate
deleted file mode 100644
index d9bccaf..0000000
--- a/Templates/DLLHeader.dsptemplate
+++ /dev/null
@@ -1,192 +0,0 @@
-# Microsoft Developer Studio Project File - Name="OUTPUT_LIBNAME" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=OUTPUT_LIBNAME - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "OUTPUT_LIBNAME.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "OUTPUT_LIBNAME.mak" CFG="OUTPUT_LIBNAME - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "OUTPUT_LIBNAME - Win32 MinSizeRel" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "OUTPUT_LIBNAME - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "OUTPUT_LIBNAME - Win32 RelWithDebInfo" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "OUTPUT_LIBNAME - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# ITK DSP Header file
-# This file is read by the build system of itk, and is used as the top part of
-# a microsoft project dsp header file
-# IF this is in a dsp file, then it is not the header, but has
-# already been used, so do not edit here...
-
-# variables to REPLACE
-#
-# BUILD_INCLUDES == include path
-# EXTRA_DEFINES == compiler defines
-# OUTPUT_DIRECTORY == override in output directory
-# OUTPUT_LIBNAME == name of output library
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Release"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_RELEASE"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" OUTPUT_LIBNAME_EXPORTS /FD /c
-# ADD CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES_RELEASE EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_RELEASE
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_RELEASE /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_RELEASE
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /dll /machine:I386
-# ADD LINK32 /nologo /dll TARGET_VERSION_FLAG /machine:I386 /out:"OUTPUT_DIRECTORY_RELEASE/OUTPUT_NAME_RELEASE" TARGET_IMPLIB_FLAG_RELEASE
-CM_MULTILINE_OPTIONS_RELEASE
-
-CMAKE_CUSTOM_RULE_CODE_RELEASE
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "OUTPUT_DIRECTORY_DEBUG"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" OUTPUT_LIBNAME_EXPORTS /FD /c
-# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES_DEBUG EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_DEBUG
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC BUILD_INCLUDES_DEBUG /l 0x409 /d "_DEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_DEBUG
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 /nologo /dll TARGET_VERSION_FLAG /debug /machine:I386 /out:"OUTPUT_DIRECTORY_DEBUG/OUTPUT_NAME_DEBUG" /pdbtype:sept TARGET_IMPLIB_FLAG_DEBUG
-CM_MULTILINE_OPTIONS_DEBUG
-
-CMAKE_CUSTOM_RULE_CODE_DEBUG
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 MinSizeRel"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "MinSizeRel"
-# PROP BASE Intermediate_Dir "MinSizeRel"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_MINSIZEREL"
-# PROP Intermediate_Dir "MinSizeRel"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c OUTPUT_LIBNAME_EXPORTS
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES_MINSIZEREL EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_MINSIZEREL /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_MINSIZEREL
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /dll /machine:I386
-# ADD LINK32 /nologo /dll TARGET_VERSION_FLAG /machine:I386 /out:"OUTPUT_DIRECTORY_MINSIZEREL/OUTPUT_NAME_MINSIZEREL" TARGET_IMPLIB_FLAG_MINSIZEREL
-CM_MULTILINE_OPTIONS_MINSIZEREL
-
-CMAKE_CUSTOM_RULE_CODE_MINSIZEREL
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 RelWithDebInfo"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "RelWithDebInfo"
-# PROP BASE Intermediate_Dir "RelWithDebInfo"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_RELWITHDEBINFO"
-# PROP Intermediate_Dir "RelWithDebInfo"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" OUTPUT_LIBNAME_EXPORTS /FD /c
-# ADD CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES_RELWITHDEBINFO EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_RELWITHDEBINFO /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_RELWITHDEBINFO
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /dll /machine:I386 /pdbtype:sept
-# ADD LINK32 /nologo /dll TARGET_VERSION_FLAG /debug /machine:I386 /pdbtype:sept /out:"OUTPUT_DIRECTORY_RELWITHDEBINFO/OUTPUT_NAME_RELWITHDEBINFO" TARGET_IMPLIB_FLAG_RELWITHDEBINFO
-CM_MULTILINE_OPTIONS_RELWITHDEBINFO
-
-CMAKE_CUSTOM_RULE_CODE_RELWITHDEBINFO
-
-!ENDIF
-
-# Begin Target
-
-# Name "OUTPUT_LIBNAME - Win32 Release"
-# Name "OUTPUT_LIBNAME - Win32 Debug"
-# Name "OUTPUT_LIBNAME - Win32 MinSizeRel"
-# Name "OUTPUT_LIBNAME - Win32 RelWithDebInfo"
diff --git a/Templates/EXEFooter.dsptemplate b/Templates/EXEFooter.dsptemplate
deleted file mode 100644
index 0d0682a..0000000
--- a/Templates/EXEFooter.dsptemplate
+++ /dev/null
@@ -1,4 +0,0 @@
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/Templates/EXEHeader.dsptemplate b/Templates/EXEHeader.dsptemplate
deleted file mode 100644
index 3a6d2fe..0000000
--- a/Templates/EXEHeader.dsptemplate
+++ /dev/null
@@ -1,183 +0,0 @@
-# Microsoft Developer Studio Project File - Name="pcbuilder" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# CM DSP Header file
-# This file is read by the build system of cm, and is used as the top part of
-# a microsoft project dsp header file
-# IF this is in a dsp file, then it is not the header, but has
-# already been used, so do not edit here...
-
-# variables to REPLACE
-#
-# BUILD_INCLUDES == include path
-# OUTPUT_DIRECTORY == override in output directory
-# EXTRA_DEFINES == compiler defines
-# OUTPUT_LIBNAME == name of output library
-# CM_LIBRARIES == libraries linked in
-# TARGTYPE "Win32 (x86) Application" 0x0103
-
-CFG=OUTPUT_LIBNAME - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "OUTPUT_LIBNAME.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "OUTPUT_LIBNAME.mak" CFG="OUTPUT_LIBNAME - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "OUTPUT_LIBNAME - Win32 MinSizeRel" (based on "Win32 (x86) Application")
-!MESSAGE "OUTPUT_LIBNAME - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "OUTPUT_LIBNAME - Win32 RelWithDebInfo" (based on "Win32 (x86) Application")
-!MESSAGE "OUTPUT_LIBNAME - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Release"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_RELEASE"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP BUILD_INCLUDES_RELEASE EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_RELEASE
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_RELEASE /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_RELEASE
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089
-# ADD LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089 TARGET_VERSION_FLAG
-# ADD LINK32 /out:"OUTPUT_DIRECTORY_RELEASE\OUTPUT_NAME_RELEASE" TARGET_IMPLIB_FLAG_RELEASE
-CM_MULTILINE_OPTIONS_RELEASE
-
-CMAKE_CUSTOM_RULE_CODE_RELEASE
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "OUTPUT_DIRECTORY_DEBUG"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
-# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
-# ADD CPP BUILD_INCLUDES_DEBUG EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_DEBUG
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC BUILD_INCLUDES_DEBUG /l 0x409 /d "_DEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_DEBUG
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089
-# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089 TARGET_VERSION_FLAG
-# ADD LINK32 /out:"OUTPUT_DIRECTORY_DEBUG\OUTPUT_NAME_DEBUG" TARGET_IMPLIB_FLAG_DEBUG
-CM_MULTILINE_OPTIONS_DEBUG
-
-CMAKE_CUSTOM_RULE_CODE_DEBUG
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 MinSizeRel"
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "MinSizeRel"
-# PROP BASE Intermediate_Dir "MinSizeRel"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_MINSIZEREL"
-# PROP Intermediate_Dir "MinSizeRel"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP /nologo /D "WIN32" BUILD_INCLUDES_MINSIZEREL EXTRA_DEFINES /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP BUILD_INCLUDES_MINSIZEREL EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_MINSIZEREL /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_MINSIZEREL
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089
-# ADD LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089 TARGET_VERSION_FLAG
-# ADD LINK32 /out:"OUTPUT_DIRECTORY_MINSIZEREL\OUTPUT_NAME_MINSIZEREL" TARGET_IMPLIB_FLAG_MINSIZEREL
-CM_MULTILINE_OPTIONS_MINSIZEREL
-
-CMAKE_CUSTOM_RULE_CODE_MINSIZEREL
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 RelWithDebInfo"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "RelWithDebInfo"
-# PROP BASE Intermediate_Dir "RelWithDebInfo"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_RELWITHDEBINFO"
-# PROP Intermediate_Dir "RelWithDebInfo"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP BUILD_INCLUDES_RELWITHDEBINFO EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_RELWITHDEBINFO /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_RELWITHDEBINFO
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /IGNORE:4089
-# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /IGNORE:4089 TARGET_VERSION_FLAG
-# ADD LINK32 /out:"OUTPUT_DIRECTORY_RELWITHDEBINFO\OUTPUT_NAME_RELWITHDEBINFO" TARGET_IMPLIB_FLAG_RELWITHDEBINFO
-CM_MULTILINE_OPTIONS_RELWITHDEBINFO
-
-CMAKE_CUSTOM_RULE_CODE_RELWITHDEBINFO
-
-!ENDIF
-
-# Begin Target
-
-# Name "OUTPUT_LIBNAME - Win32 Release"
-# Name "OUTPUT_LIBNAME - Win32 Debug"
-# Name "OUTPUT_LIBNAME - Win32 MinSizeRel"
-# Name "OUTPUT_LIBNAME - Win32 RelWithDebInfo"
diff --git a/Templates/EXEWinHeader.dsptemplate b/Templates/EXEWinHeader.dsptemplate
deleted file mode 100644
index 350e3ea..0000000
--- a/Templates/EXEWinHeader.dsptemplate
+++ /dev/null
@@ -1,187 +0,0 @@
-# Microsoft Developer Studio Project File - Name="pcbuilder" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# CM DSP Header file
-# This file is read by the build system of cm, and is used as the top part of
-# a microsoft project dsp header file
-# IF this is in a dsp file, then it is not the header, but has
-# already been used, so do not edit here...
-
-# variables to REPLACE
-#
-# BUILD_INCLUDES == include path
-# OUTPUT_DIRECTORY == override in output directory
-# EXTRA_DEFINES == compiler defines
-# OUTPUT_LIBNAME == name of output library
-# CM_LIBRARIES == libraries linked in
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=OUTPUT_LIBNAME - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "OUTPUT_LIBNAME.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "OUTPUT_LIBNAME.mak" CFG="OUTPUT_LIBNAME - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "OUTPUT_LIBNAME - Win32 MinSizeRel" (based on "Win32 (x86) Application")
-!MESSAGE "OUTPUT_LIBNAME - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "OUTPUT_LIBNAME - Win32 RelWithDebInfo" (based on "Win32 (x86) Application")
-!MESSAGE "OUTPUT_LIBNAME - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Release"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_RELEASE"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP BUILD_INCLUDES_RELEASE EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_RELEASE
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_RELEASE /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_RELEASE
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 /IGNORE:4089
-# ADD LINK32 /nologo /subsystem:windows /machine:I386 /IGNORE:4089 TARGET_VERSION_FLAG
-# ADD LINK32 /out:"OUTPUT_DIRECTORY_RELEASE\OUTPUT_NAME_RELEASE" TARGET_IMPLIB_FLAG_RELEASE
-CM_MULTILINE_OPTIONS_RELEASE
-
-CMAKE_CUSTOM_RULE_CODE_RELEASE
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "OUTPUT_DIRECTORY_DEBUG"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /GZ /c
-# ADD CPP BUILD_INCLUDES_DEBUG EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_DEBUG
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC BUILD_INCLUDES_DEBUG /l 0x409 /d "_DEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_DEBUG
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /IGNORE:4089
-# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /IGNORE:4089 TARGET_VERSION_FLAG
-# ADD LINK32 /out:"OUTPUT_DIRECTORY_DEBUG\OUTPUT_NAME_DEBUG" TARGET_IMPLIB_FLAG_DEBUG
-CM_MULTILINE_OPTIONS_DEBUG
-
-CMAKE_CUSTOM_RULE_CODE_DEBUG
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 MinSizeRel"
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "MinSizeRel"
-# PROP BASE Intermediate_Dir "MinSizeRel"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_MINSIZEREL"
-# PROP Intermediate_Dir "MinSizeRel"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP BUILD_INCLUDES_MINSIZEREL EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_MINSIZEREL /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_MINSIZEREL
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 /pdbtype:sept /IGNORE:4089
-# ADD LINK32 /nologo /subsystem:windows /machine:I386 /pdbtype:sept /IGNORE:4089 TARGET_VERSION_FLAG
-# ADD LINK32 /out:"OUTPUT_DIRECTORY_MINSIZEREL\OUTPUT_NAME_MINSIZEREL" TARGET_IMPLIB_FLAG_MINSIZEREL
-CM_MULTILINE_OPTIONS_MINSIZEREL
-
-CMAKE_CUSTOM_RULE_CODE_MINSIZEREL
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 RelWithDebInfo"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "RelWithDebInfo"
-# PROP BASE Intermediate_Dir "RelWithDebInfo"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_RELWITHDEBINFO"
-# PROP Intermediate_Dir "RelWithDebInfo"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP BUILD_INCLUDES_RELWITHDEBINFO EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_RELWITHDEBINFO /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_RELWITHDEBINFO
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 /IGNORE:4089
-# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /IGNORE:4089 TARGET_VERSION_FLAG
-# ADD LINK32 /out:"OUTPUT_DIRECTORY_RELWITHDEBINFO\OUTPUT_NAME_RELWITHDEBINFO" TARGET_IMPLIB_FLAG_RELWITHDEBINFO
-CM_MULTILINE_OPTIONS_RELWITHDEBINFO
-
-CMAKE_CUSTOM_RULE_CODE_RELWITHDEBINFO
-
-!ENDIF
-
-# Begin Target
-
-# Name "OUTPUT_LIBNAME - Win32 Release"
-# Name "OUTPUT_LIBNAME - Win32 Debug"
-# Name "OUTPUT_LIBNAME - Win32 MinSizeRel"
-# Name "OUTPUT_LIBNAME - Win32 RelWithDebInfo"
diff --git a/Templates/UtilityFooter.dsptemplate b/Templates/UtilityFooter.dsptemplate
deleted file mode 100644
index 941fb44..0000000
--- a/Templates/UtilityFooter.dsptemplate
+++ /dev/null
@@ -1,2 +0,0 @@
-# End Target
-# End Project
diff --git a/Templates/UtilityHeader.dsptemplate b/Templates/UtilityHeader.dsptemplate
deleted file mode 100644
index 509f597..0000000
--- a/Templates/UtilityHeader.dsptemplate
+++ /dev/null
@@ -1,95 +0,0 @@
-# Microsoft Developer Studio Project File - Name="OUTPUT_LIBNAME" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Generic Project" 0x010a
-
-CFG=OUTPUT_LIBNAME - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "OUTPUT_LIBNAME.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "OUTPUT_LIBNAME.mak" CFG="OUTPUT_LIBNAME - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "OUTPUT_LIBNAME - Win32 MinSizeRel" (based on "Win32 (x86) Generic Project")
-!MESSAGE "OUTPUT_LIBNAME - Win32 Release" (based on "Win32 (x86) Generic Project")
-!MESSAGE "OUTPUT_LIBNAME - Win32 RelWithDebInfo" (based on "Win32 (x86) Generic Project")
-!MESSAGE "OUTPUT_LIBNAME - Win32 Debug" (based on "Win32 (x86) Generic Project")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-MTL=midl.exe
-
-!IF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-
-CMAKE_CUSTOM_RULE_CODE_RELEASE
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-
-CMAKE_CUSTOM_RULE_CODE_DEBUG
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 MinSizeRel"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "MinSizeRel"
-# PROP BASE Intermediate_Dir "MinSizeRel"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Intermediate_Dir "MinSizeRel"
-# PROP Target_Dir ""
-
-CMAKE_CUSTOM_RULE_CODE_MINSIZEREL
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 RelWithDebInfo"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "RelWithDebInfo"
-# PROP BASE Intermediate_Dir "RelWithDebInfo"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Intermediate_Dir "RelWithDebInfo"
-# PROP Target_Dir ""
-
-CMAKE_CUSTOM_RULE_CODE_RELWITHDEBINFO
-
-!ENDIF
-
-# Begin Target
-
-# Name "OUTPUT_LIBNAME - Win32 Release"
-# Name "OUTPUT_LIBNAME - Win32 Debug"
-# Name "OUTPUT_LIBNAME - Win32 MinSizeRel"
-# Name "OUTPUT_LIBNAME - Win32 RelWithDebInfo"
diff --git a/Templates/staticLibFooter.dsptemplate b/Templates/staticLibFooter.dsptemplate
deleted file mode 100644
index 0d0682a..0000000
--- a/Templates/staticLibFooter.dsptemplate
+++ /dev/null
@@ -1,4 +0,0 @@
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/Templates/staticLibHeader.dsptemplate b/Templates/staticLibHeader.dsptemplate
deleted file mode 100644
index a8892e1..0000000
--- a/Templates/staticLibHeader.dsptemplate
+++ /dev/null
@@ -1,173 +0,0 @@
-# Microsoft Developer Studio Project File - Name="OUTPUT_LIBNAME" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# CMAKE DSP Header file
-# This file is read by the CMAKE, and is used as the top part of
-# a microsoft project dsp header file
-# IF this is in a dsp file, then it is not the header, but has
-# already been used, so do not edit in that case.
-
-# variables to REPLACE
-#
-# BUILD_INCLUDES == include path
-# EXTRA_DEFINES == compiler defines
-# OUTPUT_DIRECTORY == override in output directory
-# OUTPUT_LIBNAME == name of output library
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=OUTPUT_LIBNAME - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "OUTPUT_LIBNAME.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "OUTPUT_LIBNAME.mak" CFG="OUTPUT_LIBNAME - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "OUTPUT_LIBNAME - Win32 MinSizeRel" (based on "Win32 (x86) Static Library")
-!MESSAGE "OUTPUT_LIBNAME - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "OUTPUT_LIBNAME - Win32 RelWithDebInfo" (based on "Win32 (x86) Static Library")
-!MESSAGE "OUTPUT_LIBNAME - Win32 Debug" (based on "Win32 (x86) Static Library")
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Release"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_RELEASE"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_LIB" /FD /c
-# ADD CPP /nologo /D "NDEBUG" /D "WIN32" /D "_LIB" /FD /c
-# ADD CPP BUILD_INCLUDES_RELEASE EXTRA_DEFINES
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_RELEASE
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_RELEASE /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_RELEASE
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_RELEASE/OUTPUT_NAME_RELEASE" CM_STATIC_LIB_ARGS_RELEASE
-
-CMAKE_CUSTOM_RULE_CODE_RELEASE
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 Debug"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "OUTPUT_DIRECTORY_DEBUG"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "_DEBUG" /D "_LIB" /FD /c
-# ADD CPP /nologo /D "_DEBUG" /D "WIN32" /D "_LIB" /FD /GZ /c
-# ADD CPP BUILD_INCLUDES_DEBUG EXTRA_DEFINES
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_DEBUG
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC BUILD_INCLUDES_DEBUG /l 0x409 /d "_DEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_DEBUG
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_DEBUG/OUTPUT_NAME_DEBUG" CM_STATIC_LIB_ARGS_DEBUG
-
-CMAKE_CUSTOM_RULE_CODE_DEBUG
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 MinSizeRel"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "MinSizeRel"
-# PROP BASE Intermediate_Dir "MinSizeRel"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_MINSIZEREL"
-# PROP Intermediate_Dir "MinSizeRel"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_ATL_DLL" /FD /c
-# ADD CPP /nologo /D "NDEBUG" /D "_ATL_DLL" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES_MINSIZEREL EXTRA_DEFINES
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_MINSIZEREL /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_MINSIZEREL
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_MINSIZEREL/OUTPUT_NAME_MINSIZEREL" CM_STATIC_LIB_ARGS_MINSIZEREL
-
-CMAKE_CUSTOM_RULE_CODE_MINSIZEREL
-
-!ELSEIF "$(CFG)" == "OUTPUT_LIBNAME - Win32 RelWithDebInfo"
-
-# PROP BASE Use_MFC CMAKE_MFC_FLAG
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "RelWithDebInfo"
-# PROP BASE Intermediate_Dir "RelWithDebInfo"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC CMAKE_MFC_FLAG
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "OUTPUT_DIRECTORY_RELWITHDEBINFO"
-# PROP Intermediate_Dir "RelWithDebInfo"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_LIB" /FD /c
-# ADD CPP /nologo /D "NDEBUG" /D "WIN32" /D "_LIB" /FD /c
-# ADD CPP BUILD_INCLUDES_RELWITHDEBINFO EXTRA_DEFINES
-# ADD CPP CMAKE_CXX_FLAGS
-# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES_RELWITHDEBINFO /l 0x409 /d "NDEBUG"
-# ADD RSC COMPILE_DEFINITIONS
-# ADD RSC COMPILE_DEFINITIONS_RELWITHDEBINFO
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_RELWITHDEBINFO/OUTPUT_NAME_RELWITHDEBINFO" CM_STATIC_LIB_ARGS_RELWITHDEBINFO
-
-CMAKE_CUSTOM_RULE_CODE_RELWITHDEBINFO
-
-!ENDIF
-
-# Begin Target
-
-# Name "OUTPUT_LIBNAME - Win32 Release"
-# Name "OUTPUT_LIBNAME - Win32 Debug"
-# Name "OUTPUT_LIBNAME - Win32 MinSizeRel"
-# Name "OUTPUT_LIBNAME - Win32 RelWithDebInfo"
-
diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt
index e1d8966..47ccbdc 100644
--- a/Tests/AliasTarget/CMakeLists.txt
+++ b/Tests/AliasTarget/CMakeLists.txt
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 2.8.11)
+cmake_policy(SET CMP0054 NEW)
project(AliasTarget)
set(CMAKE_CXX_STANDARD 98)
@@ -10,6 +11,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA")
endif ()
+# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+ CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+ set(CMAKE_CXX_STANDARD 11)
+endif()
+
add_library(foo SHARED empty.cpp)
add_library(PREFIX::Foo ALIAS foo)
add_library(Another::Alias ALIAS foo)
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index 36987de..9b48b14 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -42,7 +42,7 @@ list(APPEND _cmake_options "-DTEST_LINK_DEPENDS=${TEST_LINK_DEPENDS}")
list(APPEND _cmake_options "-DCMAKE_FORCE_DEPFILES=1")
-if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^6789]|[6789][0-9])")
+if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^789]|[789][0-9])")
set(TEST_MULTI3 1)
list(APPEND _cmake_options "-DTEST_MULTI3=1")
endif()
@@ -304,9 +304,6 @@ message("Run result: ${runResult} Output: \"${out}\"")
if("${out}" STREQUAL "HEADER_STRING: ninja changed ")
message("Worked!")
-elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
- # Tolerate failure because VS 6 does not seem to recompile ninjadep.cpp
- # when the "dir/header.h" it includes changes.
else()
message(SEND_ERROR "Project did not rebuild properly. Output[${out}]\n"
" expected [HEADER_STRING: ninja changed]")
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 7bb0721..76ea5b4 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -624,8 +624,8 @@ if(BUILD_TESTING)
endif()
# test for correct sub-project generation
- # not implemented in VS 6, VS 7.0, Xcode, or Ninja
- if(NOT CMAKE_GENERATOR MATCHES "Visual Studio [67]$|Xcode|Ninja")
+ # not implemented in VS 7.0, Xcode, or Ninja
+ if(NOT CMAKE_GENERATOR MATCHES "Visual Studio 7$|Xcode|Ninja")
# run cmake and configure all of SubProject
# but only build the independent executable car
add_test(SubProject ${CMAKE_CTEST_COMMAND}
@@ -687,7 +687,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWindows
dash3win7_release.cmake)
ADD_NIGHTLY_BUILD_TEST(CMakeNightlyOSX
- dashmacmini5_release.cmake)
+ bigmac_release.cmake)
ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux32
magrathea_release.cmake)
ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux64
@@ -1371,6 +1371,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_subdirectory(FindJsonCpp)
endif()
+ if(CMake_TEST_FindLTTngUST)
+ add_subdirectory(FindLTTngUST)
+ endif()
+
if(CMake_TEST_FindOpenSSL)
add_subdirectory(FindOpenSSL)
endif()
@@ -1644,7 +1648,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5
AND OSX_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
- set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_MATCH_1})
+ set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_MATCH_1} -DCMAKE_OSX_SYSROOT=macosx)
ADD_TEST_MACRO(XCTest ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> -V)
endif()
@@ -1740,7 +1744,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
if(MSVC)
ADD_TEST_MACRO(ForceInclude foo)
ADD_TEST_MACRO(PDBDirectoryAndName myexe)
- ADD_TEST_MACRO(PrecompiledHeader foo)
+ if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ ADD_TEST_MACRO(PrecompiledHeader foo)
+ endif()
endif()
if(MSVC OR
"${CMAKE_GENERATOR}" MATCHES "(MSYS|MinGW) Makefiles")
@@ -1869,7 +1875,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
endif()
if(MSVC AND NOT MSVC_VERSION LESS 1310
- AND NOT CMAKE_GENERATOR MATCHES "Visual Studio [67]( |$)"
+ AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7( |$)"
AND (NOT CMAKE_GENERATOR MATCHES "Visual Studio [89]( |$)"
OR CMAKE_SIZEOF_VOID_P EQUAL 4)
)
@@ -1881,7 +1887,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
ADD_TEST_MACRO(SBCS SBCS)
endif()
- if(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio [6789]( |$)"
+ if(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio [789]( |$)"
AND NOT CMAKE_GENERATOR_TOOLSET)
ADD_TEST_MACRO(VSWindowsFormsResx VSWindowsFormsResx)
endif()
@@ -1910,7 +1916,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
if(CMake_TEST_DEVENV)
# The test (and tested property) works with .sln files, so it's skipped when:
- # * Using VS6, which doesn't use .sln files
# * cmake --build is set up to use MSBuild, since the MSBuild invocation does not use the .sln file
set(_last_test "")
foreach(config ${CMAKE_CONFIGURATION_TYPES})
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
index bdc2563..8f842d6 100644
--- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -81,13 +81,13 @@ endmacro()
# reported.
foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HG
- HSPELL ICOTOOL JASPER LIBLZMA LIBXML2 LIBXSLT PERL PKG_CONFIG
+ HSPELL ICOTOOL JASPER LIBLZMA LIBXML2 LIBXSLT LTTNGUST PERL PKG_CONFIG
PostgreSQL TIFF ZLIB)
check_version_string(${VTEST} ${VTEST}_VERSION_STRING)
endforeach()
foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2
- HDF5 LibArchive OPENSCENEGRAPH RUBY SWIG)
+ HDF5 LibArchive OPENSCENEGRAPH RUBY SWIG Protobuf)
check_version_string(${VTEST} ${VTEST}_VERSION)
endforeach()
diff --git a/Tests/CMakeTests/String-TIMESTAMP-UnixTime.cmake b/Tests/CMakeTests/String-TIMESTAMP-UnixTime.cmake
new file mode 100644
index 0000000..a93e7f5
--- /dev/null
+++ b/Tests/CMakeTests/String-TIMESTAMP-UnixTime.cmake
@@ -0,0 +1,22 @@
+string(TIMESTAMP timestamp "[%Y-%m-%d %H:%M:%S] %s" UTC)
+
+string(TIMESTAMP unix_time "%s")
+
+string(TIMESTAMP year "%Y" UTC)
+string(TIMESTAMP days "%j" UTC)
+
+# Doing proper date calculations here to verify unix timestamps
+# could be error prone.
+# At the very least use some safe lower and upper bounds to
+# see if we are somewhere in the right region.
+
+math(EXPR years_since_epoch "${year} - 1970")
+math(EXPR lower_bound "((${years_since_epoch} * 365) + ${days}) * 86400")
+math(EXPR upper_bound "((${years_since_epoch} * 366) + ${days}) * 86400")
+
+
+if(unix_time GREATER lower_bound AND unix_time LESS upper_bound)
+ message("~${unix_time}~")
+else()
+ message(FATAL_ERROR "${timestamp} unix time not in expected range [${lower_bound}, ${upper_bound}]")
+endif()
diff --git a/Tests/CMakeTests/StringTest.cmake.in b/Tests/CMakeTests/StringTest.cmake.in
index 92e70c3..aba35fe 100644
--- a/Tests/CMakeTests/StringTest.cmake.in
+++ b/Tests/CMakeTests/StringTest.cmake.in
@@ -36,6 +36,8 @@ set(TIMESTAMP-IncompleteSpecifier-RESULT 0)
set(TIMESTAMP-IncompleteSpecifier-STDERR "~foobar%~")
set(TIMESTAMP-AllSpecifiers-RESULT 0)
set(TIMESTAMP-AllSpecifiers-STDERR "~[0-9]+(;[0-9]+)*~")
+set(TIMESTAMP-UnixTime-RESULT 0)
+set(TIMESTAMP-UnixTime-STDERR "~[1-9][0-9]+~")
include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake")
check_cmake_test(String
@@ -58,6 +60,7 @@ check_cmake_test(String
TIMESTAMP-UnknownSpecifier
TIMESTAMP-IncompleteSpecifier
TIMESTAMP-AllSpecifiers
+ TIMESTAMP-UnixTime
)
# Execute each test listed in StringTestScript.cmake:
@@ -68,9 +71,12 @@ set(number_of_tests_expected 70)
include("@CMAKE_CURRENT_SOURCE_DIR@/ExecuteScriptTests.cmake")
execute_all_script_tests(${scriptname} number_of_tests_executed)
+string(TIMESTAMP timestamp "[%Y-%m-%d %H:%M:%S] UTC %s" UTC)
+
# And verify that number_of_tests_executed is at least as many as we know
# about as of this writing...
#
+message(STATUS "timestamp='${timestamp}'")
message(STATUS "scriptname='${scriptname}'")
message(STATUS "number_of_tests_executed='${number_of_tests_executed}'")
message(STATUS "number_of_tests_expected='${number_of_tests_expected}'")
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
index ac9b552..0f2b774 100644
--- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
@@ -14,24 +14,24 @@ if(CPACK_GENERATOR MATCHES "RPM")
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/foo/bar")
# test requires
- set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries")
+ set(CPACK_RPM_APPLICATIONS_PACKAGE_REQUIRES "mylib-libraries")
# test a "noarch" rpm
- set(CPACK_RPM_headers_PACKAGE_ARCHITECTURE "noarch")
+ set(CPACK_RPM_HEADERS_PACKAGE_ARCHITECTURE "noarch")
# test cross-built rpm
- set(CPACK_RPM_applications_PACKAGE_ARCHITECTURE "armv7hf")
+ set(CPACK_RPM_APPLICATIONS_PACKAGE_ARCHITECTURE "armv7hf")
# test package summary override - headers rpm is generated in the middle
set(CPACK_RPM_PACKAGE_SUMMARY "default summary")
- set(CPACK_RPM_headers_PACKAGE_SUMMARY "headers summary")
+ set(CPACK_RPM_HEADERS_PACKAGE_SUMMARY "headers summary")
# test package description override - headers rpm is generated in the middle
- set(CPACK_RPM_headers_PACKAGE_DESCRIPTION "headers description")
+ set(CPACK_RPM_HEADERS_PACKAGE_DESCRIPTION "headers description")
# test package do not use CPACK_PACKAGING_INSTALL_PREFIX
# as relocation path
- set(CPACK_RPM_NO_libraries_INSTALL_PREFIX_RELOCATION true)
+ set(CPACK_RPM_NO_LIBRARIES_INSTALL_PREFIX_RELOCATION true)
endif()
if(CPACK_GENERATOR MATCHES "DEB")
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in
index 60bdd06..ac65dc9 100644
--- a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in
@@ -7,7 +7,7 @@ endif()
if(CPACK_GENERATOR MATCHES "RPM")
set(CPACK_RPM_COMPONENT_INSTALL "ON")
- set(CPACK_RPM_Development_PACKAGE_REQUIRES "mylib-Runtime")
+ set(CPACK_RPM_DEVELOPMENT_PACKAGE_REQUIRES "mylib-Runtime")
endif()
if(CPACK_GENERATOR MATCHES "DEB")
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index d94a477..34b9c82 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -136,8 +136,8 @@ if(CPackGen MATCHES "RPM")
endif()
set(CPACK_RPM_PACKAGE_SUMMARY "default summary")
- set(CPACK_RPM_headers_PACKAGE_SUMMARY "headers summary")
- set(CPACK_RPM_headers_PACKAGE_DESCRIPTION "headers description")
+ set(CPACK_RPM_HEADERS_PACKAGE_SUMMARY "headers summary")
+ set(CPACK_RPM_HEADERS_PACKAGE_DESCRIPTION "headers description")
set(CPACK_COMPONENT_APPLICATIONS_DESCRIPTION
"An extremely useful application that makes use of MyLib")
set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION
@@ -206,8 +206,8 @@ if(CPackGen MATCHES "RPM")
/usr/foo/bar/other_relocatable
/usr/foo/bar/other_relocatable/depth_two$")
elseif(check_file_headers_match)
- set(check_file_match_expected_summary ".*${CPACK_RPM_headers_PACKAGE_SUMMARY}.*")
- set(check_file_match_expected_description ".*${CPACK_RPM_headers_PACKAGE_DESCRIPTION}.*")
+ set(check_file_match_expected_summary ".*${CPACK_RPM_HEADERS_PACKAGE_SUMMARY}.*")
+ set(check_file_match_expected_description ".*${CPACK_RPM_HEADERS_PACKAGE_DESCRIPTION}.*")
set(check_file_match_expected_relocation_path "Relocations${whitespaces}:${whitespaces}${CPACK_PACKAGING_INSTALL_PREFIX}${whitespaces}${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
set(check_file_match_expected_architecture "noarch")
set(spec_regex "*headers*")
diff --git a/Tests/CompileDefinitions/CMakeLists.txt b/Tests/CompileDefinitions/CMakeLists.txt
index 13d1b01..1d8afbf 100644
--- a/Tests/CompileDefinitions/CMakeLists.txt
+++ b/Tests/CompileDefinitions/CMakeLists.txt
@@ -1,11 +1,6 @@
cmake_minimum_required(VERSION 2.8)
project(CompileDefinitions)
-if ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 6")
- add_definitions(-DNO_SPACES_IN_DEFINE_VALUES)
- set(NO_SPACES_IN_DEFINE_VALUES 1)
-endif()
-
# Use compile flags to tell executables which config is built
# without depending on the compile definitions functionality.
foreach(c DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 9251ff3..83ca7f4 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -2,6 +2,7 @@
# A more complex test case
#
cmake_minimum_required(VERSION 2.4)
+cmake_policy(SET CMP0054 NEW)
project (Complex)
# Test that renaming a built-in works when configured multiple times.
@@ -438,6 +439,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA")
endif ()
+# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+ CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+ set(CMAKE_CXX_STANDARD 11)
+endif()
+
#
# Create the libs and the main exe
#
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt
index a1f8e68..c30dcbc 100644
--- a/Tests/Complex/Executable/CMakeLists.txt
+++ b/Tests/Complex/Executable/CMakeLists.txt
@@ -146,7 +146,8 @@ add_dependencies(notInAllCustom notInAllExe)
#
add_subdirectory(Temp)
-if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX
+ AND NOT XCODE) # XCODE is excluded due to #15687
add_executable(testSystemDir testSystemDir.cxx)
set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror")
endif()
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index 3b73e70..2d92809 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -2,6 +2,7 @@
# A more complex test case
#
cmake_minimum_required(VERSION 2.4)
+cmake_policy(SET CMP0054 NEW)
project (Complex)
# Try setting a new policy. The IF test is for coverage.
@@ -401,6 +402,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA")
endif ()
+# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+ CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+ set(CMAKE_CXX_STANDARD 11)
+endif()
+
#
# Create the libs and the main exe
#
diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
index b2307b2..4897b48 100644
--- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
@@ -146,7 +146,8 @@ add_dependencies(notInAllCustom notInAllExe)
#
add_subdirectory(Temp)
-if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX
+ AND NOT XCODE) # XCODE is excluded due to #15687
add_executable(testSystemDir testSystemDir.cxx)
set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror")
endif()
diff --git a/Tests/CustomCommand/wrapper.cxx b/Tests/CustomCommand/wrapper.cxx
index 93cb079..97912de 100644
--- a/Tests/CustomCommand/wrapper.cxx
+++ b/Tests/CustomCommand/wrapper.cxx
@@ -16,18 +16,12 @@ int main(int argc, char *argv[])
fprintf(fp,"int wrapped_help() { return 5; }\n");
fclose(fp);
#ifdef CMAKE_INTDIR
- /* The VS6 IDE passes a leading ".\\" in its variable expansion. */
-# if defined(_MSC_VER) && _MSC_VER == 1200
-# define CFG_DIR ".\\" CMAKE_INTDIR
-# else
-# define CFG_DIR CMAKE_INTDIR
-# endif
const char* cfg = (argc >= 4)? argv[3] : "";
- if(strcmp(cfg, CFG_DIR) != 0)
+ if(strcmp(cfg, CMAKE_INTDIR) != 0)
{
fprintf(stderr,
"Did not receive expected configuration argument:\n"
- " expected [" CFG_DIR "]\n"
+ " expected [" CMAKE_INTDIR "]\n"
" received [%s]\n", cfg);
return 1;
}
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index c2ecb0b..f504c7b 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -79,12 +79,6 @@ set_property(TARGET testLib7 PROPERTY OUTPUT_NAME_DEBUG testLib7D-$<CONFIG>)
set_property(TARGET testLib7 PROPERTY OUTPUT_NAME_RELEASE testLib7R-$<CONFIG>)
set_property(TARGET testLib7 PROPERTY OUTPUT_NAME testLib7-$<CONFIG>)
-# Work-around: Visual Studio 6 does not support per-target object files.
-set(VS6)
-if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
- set(VS6 1)
-endif()
-
# Test using the target_link_libraries command to set the
# LINK_INTERFACE_LIBRARIES* properties. We construct two libraries
# providing the same two symbols. In each library one of the symbols
@@ -93,8 +87,8 @@ endif()
# configuration in which it is built. If the proper library is not
# used via the link interface the import test will fail to link.
add_library(testLib4lib STATIC testLib4lib.c)
-add_library(testLib4libdbg STATIC testLib4libopt.c testLib4libdbg${VS6}.c)
-add_library(testLib4libopt STATIC testLib4libdbg.c testLib4libopt${VS6}.c)
+add_library(testLib4libdbg STATIC testLib4libopt.c testLib4libdbg.c)
+add_library(testLib4libopt STATIC testLib4libdbg.c testLib4libopt.c)
set_property(TARGET testLib4libdbg PROPERTY COMPILE_DEFINITIONS LIB_DBG)
set_property(TARGET testLib4libopt PROPERTY COMPILE_DEFINITIONS LIB_OPT)
target_link_libraries(testLib4
diff --git a/Tests/ExportImport/Export/testLib4libdbg1.c b/Tests/ExportImport/Export/testLib4libdbg1.c
deleted file mode 100644
index cc56cf9..0000000
--- a/Tests/ExportImport/Export/testLib4libdbg1.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "testLib4libdbg.c"
diff --git a/Tests/ExportImport/Export/testLib4libopt1.c b/Tests/ExportImport/Export/testLib4libopt1.c
deleted file mode 100644
index d9b5587..0000000
--- a/Tests/ExportImport/Export/testLib4libopt1.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "testLib4libopt.c"
diff --git a/Tests/ExternalProjectLocal/CMakeLists.txt b/Tests/ExternalProjectLocal/CMakeLists.txt
index e1a67db..17f1630 100644
--- a/Tests/ExternalProjectLocal/CMakeLists.txt
+++ b/Tests/ExternalProjectLocal/CMakeLists.txt
@@ -23,18 +23,6 @@ set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
if(NOT DEFINED can_build_tutorial_step5)
set(can_build_tutorial_step5 1)
- # Tutorial Step5 cannot build correctly using Visual Studio 6
- # on Windows 98 if the path of its build tree exceeds 72
- # characters in length... So don't attempt to build it
- # in a long path on Win98:
- #
- if(CMAKE_SYSTEM STREQUAL "Windows-4.10")
- string(LENGTH "${binary_base}/TutorialStep5-Local" n)
- if(n GREATER 72)
- set(can_build_tutorial_step5 0)
- endif()
- endif()
-
# The ExternalProject builds of Tutorial Step5 cannot be built
# correctly 2nd and later times in an in-source build...
# (because the CMakeCache.txt from the real in-source build of
diff --git a/Tests/ExternalProjectSubdir/CMakeLists.txt b/Tests/ExternalProjectSubdir/CMakeLists.txt
index e65087a..3a67ea0 100644
--- a/Tests/ExternalProjectSubdir/CMakeLists.txt
+++ b/Tests/ExternalProjectSubdir/CMakeLists.txt
@@ -3,11 +3,8 @@ project(ExternalProjectSubdir NONE)
include(ExternalProject)
# Remove the custom target output to be sure it runs in an
-# incremental test. Skip this on VS 6 because it sometimes
-# re-runs CMake after the custom command runs.
-if(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 6")
- file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/PreSubdir1.txt)
-endif()
+# incremental test.
+file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/PreSubdir1.txt)
add_custom_target(PreSubdir1
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/PreSubdir1.txt
diff --git a/Tests/FindLTTngUST/CMakeLists.txt b/Tests/FindLTTngUST/CMakeLists.txt
new file mode 100644
index 0000000..c9c471d
--- /dev/null
+++ b/Tests/FindLTTngUST/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindLTTngUST.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindLTTngUST/Test"
+ "${CMake_BINARY_DIR}/Tests/FindLTTngUST/Test"
+ ${build_generator_args}
+ --build-project TestFindLTTngUST
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindLTTngUST/Test/CMakeLists.txt b/Tests/FindLTTngUST/Test/CMakeLists.txt
new file mode 100644
index 0000000..e5bd9f3
--- /dev/null
+++ b/Tests/FindLTTngUST/Test/CMakeLists.txt
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 3.5)
+project(TestFindLTTngUST C)
+include(CTest)
+
+find_package(LTTngUST REQUIRED)
+
+add_definitions(-DCMAKE_EXPECTED_LTTNGUST_VERSION="${LTTNGUST_VERSION_STRING}")
+add_definitions(-DCMAKE_LTTNGUST_HAS_TRACEF="${LTTNGUST_HAS_TRACEF}")
+add_definitions(-DCMAKE_LTTNGUST_HAS_TRACELOG="${LTTNGUST_HAS_TRACELOG}")
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt LTTng::UST)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${LTTNGUST_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${LTTNGUST_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindLTTngUST/Test/main.c b/Tests/FindLTTngUST/Test/main.c
new file mode 100644
index 0000000..ac775a0
--- /dev/null
+++ b/Tests/FindLTTngUST/Test/main.c
@@ -0,0 +1,31 @@
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <lttng/ust-version.h>
+
+#ifdef CMAKE_LTTNGUST_HAS_TRACEF
+#include <lttng/tracef.h>
+#endif
+
+#ifdef CMAKE_LTTNGUST_HAS_TRACELOG
+#include <lttng/tracelog.h>
+#endif
+
+int main(void)
+{
+ char lttng_version_string[16];
+
+ snprintf(lttng_version_string, 16, "%u.%u.%u", LTTNG_UST_MAJOR_VERSION,
+ LTTNG_UST_MINOR_VERSION, LTTNG_UST_PATCHLEVEL_VERSION);
+ assert(!strcmp(lttng_version_string, CMAKE_EXPECTED_LTTNGUST_VERSION));
+
+#ifdef CMAKE_LTTNGUST_HAS_TRACEF
+ tracef("calling tracef()! %d %s", -23, CMAKE_EXPECTED_LTTNGUST_VERSION);
+#endif
+
+#ifdef CMAKE_LTTNGUST_HAS_TRACELOG
+ tracelog(TRACE_WARNING, "calling tracelog()! %d", 17);
+#endif
+
+ return 0;
+}
diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
index 8e21c32..56fcc5d 100644
--- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt
+++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
@@ -1,6 +1,7 @@
-if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile")
+if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile" AND
+ NOT CMake_TEST_NO_FindPackageModeMakefileTest)
# Test whether the make is GNU make, and only add the test in this case,
# since the configured makefile in this test uses $(shell ...), which
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index ecf38a6..1268982 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.0)
+cmake_minimum_required (VERSION 3.1)
project(testf C CXX Fortran)
if(NOT DEFINED CMake_TEST_NESTED_MAKE_PROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
set(CMake_TEST_NESTED_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}")
@@ -119,7 +119,7 @@ endfunction()
# call the test_fortran_c_interface_module function
if("${CMAKE_Fortran_COMPILER_ID}:${CMAKE_C_COMPILER_ID}" MATCHES
"(Intel:MSVC|Absoft:GNU)"
- OR (CMAKE_Fortran_COMPILER_ID MATCHES CMAKE_C_COMPILER_ID ))
+ OR ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "${CMAKE_C_COMPILER_ID}" ))
test_fortran_c_interface_module()
else()
message("Fortran does not match c compiler")
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index 8cd25a4..8b94ca7 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
+cmake_policy(SET CMP0054 NEW)
project(GenerateExportHeader)
@@ -66,6 +67,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA")
endif ()
+# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+ CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+ set(CMAKE_CXX_STANDARD 11)
+endif()
+
add_subdirectory(lib_shared_and_static)
add_compiler_export_flags()
@@ -107,7 +114,10 @@ add_executable(GenerateExportHeader exportheader_test.cpp)
target_link_libraries(GenerateExportHeader ${link_libraries})
if (WIN32 OR CYGWIN)
- if(MSVC AND COMPILER_HAS_DEPRECATED)
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+ CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+ set(_platform Win32-Clang)
+ elseif(MSVC AND COMPILER_HAS_DEPRECATED)
set(_platform Win32)
elseif((MINGW OR CYGWIN) AND COMPILER_HAS_DEPRECATED)
set(_platform MinGW)
@@ -124,6 +134,6 @@ endif()
message("#### Testing reference: ${_platform}")
target_compile_definitions(GenerateExportHeader
PRIVATE
- "SRC_DIR=${CMAKE_CURRENT_SOURCE_DIR}/reference/${_platform}"
- "BIN_DIR=${CMAKE_CURRENT_BINARY_DIR}"
+ "SRC_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/reference/${_platform}\""
+ "BIN_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\""
)
diff --git a/Tests/Module/GenerateExportHeader/exportheader_test.cpp b/Tests/Module/GenerateExportHeader/exportheader_test.cpp
index 4f45f37..7802c43 100644
--- a/Tests/Module/GenerateExportHeader/exportheader_test.cpp
+++ b/Tests/Module/GenerateExportHeader/exportheader_test.cpp
@@ -136,13 +136,10 @@ int main()
libstatic_not_exported();
libstatic_excluded();
-#define STRINGIFY_IMPL(A) #A
-#define STRINGIFY(A) STRINGIFY_IMPL(A)
-
- compare(STRINGIFY(SRC_DIR) "/libshared_export.h",
- STRINGIFY(BIN_DIR) "/libshared/libshared_export.h");
- compare(STRINGIFY(SRC_DIR) "/libstatic_export.h",
- STRINGIFY(BIN_DIR) "/libstatic/libstatic_export.h");
+ compare(SRC_DIR "/libshared_export.h",
+ BIN_DIR "/libshared/libshared_export.h");
+ compare(SRC_DIR "/libstatic_export.h",
+ BIN_DIR "/libstatic/libstatic_export.h");
return 0;
}
diff --git a/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libshared_export.h b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libshared_export.h
new file mode 100644
index 0000000..d376631
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libshared_export.h
@@ -0,0 +1,41 @@
+
+#ifndef LIBSHARED_EXPORT_H
+#define LIBSHARED_EXPORT_H
+
+#ifdef LIBSHARED_STATIC_DEFINE
+# define LIBSHARED_EXPORT
+# define LIBSHARED_NO_EXPORT
+#else
+# ifndef LIBSHARED_EXPORT
+# ifdef libshared_EXPORTS
+ /* We are building this library */
+# define LIBSHARED_EXPORT __declspec(dllexport)
+# else
+ /* We are using this library */
+# define LIBSHARED_EXPORT __declspec(dllimport)
+# endif
+# endif
+
+# ifndef LIBSHARED_NO_EXPORT
+# define LIBSHARED_NO_EXPORT
+# endif
+#endif
+
+#ifndef LIBSHARED_DEPRECATED
+# define LIBSHARED_DEPRECATED __attribute__ ((__deprecated__))
+#endif
+
+#ifndef LIBSHARED_DEPRECATED_EXPORT
+# define LIBSHARED_DEPRECATED_EXPORT LIBSHARED_EXPORT LIBSHARED_DEPRECATED
+#endif
+
+#ifndef LIBSHARED_DEPRECATED_NO_EXPORT
+# define LIBSHARED_DEPRECATED_NO_EXPORT LIBSHARED_NO_EXPORT LIBSHARED_DEPRECATED
+#endif
+
+#define DEFINE_NO_DEPRECATED 0
+#if DEFINE_NO_DEPRECATED
+# define LIBSHARED_NO_DEPRECATED
+#endif
+
+#endif
diff --git a/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h
new file mode 100644
index 0000000..fd021e9
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h
@@ -0,0 +1,41 @@
+
+#ifndef LIBSTATIC_EXPORT_H
+#define LIBSTATIC_EXPORT_H
+
+#ifdef LIBSTATIC_STATIC_DEFINE
+# define LIBSTATIC_EXPORT
+# define LIBSTATIC_NO_EXPORT
+#else
+# ifndef LIBSTATIC_EXPORT
+# ifdef libstatic_EXPORTS
+ /* We are building this library */
+# define LIBSTATIC_EXPORT
+# else
+ /* We are using this library */
+# define LIBSTATIC_EXPORT
+# endif
+# endif
+
+# ifndef LIBSTATIC_NO_EXPORT
+# define LIBSTATIC_NO_EXPORT
+# endif
+#endif
+
+#ifndef LIBSTATIC_DEPRECATED
+# define LIBSTATIC_DEPRECATED __attribute__ ((__deprecated__))
+#endif
+
+#ifndef LIBSTATIC_DEPRECATED_EXPORT
+# define LIBSTATIC_DEPRECATED_EXPORT LIBSTATIC_EXPORT LIBSTATIC_DEPRECATED
+#endif
+
+#ifndef LIBSTATIC_DEPRECATED_NO_EXPORT
+# define LIBSTATIC_DEPRECATED_NO_EXPORT LIBSTATIC_NO_EXPORT LIBSTATIC_DEPRECATED
+#endif
+
+#define DEFINE_NO_DEPRECATED 0
+#if DEFINE_NO_DEPRECATED
+# define LIBSTATIC_NO_DEPRECATED
+#endif
+
+#endif
diff --git a/Tests/ObjectLibrary/A/CMakeLists.txt b/Tests/ObjectLibrary/A/CMakeLists.txt
index c24c5ed..188fd64 100644
--- a/Tests/ObjectLibrary/A/CMakeLists.txt
+++ b/Tests/ObjectLibrary/A/CMakeLists.txt
@@ -12,11 +12,8 @@ add_custom_command(
)
# Remove the custom command output to be sure it runs in an
-# incremental test. Skip this on VS 6 because it sometimes
-# re-runs CMake after the custom command runs.
-if(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 6")
- file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/a.cmake)
-endif()
+# incremental test.
+file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/a.cmake)
add_custom_command(
OUTPUT a.cmake
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/a.cmake
diff --git a/Tests/ObjectLibrary/B/CMakeLists.txt b/Tests/ObjectLibrary/B/CMakeLists.txt
index 2158084..ecace4f 100644
--- a/Tests/ObjectLibrary/B/CMakeLists.txt
+++ b/Tests/ObjectLibrary/B/CMakeLists.txt
@@ -1,8 +1,4 @@
project(ObjectLibraryB C)
-if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
- # VS 6 generator does not use per-target object locations.
- set(vs6 _vs6)
-endif()
# Add -fPIC so objects can be used in shared libraries.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -11,7 +7,7 @@ add_library(B OBJECT b1.c b2.c)
target_include_directories(B PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(B PUBLIC B_DEF)
-add_library(Bexport OBJECT b1${vs6}.c b2${vs6}.c)
+add_library(Bexport OBJECT b1.c b2.c)
set_property(TARGET Bexport PROPERTY COMPILE_DEFINITIONS Bexport)
target_include_directories(Bexport PRIVATE $<TARGET_PROPERTY:B,INTERFACE_INCLUDE_DIRECTORIES>)
target_compile_definitions(Bexport PRIVATE $<TARGET_PROPERTY:B,INTERFACE_COMPILE_DEFINITIONS>)
diff --git a/Tests/ObjectLibrary/B/b1_vs6.c b/Tests/ObjectLibrary/B/b1_vs6.c
deleted file mode 100644
index b606e10..0000000
--- a/Tests/ObjectLibrary/B/b1_vs6.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "b1.c"
diff --git a/Tests/ObjectLibrary/B/b2_vs6.c b/Tests/ObjectLibrary/B/b2_vs6.c
deleted file mode 100644
index d96a43e..0000000
--- a/Tests/ObjectLibrary/B/b2_vs6.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "b2.c"
diff --git a/Tests/ObjectLibrary/CMakeLists.txt b/Tests/ObjectLibrary/CMakeLists.txt
index e9f553e..e3476df 100644
--- a/Tests/ObjectLibrary/CMakeLists.txt
+++ b/Tests/ObjectLibrary/CMakeLists.txt
@@ -16,8 +16,8 @@ add_custom_command(TARGET UseCshared POST_BUILD COMMAND ${CMAKE_COMMAND} -P ${CM
add_executable(UseCinternal main.c c.c $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:B>)
-if("${CMAKE_GENERATOR}" MATCHES "^Visual Studio (6|7|7 .NET 2003)$")
- # VS 6 and 7 generators do not add objects as sources so we need a
+if("${CMAKE_GENERATOR}" MATCHES "^Visual Studio (7|7 .NET 2003)$")
+ # VS 7 generators do not add objects as sources so we need a
# dummy object to convince the IDE to build the targets below.
set(dummy dummy.obj) # In MinGW: gcc -c dummy.c -o dummy.obj
elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt
index 180f9fe..2fb894e 100644
--- a/Tests/PDBDirectoryAndName/CMakeLists.txt
+++ b/Tests/PDBDirectoryAndName/CMakeLists.txt
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 2.8)
+cmake_policy(SET CMP0054 NEW)
project(PDBDirectoryAndName C)
# Make sure the proper compiler is in use.
@@ -62,14 +63,17 @@ list(APPEND my_targets myexe2)
target_link_libraries(myexe2 mylibA mylibD)
-#-----------------------------------------------------------------------------
-# Check that PDB files actually appear where expected.
-# The PDB_NAME and PDB_OUTPUT_DIRECTORY options do not work in VS 6.
-if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
- return()
+# Clang/C2 does not produce pdb files for static libraries
+if (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND
+ CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
+ list(REMOVE_ITEM my_targets mylibB mylibD)
endif()
+
+#-----------------------------------------------------------------------------
+# Check that PDB files actually appear where expected.
+
set(pdbs "")
foreach(t ${my_targets})
get_property(pdb_name TARGET ${t} PROPERTY PDB_NAME)
diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt
index 2b7bac1..49ff317 100644
--- a/Tests/Plugin/CMakeLists.txt
+++ b/Tests/Plugin/CMakeLists.txt
@@ -1,4 +1,5 @@
cmake_minimum_required (VERSION 2.6)
+cmake_policy(SET CMP0054 NEW)
project(Plugin)
# Test per-target output directory properties.
@@ -34,6 +35,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA")
endif ()
+# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+ CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+ set(CMAKE_CXX_STANDARD 11)
+endif()
+
# Create an executable that exports an API for use by plugins.
add_executable(example_exe src/example_exe.cxx)
set_target_properties(example_exe PROPERTIES
diff --git a/Tests/PrecompiledHeader/CMakeLists.txt b/Tests/PrecompiledHeader/CMakeLists.txt
index 98bdd88..a804538 100644
--- a/Tests/PrecompiledHeader/CMakeLists.txt
+++ b/Tests/PrecompiledHeader/CMakeLists.txt
@@ -17,14 +17,8 @@ else()
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH)
endif()
-# The VS6 IDE does not support renaming .pch files with /Fp.
-if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
- set(PCH_USE_INCLUDE_DIR 1)
- set(PCH_FILE)
-else()
- set(PCH_USE_INCLUDE_DIR 0)
- set(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"")
-endif()
+set(PCH_USE_INCLUDE_DIR 0)
+set(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"")
# Choose between an explicit include path and using /I during
# precompilation. The /I form is used to test that the PCH is
diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt
index 15e2aca..b930f56 100644
--- a/Tests/Preprocess/CMakeLists.txt
+++ b/Tests/Preprocess/CMakeLists.txt
@@ -10,9 +10,6 @@ project(Preprocess)
if("${CMAKE_GENERATOR}" MATCHES "Xcode")
set(PP_XCODE 1)
endif()
-if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
- set(PP_VS6 1)
-endif()
if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles")
set(PP_UMAKE 1)
endif()
@@ -60,20 +57,15 @@ if(NOT BORLAND AND NOT PP_VS70)
set(SEMICOLON "\;")
endif()
-if(NOT PP_VS6)
- # VS 6 IDE: spaces and '"', '$', or ';'
- # The project parser cannot handle spaces if there are quotes.
- # Since we test passing in a quoted string, we cannot have spaces.
- set(STRING_EXTRA "${STRING_EXTRA} ")
+set(STRING_EXTRA "${STRING_EXTRA} ")
- if(NOT PP_BORLAND AND NOT PP_WATCOM)
- # Borland, WMake: multiple spaces
- # The make tool seems to remove extra whitespace from inside
- # quoted strings when passing to the compiler. It does not have
- # trouble passing to other tools, and the compiler may be directly
- # invoked from the command line.
- set(STRING_EXTRA "${STRING_EXTRA} ")
- endif()
+if(NOT PP_BORLAND AND NOT PP_WATCOM)
+ # Borland, WMake: multiple spaces
+ # The make tool seems to remove extra whitespace from inside
+ # quoted strings when passing to the compiler. It does not have
+ # trouble passing to other tools, and the compiler may be directly
+ # invoked from the command line.
+ set(STRING_EXTRA "${STRING_EXTRA} ")
endif()
if(NOT PP_VS)
@@ -201,14 +193,10 @@ endif()
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DPREPROCESS_DEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DPREPROCESS_DEBUG")
-# Inform the test if it built from Xcode or VS6 IDE.
+# Inform the test if it built from Xcode.
if(PP_XCODE)
set(PREPROCESS_XCODE 1)
endif()
-if(PP_VS6)
- set(PREPROCESS_VS6 1)
- set(VS6 _vs6)
-endif()
# Test old-style definitions.
add_definitions(-DOLD_DEF -DOLD_EXPR=2)
@@ -220,7 +208,7 @@ if(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}")
message(SEND_ERROR "add_definitions not converted to directory property!")
endif()
-add_executable(Preprocess preprocess.c preprocess${VS6}.cxx)
+add_executable(Preprocess preprocess.c preprocess.cxx)
set(FILE_PATH "${Preprocess_SOURCE_DIR}/file_def.h")
set(TARGET_PATH "${Preprocess_SOURCE_DIR}/target_def.h")
@@ -236,17 +224,14 @@ foreach(c "" "_DEBUG" "_RELEASE")
PROPERTY COMPILE_DEFINITIONS${c} "TARGET_DEF${c}"
)
set_property(
- SOURCE preprocess.c preprocess${VS6}.cxx
+ SOURCE preprocess.c preprocess.cxx
PROPERTY COMPILE_DEFINITIONS${c} "FILE_DEF${c}"
)
endforeach()
# Add definitions with values.
-if(NOT PREPROCESS_VS6)
- # The path might have spaces, which VS6 does not support.
- set(DEF_TARGET_PATH "TARGET_PATH=\"${TARGET_PATH}\"")
- set(DEF_FILE_PATH "FILE_PATH=\"${FILE_PATH}\"")
-endif()
+set(DEF_TARGET_PATH "TARGET_PATH=\"${TARGET_PATH}\"")
+set(DEF_FILE_PATH "FILE_PATH=\"${FILE_PATH}\"")
set_property(
TARGET Preprocess
APPEND PROPERTY COMPILE_DEFINITIONS
@@ -255,7 +240,7 @@ set_property(
${DEF_TARGET_PATH}
)
set_property(
- SOURCE preprocess.c preprocess${VS6}.cxx
+ SOURCE preprocess.c preprocess.cxx
APPEND PROPERTY COMPILE_DEFINITIONS
"FILE_STRING=\"${STRING_VALUE}${SEMICOLON}\""
"FILE_EXPR=${EXPR}"
diff --git a/Tests/Preprocess/preprocess.h.in b/Tests/Preprocess/preprocess.h.in
index 3e1c7a0..e058a58 100644
--- a/Tests/Preprocess/preprocess.h.in
+++ b/Tests/Preprocess/preprocess.h.in
@@ -2,12 +2,6 @@
#define STRING_VALUE "@STRING_VALUE@"
#define EXPR @EXPR@
#cmakedefine PREPROCESS_XCODE
-#cmakedefine PREPROCESS_VS6
-
-#ifdef PREPROCESS_VS6
-# define FILE_PATH "@FILE_PATH@"
-# define TARGET_PATH "@TARGET_PATH@"
-#endif
/* Declarations and macros shared by all sources. */
#define TO_STRING(x) TO_STRING0(x)
diff --git a/Tests/Preprocess/preprocess_vs6.cxx b/Tests/Preprocess/preprocess_vs6.cxx
deleted file mode 100644
index 9df89f6..0000000
--- a/Tests/Preprocess/preprocess_vs6.cxx
+++ /dev/null
@@ -1,3 +0,0 @@
-// The VS6 IDE does not support object name configuration so we need a
-// source file with a different name. Include the real source file.
-#include "preprocess.cxx"
diff --git a/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake b/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake
index 3784a6a..f268de7 100644
--- a/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake
+++ b/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake
@@ -6,8 +6,8 @@ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
# configure the AutoExport test
run_cmake(AutoExport)
unset(RunCMake_TEST_OPTIONS)
-# don't run this test on VS 6 as it is not supported
-if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 6|Watcom WMake|Borland Makefiles")
+# don't run this test on Watcom or Borland make as it is not supported
+if("${RunCMake_GENERATOR}" MATCHES "Watcom WMake|Borland Makefiles")
return()
endif()
# we build debug so the say.exe will be found in Debug/say.exe for
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index 31c72fb..26ffcc0 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -30,7 +30,7 @@ function(run_BuildDepends CASE)
endfunction()
run_BuildDepends(C-Exe)
-if(NOT RunCMake_GENERATOR MATCHES "Visual Studio [67]|Xcode")
+if(NOT RunCMake_GENERATOR MATCHES "Visual Studio 7|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)
@@ -40,3 +40,42 @@ if(NOT RunCMake_GENERATOR MATCHES "Visual Studio [67]|Xcode")
endif()
run_BuildDepends(Custom-Always)
+
+function(run_ReGeneration)
+ # test re-generation of project even if CMakeLists.txt files disappeared
+
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/regenerate-project-build)
+ set(RunCMake_TEST_SOURCE_DIR ${RunCMake_BINARY_DIR}/regenerate-project-source)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}")
+ set(ProjectHeader [=[
+ cmake_minimum_required(VERSION 3.5)
+ project(Regenerate-Project NONE)
+ ]=])
+
+ # create project with subdirectory
+ file(WRITE "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" "${ProjectHeader}"
+ "add_subdirectory(mysubdir)")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}/mysubdir")
+ file(WRITE "${RunCMake_TEST_SOURCE_DIR}/mysubdir/CMakeLists.txt" "# empty")
+
+ run_cmake(Regenerate-Project)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${fs_delay})
+
+ # now we delete the subdirectory and adjust the CMakeLists.txt
+ file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}/mysubdir")
+ file(WRITE "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" "${ProjectHeader}")
+
+ run_cmake_command(Regenerate-Project-Directory-Removed
+ ${CMAKE_COMMAND} --build "${RunCMake_TEST_BINARY_DIR}")
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_SOURCE_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+endfunction()
+
+if(RunCMake_GENERATOR STREQUAL "Xcode")
+ run_ReGeneration(regenerate-project)
+endif()
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 0a388c5..588f3a1 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -152,6 +152,7 @@ add_RunCMake_test(ObjectLibrary)
add_RunCMake_test(Swift)
add_RunCMake_test(TargetObjects)
add_RunCMake_test(TargetSources)
+add_RunCMake_test(ToolchainFile)
add_RunCMake_test(find_dependency)
add_RunCMake_test(CompileDefinitions)
add_RunCMake_test(CompileFeatures)
@@ -231,11 +232,15 @@ if(PKG_CONFIG_FOUND)
add_RunCMake_test(FindPkgConfig)
endif()
-if("${CMAKE_GENERATOR}" MATCHES "Visual Studio [^6]")
+if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
add_RunCMake_test(include_external_msproject)
add_RunCMake_test(SolutionGlobalSections)
endif()
+if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^789]|[789][0-9])")
+ add_RunCMake_test(VS10Project)
+endif()
+
if(XCODE_VERSION AND NOT "${XCODE_VERSION}" VERSION_LESS 3)
add_RunCMake_test(XcodeProject -DXCODE_VERSION=${XCODE_VERSION})
endif()
diff --git a/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake b/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake
new file mode 100644
index 0000000..13aa77b
--- /dev/null
+++ b/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake
@@ -0,0 +1,26 @@
+set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
+
+# default
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh"
+ "echo \"pre install\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_install.sh"
+ "echo \"post install\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh"
+ "echo \"pre uninstall\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh"
+ "echo \"post uninstall\"\n")
+
+# specific
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh"
+ "echo \"pre install foo\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_install_foo.sh"
+ "echo \"post install foo\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh"
+ "echo \"pre uninstall foo\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh"
+ "echo \"post uninstall foo\"\n")
+
+install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo)
+install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar)
+
+set(CPACK_PACKAGE_NAME "install_scripts")
diff --git a/Tests/RunCMake/CPack/RPM/DEPENDENCIES-specifics.cmake b/Tests/RunCMake/CPack/RPM/DEPENDENCIES-specifics.cmake
index 2cdfece..8b7fb1e 100644
--- a/Tests/RunCMake/CPack/RPM/DEPENDENCIES-specifics.cmake
+++ b/Tests/RunCMake/CPack/RPM/DEPENDENCIES-specifics.cmake
@@ -4,19 +4,19 @@ set(CPACK_RPM_COMPONENT_INSTALL "ON")
# does not use them correctly: https://bugs.launchpad.net/rpm/+bug/1475755
set(CPACK_RPM_PACKAGE_AUTOREQ "no")
set(CPACK_RPM_PACKAGE_AUTOPROV "no")
-set(CPACK_RPM_applications_auto_PACKAGE_AUTOREQPROV "yes")
-set(CPACK_RPM_libs_auto_PACKAGE_AUTOREQPROV "yes")
+set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_AUTOREQPROV "yes")
+set(CPACK_RPM_LIBS_AUTO_PACKAGE_AUTOREQPROV "yes")
set(CPACK_RPM_PACKAGE_REQUIRES "depend-default, depend-default-b")
-set(CPACK_RPM_applications_PACKAGE_REQUIRES "depend-application, depend-application-b")
-set(CPACK_RPM_applications_auto_PACKAGE_REQUIRES "depend-application, depend-application-b")
-set(CPACK_RPM_headers_PACKAGE_REQUIRES "depend-headers")
+set(CPACK_RPM_APPLICATIONS_PACKAGE_REQUIRES "depend-application, depend-application-b")
+set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_REQUIRES "depend-application, depend-application-b")
+set(CPACK_RPM_HEADERS_PACKAGE_REQUIRES "depend-headers")
set(CPACK_RPM_PACKAGE_CONFLICTS "conflict-default, conflict-default-b")
-set(CPACK_RPM_applications_PACKAGE_CONFLICTS "conflict-application, conflict-application-b")
-set(CPACK_RPM_applications_auto_PACKAGE_CONFLICTS "conflict-application, conflict-application-b")
-set(CPACK_RPM_headers_PACKAGE_CONFLICTS "conflict-headers")
+set(CPACK_RPM_APPLICATIONS_PACKAGE_CONFLICTS "conflict-application, conflict-application-b")
+set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_CONFLICTS "conflict-application, conflict-application-b")
+set(CPACK_RPM_HEADERS_PACKAGE_CONFLICTS "conflict-headers")
set(CPACK_RPM_PACKAGE_PROVIDES "provided-default, provided-default-b")
-set(CPACK_RPM_libs_PACKAGE_PROVIDES "provided-lib")
-set(CPACK_RPM_libs_auto_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b")
+set(CPACK_RPM_LIBS_PACKAGE_PROVIDES "provided-lib")
+set(CPACK_RPM_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b")
diff --git a/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-ExpectedFiles.cmake
new file mode 100644
index 0000000..033a45d
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-ExpectedFiles.cmake
@@ -0,0 +1,7 @@
+set(whitespaces_ "[\t\n\r ]*")
+
+set(EXPECTED_FILES_COUNT "2")
+set(EXPECTED_FILE_1 "install_scripts*-foo.rpm")
+set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$")
+set(EXPECTED_FILE_2 "install_scripts*-bar.rpm")
+set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$")
diff --git a/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-VerifyResult.cmake b/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-VerifyResult.cmake
new file mode 100644
index 0000000..d7d82f2
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-VerifyResult.cmake
@@ -0,0 +1,29 @@
+function(checkScripts_ FILE COMPARE_LIST)
+ set(whitespaces_ "[\t\n\r ]*")
+
+ execute_process(COMMAND ${RPM_EXECUTABLE} -qp --scripts ${FILE}
+ WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ OUTPUT_VARIABLE FILE_SCRIPTS_
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ string(REPLACE "\n" ";" FILE_SCRIPTS_LIST_ "${FILE_SCRIPTS_}")
+
+ foreach(COMPARE_REGEX_ IN LISTS COMPARE_LIST)
+ unset(FOUND_)
+
+ foreach(COMPARE_ IN LISTS FILE_SCRIPTS_LIST_)
+ if(COMPARE_ MATCHES "${COMPARE_REGEX_}")
+ set(FOUND_ true)
+ break()
+ endif()
+ endforeach()
+
+ if(NOT FOUND_)
+ message(FATAL_ERROR "Missing scripts in '${FILE}'; file info: '${FILE_SCRIPTS_}'; missing: '${COMPARE_REGEX_}'")
+ endif()
+ endforeach()
+endfunction()
+
+checkScripts_("${FOUND_FILE_1}" "echo \"pre install foo\";echo \"post install foo\";echo \"pre uninstall foo\";echo \"post uninstall foo\"")
+checkScripts_("${FOUND_FILE_2}" "echo \"pre install\";echo \"post install\";echo \"pre uninstall\";echo \"post uninstall\"")
diff --git a/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-specifics.cmake b/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-specifics.cmake
new file mode 100644
index 0000000..4eb53c3
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-specifics.cmake
@@ -0,0 +1,19 @@
+set(CPACK_RPM_COMPONENT_INSTALL "ON")
+
+set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh")
+set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/post_install.sh")
+set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh")
+set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh")
+
+set(CPACK_RPM_foo_PRE_INSTALL_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh")
+set(CPACK_RPM_foo_POST_INSTALL_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/post_install_foo.sh")
+set(CPACK_RPM_foo_PRE_UNINSTALL_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh")
+set(CPACK_RPM_foo_POST_UNINSTALL_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh")
diff --git a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-specifics.cmake b/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-specifics.cmake
index d398168..524ef0c 100644
--- a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-specifics.cmake
+++ b/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-specifics.cmake
@@ -1,5 +1,5 @@
set(CPACK_RPM_COMPONENT_INSTALL "ON")
set(CPACK_RPM_PACKAGE_GROUP "default")
-set(CPACK_RPM_pkg_2_PACKAGE_NAME "second")
-set(CPACK_RPM_pkg_2_PACKAGE_GROUP "second_group")
+set(CPACK_RPM_PKG_2_PACKAGE_NAME "second")
+set(CPACK_RPM_PKG_2_PACKAGE_GROUP "second_group")
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index fe2b48b..ee4112d 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -11,3 +11,4 @@ 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)
run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false)
+run_cpack_test(INSTALL_SCRIPTS "RPM" false)
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-result.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-stderr.txt
new file mode 100644
index 0000000..f2cbaa6
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-stderr.txt
@@ -0,0 +1,3 @@
+^'--target' may not be specified more than once\.
++
+Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt
index 20df108..d2a2831 100644
--- a/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt
@@ -3,3 +3,5 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E echo CustomCommand > output.txt
)
add_custom_target(CustomTarget ALL DEPENDS output.txt)
+add_custom_target(CustomTarget2 ALL DEPENDS output.txt)
+add_custom_target(CustomTarget3 ALL DEPENDS output.txt)
diff --git a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt
deleted file mode 100644
index 1b6a510..0000000
--- a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-^CMake Warning:
- The "Visual Studio 6" generator is deprecated and will be removed in a
- future version of CMake.
-
- Add CMAKE_WARN_VS6=OFF to the cache to disable this warning.$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index e3b73ff..3b5504e 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -51,6 +51,8 @@ function(run_BuildDir)
run_cmake(BuildDir)
run_cmake_command(BuildDir--build ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build --target CustomTarget)
+ run_cmake_command(BuildDir--build-multiple-targets ${CMAKE_COMMAND} -E chdir ..
+ ${CMAKE_COMMAND} --build BuildDir-build --target CustomTarget2 --target CustomTarget3)
endfunction()
run_BuildDir()
@@ -70,12 +72,7 @@ if(RunCMake_GENERATOR STREQUAL "Ninja")
unset(RunCMake_TEST_NO_CLEAN)
endif()
-if(RunCMake_GENERATOR STREQUAL "Visual Studio 6")
- set(RunCMake_WARN_VS6 1)
- run_cmake(DeprecateVS6-WARN-ON)
- unset(RunCMake_WARN_VS6)
- run_cmake(DeprecateVS6-WARN-OFF)
-elseif(RunCMake_GENERATOR STREQUAL "Visual Studio 7")
+if(RunCMake_GENERATOR STREQUAL "Visual Studio 7")
set(RunCMake_WARN_VS70 1)
run_cmake(DeprecateVS70-WARN-ON)
unset(RunCMake_WARN_VS70)
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index db9911d..9d44a8a 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -51,9 +51,6 @@ function(run_cmake test)
if(APPLE)
list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW)
endif()
- if(RunCMake_GENERATOR STREQUAL "Visual Studio 6" AND NOT RunCMake_WARN_VS6)
- list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS6=OFF)
- endif()
if(RunCMake_GENERATOR STREQUAL "Visual Studio 7" AND NOT RunCMake_WARN_VS70)
list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS70=OFF)
endif()
diff --git a/Tests/RunCMake/ToolchainFile/CMakeLists.txt b/Tests/RunCMake/ToolchainFile/CMakeLists.txt
new file mode 100644
index 0000000..93ee9df
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.5)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ToolchainFile/CallEnableLanguage-result.txt b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ToolchainFile/CallEnableLanguage-stderr.txt b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-stderr.txt
new file mode 100644
index 0000000..0de51c6
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at CallEnableLanguage-toolchain.cmake:[0-9]+ \(enable_language\):
+ Language 'NONE' is currently being enabled. Recursive call not allowed.
+Call Stack \(most recent call first\):
+ .*/Modules/CMakeDetermineSystem.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(project\)$
diff --git a/Tests/RunCMake/ToolchainFile/CallEnableLanguage-toolchain.cmake b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-toolchain.cmake
new file mode 100644
index 0000000..8145101
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-toolchain.cmake
@@ -0,0 +1 @@
+enable_language(NONE)
diff --git a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake b/Tests/RunCMake/ToolchainFile/CallEnableLanguage.cmake
index e69de29..e69de29 100644
--- a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake
+++ b/Tests/RunCMake/ToolchainFile/CallEnableLanguage.cmake
diff --git a/Tests/RunCMake/ToolchainFile/CallProject-result.txt b/Tests/RunCMake/ToolchainFile/CallProject-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CallProject-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ToolchainFile/CallProject-stderr.txt b/Tests/RunCMake/ToolchainFile/CallProject-stderr.txt
new file mode 100644
index 0000000..e2b9f1b
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CallProject-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at CallProject-toolchain.cmake:[0-9]+ \(project\):
+ Language 'NONE' is currently being enabled. Recursive call not allowed.
+Call Stack \(most recent call first\):
+ .*/Modules/CMakeDetermineSystem.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(project\)$
diff --git a/Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake b/Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake
new file mode 100644
index 0000000..b113c13
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake
@@ -0,0 +1 @@
+project(Bad NONE)
diff --git a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake b/Tests/RunCMake/ToolchainFile/CallProject.cmake
index e69de29..e69de29 100644
--- a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake
+++ b/Tests/RunCMake/ToolchainFile/CallProject.cmake
diff --git a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
new file mode 100644
index 0000000..75293e7
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
@@ -0,0 +1,9 @@
+include(RunCMake)
+
+function(run_cmake_toolchain t)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/${t}-toolchain.cmake)
+ run_cmake(${t})
+endfunction()
+
+run_cmake_toolchain(CallEnableLanguage)
+run_cmake_toolchain(CallProject)
diff --git a/Tests/RunCMake/VS10Project/CMakeLists.txt b/Tests/RunCMake/VS10Project/CMakeLists.txt
new file mode 100644
index 0000000..91baae7
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.5.0)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
new file mode 100644
index 0000000..cc2cc2e
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -0,0 +1,2 @@
+include(RunCMake)
+run_cmake(VsConfigurationType)
diff --git a/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake b/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake
new file mode 100644
index 0000000..4690970
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake
@@ -0,0 +1,24 @@
+set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
+if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
+ return()
+endif()
+
+set(propertyFound FALSE)
+file(STRINGS "${vcProjectFile}" lines)
+foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<ConfigurationType>(.*)</ConfigurationType>$")
+ set(propertyFound TRUE)
+ set(expectedValue "MyValue")
+ set(actualValue ${CMAKE_MATCH_1})
+ if(NOT (${actualValue} STREQUAL ${expectedValue}))
+ set(RunCMake_TEST_FAILED "ConfigurationType \"${actualValue}\" differs from expected value \"${expectedValue}\".")
+ return()
+ endif()
+ endif()
+endforeach()
+
+if(NOT propertyFound)
+ set(RunCMake_TEST_FAILED "Property ConfigurationType not found in project file.")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsConfigurationType.cmake b/Tests/RunCMake/VS10Project/VsConfigurationType.cmake
new file mode 100644
index 0000000..a73dfe8
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsConfigurationType.cmake
@@ -0,0 +1,3 @@
+enable_language(CXX)
+add_library(foo foo.cpp)
+set_target_properties(foo PROPERTIES VS_CONFIGURATION_TYPE "MyValue")
diff --git a/Tests/RunCMake/VS10Project/foo.cpp b/Tests/RunCMake/VS10Project/foo.cpp
new file mode 100644
index 0000000..2fb55ee
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/foo.cpp
@@ -0,0 +1 @@
+void foo() { }
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index 395c74b..b77d5d4 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -97,6 +97,7 @@ if(NOT XCODE_VERSION VERSION_LESS 7)
endif()
if(NOT XCODE_VERSION VERSION_LESS 6)
+ # XcodeIOSInstallCombined
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombined-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
@@ -114,6 +115,7 @@ if(NOT XCODE_VERSION VERSION_LESS 6)
unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_OPTIONS)
+ # XcodeIOSInstallCombinedPrune
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedPrune-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
@@ -130,4 +132,22 @@ if(NOT XCODE_VERSION VERSION_LESS 6)
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_OPTIONS)
+
+ # XcodeIOSInstallCombinedSingleArch
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedSingleArch-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install"
+ "-DCMAKE_IOS_INSTALL_COMBINED=YES")
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(XcodeIOSInstallCombinedSingleArch)
+ run_cmake_command(XcodeIOSInstallCombinedSingleArch-build ${CMAKE_COMMAND} --build .)
+ run_cmake_command(XcodeIOSInstallCombinedSingleArch-install ${CMAKE_COMMAND} --build . --target install)
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+ unset(RunCMake_TEST_OPTIONS)
endif()
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch-install-check.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch-install-check.cmake
new file mode 100644
index 0000000..3c11ae0
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch-install-check.cmake
@@ -0,0 +1,25 @@
+function(verify_architecture file)
+ execute_process(
+ COMMAND xcrun lipo -info ${RunCMake_TEST_BINARY_DIR}/_install/${file}
+ OUTPUT_VARIABLE lipo_out
+ ERROR_VARIABLE lipo_err
+ RESULT_VARIABLE lipo_result)
+ if(NOT lipo_result EQUAL "0")
+ message(SEND_ERROR "lipo -info failed: ${lipo_err}")
+ return()
+ endif()
+
+ string(REGEX MATCHALL "is architecture: [^ \n\t]+" architecture "${lipo_out}")
+ string(REGEX REPLACE "is architecture: " "" actual "${architecture}")
+
+ set(expected armv7)
+
+ if(NOT actual STREQUAL expected)
+ message(SEND_ERROR
+ "The actual library architecture:\n ${actual} \n"
+ "which do not match expected ones:\n ${expected} \n"
+ "lipo output:\n${lipo_out}")
+ endif()
+endfunction()
+
+verify_architecture(lib/libfoo.dylib)
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
new file mode 100644
index 0000000..4b5e7ce
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 3.3)
+
+project(XcodeIOSInstallCombinedSingleArch CXX)
+
+set(CMAKE_OSX_SYSROOT iphoneos)
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
+
+add_library(foo SHARED foo.cpp)
+install(TARGETS foo DESTINATION lib)
+
+set_target_properties(
+ foo
+ PROPERTIES
+ XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] armv7
+ XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] armv7
+ XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] ""
+ XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] ""
+)
diff --git a/Tests/RunCMake/cmake_parse_arguments/CornerCases.cmake b/Tests/RunCMake/cmake_parse_arguments/CornerCases.cmake
index 72c82ab..028bfaf 100644
--- a/Tests/RunCMake/cmake_parse_arguments/CornerCases.cmake
+++ b/Tests/RunCMake/cmake_parse_arguments/CornerCases.cmake
@@ -29,6 +29,26 @@ macro(foo)
endmacro()
foo(FOO foo)
+TEST(_FOO1_FOO foo)
+TEST(_FOO2_FOO foo)
+# Make sure a list is split
+foo(FOO "foo;bar")
TEST(_FOO1_FOO foo)
+TEST(_FOO1_UNPARSED_ARGUMENTS "bar")
TEST(_FOO2_FOO foo)
+TEST(_FOO2_UNPARSED_ARGUMENTS "bar")
+
+# Do not split if argn is quoted
+foo(FOO "foo\\;bar")
+TEST(_FOO1_FOO foo)
+TEST(_FOO1_UNPARSED_ARGUMENTS "bar")
+TEST(_FOO2_FOO foo;bar)
+TEST(_FOO2_UNPARSED_ARGUMENTS "UNDEFINED")
+
+# Do not split if argn is quoted
+foo(FOO "foo\\\\;bar")
+TEST(_FOO1_FOO foo)
+TEST(_FOO1_UNPARSED_ARGUMENTS "bar")
+TEST(_FOO2_FOO foo;bar)
+TEST(_FOO2_UNPARSED_ARGUMENTS "UNDEFINED")
diff --git a/Tests/RunCMake/cmake_parse_arguments/Initialization.cmake b/Tests/RunCMake/cmake_parse_arguments/Initialization.cmake
index 462f923..b4199ea 100644
--- a/Tests/RunCMake/cmake_parse_arguments/Initialization.cmake
+++ b/Tests/RunCMake/cmake_parse_arguments/Initialization.cmake
@@ -25,6 +25,9 @@ TEST(pref_OPT1 TRUE)
cmake_parse_arguments(pref "OPT1;OPT2" "" "" OPT1 OPT2)
TEST(pref_OPT1 TRUE)
TEST(pref_OPT2 TRUE)
+cmake_parse_arguments(pref "OPT1;OPT2" "" "" "OPT1;OPT2")
+TEST(pref_OPT1 TRUE)
+TEST(pref_OPT2 TRUE)
cmake_parse_arguments(pref "OPT1;OPT2" "" "")
TEST(pref_OPT1 FALSE)
TEST(pref_OPT2 FALSE)
@@ -44,6 +47,9 @@ TEST(pref_SINGLE1 foo)
cmake_parse_arguments(pref "" "SINGLE1;SINGLE2" "" SINGLE1 foo SINGLE2 bar)
TEST(pref_SINGLE1 foo)
TEST(pref_SINGLE2 bar)
+cmake_parse_arguments(pref "" "SINGLE1;SINGLE2" "" "SINGLE1;foo;SINGLE2;bar")
+TEST(pref_SINGLE1 foo)
+TEST(pref_SINGLE2 bar)
cmake_parse_arguments(pref "" "SINGLE1;SINGLE2" "")
TEST(pref_SINGLE1 UNDEFINED)
TEST(pref_SINGLE2 UNDEFINED)
@@ -63,6 +69,9 @@ TEST(pref_MULTI1 foo)
cmake_parse_arguments(pref "" "" "MULTI1;MULTI2" MULTI1 foo bar MULTI2 bar foo)
TEST(pref_MULTI1 foo bar)
TEST(pref_MULTI2 bar foo)
+cmake_parse_arguments(pref "" "" "MULTI1;MULTI2" "MULTI1;foo;bar;MULTI2;bar;foo")
+TEST(pref_MULTI1 foo bar)
+TEST(pref_MULTI2 bar foo)
cmake_parse_arguments(pref "" "" "MULTI1;MULTI2")
TEST(pref_MULTI1 UNDEFINED)
TEST(pref_MULTI2 UNDEFINED)
diff --git a/Tests/RunCMake/file/DOWNLOAD-hash-mismatch-result.txt b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/DOWNLOAD-hash-mismatch-stderr.txt b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch-stderr.txt
new file mode 100644
index 0000000..406e315
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at DOWNLOAD-hash-mismatch.cmake:[0-9]+ \(file\):
+ file DOWNLOAD HASH mismatch
+
+ for file: \[.*/Tests/RunCMake/file/DOWNLOAD-hash-mismatch-build/hash-mismatch.txt\]
+ expected hash: \[0123456789abcdef0123456789abcdef01234567\]
+ actual hash: \[da39a3ee5e6b4b0d3255bfef95601890afd80709\]
+ status: \[0;"No error"\]
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
++
+status='1;HASH mismatch: expected: 0123456789abcdef0123456789abcdef01234567 actual: da39a3ee5e6b4b0d3255bfef95601890afd80709'$
diff --git a/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake
new file mode 100644
index 0000000..ca72692
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake
@@ -0,0 +1,7 @@
+file(DOWNLOAD
+ "file://${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-hash-mismatch.txt"
+ ${CMAKE_CURRENT_BINARY_DIR}/hash-mismatch.txt
+ EXPECTED_HASH SHA1=0123456789abcdef0123456789abcdef01234567
+ STATUS status
+ )
+message("status='${status}'")
diff --git a/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.txt b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.txt
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index d3dfb1b..5f85bba 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -1,5 +1,6 @@
include(RunCMake)
+run_cmake(DOWNLOAD-hash-mismatch)
run_cmake(INSTALL-DIRECTORY)
run_cmake(INSTALL-MESSAGE-bad)
run_cmake(FileOpenFailRead)
diff --git a/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-all-check.cmake b/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-all-check.cmake
new file mode 100644
index 0000000..0368df1
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-all-check.cmake
@@ -0,0 +1 @@
+check_installed([[^src-all;src-all/main\.c$]])
diff --git a/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-exc-check.cmake b/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-exc-check.cmake
new file mode 100644
index 0000000..41a816f
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-exc-check.cmake
@@ -0,0 +1 @@
+check_installed([[^src-exc;src-exc/main\.c$]])
diff --git a/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-uns-check.cmake b/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-uns-check.cmake
new file mode 100644
index 0000000..68a1378
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL-uns-check.cmake
@@ -0,0 +1 @@
+check_installed([[^src-all;src-all/main\.c;src-uns;src-uns/main\.c$]])
diff --git a/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL.cmake b/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL.cmake
new file mode 100644
index 0000000..720299b
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-EXCLUDE_FROM_ALL.cmake
@@ -0,0 +1,3 @@
+install(FILES main.c DESTINATION src-all)
+install(FILES main.c DESTINATION src-uns EXCLUDE_FROM_ALL)
+install(FILES main.c DESTINATION src-exc EXCLUDE_FROM_ALL COMPONENT exc)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index c2347d8..45693b5 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -1,4 +1,46 @@
+cmake_minimum_required(VERSION 3.4)
include(RunCMake)
+
+# Function to build and install a project. The latter step *-check.cmake
+# scripts can check installed files using the check_installed function.
+function(run_install_test case)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(${case})
+ run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config Debug)
+ # Check "all" components.
+ set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-all)
+ run_cmake_command(${case}-all ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -P cmake_install.cmake)
+ # Check unspecified component.
+ set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-uns)
+ run_cmake_command(${case}-uns ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -DCOMPONENT=Unspecified -P cmake_install.cmake)
+ # Check explicit component.
+ set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-exc)
+ run_cmake_command(${case}-exc ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -DCOMPONENT=exc -P cmake_install.cmake)
+endfunction()
+
+# Function called in *-check.cmake scripts to check installed files.
+function(check_installed expect)
+ file(GLOB_RECURSE actual
+ LIST_DIRECTORIES TRUE
+ RELATIVE ${CMAKE_INSTALL_PREFIX}
+ ${CMAKE_INSTALL_PREFIX}/*
+ )
+ if(actual)
+ list(SORT actual)
+ endif()
+ if(NOT "${actual}" MATCHES "${expect}")
+ set(RunCMake_TEST_FAILED "Installed files:
+ ${actual}
+do not match what we expected:
+ ${expect}
+in directory:
+ ${CMAKE_INSTALL_PREFIX}" PARENT_SCOPE)
+ endif()
+endfunction()
+
run_cmake(DIRECTORY-MESSAGE_NEVER)
run_cmake(DIRECTORY-PATTERN-MESSAGE_NEVER)
run_cmake(DIRECTORY-message)
@@ -14,3 +56,6 @@ run_cmake(EXPORT-OldIFace)
run_cmake(CMP0062-OLD)
run_cmake(CMP0062-NEW)
run_cmake(CMP0062-WARN)
+
+run_install_test(FILES-EXCLUDE_FROM_ALL)
+run_install_test(TARGETS-EXCLUDE_FROM_ALL)
diff --git a/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-all-check.cmake b/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-all-check.cmake
new file mode 100644
index 0000000..9b538bb
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-all-check.cmake
@@ -0,0 +1 @@
+check_installed([[^bin-all;bin-all/myexe(\.exe)?$]])
diff --git a/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-exc-check.cmake b/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-exc-check.cmake
new file mode 100644
index 0000000..aef0d27
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-exc-check.cmake
@@ -0,0 +1 @@
+check_installed([[^bin-exc;bin-exc/myexe(\.exe)?$]])
diff --git a/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-uns-check.cmake b/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-uns-check.cmake
new file mode 100644
index 0000000..56fd264
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL-uns-check.cmake
@@ -0,0 +1 @@
+check_installed([[^bin-all;bin-all/myexe(\.exe)?;bin-uns;bin-uns/myexe(\.exe)?$]])
diff --git a/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL.cmake b/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL.cmake
new file mode 100644
index 0000000..6fb2036
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-EXCLUDE_FROM_ALL.cmake
@@ -0,0 +1,5 @@
+enable_language(C)
+add_executable(myexe main.c)
+install(TARGETS myexe DESTINATION bin-all)
+install(TARGETS myexe DESTINATION bin-uns EXCLUDE_FROM_ALL)
+install(TARGETS myexe DESTINATION bin-exc EXCLUDE_FROM_ALL COMPONENT exc)
diff --git a/Tests/RunCMake/install/main.c b/Tests/RunCMake/install/main.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/Tests/RunCMake/install/main.c
@@ -0,0 +1 @@
+int main(void) { return 0; }
diff --git a/Tests/RunCMake/list/EmptyFilterRegex-result.txt b/Tests/RunCMake/list/EmptyFilterRegex-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyFilterRegex-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/list/EmptyFilterRegex-stderr.txt b/Tests/RunCMake/list/EmptyFilterRegex-stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyFilterRegex-stderr.txt
diff --git a/Tests/RunCMake/list/EmptyFilterRegex.cmake b/Tests/RunCMake/list/EmptyFilterRegex.cmake
new file mode 100644
index 0000000..33849cd
--- /dev/null
+++ b/Tests/RunCMake/list/EmptyFilterRegex.cmake
@@ -0,0 +1,2 @@
+set(mylist "")
+list(FILTER mylist INCLUDE REGEX "^FILTER_THIS_.+")
diff --git a/Tests/RunCMake/list/FILTER-NotList-result.txt b/Tests/RunCMake/list/FILTER-NotList-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-NotList-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/list/FILTER-NotList-stderr.txt b/Tests/RunCMake/list/FILTER-NotList-stderr.txt
new file mode 100644
index 0000000..159c28d
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-NotList-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at FILTER-NotList.cmake:2 \(list\):
+ list sub-command FILTER requires list to be present.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/FILTER-NotList.cmake b/Tests/RunCMake/list/FILTER-NotList.cmake
new file mode 100644
index 0000000..1e15635
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-NotList.cmake
@@ -0,0 +1,2 @@
+unset(nosuchlist)
+list(FILTER nosuchlist EXCLUDE REGEX "^FILTER_THIS_.+")
diff --git a/Tests/RunCMake/list/FILTER-REGEX-InvalidMode-result.txt b/Tests/RunCMake/list/FILTER-REGEX-InvalidMode-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-InvalidMode-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/list/FILTER-REGEX-InvalidMode-stderr.txt b/Tests/RunCMake/list/FILTER-REGEX-InvalidMode-stderr.txt
new file mode 100644
index 0000000..7f783fa
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-InvalidMode-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at FILTER-REGEX-InvalidMode.cmake:2 \(list\):
+ list sub-command FILTER does not recognize mode NOOP
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/FILTER-REGEX-InvalidMode.cmake b/Tests/RunCMake/list/FILTER-REGEX-InvalidMode.cmake
new file mode 100644
index 0000000..e02b929
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-InvalidMode.cmake
@@ -0,0 +1,2 @@
+set(mylist FILTER_THIS_BIT DO_NOT_FILTER_THIS thisisanitem FILTER_THIS_THING)
+list(FILTER mylist EXCLUDE NOOP "^FILTER_THIS_.+")
diff --git a/Tests/RunCMake/list/FILTER-REGEX-InvalidOperator-result.txt b/Tests/RunCMake/list/FILTER-REGEX-InvalidOperator-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-InvalidOperator-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/list/FILTER-REGEX-InvalidOperator-stderr.txt b/Tests/RunCMake/list/FILTER-REGEX-InvalidOperator-stderr.txt
new file mode 100644
index 0000000..94f2427
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-InvalidOperator-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at FILTER-REGEX-InvalidOperator.cmake:2 \(list\):
+ list sub-command FILTER does not recognize operator RM
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/FILTER-REGEX-InvalidOperator.cmake b/Tests/RunCMake/list/FILTER-REGEX-InvalidOperator.cmake
new file mode 100644
index 0000000..9624622
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-InvalidOperator.cmake
@@ -0,0 +1,2 @@
+set(mylist FILTER_THIS_BIT DO_NOT_FILTER_THIS thisisanitem FILTER_THIS_THING)
+list(FILTER mylist RM REGEX "^FILTER_THIS_.+")
diff --git a/Tests/RunCMake/list/FILTER-REGEX-InvalidRegex-result.txt b/Tests/RunCMake/list/FILTER-REGEX-InvalidRegex-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-InvalidRegex-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/list/FILTER-REGEX-InvalidRegex-stderr.txt b/Tests/RunCMake/list/FILTER-REGEX-InvalidRegex-stderr.txt
new file mode 100644
index 0000000..9e98cbf
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-InvalidRegex-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at FILTER-REGEX-InvalidRegex.cmake:2 \(list\):
+ list sub-command FILTER, mode REGEX failed to compile regex "UHOH!\)\(".
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/FILTER-REGEX-InvalidRegex.cmake b/Tests/RunCMake/list/FILTER-REGEX-InvalidRegex.cmake
new file mode 100644
index 0000000..0641062
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-InvalidRegex.cmake
@@ -0,0 +1,2 @@
+set(mylist FILTER_THIS_BIT DO_NOT_FILTER_THIS thisisanitem FILTER_THIS_THING)
+list(FILTER mylist EXCLUDE REGEX "UHOH!)(")
diff --git a/Tests/RunCMake/list/FILTER-REGEX-TooManyArguments-result.txt b/Tests/RunCMake/list/FILTER-REGEX-TooManyArguments-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-TooManyArguments-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/list/FILTER-REGEX-TooManyArguments-stderr.txt b/Tests/RunCMake/list/FILTER-REGEX-TooManyArguments-stderr.txt
new file mode 100644
index 0000000..ec7f41c
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-TooManyArguments-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at FILTER-REGEX-TooManyArguments.cmake:2 \(list\):
+ list sub-command FILTER, mode REGEX requires five arguments.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/FILTER-REGEX-TooManyArguments.cmake b/Tests/RunCMake/list/FILTER-REGEX-TooManyArguments.cmake
new file mode 100644
index 0000000..d9cd8eb
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-TooManyArguments.cmake
@@ -0,0 +1,2 @@
+set(mylist FILTER_THIS_BIT DO_NOT_FILTER_THIS thisisanitem FILTER_THIS_THING)
+list(FILTER mylist EXCLUDE REGEX "^FILTER_THIS_.+" one_too_many)
diff --git a/Tests/RunCMake/list/FILTER-REGEX-Valid0-result.txt b/Tests/RunCMake/list/FILTER-REGEX-Valid0-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-Valid0-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/list/FILTER-REGEX-Valid0-stderr.txt b/Tests/RunCMake/list/FILTER-REGEX-Valid0-stderr.txt
new file mode 100644
index 0000000..d9ba38d
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-Valid0-stderr.txt
@@ -0,0 +1,2 @@
+^mylist was: FILTER_THIS_BIT;DO_NOT_FILTER_THIS;thisisanitem;FILTER_THIS_THING
+mylist is: DO_NOT_FILTER_THIS;thisisanitem$
diff --git a/Tests/RunCMake/list/FILTER-REGEX-Valid0.cmake b/Tests/RunCMake/list/FILTER-REGEX-Valid0.cmake
new file mode 100644
index 0000000..f395e61
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-Valid0.cmake
@@ -0,0 +1,4 @@
+set(mylist FILTER_THIS_BIT DO_NOT_FILTER_THIS thisisanitem FILTER_THIS_THING)
+message("mylist was: ${mylist}")
+list(FILTER mylist EXCLUDE REGEX "^FILTER_THIS_.+")
+message("mylist is: ${mylist}")
diff --git a/Tests/RunCMake/list/FILTER-REGEX-Valid1-result.txt b/Tests/RunCMake/list/FILTER-REGEX-Valid1-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-Valid1-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/list/FILTER-REGEX-Valid1-stderr.txt b/Tests/RunCMake/list/FILTER-REGEX-Valid1-stderr.txt
new file mode 100644
index 0000000..5e5280d
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-Valid1-stderr.txt
@@ -0,0 +1,2 @@
+^mylist was: FILTER_THIS_BIT;DO_NOT_FILTER_THIS;thisisanitem;FILTER_THIS_THING
+mylist is: FILTER_THIS_BIT;FILTER_THIS_THING$
diff --git a/Tests/RunCMake/list/FILTER-REGEX-Valid1.cmake b/Tests/RunCMake/list/FILTER-REGEX-Valid1.cmake
new file mode 100644
index 0000000..e659281
--- /dev/null
+++ b/Tests/RunCMake/list/FILTER-REGEX-Valid1.cmake
@@ -0,0 +1,4 @@
+set(mylist FILTER_THIS_BIT DO_NOT_FILTER_THIS thisisanitem FILTER_THIS_THING)
+message("mylist was: ${mylist}")
+list(FILTER mylist INCLUDE REGEX "^FILTER_THIS_.+")
+message("mylist is: ${mylist}")
diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake
index 25d6a03..b002ab3 100644
--- a/Tests/RunCMake/list/RunCMakeTest.cmake
+++ b/Tests/RunCMake/list/RunCMakeTest.cmake
@@ -1,5 +1,6 @@
include(RunCMake)
+run_cmake(EmptyFilterRegex)
run_cmake(EmptyGet0)
run_cmake(EmptyRemoveAt0)
run_cmake(EmptyInsert-1)
@@ -8,17 +9,25 @@ run_cmake(NoArguments)
run_cmake(InvalidSubcommand)
run_cmake(GET-CMP0007-WARN)
+run_cmake(FILTER-REGEX-InvalidRegex)
run_cmake(GET-InvalidIndex)
run_cmake(INSERT-InvalidIndex)
run_cmake(REMOVE_AT-InvalidIndex)
+run_cmake(FILTER-REGEX-TooManyArguments)
run_cmake(LENGTH-TooManyArguments)
run_cmake(REMOVE_DUPLICATES-TooManyArguments)
run_cmake(REVERSE-TooManyArguments)
run_cmake(SORT-TooManyArguments)
+run_cmake(FILTER-NotList)
run_cmake(REMOVE_AT-NotList)
run_cmake(REMOVE_DUPLICATES-NotList)
run_cmake(REMOVE_ITEM-NotList)
run_cmake(REVERSE-NotList)
run_cmake(SORT-NotList)
+
+run_cmake(FILTER-REGEX-InvalidMode)
+run_cmake(FILTER-REGEX-InvalidOperator)
+run_cmake(FILTER-REGEX-Valid0)
+run_cmake(FILTER-REGEX-Valid1)
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index 6cdbafa..43ce998 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -16,6 +16,10 @@ run_cmake(BadSources2)
run_cmake(NonSourceCopyFile)
run_cmake(NonSourceCompileDefinitions)
+run_cmake(TargetTypeExe)
+run_cmake(TargetTypeInvalid)
+run_cmake(TargetTypeStatic)
+
run_cmake(CMP0056)
if(RunCMake_GENERATOR MATCHES "Make|Ninja")
diff --git a/Tests/RunCMake/try_compile/TargetTypeExe.cmake b/Tests/RunCMake/try_compile/TargetTypeExe.cmake
new file mode 100644
index 0000000..9b6e727
--- /dev/null
+++ b/Tests/RunCMake/try_compile/TargetTypeExe.cmake
@@ -0,0 +1,14 @@
+enable_language(C)
+set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE)
+try_compile(result ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src.c
+ OUTPUT_VARIABLE out
+ COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/copy
+ COPY_FILE_ERROR copy_err
+ )
+if(NOT result)
+ message(FATAL_ERROR "try_compile failed:\n${out}")
+endif()
+if(copy_err)
+ message(FATAL_ERROR "try_compile COPY_FILE failed:\n${copy_err}")
+endif()
diff --git a/Tests/RunCMake/try_compile/TargetTypeInvalid-result.txt b/Tests/RunCMake/try_compile/TargetTypeInvalid-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/TargetTypeInvalid-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/TargetTypeInvalid-stderr.txt b/Tests/RunCMake/try_compile/TargetTypeInvalid-stderr.txt
new file mode 100644
index 0000000..08b281a
--- /dev/null
+++ b/Tests/RunCMake/try_compile/TargetTypeInvalid-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at TargetTypeInvalid.cmake:2 \(try_compile\):
+ Invalid value 'INVALID' for CMAKE_TRY_COMPILE_TARGET_TYPE. Only
+ 'EXECUTABLE' and 'STATIC_LIBRARY' are allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/TargetTypeInvalid.cmake b/Tests/RunCMake/try_compile/TargetTypeInvalid.cmake
new file mode 100644
index 0000000..0bbc4ac
--- /dev/null
+++ b/Tests/RunCMake/try_compile/TargetTypeInvalid.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_TRY_COMPILE_TARGET_TYPE INVALID)
+try_compile(result ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c)
diff --git a/Tests/RunCMake/try_compile/TargetTypeStatic.cmake b/Tests/RunCMake/try_compile/TargetTypeStatic.cmake
new file mode 100644
index 0000000..006b8b8
--- /dev/null
+++ b/Tests/RunCMake/try_compile/TargetTypeStatic.cmake
@@ -0,0 +1,14 @@
+enable_language(C)
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+try_compile(result ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/other.c
+ OUTPUT_VARIABLE out
+ COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/copy
+ COPY_FILE_ERROR copy_err
+ )
+if(NOT result)
+ message(FATAL_ERROR "try_compile failed:\n${out}")
+endif()
+if(copy_err)
+ message(FATAL_ERROR "try_compile COPY_FILE failed:\n${copy_err}")
+endif()
diff --git a/Tests/RunCMake/try_compile/other.c b/Tests/RunCMake/try_compile/other.c
new file mode 100644
index 0000000..6c24f10
--- /dev/null
+++ b/Tests/RunCMake/try_compile/other.c
@@ -0,0 +1 @@
+int other(void) { return 0; }
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index e497503..d11cfc5 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -108,9 +108,7 @@ endif()
# try to compile a file that should compile
set(_c_flags "${CMAKE_C_FLAGS}")
-if(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D \"TESTDEF\"")
-elseif(WATCOM)
+if(WATCOM)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -dTESTDEF")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \"-DTESTDEF\"")
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt
index 73ea05a..20301c2 100644
--- a/Tests/VSExternalInclude/CMakeLists.txt
+++ b/Tests/VSExternalInclude/CMakeLists.txt
@@ -1,13 +1,10 @@
cmake_minimum_required (VERSION 2.6)
project(VSExternalInclude)
-if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
- set(PROJECT_EXT dsp)
-else()
- set(PROJECT_EXT vcproj)
-endif()
if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[0124]")
set(PROJECT_EXT vcxproj)
+else()
+ set(PROJECT_EXT vcproj)
endif()
# make sure directories exists
diff --git a/Tests/VSMidl/src/CMakeLists.txt b/Tests/VSMidl/src/CMakeLists.txt
index 86c04ed..e745fdd 100644
--- a/Tests/VSMidl/src/CMakeLists.txt
+++ b/Tests/VSMidl/src/CMakeLists.txt
@@ -1,12 +1,6 @@
cmake_minimum_required(VERSION 2.8)
project(VSMidl)
-if(MSVC_VERSION GREATER 1200)
- include_directories("${CMAKE_CURRENT_BINARY_DIR}/\$(IntDir)")
-else()
- # midl generated headers end up directly in CMAKE_CURRENT_BINARY_DIR with
- # VS6 builds.
- include_directories("${CMAKE_CURRENT_BINARY_DIR}")
-endif()
+include_directories("${CMAKE_CURRENT_BINARY_DIR}/\$(IntDir)")
add_executable(VSMidl main.cpp test.idl)
diff --git a/Utilities/Release/dashmacmini5_release.cmake b/Utilities/Release/bigmac_release.cmake
index b147013..568a98c 100644
--- a/Utilities/Release/dashmacmini5_release.cmake
+++ b/Utilities/Release/bigmac_release.cmake
@@ -1,27 +1,32 @@
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(BOOTSTRAP_ARGS "--prefix=/ --docdir=doc/cmake")
-set(HOST dashmacmini5)
+set(HOST bigmac)
set(MAKE_PROGRAM "make")
set(MAKE "${MAKE_PROGRAM} -j5")
set(CPACK_BINARY_GENERATORS "DragNDrop TGZ TZ")
set(CPACK_SOURCE_GENERATORS "TGZ TZ")
set(CPACK_DMG_FORMAT "UDBZ") #build using bzip2 for smaller package size
+set(CC clang)
+set(CXX clang++)
+set(CFLAGS "")
+set(CXXFLAGS "-stdlib=libc++")
set(INITIAL_CACHE "
-CMAKE_USE_OPENSSL:BOOL=OFF
-OPENSSL_CRYPTO_LIBRARY:FILEPATH=/Users/kitware/openssl-1.0.1g-install/lib/libcrypto.a
-OPENSSL_INCLUDE_DIR:PATH=/Users/kitware/openssl-1.0.1g-install/include
-OPENSSL_SSL_LIBRARY:FILEPATH=/Users/kitware/openssl-1.0.1g-install/lib/libssl.a
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_OSX_ARCHITECTURES:STRING=x86_64
-CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.6
+CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7
CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
CPACK_SYSTEM_NAME:STRING=Darwin-x86_64
BUILD_QtDialog:BOOL=TRUE
CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:BOOL=TRUE
CMake_INSTALL_DEPENDENCIES:BOOL=ON
-QT_QMAKE_EXECUTABLE:FILEPATH=/Users/kitware/Support/qt-4.8.6/install/bin/qmake
+CMAKE_SKIP_RPATH:BOOL=TRUE
+CMake_NO_C_STANDARD:BOOL=TRUE
+CMake_NO_CXX_STANDARD:BOOL=TRUE
+CMake_TEST_NO_FindPackageModeMakefileTest:BOOL=TRUE
")
+set(ENV [[
+export CMAKE_PREFIX_PATH='/Users/kitware/dashboards/support/Qt-5.5.1'
+]])
get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake
index d41c4ec..403367b 100644
--- a/Utilities/Release/create-cmake-release.cmake
+++ b/Utilities/Release/create-cmake-release.cmake
@@ -7,7 +7,7 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/logs)
set(RELEASE_SCRIPTS_BATCH_1
dash3win7_release.cmake # Windows
- dashmacmini5_release.cmake # OS X x86_64
+ bigmac_release.cmake # OS X x86_64
magrathea_release.cmake # Linux
linux64_release.cmake # Linux x86_64
)
diff --git a/Utilities/Release/linux64_release.cmake b/Utilities/Release/linux64_release.cmake
index 81442e7..4787d69 100644
--- a/Utilities/Release/linux64_release.cmake
+++ b/Utilities/Release/linux64_release.cmake
@@ -12,9 +12,9 @@ CURSES_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libncurses.a
CURSES_INCLUDE_PATH:PATH=/home/kitware/ncurses-5.9/include
FORM_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libform.a
CMAKE_USE_OPENSSL:BOOL=ON
-OPENSSL_CRYPTO_LIBRARY:FILEPATH=/home/kitware/openssl-1.0.2d/lib/libcrypto.a
-OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.0.2d/include
-OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.0.2d/lib/libssl.a
+OPENSSL_CRYPTO_LIBRARY:FILEPATH=/home/kitware/openssl-1.0.2f/lib/libcrypto.a
+OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.0.2f/include
+OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.0.2f/lib/libssl.a
CPACK_SYSTEM_NAME:STRING=Linux-x86_64
BUILD_QtDialog:BOOL:=TRUE
CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:BOOL=TRUE
diff --git a/Utilities/Release/magrathea_release.cmake b/Utilities/Release/magrathea_release.cmake
index 0634dda..00abcc1 100644
--- a/Utilities/Release/magrathea_release.cmake
+++ b/Utilities/Release/magrathea_release.cmake
@@ -12,9 +12,9 @@ CURSES_LIBRARY:FILEPATH=/usr/i686-gcc-332s/lib/libncurses.a
CURSES_INCLUDE_PATH:PATH=/usr/i686-gcc-332s/include/ncurses
FORM_LIBRARY:FILEPATH=/usr/i686-gcc-332s/lib/libform.a
CMAKE_USE_OPENSSL:BOOL=ON
-OPENSSL_CRYPTO_LIBRARY:FILEPATH=/home/kitware/openssl-1.0.2d/lib/libcrypto.a
-OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.0.2d/include
-OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.0.2d/lib/libssl.a
+OPENSSL_CRYPTO_LIBRARY:FILEPATH=/home/kitware/openssl-1.0.2f/lib/libcrypto.a
+OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.0.2f/include
+OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.0.2f/lib/libssl.a
CPACK_SYSTEM_NAME:STRING=Linux-i386
BUILD_QtDialog:BOOL:=TRUE
CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:BOOL=TRUE
diff --git a/Utilities/Scripts/update-third-party.bash b/Utilities/Scripts/update-third-party.bash
index 8925296..6aeeccd 100644
--- a/Utilities/Scripts/update-third-party.bash
+++ b/Utilities/Scripts/update-third-party.bash
@@ -1,3 +1,19 @@
+#=============================================================================
+# Copyright 2015-2016 Kitware, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#=============================================================================
+
########################################################################
# Script for updating third party packages.
#
@@ -32,7 +48,7 @@
# Utility functions
########################################################################
git_archive () {
- git archive --prefix="$name-reduced/" HEAD -- $paths | \
+ git archive --worktree-attributes --prefix="$name-reduced/" HEAD -- $paths | \
tar -C "$extractdir" -x
}
@@ -85,6 +101,7 @@ if [ -n "$basehash" ]; then
# Clear out the working tree
pushd "$extractdir"
git ls-files | xargs rm -v
+ find . -type d -empty -delete
popd
else
# Create a repo to hold this package's history