Sfoglia il codice sorgente

Merge branch 'master' into escape-regex-specials-in-path

Resolve conflicts in Tests/CTestTestMemcheck/CMakeLists.txt by combining
changes from both sides.
Rolf Eike Beer 12 anni fa
parent
commit
e4e09212c5
100 ha cambiato i file con 2139 aggiunte e 479 eliminazioni
  1. 1 1
      CMakeCPackOptions.cmake.in
  2. 646 0
      ChangeLog.manual
  3. 3 4
      Modules/CMakeCCompilerId.c.in
  4. 5 0
      Modules/CMakeCXXCompilerId.cpp.in
  5. 4 0
      Modules/CMakeDetermineASMCompiler.cmake
  6. 7 0
      Modules/CMakeDetermineCCompiler.cmake
  7. 7 0
      Modules/CMakeDetermineCXXCompiler.cmake
  8. 2 0
      Modules/CMakeDetermineCompilerId.cmake
  9. 5 5
      Modules/CMakeDetermineRCCompiler.cmake
  10. 1 1
      Modules/CMakeFindPackageMode.cmake
  11. 1 1
      Modules/CMakeParseArguments.cmake
  12. 2 1
      Modules/CMakeParseImplicitLinkInfo.cmake
  13. 5 5
      Modules/CMakeSystem.cmake.in
  14. 2 2
      Modules/CPack.cmake
  15. 1 1
      Modules/CPackPackageMaker.cmake
  16. 57 6
      Modules/CPackRPM.cmake
  17. 12 0
      Modules/CheckCCompilerFlag.cmake
  18. 13 0
      Modules/CheckCXXCompilerFlag.cmake
  19. 1 1
      Modules/CheckFunctionExists.cmake
  20. 1 1
      Modules/CheckSizeOf.cmake
  21. 14 0
      Modules/Compiler/IAR-ASM.cmake
  22. 34 0
      Modules/Compiler/IAR-C.cmake
  23. 34 0
      Modules/Compiler/IAR-CXX.cmake
  24. 46 0
      Modules/Compiler/IAR.cmake
  25. 1 1
      Modules/CompilerId/Xcode-1.pbxproj.in
  26. 1 1
      Modules/CompilerId/Xcode-2.pbxproj.in
  27. 1 1
      Modules/CompilerId/Xcode-3.pbxproj.in
  28. 4 1
      Modules/ExternalData.cmake
  29. 4 4
      Modules/ExternalProject.cmake
  30. 13 5
      Modules/FindBoost.cmake
  31. 10 1
      Modules/FindCUDA.cmake
  32. 1 1
      Modules/FindCUDA/make2cmake.cmake
  33. 1 1
      Modules/FindFLTK2.cmake
  34. 2 2
      Modules/FindITK.cmake
  35. 1 1
      Modules/FindMPI.cmake
  36. 88 91
      Modules/FindOpenGL.cmake
  37. 2 2
      Modules/FindOpenSSL.cmake
  38. 13 0
      Modules/FindProtobuf.cmake
  39. 9 6
      Modules/FindQt4.cmake
  40. 2 2
      Modules/FindVTK.cmake
  41. 5 3
      Modules/FindwxWidgets.cmake
  42. 3 3
      Modules/FindwxWindows.cmake
  43. 9 5
      Modules/GenerateExportHeader.cmake
  44. 3 1
      Modules/NSIS.template.in
  45. 2 2
      Modules/Platform/Windows-Intel.cmake
  46. 3 6
      Modules/Platform/Windows-MSVC.cmake
  47. 0 2
      Modules/Platform/Windows-df.cmake
  48. 4 2
      Modules/Platform/WindowsPaths.cmake
  49. 2 2
      Modules/UseEcos.cmake
  50. 59 36
      Modules/UseJava.cmake
  51. 6 1
      Source/CMakeLists.txt
  52. 2 2
      Source/CMakeVersion.cmake
  53. 1 1
      Source/CPack/cmCPackDocumentVariables.cxx
  54. 1 1
      Source/CPack/cmCPackGenerator.cxx
  55. 2 1
      Source/CTest/cmCTestBuildCommand.cxx
  56. 0 26
      Source/CTest/cmCTestConfigureCommand.cxx
  57. 14 13
      Source/CTest/cmCTestHandlerCommand.cxx
  58. 21 10
      Source/CTest/cmCTestMemCheckHandler.cxx
  59. 4 0
      Source/CTest/cmCTestMemCheckHandler.h
  60. 14 6
      Source/CTest/cmCTestRunTest.cxx
  61. 3 4
      Source/CTest/cmCTestTestHandler.cxx
  62. 8 0
      Source/CTest/cmProcess.cxx
  63. 3 3
      Source/CursesDialog/form/frm_driver.c
  64. 1 1
      Source/CursesDialog/form/fty_enum.c
  65. 158 5
      Source/QtDialog/CMakeSetupDialog.cxx
  66. 6 0
      Source/QtDialog/CMakeSetupDialog.h
  67. 4 1
      Source/QtDialog/CMakeSetupDialog.ui
  68. 1 1
      Source/QtDialog/QCMakeCacheView.cxx
  69. 1 1
      Source/cmAddDefinitionsCommand.h
  70. 1 1
      Source/cmAddSubDirectoryCommand.h
  71. 1 0
      Source/cmBootstrapCommands.cxx
  72. 2 2
      Source/cmBuildCommand.cxx
  73. 12 1
      Source/cmCTest.cxx
  74. 1 0
      Source/cmCTest.h
  75. 1 1
      Source/cmCacheManager.cxx
  76. 1 1
      Source/cmCacheManager.h
  77. 10 4
      Source/cmComputeLinkInformation.cxx
  78. 2 1
      Source/cmComputeLinkInformation.h
  79. 1 1
      Source/cmCoreTryCompile.cxx
  80. 1 1
      Source/cmDocumentCompileDefinitions.h
  81. 11 1
      Source/cmDocumentGeneratorExpressions.h
  82. 90 65
      Source/cmDocumentVariables.cxx
  83. 2 2
      Source/cmDocumentation.cxx
  84. 2 2
      Source/cmExportBuildFileGenerator.cxx
  85. 1 1
      Source/cmExportCommand.cxx
  86. 7 5
      Source/cmExportFileGenerator.cxx
  87. 4 3
      Source/cmExportInstallFileGenerator.cxx
  88. 16 2
      Source/cmExtraEclipseCDT4Generator.cxx
  89. 1 0
      Source/cmExtraEclipseCDT4Generator.h
  90. 1 1
      Source/cmExtraSublimeTextGenerator.cxx
  91. 80 2
      Source/cmFileCommand.cxx
  92. 19 0
      Source/cmFileCommand.h
  93. 1 1
      Source/cmFunctionCommand.cxx
  94. 151 0
      Source/cmGeneratorExpressionEvaluationFile.cxx
  95. 48 0
      Source/cmGeneratorExpressionEvaluationFile.h
  96. 250 92
      Source/cmGeneratorExpressionEvaluator.cxx
  97. 8 0
      Source/cmGeneratorExpressionEvaluator.h
  98. 12 0
      Source/cmGeneratorTarget.cxx
  99. 4 0
      Source/cmGeneratorTarget.h
  100. 1 1
      Source/cmGetFilenameComponentCommand.cxx

+ 1 - 1
CMakeCPackOptions.cmake.in

@@ -34,7 +34,7 @@ if(CPACK_GENERATOR MATCHES "NSIS")
   set(CPACK_NSIS_MODIFY_PATH ON)
 endif()
 
-# include the cpack options for qt dialog if they exisit
+# include the cpack options for qt dialog if they exist
 # they might not if qt was not enabled for the build
 include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
 

+ 646 - 0
ChangeLog.manual

@@ -1,3 +1,649 @@
+Changes in CMake 2.8.11 (since 2.8.11-rc4)
+----------------------------------------
+None
+
+Changes in CMake 2.8.11-rc4 (since 2.8.11-rc3)
+----------------------------------------------
+Brad King (1):
+      target_link_libraries: Update usage requirements documentation
+
+Stephen Kelly (3):
+      Centralize maintenance of usage requirement include directories
+      Fix include dir propagation from conditionally linked targets
+      Memoize usage requirement include directories in a config-specific map
+
+Changes in CMake 2.8.11-rc3 (since 2.8.11-rc2)
+----------------------------------------------
+Brad King (1):
+      get_filename_component: Document path components more clearly (#14091)
+
+Rolf Eike Beer (1):
+      try_compile: add missing fclose() to recently added error case
+
+Stephen Kelly (1):
+      Fix clearing of the INCLUDE_DIRECTORIES DIRECTORY property.
+
+Changes in CMake 2.8.11-rc2 (since 2.8.11-rc1)
+----------------------------------------------
+Alex Neundorf (6):
+      Determine C/CXX/Fortran compiler: minor restructuring
+      Determine C/CXX/Fortran compiler: fix indentation
+      rename TI_DSP toolchain to TI, since it works also for the ARM compiler
+      TI compiler: add automatic detection of prefix and suffixes
+      Modules/readme.txt: switch from "XXX" to "Xxx"
+      Modules/readme.txt: make lines a bit shorter for easier readability
+
+Ben Boeckel (1):
+      Clang: Add -isystem flag support everywhere
+
+Bill Hoffman (1):
+      ExternalProject: Retry on a failed git clone
+
+Brad King (8):
+      string: Fix regex documentation of '^' and '$' (#14028)
+      Rename variable for including current directory in interfaces
+      Replace <TARGET> in CMAKE_<LANG>_COMPILE_OBJECT rule variables
+      Test evaluation of per-config COMPILE_DEFINITIONS (#14037)
+      VS: Fix VS 10/11 .sln headers (#14038)
+      add_dependencies: Distinguish target v. file dependencies in error (#14050)
+      automoc: Use a pre-build event in VS >= 7
+      Handle usr-move without forcing absolute paths (#14041)
+
+Clinton Stimpson (2):
+      FindQt4: If Qt5 is in CMAKE_PREFIX_PATH, be sure to find Qt4 includes.
+      Qt4: Fix typo setting a variable for FindThreads.
+
+James Bigler (1):
+      FindCUDA: Use the PRE_LINK mode only for MSVC >= 10
+
+Matthew Woehlke (4):
+      UseJava.cmake: simplify path logic
+      UseJava.cmake: fix passing jars to add_jar
+      UseJava.cmake: accept jar targets in add_jar
+      UseJava.cmake: require explicit request to include jars
+
+Paul Kunysch (1):
+      CPack: Avoid "format expects 'unsigned int'" warnings
+
+Petr Kmoch (1):
+      cmSystemTools: Generalize TrimWhitespace to all whitespace
+
+Rex Dieter (1):
+      FindImageMagick: Search versioned suffixes (#14012)
+
+Rolf Eike Beer (1):
+      FindRuby: improve version selection
+
+Stephen Kelly (13):
+      FindQt4: Set the Qt4_FOUND variable if Qt4 is found
+      FindQt4: Set the INTERFACE_QT_MAJOR_VERSION for Qt4::QtCore
+      Document that CMAKE_AUTOMOC works with Qt 5.
+      FPHSA: Fix FOUND_VAR check to work with if() auto-dereference
+      Fix cmGeneratorExpression::Preprocess for interleaved inputs.
+      cmake-gui: Use the QStandardItemModel workaround until 5.1.0.
+      Automoc: append implicit includes after user-specified dirs
+      Fix the evaluation of per-config COMPILE_DEFINITIONS (#14037)
+      Fix new target commands documentation.
+      install(EXPORT): Ensure clean INTERFACE_INCLUDE_DIRECTORIES
+      Report an error on IMPORTED targets with a faulty INTERFACE
+      Error if linked target has relative paths in INTERFACE_INCLUDE_DIRECTORIES
+      Fix the Qt 5 version required to run the IncompatibleQt test.
+
+Changes in CMake 2.8.11-rc1 (since 2.8.10.2)
+----------------------------------------------
+Alan Witkowski (1):
+      FindBullet: Search in per-config dirs on Windows (#13738)
+
+Aleksey Avdeev (1):
+      Add module FindIcotool
+
+Alex Neundorf (30):
+      Eclipse: add switch to disable linked resources (#13189)
+      Eclipse: set source path once to fix Eclipse indexer (#13596)
+      cmDependsC: remove unused member variable
+      cmDependsC: remove code duplication
+      cmDependsC: fix indentation
+      cmDepends: allow multiple dependees per depender
+      AddCustomCommand: Handle multiple IMPLICIT_DEPENDS files (#10048)
+      Add support for Texas Instruments DSP compiler (#12405)
+      Squish: detect version
+      Squish: use FPHSA
+      Squish: find executables also under Windows
+      Squish: rename squish_add_test() to squish_v3_add_test() and fix docs a bit
+      Squish: use ${CMAKE_CURRENT_LIST_DIR}
+      Squish: add support for squish 4 (#9734)
+      Squish: fix new squish_v4_add_test() macro
+      Automoc: "inherit" FOLDER target property from target (#13688)
+      FPHSA: don't succeed if only checking for XX_FOUND (#13755)
+      CONFIGURE_PACKAGE_CONFIG_FILE(): improve generated comments
+      Automoc: get include dirs without stripping implicit include dirs off
+      configure_package_config_file: force absolute paths for usr-move
+      configure_package_config_file(): fix indentation
+      configure_package_config_file(): extend documentation
+      documentation: handling of relative paths by include- and link_directories()
+      automoc: use a std::vector<> instead a std::list
+      automoc: use the header extensions from cmMakefile
+      Eclipse: also detect include dirs and macro for clang (#13823)
+      cmLocalGenerator: remove "virtual" where not used
+      export files: rewrite the code for checking required targets
+      FPHSA: Add FOUND_VAR option to specify _FOUND variable name
+      FPHSA: improve documentation
+
+Alexander Chehovsky (2):
+      Xcode: Fix nested source group handling (#12943)
+      Xcode: Sort source files
+
+Amine Chadly (2):
+      file: remove dead code
+      Add test to secure the file(GLOB empty) behavior.
+
+Amit Kulkarni (6):
+      OpenBSD: Install shared libraries without executable permission
+      OpenBSD: Add paths for Java 1.6.0/1.7.0 JRE/JDK
+      OpenBSD: Add path for Freetype under X.org
+      OpenBSD: Add paths for Tcl/Tk 8.4/8.5
+      OpenBSD: Add path for Lua 5.1
+      OpenBSD: Add paths for Qt3/Qt4
+
+Andreas Mohr (4):
+      Documentation: Correct typos and grammar
+      Documentation: Clarify some command descriptions
+      Correct string literal typo (have "(NULL)" like all other cases).
+      Remove seemingly bogus duplicate CPACK_PACKAGE_FILE_NAME call.
+
+Anton Helwart (1):
+      VS: Avoid empty source groups in some cases (#3474)
+
+Benjamin Eikel (2):
+      Swap linking order of SDLmain and SDL (#0013769)
+      FindSDL_...: Restore dropped search paths (#13819)
+
+Brad King (109):
+      find_library: Refactor internal name iteration
+      find_library: Simplify framework search logic
+      find_library: Generalize helper macro in test case
+      find_library: Optionally consider all names in each directory
+      FindBoost: Remove extra indentation level
+      FindBoost: Mark Boost_DIR cache entry as advanced
+      FindBoost: Use PATH_SUFFIXES to look in "Program Files"
+      FindBoost: Overhaul caching and search repeat behavior
+      FindBoost: Construct a clean Boost_LIBRARIES value
+      FindBoost: Refactor Boost_FOUND computation and version check
+      FindBoost: Rewrite documentation
+      BSD: Do not require dlfcn.h to build shared libs (#13573)
+      Xcode: Fix ReRunCMake.make path to cmake.check_cache (#13603)
+      VS10: Refactor link options collection
+      VS10: Honor /DELAYSIGN and /KEYFILE flags (#13601)
+      Document external language support policy
+      CTest: Allow SUBMIT_INDEX with CDash
+      KWSys: Submit dashboard builds to PublicDashboard
+      pre-commit: Update KWSys rejection message for new workflow
+      CTestCustom: Suppress LNK4089 warning about PSAPI
+      load_command: Deprecate and document pending removal
+      Documentation: Clarify configure_file behavior
+      OS X: Warn about known SDK breakage by Xcode 3.2.6
+      Optionally skip link dependencies on shared library files
+      Teach BuildDepends test to cover LINK_DEPENDS_NO_SHARED
+      Serialize tests for EXCLUDE_FROM_DEFAULT_BUILD
+      MSVC: Drop default use of /Zm1000 for VS >= 7.1
+      Teach find_(path|file) about Linux multiarch (#13742)
+      Test find_path multiarch support (#13742)
+      Add policy CMP0019 to skip include/link variable re-expansion
+      Xcode: Add frameworks search paths from link dependeny closure (#13397)
+      Makefile: Use modern link information for framework search paths
+      Documentation: Clarify handling of implicit link directories
+      Remove references to KWSys Process Win9x support
+      add_library: Document object library portability suggestion
+      OS X: Link with all framework search paths, not just the last
+      OS X: Detect implicit link directories on modern toolchains
+      OS X: Detect implicit linker framework search paths
+      Revert "load_command: Deprecate and document pending removal"
+      VS11: Simplify external object file handling (#13831)
+      KWIML: Teach ABI about 'long long' on older GNU
+      CMake: Skip empty link.txt lines (#13845)
+      ExternalProject: Allow DEPENDS on normal targets (#13849)
+      VS11: Fix VSExternalInclude test
+      target_link_libraries: Document that new sigs privatize old (#13876)
+      Tests: Avoid CTestLimitDashJ crash on Borland 5.8 builds
+      Fix use of cmTypeMacro in new command classes
+      Fix cmSystemTools::RenameFile race on Windows
+      VS 6: Create .rule file directory before file
+      Add ExternalData module
+      ExternalData: Remove compatibility with CMake < 2.8.5
+      ExternalData: Do not match directory names when resolving DATA{}
+      ExternalData: Cleanup stray TODO and typo in comments
+      ExternalData: Remove unused private interface
+      ExternalData: Improve series matching using an explicit syntax
+      ExternalData: Add tests covering interfaces and errors
+      ExternalData: Allow ()-groups in series match regex
+      ExternalData: Allow DATA{} syntax to reference directories
+      ExternalData: Generalize hash algo/ext handling
+      ExternalData: Add support for SHA 1 and 2 hash algorithms
+      ExternalData: Collapse ../ components in DATA{} paths
+      Fix Module.ExternalData test on Cygwin
+      Fix Module.ExternalData test on VS 6
+      ExternalData: Attach download rules to content links in IDEs
+      find_package: Reword <package>_NO_INTERFACES documentation
+      Normalize full paths in implicit link library list
+      Fail early if no current working directory exists
+      MSVC: Fix CMAKE_CL_64 in CXX-only projects (#13896)
+      ExternalProject: Simplify CMake command line generation
+      Tests: Run ctest custom commands with VERBATIM
+      CMake: Add -T option to choose a generator toolset
+      VS: Implement generator toolset selection (#10722, #13774)
+      Xcode: Implement generator toolset selection (#9831, #13802)
+      CTest: Add options to set generator toolset
+      ExternalProject: Propagate the generator toolset
+      Tests: Consolidate ctest --build-and-test generator options
+      Tests: Add generator toolset support
+      Fix crash on empty CMAKE_<lang>_COMPILER value (#13901)
+      file: Do not remove symlinked directories recursively (#10538)
+      Embarcadero: Fix default link stack/heap flags (#13912)
+      Avoid duplicate RPATH entries
+      AIX-GNU: Put implicit link directories in runtime libpath (#13909)
+      VS: Replace generation timestamp file atomically
+      VS,Xcode: Remove unused CMAKE_GENERATOR_* variables
+      Delete entire CMakeFiles directory when deleting CMakeCache.txt (#13756)
+      Tests/RunCMake: Allow tests to control build tree behavior
+      Test Unix Makefiles generator support for changing compilers
+      Xcode: Drop check for circular target dependencies
+      Xcode: Each target dependency edge needs a unique object (#13935)
+      Tests: Replace exec_program with execute_process
+      Tests: Generalize decision for 'make' tool supporting spaces
+      ExternalData: Test content link with a space in its name
+      FPHSA: Convert FOUND_VAR failure test to RunCMake
+      VS: Restore CMAKE_GENERATOR_FC variable
+      Xcode: Generate recommended artwork setting (#13954)
+      CTest: Fix ctest_update with 'HEAD' file in source tree
+      VS 10: Fix CMAKE_<LANG>_STACK_SIZE implementation (#13968)
+      install(EXPORT): Force absolute paths for usr-move
+      AIX: Do not use -brtl to create shared libraries (#13997)
+      add_subdirectory: Compute output dir with consistent slashes (#10072)
+      ExternalData: Preserve escaped semicolons during argument expansion
+      Avoid crash when checking property link dependencies without link info
+      Avoid crash when checking property compatibility without link info
+      Refactor RunCMake.build_command test to allow more cases
+      build_command: Fail early without CMAKE_MAKE_PROGRAM (#14005)
+      CTest: Fail early without PROJECT_BINARY_DIR (#14005)
+      FindQt4: Fix QT_QMAKE{_QMAKE => }_EXECUTABLE typo
+      XL: Use -qpic for position independent code (#14010)
+      Configure Tests/CMakeTests only with BUILD_TESTING ON
+
+Casey Goodlett (1):
+      CTest: Prevent creation of unbounded number of tests in ctest (#12904)
+
+Clemens Heppner (1):
+      CMake: source_group needs to check its own regex after its children (#13611)
+
+Clinton Stimpson (5):
+      Fix for possible Rez errors when creating dmg.
+      PackageMaker: Enable postflight script in component mode (#12375)
+      CPack: Fix RPM/Deb package names to not include "ALL_COMPONENTS_IN_ONE"
+      Qt4: Add SYSTEM option to include_directories.
+      FindQt4: set QT_VERSION_* variables sooner.
+
+David Cole (19):
+      Begin post-2.8.10 development
+      CPack: Add automatic detection of the Unicode makensis (#9629)
+      BundleUtilities: Use a more inclusive REGEX for frameworks (#13600)
+      VS: Avoid empty, unreferenced solution folders... (#13571)
+      NMake: Add a test to demonstrate EmptyDepends issue (#13392)
+      NMake: Fix problem with empty DEPENDS args (#13392)
+      CMake: Remove "/STACK:10000000" from default linker flags (#12437)
+      Watcom: Avoid prompt from wmake about dll with no exports...
+      Tests: Use the right path to CPack value for running CPack tests
+      VS11: Allow using folders with the VS11 Express Edition (#13770)
+      CPack: Fix dashboard errors (#11575)
+      CPack: Fix dashboard warnings (#11575)
+      CPack: Fix dashboard errors and warnings (#11575)
+      CMake: Stylistic changes and documentation tweaks
+      CMake: Fix dashboard warnings
+      CMake: Fix dashboard test failure
+      CMake: Fix dashboard build errors and warnings
+      CTest: Coverage handler: expect certain output lines from gcov 4.7 (#13657)
+      Add CTestLimitDashJ test (#12904)
+
+David Golub (2):
+      CPack/NSIS: Fix compatibility issues with prerelease NSIS (#13202)
+      CPack/NSIS: Add support for 64-bit NSIS (#13203)
+
+Eric LaFranchi (1):
+      CPack: WIX Product Icon, UI Banner, UI Dialog support (#13789)
+
+Eric NOULARD (1):
+      CPackRPM fix #13898 uses IF(DEFINED var) to avoid wrong var value logic
+
+Gerald Hofmann (1):
+      CPack: Fix NSIS version check without release version (#9721)
+
+James Bigler (4):
+      Use PRE_LINK instead of PRE_BUILD when testing PRE_LINK.
+      FindCUDA: Remove linkage against CUDA driver library (#13084)
+      FindCUDA: Add support for separable compilation
+      FindCUDA: Added cupti library.
+
+Janne Rönkkö (1):
+      FindQt4: Do not use qmake from Qt5
+
+Jean-Christophe Fillion-Robin (1):
+      Add $<SEMICOLON> generator expression.
+
+Marcus D. Hanwell (1):
+      Removed GenerateExportHeader warnings about old compilers
+
+Mark Salisbury (2):
+      VS: Specify WinCE subsystem also for DLLs
+      VS: Specify WinCE subsystems correctly in VS 9 2008
+
+Mathias Gaunard (2):
+      enable CTEST_USE_LAUNCHERS with Ninja too
+      Ninja: fix usage of cldeps with ctest launchers
+
+Matt McCormick (7):
+      ExternalProject: Only run 'git fetch' when required.
+      ExternalProject: Do smoke tests for Git Tutorial builds.
+      ExternalProject: Add tests for UPDATE_COMMAND.
+      ExternalProject: Always do a git fetch for a remote ref.
+      ExternalProject: Make sure the ExternalProjectUpdate setup is available.
+      ExternalProject: Verify when a fetch occurs during update test.
+      ExternalProjectUpdateTest: Only support Git 1.6.5 and greater.
+
+Matthew Woehlke (1):
+      ccmake: Allow DEL key in first column
+
+Michael Tänzer (4):
+      GetPrerequisites: Move tool search paths up
+      GetPrerequisites: Add support for objdump
+      GetPrerequisites: Enable test for BundleUtilities on MinGW
+      GetPrerequisites: Add documentation for objdump
+
+Michael Wild (1):
+      cmDepends: No dependency-vector erasure in CheckDependencies
+
+Morné Chamberlain (15):
+      Added a generator for Sublime Text 2 project files.
+      Added some support for sublimeclang_options in the generated project file.
+      Changed SublimeClang include path generation to expand to absolute paths.
+      Cleaned up the Sublime Text 2 Generator code a bit.
+      Fixed support for the Ninja build system.
+      Added and cleaned up some comments.
+      The generator no longer generates an explicit list of source files.
+      The generator no longer generates absolute paths to the ninja.build/Makefiles.
+      Added a CMAKE_SUBLIMECLANG_DISABLED variable that disables SublimeClang.
+      Fixed Sublime Text project generation for in-source builds
+      Define flags in CMAKE_C(XX)_FLAGS are now included in SublimeClang settings.
+      SublimeText2 Gen: Improved use of define, include flags from CMAKE_C(XX)_FLAGS
+      SublimeText2 Gen: Fixed the issue where include directory flags used -D
+      Sublime Text 2 Gen: Per-source Compile flags are now saved in a separate file.
+      SublimeText 2 Gen: Set the sublimeclang_options_script property.
+
+Neil Carlson (1):
+      NAG: Use -PIC for Fortran position-independent code (#13932)
+
+Nils Gladitz (2):
+      CPack: Add a WiX Generator (#11575)
+      CMake: Add TIMESTAMP subcommand to string and file commands
+
+Patrick Gansterer (28):
+      Introduce the abstract class cmGlobalGeneratorFactory
+      Add cmGlobalGeneratorFactory::GetGenerators()
+      Search generator in cmake::ExtraGenerators before in cmake::Generators
+      Allow a GeneratorFactory handling of more than one generator
+      Make cmGlobalGenerator::GetDocumentation() a static function
+      VS: Remove AddPlatformDefinitions from platform-specific generators
+      VS: Fix ArchitectureId of Visual Studio 10 IA64 generator
+      VS: Remove GetPlatformName from platform-specific generators
+      VS: Remove EnableLanguage from platform-specific generators
+      VS: Remove platform specific generator files
+      FindBISON: Add support for the Win flex-bison distribution
+      FindFLEX: Add support for the Win flex-bison distribution
+      VS: Remove TargetMachine for linker when checking compiler id
+      VS: Add CMAKE_VS_PLATFORM_NAME definition to cmMakefile
+      VS: Add static method to get the base of the registry
+      VS: Change variable type of ArchitectureId from const char* to string
+      VS: Change variable type of Name from const char* to string
+      VS: Support setting correct subsystem and entry point for WinCE
+      VS: Add parser for WCE.VCPlatform.config to read WinCE platforms
+      VS: Allow setting the name of the target platform
+      VS: Make DetermineCompilerId working with WinCE too
+      VS: Added "Deploy" at project configuration for WindowsCE targets
+      Add command to generate environment for a Windows CE SDK
+      VS: Set the correct SubSystem when determinating the CompilerId
+      VS: Add the entry point when compiling for WindowsCE
+      VS: Ignore LIBC.lib when linking the CompilerId executables
+      Set WINCE to 1 when building for WindowsCE
+      Ninja: Avoid LNK1170 linker error
+
+Peter Kümmel (6):
+      Ninja: encode LINK_FLAGS to handle bash variables
+      Ninja: fix building from Codeblocks GUI
+      Ninja: remove implicit dependency on custom command outputs
+      Ninja: use MinGW generator code in EnableLanguage()
+      Ninja: the Ninja generator does not support Fortran yet.
+      Ninja: escape line breaks in literals
+
+Petr Kmoch (11):
+      Add tests for list() argument count
+      Add tests for list() invalid arguments
+      Consolidate list() argument count testing
+      Add several get_property() tests
+      Add tests for EXCLUDE_FROM_DEFAULT_BUILD
+      Add property EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG>
+      Define property EXCLUDE_FROM_DEFAULT_BUILD
+      Add tests for VS_SOLUTION_GLOBAL_SECTIONS
+      Implement properties VS_GLOBAL_SECTION_*
+      Define properties VS_GLOBAL_SECTION_*
+      Documentation: Clarify a few subtleties
+
+Riku Voipio (1):
+      KWIML: Teach ABI.h about Aarch64
+
+Robert Maynard (4):
+      XCode generator won't infinitely parse compiler flags (bug #13354).
+      Correct missing parameter to CMP0018Flags call.
+      Remove ability to generate sublime clang files.
+      Update generator to use new cmGeneratorTarget api.
+
+Rodolfo Schulz de Lima (1):
+      FindGTK2: Fix GTK2_LIBRARIES order for static gtk libraries
+
+Rolf Eike Beer (21):
+      FindQt: improve version selection
+      FindQt: add some more places to look for Qt3
+      Tests: add MajorVersionSelection tests
+      Linux/PA-RISC: Link with --unique=.text.* to help binutils
+      FindQt: add to MajorVersionSelection test
+      CMakeTests: allow to call the check_cmake_test macro with a given file
+      list: add tests for CMP0007 behavior
+      GetProperty test: move doc property tests into main process
+      Find* (and some other): use ${CMAKE_CURRENT_LIST_DIR} in include()
+      bootstrap: use better defaults for Haiku
+      Haiku no longer defines __BEOS__
+      check for Haiku only with __HAIKU__
+      FindLua51: do not try to link libm on BeOS
+      FindGLUT: BeOS does not have libXi and libXmu
+      FindOpenGL: add Haiku paths
+      doc: fix linebreaks in generator expression documentation
+      ProcessorCount test: fix path to cmsysTestsCxx executable
+      ProcessorCount test: require SystemInformation process to work
+      FindOpenMP: improve documentation (#13895)
+      properly detect processor architecture on Windows
+      fix Windows processor detection
+
+Sean McBride (1):
+      libarchive: fixed undefined left shift with signed ints
+
+Slava Sysoltsev (1):
+      FindImageMagick: Search quantum depth suffixes (#13859)
+
+Stephen Kelly (158):
+      GenEx: Test early determination of AND and OR
+      Enable some compiler warnings when building CMake.
+      Resolve warnings about unused variables.
+      Resolve warnings about used enum values in switch blocks.
+      Resolve warnings about shadowing parameters and local variables.
+      Resolve ambiguity warning regarding use of && and ||.
+      Remove references to ancient and removed parts of the code.
+      Always use the auto_ptr from cmsys.
+      Port cmGeneratorExpression to cmTarget from cmGeneratorTarget.
+      Split link information processing into two steps.
+      Revert "Move GetLinkInformation to cmGeneratorTarget"
+      Genex: Extract a method to parse parameters.
+      Genex: Ensure that $<0:...> has a parameter.
+      Genex: Don't segfault on $<FOO,>
+      Generate an early-return guard in target Export files.
+      Fix some warnings from -Wundef
+      Make targets depend on the link interface of their dependees.
+      Use cmsys::auto_ptr to manage cmCompiledGeneratorExpressions
+      Keep track of INCLUDE_DIRECTORIES as a vector of structs.
+      Add a way to print the origins of used include directories.
+      Tests: Fix warning about unused variable
+      Qt4: Add module dependencies to the IMPORTED targets
+      Don't crash when a target is expected but is not available.
+      Add test for custom command with a genex referring to a target.
+      GenEx: Add expressions to specify build- or install-only values
+      Allow generator expressions to require literals.
+      Add the TARGET_NAME generator expression.
+      Add API to extract target names from a genex string.
+      Add API to populate INTERFACE properties in exported targets.
+      Make all relevant targets available in the genex context.
+      Use mapped config properties to evaluate $<CONFIG>
+      Make cycles in target properties ignored, not an error.
+      Populate the ExportedTargets member early in GenerateMainFile
+      Handle INTERFACE properties transitively for includes and defines.
+      Add CMAKE_BUILD_INTERFACE_INCLUDES build-variable.
+      Make linking APIs aware of 'head' target
+      Add LINK_LIBRARIES property for direct target link dependencies
+      Allow target_link_libraries with IMPORTED targets.
+      Add the -Wundef flag when compiling CMake.
+      FindQt4: Add INTERFACE includes and defines to Qt4 targets
+      Add the target_include_directories command.
+      Add the target_compile_definitions command.
+      Keep track of properties used to determine linker libraries.
+      Add API to calculate link-interface-dependent bool properties or error.
+      Process the INTERFACE_PIC property from linked dependencies
+      Fix linking to imported libraries test.
+      Add cmGeneratorExpression::Split() API.
+      Don't pass a position when determining if a target name is a literal.
+      Extract the AddTargetNamespace method.
+      Split the generator expression before extracting targets.
+      Split LINK_INTERFACE_LIBRARIES export handling into dedicated method.
+      Allow generator expressions in LINK_INTERFACE_LIBRARIES.
+      Add a way to check INTERFACE user property compatibility.
+      Don't include generator expressions in old-style link handling.
+      Document the use of generator expressions in new commands.
+      Add the TARGET_DEFINED generator expression
+      Strip consecutive semicolons when preprocessing genex strings.
+      Don't write a comment in the export file without the code.
+      Only generate one check per missing target.
+      Move the exported check for dependencies of targets
+      Move the exported check for file existence.
+      Add a test for the interfaces in targets exported from the build tree.
+      Make the BUILD_INTERFACE of export()ed targets work.
+      Export the INTERFACE_PIC property.
+      Test evaluation target via export for generator expressions
+      Make sure generator expressions can be used with target_include_directories.
+      Populate the link information cache before checking dependent properties.
+      Exit early if we find an inconsistent property.
+      Make INTERFACE determined properties readable in generator expressions.
+      Clear the link information in ClearLinkMaps.
+      Export the COMPATIBLE_INTERFACE_BOOL content properties
+      Add the $<TARGET_POLICY> expression
+      Automatically link to the qtmain library when linking to QtCore.
+      Don't wrap all targets in LINK_LIBRARIES in a TARGET_NAME genex.
+      Generate new-style cmake code during export.
+      Store includes from the same include_directories call together.
+      Only output includes once after the start of 'generate-time' when debugging.
+      Specify the target whose includes are being listed.
+      Output include directories as LOG messages, not warnings.
+      Revert "Allow target_link_libraries with IMPORTED targets."
+      Disallow porcelain to populate includes and defines of IMPORTED targets.
+      Exclude the LINK_LIBRARIES related properties from INTERFACE evaluation.
+      Make calculation of link-interface-dependent properties type-sensitive.
+      Add the COMPATIBLE_INTERFACE_STRING property.
+      Move GetCompileDefinitions to cmTarget.
+      Process COMPILE_DEFINITIONS as generator expressions in QtAutomoc.
+      Generate the _IMPORT_PREFIX in the non-config export file.
+      Add the INSTALL_PREFIX genex.
+      Fix TARGET_PROPERTY target extractions.
+      Make the Property name protected so that subclasses can use it.
+      Don't allow targets args in the new target commands.
+      Make subclasses responsible for joining content.
+      Use the result of converting to a unix path.
+      Handle reading empty properties defined by the link interface.
+      Advance more when preprocessing exported strings.
+      Make it an error for INSTALL_PREFIX to be evaluated.
+      Export targets to a targets file, not a Config file.
+      Add a way to exclude INTERFACE properties from exported targets.
+      Add API to check if we're reading a includes or defines property.
+      Add the $<LINKED:...> generator expression.
+      Add includes and compile definitions with target_link_libraries.
+      Test workaround of bad interface include directories from depends.
+      Optimize genex evaluation for includes and defines.
+      Cache context-independent includes on evaluation.
+      Style: Use this-> when invoking member functions.
+      Process generator expressions for 'system' include directories.
+      Deduplicate the isGeneratorExpression method.
+      De-duplicate validation of genex target names.
+      Test printing origin of include dirs from tll().
+      The COMPATIBLE_INTERFACE does not affect the target it is set on.
+      Ensure type specific compatible interface properties do not intersect.
+      Fix generation of COMPILE_DEFINITIONS in DependInfo.cmake.
+      Fix determination of evaluating link libraries.
+      Only use early evaluation termination for transitive properties.
+      Move a special case for PIC from the genex to the cmTarget code.
+      Don't keep track of content determined by target property values.
+      Only append build interface include dirs to particular targets.
+      Ensure that the build interface includes have been added.
+      Whitelist target types in target_{include_directories,compile_definitions}
+      Make sure INTERFACE properties work with OBJECT libraries.
+      Don't allow utility or global targets in the LINKED expression.
+      Generate config-specific interface link libraries propeties.
+      Fix determination of when we're evaluating compile definitions.
+      Rename the IncludeDirectoriesEntry to be more generic.
+      Don't use LINKED where not needed.
+      Use the link information as a source of compile definitions and includes.
+      Revert "Don't allow utility or global targets in the LINKED expression."
+      Don't populate INTERFACE includes and defines properties in tll.
+      Revert "Add the $<LINKED:...> generator expression."
+      Revert "find_package: Reword <package>_NO_INTERFACES documentation"
+      Revert "Add a way to exclude INTERFACE properties from exported targets."
+      Don't add target-specific interface includes and defines to Qt 4 targets.
+      Fix GenerateExportHeader documentation #13936
+      automoc: Add source file to target early to set the linker language
+      Keep track of all targets seen while evaluating a genex.
+      Add a new Export generator for IMPORTED targets.
+      Handle targets in the LINK_LIBRARIES of try_compile.
+      Strip stray semicolons when evaluating generator expressions.
+      Workaround broken code where a target has itself in its link iface.
+      Fix DAG checker finding cycling dependencies.
+      Expand includes and defines transitively in 'external' genexes.
+      Fix constness of accessors.
+      Fix the tests for evaluating includes and defines.
+      Memoize includes and defines from interface libraries.
+      Remove use of TARGET_DEFINED from target_include_directories test.
+      Remove use of TARGET_DEFINED from the ExportImport test.
+      Remove use of TARGET_DEFINED from the target_link_libraries test.
+      Revert "Add the TARGET_DEFINED generator expression"
+      Only add existing targets to the Qt4 target depends properties.
+      Fix the cmGeneratorExpression::Split when leading chars are present.
+      Fix RPATH information when only a genex is used as a link library.
+      Mention that IMPORTED targets may be created by a find_package call.
+      Remove unused parameters from target_link_libraries tests.
+      Only process transitive interface properties for valid target names.
+      Restore support for target names with '+' (#13986)
+      Automoc: Don't create automoc targets if Qt is not used (#13999)
+      cmake-gui: Use -fPIE if required by Qt.
+      cmake-gui: Workaround bug in Qt 5.0.0 to 5.0.3 QStandardItemModel
+
+Thomas Klausner (1):
+      KWIML: Teach ABI.h that VAX is big endian
+
+Yury G. Kudryashov (3):
+      Automoc: Fix automoc for OBJECT libraries.
+      Automoc: add OBJECT library to QtAutomoc test
+      spell: fix a few typos in comments
+
 Changes in CMake 2.8.10.2 (since 2.8.10.1)
 ----------------------------------------------
 Alex Neundorf (1):

+ 3 - 4
Modules/CMakeCCompilerId.c.in

@@ -160,10 +160,9 @@
 # define COMPILER_ID "ADSP"
 
 /* IAR Systems compiler for embedded systems.
-   http://www.iar.com
-   Not supported yet by CMake
-#elif defined(__IAR_SYSTEMS_ICC__)
-# define COMPILER_ID "IAR" */
+   http://www.iar.com */
+#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC)
+# define COMPILER_ID "IAR"
 
 /* sdcc, the small devices C compiler for embedded systems,
    http://sdcc.sourceforge.net  */

+ 5 - 0
Modules/CMakeCXXCompilerId.cpp.in

@@ -161,6 +161,11 @@
 #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
 # define COMPILER_ID "ADSP"
 
+/* IAR Systems compiler for embedded systems.
+   http://www.iar.com */
+#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC)
+# define COMPILER_ID "IAR"
+
 #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
 # define COMPILER_ID "MIPSpro"
 # if defined(_SGI_COMPILER_VERSION)

+ 4 - 0
Modules/CMakeDetermineASMCompiler.cmake

@@ -103,6 +103,10 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI "-h")
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI "Texas Instruments")
 
+  list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU IAR)
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_IAR )
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_IAR "IAR Assembler")
+
   include(CMakeDetermineCompilerId)
   CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
 

+ 7 - 0
Modules/CMakeDetermineCCompiler.cmake

@@ -120,6 +120,13 @@ if(NOT CMAKE_C_COMPILER_ID_RUN)
   set(CMAKE_C_COMPILER_ID)
   file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
     CMAKE_C_COMPILER_ID_PLATFORM_CONTENT)
+
+  # The IAR compiler produces weird output.
+  # See http://www.cmake.org/Bug/view.php?id=10176#c19598
+  list(APPEND CMAKE_C_COMPILER_ID_VENDORS IAR)
+  set(CMAKE_C_COMPILER_ID_VENDOR_FLAGS_IAR )
+  set(CMAKE_C_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler")
+
   include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
   CMAKE_DETERMINE_COMPILER_ID(C CFLAGS CMakeCCompilerId.c)
 

+ 7 - 0
Modules/CMakeDetermineCXXCompiler.cmake

@@ -116,6 +116,13 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN)
   set(CMAKE_CXX_COMPILER_ID)
   file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
     CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT)
+
+  # The IAR compiler produces weird output.
+  # See http://www.cmake.org/Bug/view.php?id=10176#c19598
+  list(APPEND CMAKE_CXX_COMPILER_ID_VENDORS IAR)
+  set(CMAKE_CXX_COMPILER_ID_VENDOR_FLAGS_IAR )
+  set(CMAKE_CXX_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler")
+
   include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
   CMAKE_DETERMINE_COMPILER_ID(CXX CXXFLAGS CMakeCXXCompilerId.cpp)
 

+ 2 - 0
Modules/CMakeDetermineCompilerId.cmake

@@ -131,6 +131,8 @@ Id flags: ${testflags}
     elseif("${id_arch}" STREQUAL "Itanium")
       set(id_machine_10 MachineIA64)
       set(id_arch ia64)
+    elseif("${id_arch}" STREQUAL "ARM")
+      set(id_machine_10 MachineARM)
     else()
       set(id_machine_6 x86)
       set(id_machine_10 MachineX86)

+ 5 - 5
Modules/CMakeDetermineRCCompiler.cmake

@@ -12,14 +12,14 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-# determine the compiler to use for C programs
-# NOTE, a generator may set CMAKE_C_COMPILER before
+# determine the compiler to use for RC programs
+# NOTE, a generator may set CMAKE_RC_COMPILER before
 # loading this file to force a compiler.
-# use environment variable CCC first if defined by user, next use
-# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
+# use environment variable RC first if defined by user, next use
+# the cmake variable CMAKE_GENERATOR_RC which can be defined by a generator
 # as a default compiler
 if(NOT CMAKE_RC_COMPILER)
-  # prefer the environment variable CC
+  # prefer the environment variable RC
   if($ENV{RC} MATCHES ".+")
     get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
     if(CMAKE_RC_FLAGS_ENV_INIT)

+ 1 - 1
Modules/CMakeFindPackageMode.cmake

@@ -3,7 +3,7 @@
 #   NAME = name of the package
 #   COMPILER_ID = the CMake compiler ID for which the result is, i.e. GNU/Intel/Clang/MSVC, etc.
 #   LANGUAGE = language for which the result will be used, i.e. C/CXX/Fortan/ASM
-#   MODE = EXIST : only check for existance of the given package
+#   MODE = EXIST : only check for existence of the given package
 #          COMPILE : print the flags needed for compiling an object file which uses the given package
 #          LINK : print the flags needed for linking when using the given package
 #   QUIET = if TRUE, don't print anything

+ 1 - 1
Modules/CMakeParseArguments.cmake

@@ -51,7 +51,7 @@
 #   MY_INSTALL_CONFIGURATIONS = "" (was not used)
 #   MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
 #
-# You can the continue and process these variables.
+# You can then continue and process these variables.
 #
 # Keywords terminate lists of values, e.g. if directly after a one_value_keyword
 # another recognized keyword follows, this is interpreted as the beginning of

+ 2 - 1
Modules/CMakeParseImplicitLinkInfo.cmake

@@ -26,10 +26,11 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
   set(linker "CMAKE_LINKER-NOTFOUND")
   if(CMAKE_LINKER)
     get_filename_component(linker ${CMAKE_LINKER} NAME)
+    string(REGEX REPLACE "([][+.*?()^$])" "\\\\\\1" linker "${linker}")
   endif()
   # Construct a regex to match linker lines.  It must match both the
   # whole line and just the command (argv[0]).
-  set(linker_regex "^( *|.*[/\\])(${linker}|ld|collect2)[^/\\]*( |$)")
+  set(linker_regex "^( *|.*[/\\])(${linker}|([^/\\]+-)?ld|collect2)[^/\\]*( |$)")
   set(linker_exclude_regex "collect2 version ")
   set(log "${log}  link line regex: [${linker_regex}]\n")
   string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")

+ 5 - 5
Modules/CMakeSystem.cmake.in

@@ -1,3 +1,8 @@
+set(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
+set(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@")
+set(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@")
+set(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
+
 @INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED@
 
 set(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
@@ -5,11 +10,6 @@ set(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
 set(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
 set(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
 
-set(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
-set(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@")
-set(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@")
-set(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
-
 set(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
 
 set(CMAKE_SYSTEM_LOADED 1)

+ 2 - 2
Modules/CPack.cmake

@@ -263,8 +263,8 @@
 #
 ##variable
 #   CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
-#   installing this project. This is only used
-#   by installer for Windows.
+#   installing this project. This is only used by installer for Windows.
+#   The default value is based on the installation directory.
 ##end
 ##variable
 #   CPACK_CREATE_DESKTOP_LINKS - List of desktop links to create.

+ 1 - 1
Modules/CPackPackageMaker.cmake

@@ -2,7 +2,7 @@
 ##end
 ##module
 # - PackageMaker CPack generator (Mac OS X).
-# The following variable is specific to installers build on Mac OS X
+# The following variable is specific to installers built on Mac OS X
 # using PackageMaker:
 ##end
 #

+ 57 - 6
Modules/CPackRPM.cmake

@@ -163,6 +163,8 @@
 #     May be set by the user in order to specify a USER binary spec file
 #     to be used by CPackRPM instead of generating the file.
 #     The specified file will be processed by configure_file( @ONLY).
+#     One can provide a component specific file by setting
+#     CPACK_RPM_<componentName>_USER_BINARY_SPECFILE.
 ##end
 ##variable
 #  CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template.
@@ -223,6 +225,24 @@
 #     The refered file will be read and directly put after the %changelog
 #     section.
 ##end
+##variable
+#  CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST - list of path to be excluded.
+#     Mandatory : NO
+#     Default   : /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include
+#     May be used to exclude path (directories or files) from the auto-generated
+#     list of paths discovered by CPack RPM. The defaut value contains a reasonable
+#     set of values if the variable is not defined by the user. If the variable
+#     is defined by the user then CPackRPM will NOT any of the default path.
+#     If you want to add some path to the default list then you can use
+#     CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION variable.
+##end
+##variable
+#  CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION - additional list of path to be excluded.
+#     Mandatory : NO
+#     Default   : -
+#     May be used to add more exclude path (directories or files) from the initial
+#     default list of excluded paths. See CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST.
+##end
 
 #=============================================================================
 # Copyright 2007-2009 Kitware, Inc.
@@ -666,6 +686,30 @@ if(CPACK_RPM_PACKAGE_RELOCATABLE)
   endforeach()
 endif()
 
+if (CPACK_RPM_PACKAGE_DEBUG)
+   message("CPackRPM:Debug: Initial list of path to OMIT in RPM: ${_RPM_DIRS_TO_OMIT}")
+endif()
+
+if (NOT DEFINED CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
+  set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include)
+  if (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION)
+    message("CPackRPM:Debug: Adding ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION} to builtin omit list.")
+    list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST "${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION}")
+  endif()
+endif()
+
+if(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
+  if (CPACK_RPM_PACKAGE_DEBUG)
+   message("CPackRPM:Debug: CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST= ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST}")
+ endif()
+  foreach(_DIR ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST})
+    list(APPEND _RPM_DIRS_TO_OMIT "-o;-path;.${_DIR}")
+  endforeach()
+endif()
+if (CPACK_RPM_PACKAGE_DEBUG)
+   message("CPackRPM:Debug: Final list of path to OMIT in RPM: ${_RPM_DIRS_TO_OMIT}")
+endif()
+
 # Use files tree to construct files command (spec file)
 # We should not forget to include symlinks (thus -o -type l)
 # We should include directory as well (thus -type d)
@@ -832,11 +876,18 @@ if(CPACK_RPM_PACKAGE_DEBUG)
    message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
 endif()
 
-# USER generated spec file handling.
-# We should generate a spec file template:
+#
+# USER generated/provided spec file handling.
+#
+
+# 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})
+endif()
+
+# We should generate a USER spec file template:
 #  - either because the user asked for it : CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
 #  - or the user did not provide one : NOT CPACK_RPM_USER_BINARY_SPECFILE
-#
 if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
    file(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
       "# -*- rpm-spec -*-
@@ -902,9 +953,9 @@ mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
-${CPACK_RPM_INSTALL_FILES}
-${CPACK_RPM_ABSOLUTE_INSTALL_FILES}
-${CPACK_RPM_USER_INSTALL_FILES}
+\@CPACK_RPM_INSTALL_FILES\@
+\@CPACK_RPM_ABSOLUTE_INSTALL_FILES\@
+\@CPACK_RPM_USER_INSTALL_FILES\@
 
 %changelog
 \@CPACK_RPM_SPEC_CHANGELOG\@

+ 12 - 0
Modules/CheckCCompilerFlag.cmake

@@ -26,6 +26,12 @@ include(CheckCSourceCompiles)
 macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
    set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
    set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+   # Normalize locale during test compilation.
+   set(_CheckCCompilerFlag_LOCALE_VARS LC_ALL LC_MESSAGES LANG)
+   foreach(v ${_CheckCCompilerFlag_LOCALE_VARS})
+     set(_CheckCCompilerFlag_SAVED_${v} "$ENV{${v}}")
+     set(ENV{${v}} C)
+   endforeach()
    CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
      # Some compilers do not fail with a bad flag
      FAIL_REGEX "command line option .* is valid for .* but not for C" # GNU
@@ -41,5 +47,11 @@ macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
      FAIL_REGEX "command option .* is not recognized"       # XL
      FAIL_REGEX "WARNING: unknown flag:"                    # Open64
      )
+   foreach(v ${_CheckCCompilerFlag_LOCALE_VARS})
+     set(ENV{${v}} ${_CheckCCompilerFlag_SAVED_${v}})
+     unset(_CheckCCompilerFlag_SAVED_${v})
+   endforeach()
+   unset(_CheckCCompilerFlag_LOCALE_VARS)
+
    set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
 endmacro ()

+ 13 - 0
Modules/CheckCXXCompilerFlag.cmake

@@ -26,6 +26,13 @@ include(CheckCXXSourceCompiles)
 macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
    set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
    set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+
+   # Normalize locale during test compilation.
+   set(_CheckCXXCompilerFlag_LOCALE_VARS LC_ALL LC_MESSAGES LANG)
+   foreach(v ${_CheckCXXCompilerFlag_LOCALE_VARS})
+     set(_CheckCXXCompilerFlag_SAVED_${v} "$ENV{${v}}")
+     set(ENV{${v}} C)
+   endforeach()
    CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
      # Some compilers do not fail with a bad flag
      FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU
@@ -43,6 +50,12 @@ macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
      FAIL_REGEX "File with unknown suffix passed to linker" # PGI
      FAIL_REGEX "WARNING: unknown flag:"                    # Open64
      )
+   foreach(v ${_CheckCXXCompilerFlag_LOCALE_VARS})
+     set(ENV{${v}} ${_CheckCXXCompilerFlag_SAVED_${v}})
+     unset(_CheckCXXCompilerFlag_SAVED_${v})
+   endforeach()
+   unset(_CheckCXXCompilerFlag_LOCALE_VARS)
+
    set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
 endmacro ()
 

+ 1 - 1
Modules/CheckFunctionExists.cmake

@@ -4,7 +4,7 @@
 # Check that the <function> is provided by libraries on the system and
 # store the result in a <variable>.  This does not verify that any
 # system header file declares the function, only that it can be found
-# at link time (considure using CheckSymbolExists).
+# at link time (consider using CheckSymbolExists).
 #
 # The following variables may be set before calling this macro to
 # modify the way the check is run:

+ 1 - 1
Modules/CheckSizeOf.cmake

@@ -15,4 +15,4 @@
 message(SEND_ERROR
         "Modules/CheckSizeOf.cmake has been removed.  "
         "Use Modules/CheckTypeSize.cmake instead.  This "
-        "compatability check may be removed before the next release!")
+        "compatibility check may be removed before the next release!")

+ 14 - 0
Modules/Compiler/IAR-ASM.cmake

@@ -0,0 +1,14 @@
+# This file is processed when the IAR compiler is used for an assembler file
+
+include(Compiler/IAR)
+
+set(CMAKE_ASM_COMPILE_OBJECT  "<CMAKE_ASM_COMPILER> <SOURCE> <DEFINES> <FLAGS> -o <OBJECT>")
+
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
+  set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa)
+endif()
+
+
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR")
+  set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s90;asm;msa)
+endif()

+ 34 - 0
Modules/Compiler/IAR-C.cmake

@@ -0,0 +1,34 @@
+# This file is processed when the IAR compiler is used for a C file
+
+
+include(Compiler/IAR)
+
+set(CMAKE_C_COMPILE_OBJECT             "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <FLAGS> -o <OBJECT>")
+set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
+set(CMAKE_C_CREATE_ASSEMBLY_SOURCE     "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
+
+# The toolchains for ARM and AVR are quite different:
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
+
+  set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+  set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> <TARGET> --create <LINK_FLAGS> <OBJECTS> ")
+
+endif()
+
+
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR")
+  set(CMAKE_C_OUTPUT_EXTENSION ".r90")
+
+  if(NOT CMAKE_C_LINK_FLAGS)
+    set(CMAKE_C_LINK_FLAGS "-Fmotorola")
+  endif()
+
+  set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+  set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> -o <TARGET> <OBJECTS> ")
+
+endif()
+
+# add the target specific include directory:
+get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
+get_filename_component(_compilerDir "${_compilerDir}" PATH)
+include_directories("${_compilerDir}/inc" )

+ 34 - 0
Modules/Compiler/IAR-CXX.cmake

@@ -0,0 +1,34 @@
+# This file is processed when the IAR compiler is used for a C++ file
+
+include(Compiler/IAR)
+
+set(CMAKE_CXX_COMPILE_OBJECT  "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <FLAGS> -o <OBJECT>")
+
+set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
+set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE     "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
+
+
+
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
+
+  set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+  set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> <TARGET> --create <LINK_FLAGS> <OBJECTS> ")
+
+endif()
+
+
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR")
+  set(CMAKE_CXX_OUTPUT_EXTENSION ".r90")
+  if(NOT CMAKE_CXX_LINK_FLAGS)
+    set(CMAKE_CXX_LINK_FLAGS "-Fmotorola")
+  endif()
+
+  set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+  set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> -o <TARGET> <OBJECTS> ")
+
+endif()
+
+# add the target specific include directory:
+get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
+get_filename_component(_compilerDir "${_compilerDir}" PATH)
+include_directories("${_compilerDir}/inc")

+ 46 - 0
Modules/Compiler/IAR.cmake

@@ -0,0 +1,46 @@
+# This file is processed when the IAR compiler is used for a C or C++ file
+# Documentation can be downloaded here: http://www.iar.com/website1/1.0.1.0/675/1/
+# The initial feature request is here: http://www.cmake.org/Bug/view.php?id=10176
+# It also contains additional links and information.
+
+if(_IAR_CMAKE_LOADED)
+  return()
+endif()
+set(_IAR_CMAKE_LOADED TRUE)
+
+
+get_filename_component(_CMAKE_C_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
+get_filename_component(_CMAKE_CXX_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
+get_filename_component(_CMAKE_ASM_TOOLCHAIN_LOCATION "${CMAKE_ASM_COMPILER}" PATH)
+
+
+if("${CMAKE_C_COMPILER}" MATCHES "arm"  OR  "${CMAKE_CXX_COMPILER}" MATCHES "arm"  OR  "${CMAKE_ASM_COMPILER}" MATCHES "arm")
+  set(CMAKE_EXECUTABLE_SUFFIX ".elf")
+
+  # For arm, IAR uses the "ilinkarm" linker and "iarchive" archiver:
+  find_program(CMAKE_IAR_LINKER ilinkarm HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}")
+  find_program(CMAKE_IAR_AR iarchive HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" )
+
+  set(IAR_TARGET_ARCHITECTURE "ARM" CACHE STRING "IAR compiler target architecture")
+endif()
+
+if("${CMAKE_C_COMPILER}" MATCHES "avr"  OR  "${CMAKE_CXX_COMPILER}" MATCHES "avr"  OR  "${CMAKE_ASM_COMPILER}" MATCHES "avr")
+  set(CMAKE_EXECUTABLE_SUFFIX ".bin")
+
+  # For AVR and AVR32, IAR uses the "xlink" linker and the "xar" archiver:
+  find_program(CMAKE_IAR_LINKER xlink HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" )
+  find_program(CMAKE_IAR_AR xar HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" )
+
+  set(IAR_TARGET_ARCHITECTURE "AVR" CACHE STRING "IAR compiler target architecture")
+
+  set(CMAKE_LIBRARY_PATH_FLAG "-I")
+
+endif()
+
+if(NOT IAR_TARGET_ARCHITECTURE)
+  message(FATAL_ERROR "The IAR compiler for this architecture is not yet supported "
+          " by CMake. Please go to http://www.cmake.org/Bug and enter a feature request there.")
+endif()
+
+set(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE)
+set(CMAKE_AR "${CMAKE_IAR_AR}" CACHE FILEPATH "The IAR archiver" FORCE)

+ 1 - 1
Modules/CompilerId/Xcode-1.pbxproj.in

@@ -56,7 +56,7 @@
 		2C18F0B415DC1DC700593670 = {
 			fileEncoding = 30;
 			isa = PBXFileReference;
-			lastKnownFileType = @id_type@;
+			explicitFileType = @id_type@;
 			path = @id_src@;
 			refType = 4;
 			sourceTree = "<group>";

+ 1 - 1
Modules/CompilerId/Xcode-2.pbxproj.in

@@ -7,7 +7,7 @@
 	objects = {
 
 		2C18F0B615DC1E0300593670 = {isa = PBXBuildFile; fileRef = 2C18F0B415DC1DC700593670; };
-		2C18F0B415DC1DC700593670 = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = @id_type@; path = @id_src@; sourceTree = "<group>"; };
+		2C18F0B415DC1DC700593670 = {isa = PBXFileReference; fileEncoding = 4; explicitFileType = @id_type@; path = @id_src@; sourceTree = "<group>"; };
 		8DD76F6C0486A84900D96B5E = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CompilerId@id_lang@; sourceTree = BUILT_PRODUCTS_DIR; };
 
 		08FB7794FE84155DC02AAC07 = {

+ 1 - 1
Modules/CompilerId/Xcode-3.pbxproj.in

@@ -7,7 +7,7 @@
 	objects = {
 
 		2C18F0B615DC1E0300593670 = {isa = PBXBuildFile; fileRef = 2C18F0B415DC1DC700593670; };
-		2C18F0B415DC1DC700593670 = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = @id_type@; path = @id_src@; sourceTree = "<group>"; };
+		2C18F0B415DC1DC700593670 = {isa = PBXFileReference; fileEncoding = 4; explicitFileType = @id_type@; path = @id_src@; sourceTree = "<group>"; };
 		08FB7794FE84155DC02AAC07 = {
 			isa = PBXGroup;
 			children = (

+ 4 - 1
Modules/ExternalData.cmake

@@ -551,7 +551,10 @@ function(_ExternalData_arg_find_files pattern regex)
       set(relname "${entry}")
       set(alg "")
     endif()
-    if("x${relname}" MATCHES "^x${regex}$" AND NOT IS_DIRECTORY "${top_src}/${entry}")
+    if("x${relname}" MATCHES "^x${regex}$" # matches
+        AND NOT IS_DIRECTORY "${top_src}/${entry}" # not a directory
+        AND NOT "x${relname}" MATCHES "(^x|/)\\.ExternalData_" # not staged obj
+        )
       set(name "${top_src}/${relname}")
       set(file "${top_bin}/${relname}")
       if(alg)

+ 4 - 4
Modules/ExternalProject.cmake

@@ -1251,10 +1251,10 @@ function(_ep_add_download_command name)
     get_filename_component(work_dir "${source_dir}" PATH)
     set(comment "Performing download step (SVN checkout) for '${name}'")
     set(svn_user_pw_args "")
-    if(svn_username)
+    if(DEFINED svn_username)
       set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}")
     endif()
-    if(svn_password)
+    if(DEFINED svn_password)
       set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}")
     endif()
     if(svn_trust_cert)
@@ -1473,10 +1473,10 @@ function(_ep_add_update_command name)
     get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD)
     get_property(svn_trust_cert TARGET ${name} PROPERTY _EP_SVN_TRUST_CERT)
     set(svn_user_pw_args "")
-    if(svn_username)
+    if(DEFINED svn_username)
       set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}")
     endif()
-    if(svn_password)
+    if(DEFINED svn_password)
       set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}")
     endif()
     if(svn_trust_cert)

+ 13 - 5
Modules/FindBoost.cmake

@@ -41,7 +41,7 @@
 #  Boost_LIBRARY_DIR         - Directory containing Boost libraries
 #  Boost_<C>_LIBRARY_DEBUG   - Component <C> library debug variant
 #  Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
-# Users may set the these hints or results as cache entries.  Projects should
+# Users may set these hints or results as cache entries.  Projects should
 # not read these entries directly but instead use the above result variables.
 # Note that some hint names start in upper-case "BOOST".  One may specify
 # these as environment variables if they are not specified as CMake variables
@@ -154,7 +154,7 @@
 
 
 #-------------------------------------------------------------------------------
-# Before we go searching, check whether boost-cmake is avaialble, unless the
+# Before we go searching, check whether boost-cmake is available, unless the
 # user specifically asked NOT to search for boost-cmake.
 #
 # If Boost_DIR is set, this behaves as any find_package call would. If not,
@@ -247,7 +247,7 @@ macro(_Boost_ADJUST_LIB_VARS basename)
     endif()
 
   endif()
-  # Make variables changeble to the advanced user
+  # Make variables changeable to the advanced user
   mark_as_advanced(
       Boost_${basename}_LIBRARY_RELEASE
       Boost_${basename}_LIBRARY_DEBUG
@@ -928,9 +928,13 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
     message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
                    "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}")
   endif()
+
+  # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
+  string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS}")
+
   _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
     NAMES ${_boost_RELEASE_NAMES}
-    HINTS ${_boost_LIBRARY_SEARCH_DIRS}
+    HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp}
     NAMES_PER_DIR
     DOC "${_boost_docstring_release}"
     )
@@ -960,9 +964,13 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
     message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
                    "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}")
   endif()
+
+  # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
+  string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS}")
+
   _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
     NAMES ${_boost_DEBUG_NAMES}
-    HINTS ${_boost_LIBRARY_SEARCH_DIRS}
+    HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp}
     NAMES_PER_DIR
     DOC "${_boost_docstring_debug}"
     )

+ 10 - 1
Modules/FindCUDA.cmake

@@ -920,7 +920,13 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
   if (IS_ABSOLUTE "${bpath}")
     # Absolute paths are generally unnessary, especially if something like
     # file(GLOB_RECURSE) is used to pick up the files.
-    file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}")
+
+    string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos)
+    if (_binary_dir_pos EQUAL 0)
+      file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}")
+    else()
+      file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}")
+    endif()
   endif()
 
   # This recipie is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
@@ -1021,7 +1027,10 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
   # Initialize our list of includes with the user ones followed by the CUDA system ones.
   set(CUDA_NVCC_INCLUDE_ARGS ${CUDA_NVCC_INCLUDE_ARGS_USER} "-I${CUDA_INCLUDE_DIRS}")
   # Get the include directories for this directory and use them for our nvcc command.
+  # Remove duplicate entries which may be present since include_directories
+  # in CMake >= 2.8.8 does not remove them.
   get_directory_property(CUDA_NVCC_INCLUDE_DIRECTORIES INCLUDE_DIRECTORIES)
+  list(REMOVE_DUPLICATES CUDA_NVCC_INCLUDE_DIRECTORIES)
   if(CUDA_NVCC_INCLUDE_DIRECTORIES)
     foreach(dir ${CUDA_NVCC_INCLUDE_DIRECTORIES})
       list(APPEND CUDA_NVCC_INCLUDE_ARGS -I${dir})

+ 1 - 1
Modules/FindCUDA/make2cmake.cmake

@@ -63,7 +63,7 @@ if (${depend_text} MATCHES ".+")
       if (EXISTS "/${file}")
         set(file "/${file}")
       else()
-        message(WARNING " Removing non-existant dependency file: ${file}")
+        message(WARNING " Removing non-existent dependency file: ${file}")
         set(file "")
       endif()
     endif()

+ 1 - 1
Modules/FindFLTK2.cmake

@@ -45,7 +45,7 @@ if(APPLE)
   set( FLTK2_PLATFORM_DEPENDENT_LIBS  "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
 endif()
 
-# If FLTK2_INCLUDE_DIR is already defined we assigne its value to FLTK2_DIR
+# If FLTK2_INCLUDE_DIR is already defined we assign its value to FLTK2_DIR
 if(FLTK2_INCLUDE_DIR)
   set(FLTK2_DIR ${FLTK2_INCLUDE_DIR})
 else()

+ 2 - 2
Modules/FindITK.cmake

@@ -17,7 +17,7 @@
 #
 #  USE_ITK_FILE - The full path to the UseITK.cmake file.
 #                 This is provided for backward
-#                 compatability.  Use ITK_USE_FILE
+#                 compatibility.  Use ITK_USE_FILE
 #                 instead.
 
 #=============================================================================
@@ -52,6 +52,6 @@ if(NOT ITK_FOUND)
 endif()
 
 if(ITK_FOUND)
-  # Set USE_ITK_FILE for backward-compatability.
+  # Set USE_ITK_FILE for backward-compatibility.
   set(USE_ITK_FILE ${ITK_USE_FILE})
 endif()

+ 1 - 1
Modules/FindMPI.cmake

@@ -86,7 +86,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/GetPrerequisites.cmake)
 #
 # The compilers are detected in this order:
 #
-# 1. Try to find the most generic availble MPI compiler, as this is usually set up by
+# 1. Try to find the most generic available MPI compiler, as this is usually set up by
 #    cluster admins.  e.g., if plain old mpicc is available, we'll use it and assume it's
 #    the right compiler.
 #

+ 88 - 91
Modules/FindOpenGL.cmake

@@ -28,111 +28,107 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-if (WIN32)
-  if (CYGWIN)
+set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
 
-    find_path(OPENGL_INCLUDE_DIR GL/gl.h )
+if (CYGWIN)
 
-    find_library(OPENGL_gl_LIBRARY opengl32 )
+  find_path(OPENGL_INCLUDE_DIR GL/gl.h )
+  list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
 
-    find_library(OPENGL_glu_LIBRARY glu32 )
+  find_library(OPENGL_gl_LIBRARY opengl32 )
 
-  else ()
+  find_library(OPENGL_glu_LIBRARY glu32 )
 
-    if(BORLAND)
-      set (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32")
-      set (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32")
-    else()
-      set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
-      set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
-    endif()
-
-  endif ()
+elseif (WIN32)
 
-else ()
+  if(BORLAND)
+    set (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32")
+    set (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32")
+  else()
+    set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
+    set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
+  endif()
 
-  if (APPLE)
+elseif (APPLE)
 
-    find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL lib for OSX")
-    find_library(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX")
-    find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX")
+  find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL lib for OSX")
+  find_library(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX")
+  find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX")
+  list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
 
-  else()
-    if (CMAKE_SYSTEM_NAME MATCHES "HP-UX")
-      # Handle HP-UX cases where we only want to find OpenGL in either hpux64
-      # or hpux32 depending on if we're doing a 64 bit build.
-      if(CMAKE_SIZEOF_VOID_P EQUAL 4)
-        set(_OPENGL_LIB_PATH
-          /opt/graphics/OpenGL/lib/hpux32/)
-      else()
-        set(_OPENGL_LIB_PATH
-          /opt/graphics/OpenGL/lib/hpux64/
-          /opt/graphics/OpenGL/lib/pa20_64)
-      endif()
-    elseif(CMAKE_SYSTEM_NAME STREQUAL Haiku)
+else()
+  if (CMAKE_SYSTEM_NAME MATCHES "HP-UX")
+    # Handle HP-UX cases where we only want to find OpenGL in either hpux64
+    # or hpux32 depending on if we're doing a 64 bit build.
+    if(CMAKE_SIZEOF_VOID_P EQUAL 4)
       set(_OPENGL_LIB_PATH
-        /boot/develop/lib/x86)
-      set(_OPENGL_INCLUDE_PATH
-        /boot/develop/headers/os/opengl)
+        /opt/graphics/OpenGL/lib/hpux32/)
+    else()
+      set(_OPENGL_LIB_PATH
+        /opt/graphics/OpenGL/lib/hpux64/
+        /opt/graphics/OpenGL/lib/pa20_64)
     endif()
+  elseif(CMAKE_SYSTEM_NAME STREQUAL Haiku)
+    set(_OPENGL_LIB_PATH
+      /boot/develop/lib/x86)
+    set(_OPENGL_INCLUDE_PATH
+      /boot/develop/headers/os/opengl)
+  endif()
 
-    # The first line below is to make sure that the proper headers
-    # are used on a Linux machine with the NVidia drivers installed.
-    # They replace Mesa with NVidia's own library but normally do not
-    # install headers and that causes the linking to
-    # fail since the compiler finds the Mesa headers but NVidia's library.
-    # Make sure the NVIDIA directory comes BEFORE the others.
-    #  - Atanas Georgiev <[email protected]>
-
-    find_path(OPENGL_INCLUDE_DIR GL/gl.h
-      /usr/share/doc/NVIDIA_GLX-1.0/include
-      /usr/openwin/share/include
-      /opt/graphics/OpenGL/include /usr/X11R6/include
-      ${_OPENGL_INCLUDE_PATH}
-    )
-
-    find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
-      /usr/share/doc/NVIDIA_GLX-1.0/include
-      /usr/openwin/share/include
-      /opt/graphics/OpenGL/include /usr/X11R6/include
-    )
-
-    find_library(OPENGL_gl_LIBRARY
-      NAMES GL MesaGL
-      PATHS /opt/graphics/OpenGL/lib
-            /usr/openwin/lib
-            /usr/shlib /usr/X11R6/lib
-            ${_OPENGL_LIB_PATH}
-    )
-
-    unset(_OPENGL_INCLUDE_PATH)
-    unset(_OPENGL_LIB_PATH)
-
-    # On Unix OpenGL most certainly always requires X11.
-    # Feel free to tighten up these conditions if you don't
-    # think this is always true.
-    # It's not true on OSX.
-
-    if (OPENGL_gl_LIBRARY)
-      if(NOT X11_FOUND)
-        include(${CMAKE_CURRENT_LIST_DIR}/FindX11.cmake)
-      endif()
-      if (X11_FOUND)
-        if (NOT APPLE)
-          set (OPENGL_LIBRARIES ${X11_LIBRARIES})
-        endif ()
-      endif ()
+  # The first line below is to make sure that the proper headers
+  # are used on a Linux machine with the NVidia drivers installed.
+  # They replace Mesa with NVidia's own library but normally do not
+  # install headers and that causes the linking to
+  # fail since the compiler finds the Mesa headers but NVidia's library.
+  # Make sure the NVIDIA directory comes BEFORE the others.
+  #  - Atanas Georgiev <[email protected]>
+
+  find_path(OPENGL_INCLUDE_DIR GL/gl.h
+    /usr/share/doc/NVIDIA_GLX-1.0/include
+    /usr/openwin/share/include
+    /opt/graphics/OpenGL/include /usr/X11R6/include
+    ${_OPENGL_INCLUDE_PATH}
+  )
+  list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
+
+  find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
+    /usr/share/doc/NVIDIA_GLX-1.0/include
+    /usr/openwin/share/include
+    /opt/graphics/OpenGL/include /usr/X11R6/include
+  )
+
+  find_library(OPENGL_gl_LIBRARY
+    NAMES GL MesaGL
+    PATHS /opt/graphics/OpenGL/lib
+          /usr/openwin/lib
+          /usr/shlib /usr/X11R6/lib
+          ${_OPENGL_LIB_PATH}
+  )
+
+  unset(_OPENGL_INCLUDE_PATH)
+  unset(_OPENGL_LIB_PATH)
+
+  # On Unix OpenGL most certainly always requires X11.
+  # Feel free to tighten up these conditions if you don't
+  # think this is always true.
+
+  if (OPENGL_gl_LIBRARY)
+    if(NOT X11_FOUND)
+      include(${CMAKE_CURRENT_LIST_DIR}/FindX11.cmake)
+    endif()
+    if (X11_FOUND)
+      set (OPENGL_LIBRARIES ${X11_LIBRARIES})
     endif ()
+  endif ()
 
-    find_library(OPENGL_glu_LIBRARY
-      NAMES GLU MesaGLU
-      PATHS ${OPENGL_gl_LIBRARY}
-            /opt/graphics/OpenGL/lib
-            /usr/openwin/lib
-            /usr/shlib /usr/X11R6/lib
-    )
+  find_library(OPENGL_glu_LIBRARY
+    NAMES GLU MesaGLU
+    PATHS ${OPENGL_gl_LIBRARY}
+          /opt/graphics/OpenGL/lib
+          /usr/openwin/lib
+          /usr/shlib /usr/X11R6/lib
+  )
 
-  endif()
 endif ()
 
 if(OPENGL_gl_LIBRARY)
@@ -162,7 +158,8 @@ set(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
 # handle the QUIETLY and REQUIRED arguments and set OPENGL_FOUND to TRUE if
 # all listed variables are TRUE
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL DEFAULT_MSG OPENGL_gl_LIBRARY)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL REQUIRED_VARS ${_OpenGL_REQUIRED_VARS})
+unset(_OpenGL_REQUIRED_VARS)
 
 mark_as_advanced(
   OPENGL_INCLUDE_DIR

+ 2 - 2
Modules/FindOpenSSL.cmake

@@ -140,10 +140,10 @@ if(WIN32 AND NOT CYGWIN)
 
     set( OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} )
   elseif(MINGW)
-    # same player, for MingW
+    # same player, for MinGW
     set(LIB_EAY_NAMES libeay32)
     set(SSL_EAY_NAMES ssleay32)
-    if(CMAKE_CROSS_COMPILING)
+    if(CMAKE_CROSSCOMPILING)
       list(APPEND LIB_EAY_NAMES crypto)
       list(APPEND SSL_EAY_NAMES ssl)
     endif()

+ 13 - 0
Modules/FindProtobuf.cmake

@@ -156,6 +156,16 @@ function(_protobuf_find_libraries name filename)
    endif()
 endfunction()
 
+# Internal function: find threads library
+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)
+    endif()
+endfunction()
+
 #
 # Main.
 #
@@ -190,6 +200,9 @@ if(MSVC)
     set(CMAKE_FIND_LIBRARY_PREFIXES "${PROTOBUF_ORIG_FIND_LIBRARY_PREFIXES}")
 endif()
 
+if(UNIX)
+    _protobuf_find_threads()
+endif()
 
 # Find the include directory
 find_path(PROTOBUF_INCLUDE_DIR

+ 9 - 6
Modules/FindQt4.cmake

@@ -115,7 +115,7 @@
 #        You should have a look on the AUTOMOC property for targets to achieve the same results.
 #
 #  macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
-#        Create a the interface header and implementation files with the
+#        Create the interface header and implementation files with the
 #        given basename from the given interface xml file and add it to
 #        the list of sources.
 #
@@ -171,7 +171,7 @@
 #        in:  ts_files
 #        generates commands to create .qm from .ts - files. The generated
 #        filenames can be found in qm_files. The ts_files
-#        must exists and are not updated in any way.
+#        must exist and are not updated in any way.
 #
 # function QT4_USE_MODULES( target [link_type] modules...)
 #        Make <target> use the <modules> from Qt. Using a Qt module means
@@ -495,7 +495,7 @@ macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
     set(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
   endif ()
 
-  # Make variables changeble to the advanced user
+  # Make variables changeable to the advanced user
   mark_as_advanced(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
 endmacro ()
 
@@ -635,10 +635,10 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
           )
     endif()
 
-    # try dropping a hint if trying to use Visual Studio with Qt built by mingw
+    # try dropping a hint if trying to use Visual Studio with Qt built by MinGW
     if(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
       if(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
-        message( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw.  Those compilers do not produce code compatible with each other.")
+        message( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by MinGW.  Those compilers do not produce code compatible with each other.")
       endif()
     endif()
 
@@ -657,8 +657,11 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
     message(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" "
                     "but QtCore could not be found there.  "
                     "Qt is NOT installed correctly for the target build environment.")
+    set(Qt4_FOUND FALSE)
     if(Qt4_FIND_REQUIRED)
       message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
+    else()
+      return()
     endif()
   endif()
 
@@ -771,7 +774,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
     endif()
   endif ()
 
-  # Make variables changeble to the advanced user
+  # Make variables changeable to the advanced user
   mark_as_advanced( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR
                     QT_PLUGINS_DIR QT_TRANSLATIONS_DIR)
 

+ 2 - 2
Modules/FindVTK.cmake

@@ -51,7 +51,7 @@ if("${VTK_FIND_VERSION}" VERSION_LESS 4.1)
   endif()
 endif()
 
-# Construct consitent error messages for use below.
+# Construct consistent error messages for use below.
 set(VTK_DIR_DESCRIPTION "directory containing VTKConfig.cmake.  This is either the root of the build tree, or PREFIX/lib/vtk for an installation.")
 if(_VTK_40_ALLOW)
   set(VTK_DIR_DESCRIPTION "${VTK_DIR_DESCRIPTION}  For VTK 4.0, this is the location of UseVTK.cmake.  This is either the root of the build tree or PREFIX/include/vtk for an installation.")
@@ -127,7 +127,7 @@ endif()
 
 #-----------------------------------------------------------------------------
 if(VTK_FOUND)
-  # Set USE_VTK_FILE for backward-compatability.
+  # Set USE_VTK_FILE for backward-compatibility.
   set(USE_VTK_FILE ${VTK_USE_FILE})
 else()
   # VTK not found, explain to the user how to specify its location.

+ 5 - 3
Modules/FindwxWidgets.cmake

@@ -458,7 +458,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
       wxWidgets-2.5.2
       wxWidgets-2.5.1
       wxWidgets
-    DOC "wxWidgets base/installation directory?"
+    DOC "wxWidgets base/installation directory"
     )
 
   # If wxWidgets_ROOT_DIR changed, clear lib dir.
@@ -492,7 +492,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         PATHS
         ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll   # prefer shared
         ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib
-        DOC "Path to wxWidgets libraries?"
+        DOC "Path to wxWidgets libraries"
         NO_DEFAULT_PATH
         )
     else()
@@ -509,7 +509,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         PATHS
         ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib   # prefer static
         ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll
-        DOC "Path to wxWidgets libraries?"
+        DOC "Path to wxWidgets libraries"
         NO_DEFAULT_PATH
         )
     endif()
@@ -703,6 +703,7 @@ else()
     #-----------------------------------------------------------------
     # Support cross-compiling, only search in the target platform.
     find_program(wxWidgets_CONFIG_EXECUTABLE wx-config
+      DOC "Location of wxWidgets library configuration provider binary (wx-config)."
       ONLY_CMAKE_FIND_ROOT_PATH
       )
 
@@ -843,6 +844,7 @@ set(wxWidgets_FOUND ${WXWIDGETS_FOUND})
 # Resource file compiler.
 find_program(wxWidgets_wxrc_EXECUTABLE wxrc
   ${wxWidgets_ROOT_DIR}/utils/wxrc/vc_msw
+  DOC "Location of wxWidgets resource file compiler binary (wxrc)"
   )
 
 #

+ 3 - 3
Modules/FindwxWindows.cmake

@@ -321,7 +321,7 @@ if(WIN32_STYLE_FIND)
       rpcrt4
       wsock32
       )
-    ## HACK: feed in to optimized / debug libaries if both were FOUND.
+    ## HACK: feed in to optimized / debug libraries if both were FOUND.
     set(WXWINDOWS_STATIC_DEBUG_LIBS ${WXWINDOWS_STATIC_DEBUG_LIBS}
       wxbase26d
       wxbase26d_net
@@ -354,7 +354,7 @@ if(WIN32_STYLE_FIND)
   ##
 
   ## if there is at least one shared lib available
-  ## let user choose wether to use shared or static wxwindows libs
+  ## let user choose whether to use shared or static wxwindows libs
   if(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY)
     ## default value OFF because wxWindows MSVS default build is static
     option(WXWINDOWS_USE_SHARED_LIBS
@@ -606,7 +606,7 @@ else()
       ../wx/bin
       ../../wx/bin )
 
-    # check wether wx-config was found:
+    # check whether wx-config was found:
     if(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
 
       # use shared/static wx lib?

+ 9 - 5
Modules/GenerateExportHeader.cmake

@@ -267,6 +267,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
   if(_GEH_EXPORT_MACRO_NAME)
     set(EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_EXPORT_MACRO_NAME})
   endif()
+  string(MAKE_C_IDENTIFIER ${EXPORT_MACRO_NAME} EXPORT_MACRO_NAME)
   if(_GEH_EXPORT_FILE_NAME)
     if(IS_ABSOLUTE ${_GEH_EXPORT_FILE_NAME})
       set(EXPORT_FILE_NAME ${_GEH_EXPORT_FILE_NAME})
@@ -277,12 +278,15 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
   if(_GEH_DEPRECATED_MACRO_NAME)
     set(DEPRECATED_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_DEPRECATED_MACRO_NAME})
   endif()
+  string(MAKE_C_IDENTIFIER ${DEPRECATED_MACRO_NAME} DEPRECATED_MACRO_NAME)
   if(_GEH_NO_EXPORT_MACRO_NAME)
     set(NO_EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_NO_EXPORT_MACRO_NAME})
   endif()
+  string(MAKE_C_IDENTIFIER ${NO_EXPORT_MACRO_NAME} NO_EXPORT_MACRO_NAME)
   if(_GEH_STATIC_DEFINE)
     set(STATIC_DEFINE ${_GEH_PREFIX_NAME}${_GEH_STATIC_DEFINE})
   endif()
+  string(MAKE_C_IDENTIFIER ${STATIC_DEFINE} STATIC_DEFINE)
 
   if(_GEH_DEFINE_NO_DEPRECATED)
     set(DEFINE_NO_DEPRECATED TRUE)
@@ -292,6 +296,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
     set(NO_DEPRECATED_MACRO_NAME
       ${_GEH_PREFIX_NAME}${_GEH_NO_DEPRECATED_MACRO_NAME})
   endif()
+  string(MAKE_C_IDENTIFIER ${NO_DEPRECATED_MACRO_NAME} NO_DEPRECATED_MACRO_NAME)
 
   set(INCLUDE_GUARD_NAME "${EXPORT_MACRO_NAME}_H")
 
@@ -300,6 +305,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
   if(NOT EXPORT_IMPORT_CONDITION)
     set(EXPORT_IMPORT_CONDITION ${TARGET_LIBRARY}_EXPORTS)
   endif()
+  string(MAKE_C_IDENTIFIER ${EXPORT_IMPORT_CONDITION} EXPORT_IMPORT_CONDITION)
 
   configure_file("${_GENERATE_EXPORT_HEADER_MODULE_DIR}/exportheader.cmake.in"
     "${EXPORT_FILE_NAME}" @ONLY)
@@ -307,11 +313,9 @@ endmacro()
 
 function(GENERATE_EXPORT_HEADER TARGET_LIBRARY)
   get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE)
-  if(${type} STREQUAL "MODULE")
-    message(WARNING "This macro should not be used with libraries of type MODULE")
-    return()
-  endif()
-  if(NOT ${type} STREQUAL "STATIC_LIBRARY" AND NOT ${type} STREQUAL "SHARED_LIBRARY")
+  if(NOT ${type} STREQUAL "STATIC_LIBRARY"
+      AND NOT ${type} STREQUAL "SHARED_LIBRARY"
+      AND NOT ${type} STREQUAL "MODULE_LIBRARY")
     message(WARNING "This macro can only be used with libraries")
     return()
   endif()

+ 3 - 1
Modules/NSIS.template.in

@@ -916,7 +916,9 @@ Function .onInit
 ;Run the uninstaller
 uninst:
   ClearErrors
-  ExecWait '$0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
+  StrLen $2 "\Uninstall.exe"
+  StrCpy $3 $0 -$2 # remove "\Uninstall.exe" from UninstallString to get path
+  ExecWait '$0 _?=$3' ;Do not copy the uninstaller to a temp file
 
   IfErrors uninst_failed inst
 uninst_failed:

+ 2 - 2
Modules/Platform/Windows-Intel.cmake

@@ -81,7 +81,7 @@ endif()
 
 macro(__windows_compiler_intel lang)
   set(CMAKE_${lang}_COMPILE_OBJECT
-    "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} /Fo<OBJECT> <DEFINES> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
+    "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} /Fo<OBJECT> /Fd<OBJECT_DIR>/ <DEFINES> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
   set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
     "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <DEFINES> <FLAGS> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
   set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
@@ -91,7 +91,7 @@ macro(__windows_compiler_intel lang)
   set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
   set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
   set(CMAKE_${lang}_LINK_EXECUTABLE
-    "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> <OBJECTS> /link /implib:<TARGET_IMPLIB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+    "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> <OBJECTS> /link /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
   set(CMAKE_${lang}_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}")
   set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Od /RTC1")
   set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/DNDEBUG /MD /O1")

+ 3 - 6
Modules/Platform/Windows-MSVC.cmake

@@ -22,7 +22,7 @@ set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
 set(CMAKE_LINK_LIBRARY_FLAG "")
 set(MSVC 1)
 
-# hack: if a new cmake (which uses CMAKE__LINKER) runs on an old build tree
+# hack: if a new cmake (which uses CMAKE_LINKER) runs on an old build tree
 # (where link was hardcoded) and where CMAKE_LINKER isn't in the cache
 # and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
 # hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex
@@ -52,9 +52,6 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
 endif()
 if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
   set (CMAKE_NO_BUILD_TYPE 1)
-  set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
-     "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
-  mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
 endif()
 
 # make sure to enable languages after setting configuration types
@@ -228,7 +225,7 @@ macro(__windows_compiler_msvc lang)
   set(CMAKE_${lang}_CREATE_STATIC_LIBRARY  "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
 
   set(CMAKE_${lang}_COMPILE_OBJECT
-    "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
+    "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<OBJECT_DIR>/ -c <SOURCE>${CMAKE_END_TEMP_FILE}")
   set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
     "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
   set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
@@ -237,7 +234,7 @@ macro(__windows_compiler_msvc lang)
   set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
   set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
   set(CMAKE_${lang}_LINK_EXECUTABLE
-    "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> <OBJECTS> /link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+    "${_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> <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}")

+ 0 - 2
Modules/Platform/Windows-df.cmake

@@ -38,8 +38,6 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
 endif()
 if(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
   set (CMAKE_NO_BUILD_TYPE 1)
-  set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
-     "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
 endif()
 # does the compiler support pdbtype and is it the newer compiler
 

+ 4 - 2
Modules/Platform/WindowsPaths.cmake

@@ -77,10 +77,12 @@ list(APPEND CMAKE_SYSTEM_PREFIX_PATH "${_CMAKE_INSTALL_DIR}")
 list(APPEND CMAKE_SYSTEM_PREFIX_PATH
   # Project install destination.
   "${CMAKE_INSTALL_PREFIX}"
+  )
 
+if(CMAKE_CROSSCOMPILING AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
   # MinGW (useful when cross compiling from linux with CMAKE_FIND_ROOT_PATH set)
-  /
-  )
+  list(APPEND CMAKE_SYSTEM_PREFIX_PATH /)
+endif()
 
 list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
   )

+ 2 - 2
Modules/UseEcos.cmake

@@ -132,10 +132,10 @@ macro(ECOS_ADJUST_DIRECTORY _target_FILES )
 endmacro()
 
 # the default ecos config file name
-# maybe in the future also out-of-source builds may be possible
+# maybe in future also out-of-source builds may be possible
 set(ECOS_CONFIG_FILE ecos.ecc)
 
-#creates the dependancy from all source files on the ecos target.ld,
+#creates the dependency from all source files on the ecos target.ld,
 #adds the command for compiling ecos
 macro(ECOS_ADD_TARGET_LIB)
 # when building out-of-source, create the ecos/ subdir

+ 59 - 36
Modules/UseJava.cmake

@@ -6,6 +6,10 @@
 # add_jar(target_name
 #         [SOURCES] source1 [source2 ...] [resource1 ...]
 #         [INCLUDE_JARS jar1 [jar2 ...]]
+#         [ENTRY_POINT entry]
+#         [VERSION version]
+#         [OUTPUT_NAME name]
+#         [OUTPUT_DIR dir]
 #        )
 #
 # This command creates a <target_name>.jar. It compiles the given source files
@@ -17,6 +21,9 @@
 # listed as sources are ignored (as they have been since the first version of
 # this module).
 #
+# The default OUTPUT_DIR can also be changed by setting the variable
+# CMAKE_JAVA_TARGET_OUTPUT_DIR.
+#
 # Additional instructions:
 #   To add compile flags to the target you can set these flags with
 #   the following variable:
@@ -30,32 +37,30 @@
 #
 #   To use a different output name for the target you can set it with:
 #
-#       set(CMAKE_JAVA_TARGET_OUTPUT_NAME shibboleet.jar)
-#       add_jar(foobar foobar.java)
+#       add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar)
 #
 #   To use a different output directory than CMAKE_CURRENT_BINARY_DIR
 #   you can set it with:
 #
-#       set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
+#       add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
 #
-#   To define an entry point in your jar you can set it with:
+#   To define an entry point in your jar you can set it with the ENTRY_POINT
+#   named argument:
 #
-#       set(CMAKE_JAVA_JAR_ENTRY_POINT com/examples/MyProject/Main)
+#       add_jar(example ENTRY_POINT com/examples/MyProject/Main)
 #
 #   To add a VERSION to the target output name you can set it using
-#   CMAKE_JAVA_TARGET_VERSION. This will create a jar file with the name
-#   shibboleet-1.0.0.jar and will create a symlink shibboleet.jar
+#   the VERSION named argument to add_jar. This will create a jar file with the
+#   name shibboleet-1.0.0.jar and will create a symlink shibboleet.jar
 #   pointing to the jar with the version information.
 #
-#       set(CMAKE_JAVA_TARGET_VERSION 1.2.0)
-#       add_jar(shibboleet shibbotleet.java)
+#       add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
 #
 #    If the target is a JNI library, utilize the following commands to
 #    create a JNI symbolic link:
 #
 #       set(CMAKE_JNI_TARGET TRUE)
-#       set(CMAKE_JAVA_TARGET_VERSION 1.2.0)
-#       add_jar(shibboleet shibbotleet.java)
+#       add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
 #       install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
 #       install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
 #
@@ -216,23 +221,43 @@ set(_JAVA_SYMLINK_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaSymlinks.cmake)
 
 function(add_jar _TARGET_NAME)
 
-    cmake_parse_arguments(_add_jar "" "" "SOURCES;INCLUDE_JARS" ${ARGN})
+    if(DEFINED CMAKE_JAVA_TARGET_VERSION)
+        set(_add_jar_VERSION "${CMAKE_JAVA_TARGET_VERSION}")
+    endif()
+    if(DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
+        set(_add_jar_OUTPUT_DIR "${CMAKE_JAVA_TARGET_OUTPUT_DIR}")
+    endif()
+    if(DEFINED CMAKE_JAVA_TARGET_OUTPUT_NAME)
+        set(_add_jar_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}")
+        # reset
+        set(CMAKE_JAVA_TARGET_OUTPUT_NAME)
+    endif()
+    if(DEFINED CMAKE_JAVA_JAR_ENTRY_POINT)
+        set(_add_jar_ENTRY_POINT "${CMAKE_JAVA_JAR_ENTRY_POINT}")
+    endif()
+
+    cmake_parse_arguments(_add_jar
+      ""
+      "VERSION;OUTPUT_DIR;OUTPUT_NAME;ENTRY_POINT"
+      "SOURCES;INCLUDE_JARS"
+      ${ARGN}
+    )
 
     set(_JAVA_SOURCE_FILES ${_add_jar_SOURCES} ${_add_jar_UNPARSED_ARGUMENTS})
 
-    if (NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
-      set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
+    if (NOT DEFINED _add_jar_OUTPUT_DIR)
+        set(_add_jar_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
     endif()
 
-    if (CMAKE_JAVA_JAR_ENTRY_POINT)
-      set(_ENTRY_POINT_OPTION e)
-      set(_ENTRY_POINT_VALUE ${CMAKE_JAVA_JAR_ENTRY_POINT})
+    if (_add_jar_ENTRY_POINT)
+        set(_ENTRY_POINT_OPTION e)
+        set(_ENTRY_POINT_VALUE ${_add_jar_ENTRY_POINT})
     endif ()
 
     if (LIBRARY_OUTPUT_PATH)
         set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH})
     else ()
-        set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR})
+        set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${_add_jar_OUTPUT_DIR})
     endif ()
 
     set(CMAKE_JAVA_INCLUDE_PATH
@@ -242,7 +267,7 @@ function(add_jar _TARGET_NAME)
         ${CMAKE_JAVA_LIBRARY_OUTPUT_PATH}
     )
 
-    if (WIN32 AND NOT CYGWIN)
+    if (WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
         set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
     else ()
         set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
@@ -252,20 +277,18 @@ function(add_jar _TARGET_NAME)
        set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
     endforeach()
 
-    set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
+    set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${_add_jar_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
 
     set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar")
-    if (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION)
-        set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar")
-        set(_JAVA_TARGET_OUTPUT_LINK "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar")
-    elseif (CMAKE_JAVA_TARGET_VERSION)
-        set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar")
+    if (_add_jar_OUTPUT_NAME AND _add_jar_VERSION)
+        set(_JAVA_TARGET_OUTPUT_NAME "${_add_jar_OUTPUT_NAME}-${_add_jar_VERSION}.jar")
+        set(_JAVA_TARGET_OUTPUT_LINK "${_add_jar_OUTPUT_NAME}.jar")
+    elseif (_add_jar_VERSION)
+        set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}-${_add_jar_VERSION}.jar")
         set(_JAVA_TARGET_OUTPUT_LINK "${_TARGET_NAME}.jar")
-    elseif (CMAKE_JAVA_TARGET_OUTPUT_NAME)
-        set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar")
+    elseif (_add_jar_OUTPUT_NAME)
+        set(_JAVA_TARGET_OUTPUT_NAME "${_add_jar_OUTPUT_NAME}.jar")
     endif ()
-    # reset
-    set(CMAKE_JAVA_TARGET_OUTPUT_NAME)
 
     set(_JAVA_CLASS_FILES)
     set(_JAVA_COMPILE_FILES)
@@ -279,7 +302,7 @@ function(add_jar _TARGET_NAME)
         get_filename_component(_JAVA_FULL ${_JAVA_SOURCE_FILE} ABSOLUTE)
 
         if (_JAVA_EXT MATCHES ".java")
-            file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR} ${_JAVA_FULL})
+            file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${_add_jar_OUTPUT_DIR} ${_JAVA_FULL})
             file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL})
             string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN)
             string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN)
@@ -364,7 +387,7 @@ function(add_jar _TARGET_NAME)
 
     # create the jar file
     set(_JAVA_JAR_OUTPUT_PATH
-      ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME})
+      ${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME})
     if (CMAKE_JNI_TARGET)
         add_custom_command(
             OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
@@ -372,12 +395,12 @@ function(add_jar _TARGET_NAME)
                 -cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE}
                 ${_JAVA_RESOURCE_FILES} @java_class_filelist
             COMMAND ${CMAKE_COMMAND}
-                -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
+                -D_JAVA_TARGET_DIR=${_add_jar_OUTPUT_DIR}
                 -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME}
                 -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
                 -P ${_JAVA_SYMLINK_SCRIPT}
             COMMAND ${CMAKE_COMMAND}
-                -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
+                -D_JAVA_TARGET_DIR=${_add_jar_OUTPUT_DIR}
                 -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_JAR_OUTPUT_PATH}
                 -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
                 -P ${_JAVA_SYMLINK_SCRIPT}
@@ -392,7 +415,7 @@ function(add_jar _TARGET_NAME)
                 -cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE}
                 ${_JAVA_RESOURCE_FILES} @java_class_filelist
             COMMAND ${CMAKE_COMMAND}
-                -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
+                -D_JAVA_TARGET_DIR=${_add_jar_OUTPUT_DIR}
                 -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME}
                 -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
                 -P ${_JAVA_SYMLINK_SCRIPT}
@@ -420,7 +443,7 @@ function(add_jar _TARGET_NAME)
             PROPERTY
                 INSTALL_FILES
                     ${_JAVA_JAR_OUTPUT_PATH}
-                    ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
+                    ${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
         )
 
         if (CMAKE_JNI_TARGET)
@@ -429,7 +452,7 @@ function(add_jar _TARGET_NAME)
                     ${_TARGET_NAME}
                 PROPERTY
                     JNI_SYMLINK
-                        ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
+                        ${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
             )
         endif ()
     endif ()

+ 6 - 1
Source/CMakeLists.txt

@@ -357,6 +357,10 @@ if (WIN32)
       cmLocalVisualStudio7Generator.h
       cmLocalVisualStudioGenerator.cxx
       cmLocalVisualStudioGenerator.h
+      cmVisualStudioSlnData.h
+      cmVisualStudioSlnData.cxx
+      cmVisualStudioSlnParser.h
+      cmVisualStudioSlnParser.cxx
       cmVisualStudioWCEPlatformParser.h
       cmVisualStudioWCEPlatformParser.cxx
       cmWin32ProcessExecution.cxx
@@ -537,7 +541,8 @@ endif()
 add_executable(cmake cmakemain.cxx)
 target_link_libraries(cmake CMakeLib)
 
-# Build special executable for running programs on Windows 98
+# Build special executable for running programs on Windows 98.
+# Included on any Windows (unconditional packaging required!).
 if(WIN32)
   if(NOT UNIX)
     add_executable(cmw9xcom cmw9xcom.cxx)

+ 2 - 2
Source/CMakeVersion.cmake

@@ -1,6 +1,6 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 2)
 set(CMake_VERSION_MINOR 8)
-set(CMake_VERSION_PATCH 10)
-set(CMake_VERSION_TWEAK 20130515)
+set(CMake_VERSION_PATCH 11)
+set(CMake_VERSION_TWEAK 20130602)
 #set(CMake_VERSION_RC 1)

+ 1 - 1
Source/CPack/cmCPackDocumentVariables.cxx

@@ -60,7 +60,7 @@ void cmCPackDocumentVariables::DefineVariables(cmake* cm)
            "It is usually invoked like this:\n"
            " make DESTDIR=/home/john install\n"
            "which will install the concerned software using the"
-           " installation prefix, e.g. \"/usr/local\" pre-pended with "
+           " installation prefix, e.g. \"/usr/local\" prepended with "
            "the DESTDIR value which finally gives \"/home/john/usr/local\"."
            " When preparing a package, CPack first installs the items to be "
            "packaged in a local (to the build tree) directory by using the "

+ 1 - 1
Source/CPack/cmCPackGenerator.cxx

@@ -638,7 +638,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
           = this->MakefileMap->GetDefinition("CMAKE_MAKE_PROGRAM");
         std::string buildCommand
           = globalGenerator->GenerateBuildCommand(cmakeMakeProgram,
-            installProjectName.c_str(), 0,
+            installProjectName.c_str(), 0, 0,
             globalGenerator->GetPreinstallTargetName(),
             buildConfig, false, false);
         cmCPackLogger(cmCPackLog::LOG_DEBUG,

+ 2 - 1
Source/CTest/cmCTestBuildCommand.cxx

@@ -130,10 +130,11 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
         cmakeBuildConfiguration = config;
         }
 
+      std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory");
       std::string buildCommand
         = this->GlobalGenerator->
         GenerateBuildCommand(cmakeMakeProgram,
-                             cmakeProjectName,
+                             cmakeProjectName, dir.c_str(),
                              cmakeBuildAdditionalFlags, cmakeBuildTarget,
                              cmakeBuildConfiguration, true, false);
       cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,

+ 0 - 26
Source/CTest/cmCTestConfigureCommand.cxx

@@ -31,32 +31,6 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
     cmSystemTools::ExpandListArgument(this->Values[ctc_OPTIONS], options);
     }
 
-  if ( this->Values[ct_BUILD] )
-    {
-    this->CTest->SetCTestConfiguration("BuildDirectory",
-      cmSystemTools::CollapseFullPath(
-        this->Values[ct_BUILD]).c_str());
-    }
-  else
-    {
-    this->CTest->SetCTestConfiguration("BuildDirectory",
-      cmSystemTools::CollapseFullPath(
-       this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY")).c_str());
-    }
-
-  if ( this->Values[ct_SOURCE] )
-    {
-    this->CTest->SetCTestConfiguration("SourceDirectory",
-      cmSystemTools::CollapseFullPath(
-        this->Values[ct_SOURCE]).c_str());
-    }
-  else
-    {
-    this->CTest->SetCTestConfiguration("SourceDirectory",
-      cmSystemTools::CollapseFullPath(
-        this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
-    }
-
   if ( this->CTest->GetCTestConfiguration("BuildDirectory").empty() )
     {
     this->SetError("Build directory not specified. Either use BUILD "

+ 14 - 13
Source/CTest/cmCTestHandlerCommand.cxx

@@ -70,19 +70,6 @@ bool cmCTestHandlerCommand
     this->CTest->SetConfigType(ctestConfigType);
     }
 
-  cmCTestLog(this->CTest, DEBUG, "Initialize handler" << std::endl;);
-  cmCTestGenericHandler* handler = this->InitializeHandler();
-  if ( !handler )
-    {
-    cmCTestLog(this->CTest, ERROR_MESSAGE,
-               "Cannot instantiate test handler " << this->GetName()
-               << std::endl);
-    return false;
-    }
-
-  handler->SetAppendXML(this->AppendXML);
-
-  handler->PopulateCustomVectors(this->Makefile);
   if ( this->Values[ct_BUILD] )
     {
     this->CTest->SetCTestConfiguration("BuildDirectory",
@@ -119,6 +106,20 @@ bool cmCTestHandlerCommand
       cmSystemTools::CollapseFullPath(
         this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
     }
+
+  cmCTestLog(this->CTest, DEBUG, "Initialize handler" << std::endl;);
+  cmCTestGenericHandler* handler = this->InitializeHandler();
+  if ( !handler )
+    {
+    cmCTestLog(this->CTest, ERROR_MESSAGE,
+               "Cannot instantiate test handler " << this->GetName()
+               << std::endl);
+    return false;
+    }
+
+  handler->SetAppendXML(this->AppendXML);
+
+  handler->PopulateCustomVectors(this->Makefile);
   if ( this->Values[ct_SUBMIT_INDEX] )
     {
     if(!this->CTest->GetDropSiteCDash() && this->CTest->GetDartVersion() <= 1)

+ 21 - 10
Source/CTest/cmCTestMemCheckHandler.cxx

@@ -43,8 +43,7 @@ static CatToErrorType cmCTestMemCheckBoundsChecker[] = {
   {0,0}
 };
 
-// parse the xml file storing the installed version of Xcode on
-// the machine
+// parse the xml file containing the results of last BoundsChecker run
 class cmBoundsCheckerParser : public cmXMLParser
 {
 public:
@@ -461,13 +460,6 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
     return false;
     }
 
-  if ( this->MemoryTester[0] == '\"' &&
-    this->MemoryTester[this->MemoryTester.size()-1] == '\"' )
-    {
-    this->MemoryTester
-      = this->MemoryTester.substr(1, this->MemoryTester.size()-2);
-    }
-
   // Setup the options
   std::string memoryTesterOptions;
   if ( this->CTest->GetCTestConfiguration(
@@ -491,13 +483,13 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
   switch ( this->MemoryTesterStyle )
     {
     case cmCTestMemCheckHandler::VALGRIND:
+      {
       if ( this->MemoryTesterOptions.empty() )
         {
         this->MemoryTesterOptions.push_back("-q");
         this->MemoryTesterOptions.push_back("--tool=memcheck");
         this->MemoryTesterOptions.push_back("--leak-check=yes");
         this->MemoryTesterOptions.push_back("--show-reachable=yes");
-        this->MemoryTesterOptions.push_back("--workaround-gcc296-bugs=yes");
         this->MemoryTesterOptions.push_back("--num-callers=50");
         }
       if ( this->CTest->GetCTestConfiguration(
@@ -516,7 +508,11 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
           + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
         this->MemoryTesterOptions.push_back(suppressions);
         }
+      std::string outputFile = "--log-file="
+        + this->MemoryTesterOutputFile;
+      this->MemoryTesterOptions.push_back(outputFile);
       break;
+      }
     case cmCTestMemCheckHandler::PURIFY:
       {
       std::string outputFile;
@@ -948,6 +944,21 @@ cmCTestMemCheckHandler::PostProcessPurifyTest(cmCTestTestResult& res)
   cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
              "PostProcessPurifyTest for : "
              << res.Name.c_str() << std::endl);
+  appendMemTesterOutput(res);
+}
+
+void
+cmCTestMemCheckHandler::PostProcessValgrindTest(cmCTestTestResult& res)
+{
+  cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+             "PostProcessValgrindTest for : "
+             << res.Name.c_str() << std::endl);
+  appendMemTesterOutput(res);
+}
+
+void
+cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res)
+{
   if ( !cmSystemTools::FileExists(this->MemoryTesterOutputFile.c_str()) )
     {
     std::string log = "Cannot find memory tester output file: "

+ 4 - 0
Source/CTest/cmCTestMemCheckHandler.h

@@ -119,6 +119,10 @@ private:
 
   void PostProcessPurifyTest(cmCTestTestResult& res);
   void PostProcessBoundsCheckerTest(cmCTestTestResult& res);
+  void PostProcessValgrindTest(cmCTestTestResult& res);
+
+  ///! append MemoryTesterOutputFile to the test log
+  void appendMemTesterOutput(cmCTestTestHandler::cmCTestTestResult& res);
 };
 
 #endif

+ 14 - 6
Source/CTest/cmCTestRunTest.cxx

@@ -166,6 +166,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
         {
         found = true;
         reason = "Required regular expression found.";
+        break;
         }
       }
     if ( !found )
@@ -196,6 +197,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
         reason += passIt->second;
         reason += "]";
         forceFail = true;
+        break;
         }
       }
     }
@@ -384,13 +386,19 @@ void cmCTestRunTest::MemCheckPostProcess()
              << this->TestResult.Name.c_str() << std::endl);
   cmCTestMemCheckHandler * handler = static_cast<cmCTestMemCheckHandler*>
     (this->TestHandler);
-  if(handler->MemoryTesterStyle == cmCTestMemCheckHandler::BOUNDS_CHECKER)
-    {
-    handler->PostProcessBoundsCheckerTest(this->TestResult);
-    }
-  else if(handler->MemoryTesterStyle == cmCTestMemCheckHandler::PURIFY)
+  switch ( handler->MemoryTesterStyle )
     {
-    handler->PostProcessPurifyTest(this->TestResult);
+    case cmCTestMemCheckHandler::VALGRIND:
+      handler->PostProcessValgrindTest(this->TestResult);
+      break;
+    case cmCTestMemCheckHandler::PURIFY:
+      handler->PostProcessPurifyTest(this->TestResult);
+      break;
+    case cmCTestMemCheckHandler::BOUNDS_CHECKER:
+      handler->PostProcessBoundsCheckerTest(this->TestResult);
+      break;
+    default:
+      break;
     }
 }
 

+ 3 - 4
Source/CTest/cmCTestTestHandler.cxx

@@ -82,7 +82,6 @@ bool cmCTestSubdirCommand
   std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
   for ( it = args.begin(); it != args.end(); ++ it )
     {
-    cmSystemTools::ChangeDirectory(cwd.c_str());
     std::string fname;
 
     if(cmSystemTools::FileIsFullPath(it->c_str()))
@@ -116,7 +115,6 @@ bool cmCTestSubdirCommand
     else
       {
       // No CTestTestfile? Who cares...
-      cmSystemTools::ChangeDirectory(cwd.c_str());
       continue;
       }
     fname += "/";
@@ -133,6 +131,7 @@ bool cmCTestSubdirCommand
       return false;
       }
     }
+  cmSystemTools::ChangeDirectory(cwd.c_str());
   return true;
 }
 
@@ -1363,7 +1362,7 @@ void cmCTestTestHandler
     tempPath += filename;
     attempted.push_back(tempPath);
     attemptedConfigs.push_back(ctest->GetConfigType());
-    // If the file is an OSX bundle then the configtyp
+    // If the file is an OSX bundle then the configtype
     // will be at the start of the path
     tempPath = ctest->GetConfigType();
     tempPath += "/";
@@ -1374,7 +1373,7 @@ void cmCTestTestHandler
     }
   else
     {
-    // no config specified to try some options
+    // no config specified - try some options...
     tempPath = filepath;
     tempPath += "Release/";
     tempPath += filename;

+ 8 - 0
Source/CTest/cmProcess.cxx

@@ -175,6 +175,14 @@ int cmProcess::GetNextOutputLine(std::string& line, double timeout)
   // Record exit information.
   this->ExitValue = cmsysProcess_GetExitValue(this->Process);
   this->TotalTime = cmSystemTools::GetTime() - this->StartTime;
+  // Because of a processor clock scew the runtime may become slightly
+  // negative. If someone changed the system clock while the process was
+  // running this may be even more. Make sure not to report a negative
+  // duration here.
+  if (this->TotalTime <= 0.0)
+    {
+    this->TotalTime = 0.0;
+    }
   //  std::cerr << "Time to run: " << this->TotalTime << "\n";
   return cmsysProcess_Pipe_None;
 }

+ 3 - 3
Source/CursesDialog/form/frm_driver.c

@@ -176,7 +176,7 @@ static int FE_Delete_Previous(FORM *);
 #define Address_Of_Current_Position_In_Buffer(form) \
   Address_Of_Current_Position_In_Nth_Buffer(form,0)
 
-/* Logic to decide wether or not a field is actually a field with
+/* Logic to decide whether or not a field is actually a field with
    vertical or horizontal scrolling */
 #define Is_Scroll_Field(field)          \
    (((field)->drows > (field)->rows) || \
@@ -2100,7 +2100,7 @@ static int Insert_String(FORM *form, int row, char *txt, int len)
 |                    the wrapping.
 |
 |   Return Values :  E_OK              - no wrapping required or wrapping
-|                                        was successfull
+|                                        was successful
 |                    E_REQUEST_DENIED  -
 |                    E_SYSTEM_ERROR    - some system error
 +--------------------------------------------------------------------------*/
@@ -3825,7 +3825,7 @@ int set_field_buffer(FIELD * field, int buffer, const char * value)
                            (int)(1 + (vlen-len)/((field->rows+field->nrow)*field->cols))))
             RETURN(E_SYSTEM_ERROR);
 
-          /* in this case we also have to check, wether or not the remaining
+          /* in this case we also have to check, whether or not the remaining
              characters in value are also printable for buffer 0. */
           if (buffer==0)
             {

+ 1 - 1
Source/CursesDialog/form/fty_enum.c

@@ -101,7 +101,7 @@ static void Free_Enum_Type(void * argp)
 |                                       const unsigned char * buf,
 |                                       bool  ccase )
 |   
-|   Description   :  Check wether or not the text in 'buf' matches the
+|   Description   :  Check whether or not the text in 'buf' matches the
 |                    text in 's', at least partial.
 |
 |   Return Values :  NOMATCH   - buffer doesn't match

+ 158 - 5
Source/QtDialog/CMakeSetupDialog.cxx

@@ -28,6 +28,7 @@
 #include <QShortcut>
 #include <QKeySequence>
 #include <QMacInstallDialog.h>
+#include <QInputDialog>
 
 #include "QCMake.h"
 #include "QCMakeCacheView.h"
@@ -122,6 +123,22 @@ CMakeSetupDialog::CMakeSetupDialog()
   QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)),
                    this, SLOT(doInstallForCommandLine()));
 #endif
+  ToolsMenu->addSeparator();
+  ToolsMenu->addAction(tr("&Find in Output..."),
+                       this, SLOT(doOutputFindDialog()),
+                       QKeySequence::Find);
+  ToolsMenu->addAction(tr("Find Next"),
+                       this, SLOT(doOutputFindNext()),
+                       QKeySequence::FindNext);
+  ToolsMenu->addAction(tr("Find Previous"),
+                       this, SLOT(doOutputFindPrev()),
+                       QKeySequence::FindPrevious);
+  ToolsMenu->addAction(tr("Goto Next Error"),
+                       this, SLOT(doOutputErrorNext()),
+                       QKeySequence(Qt::Key_F8));  // in Visual Studio
+  new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Period),
+                       this, SLOT(doOutputErrorNext()));  // in Eclipse
+
   QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options"));
   this->SuppressDevWarningsAction =
     OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)"));
@@ -154,10 +171,6 @@ CMakeSetupDialog::CMakeSetupDialog()
   QObject::connect(a, SIGNAL(triggered(bool)),
                    this, SLOT(doHelp()));
 
-  QShortcut* filterShortcut = new QShortcut(QKeySequence::Find, this);
-  QObject::connect(filterShortcut, SIGNAL(activated()),
-                   this, SLOT(startSearch()));
-
   this->setAcceptDrops(true);
 
   // get the saved binary directories
@@ -172,6 +185,10 @@ CMakeSetupDialog::CMakeSetupDialog()
   this->Output->setFont(outputFont);
   this->ErrorFormat.setForeground(QBrush(Qt::red));
 
+  this->Output->setContextMenuPolicy(Qt::CustomContextMenu);
+  connect(this->Output, SIGNAL(customContextMenuRequested(const QPoint&)),
+          this, SLOT(doOutputContextMenu(const QPoint &)));
+
   // start the cmake worker thread
   this->CMakeThread = new QCMakeThread(this);
   QObject::connect(this->CMakeThread, SIGNAL(cmakeInitialized()),
@@ -637,7 +654,13 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
 void CMakeSetupDialog::error(const QString& msg)
 {
   this->Output->setCurrentCharFormat(this->ErrorFormat);
-  this->Output->append(msg);
+  //QTextEdit will terminate the msg with a ParagraphSeparator, but it also replaces
+  //all newlines with ParagraphSeparators. By replacing the newlines by ourself, one
+  //error msg will be one paragraph.
+  QString paragraph(msg);
+  paragraph.replace(QLatin1Char('\n'), QChar::LineSeparator);
+  this->Output->append(paragraph);
+
 }
 
 void CMakeSetupDialog::message(const QString& msg)
@@ -1149,4 +1172,134 @@ void CMakeSetupDialog::setSearchFilter(const QString& str)
   this->CacheValues->setSearchFilter(str);
 }
 
+void CMakeSetupDialog::doOutputContextMenu(const QPoint &pt)
+{
+  QMenu *menu = this->Output->createStandardContextMenu();
+
+  menu->addSeparator();
+  menu->addAction(tr("Find..."),
+                  this, SLOT(doOutputFindDialog()), QKeySequence::Find);
+  menu->addAction(tr("Find Next"),
+                  this, SLOT(doOutputFindNext()), QKeySequence::FindNext);
+  menu->addAction(tr("Find Previous"),
+                  this, SLOT(doOutputFindPrev()), QKeySequence::FindPrevious);
+  menu->addSeparator();
+  menu->addAction(tr("Goto Next Error"),
+                  this, SLOT(doOutputErrorNext()), QKeySequence(Qt::Key_F8));
+
+  menu->exec(this->Output->mapToGlobal(pt));
+  delete menu;
+}
+
+void CMakeSetupDialog::doOutputFindDialog()
+{
+  QStringList strings(this->FindHistory);
+
+  QString selection = this->Output->textCursor().selectedText();
+  if (!selection.isEmpty() &&
+      !selection.contains(QChar::ParagraphSeparator) &&
+      !selection.contains(QChar::LineSeparator))
+    {
+    strings.push_front(selection);
+    }
+
+  bool ok;
+  QString search = QInputDialog::getItem(this, tr("Find in Output"),
+                                         tr("Find:"), strings, 0, true, &ok);
+  if (ok && !search.isEmpty())
+    {
+    if (!this->FindHistory.contains(search))
+      {
+      this->FindHistory.push_front(search);
+      }
+    doOutputFindNext();
+    }
+}
+
+void CMakeSetupDialog::doOutputFindPrev()
+{
+  doOutputFindNext(false);
+}
+
+void CMakeSetupDialog::doOutputFindNext(bool directionForward)
+{
+  if (this->FindHistory.isEmpty())
+    {
+    doOutputFindDialog(); //will re-call this function again
+    return;
+    }
+
+  QString search = this->FindHistory.front();
+
+  QTextCursor cursor = this->Output->textCursor();
+  QTextDocument* document = this->Output->document();
+  QTextDocument::FindFlags flags;
+  if (!directionForward)
+    {
+    flags |= QTextDocument::FindBackward;
+    }
+
+  cursor = document->find(search, cursor, flags);
+
+  if (cursor.isNull())
+    {
+    // first search found nothing, wrap around and search again
+    cursor = this->Output->textCursor();
+    cursor.movePosition(directionForward ? QTextCursor::Start
+                                         : QTextCursor::End);
+    cursor = document->find(search, cursor, flags);
+    }
+
+  if (cursor.hasSelection())
+    {
+    this->Output->setTextCursor(cursor);
+    }
+}
+
+void CMakeSetupDialog::doOutputErrorNext()
+{
+  QTextCursor cursor = this->Output->textCursor();
+  bool atEnd = false;
 
+  // move cursor out of current error-block
+  if (cursor.blockCharFormat() == this->ErrorFormat)
+    {
+    atEnd = !cursor.movePosition(QTextCursor::NextBlock);
+    }
+
+  // move cursor to next error-block
+  while (cursor.blockCharFormat() != this->ErrorFormat && !atEnd)
+    {
+    atEnd = !cursor.movePosition(QTextCursor::NextBlock);
+    }
+
+  if (atEnd)
+    {
+    // first search found nothing, wrap around and search again
+    atEnd = !cursor.movePosition(QTextCursor::Start);
+
+    // move cursor to next error-block
+    while (cursor.blockCharFormat() != this->ErrorFormat && !atEnd)
+      {
+      atEnd = !cursor.movePosition(QTextCursor::NextBlock);
+      }
+    }
+
+  if (!atEnd)
+    {
+    cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
+
+    QTextCharFormat selectionFormat;
+    selectionFormat.setBackground(Qt::yellow);
+    QTextEdit::ExtraSelection extraSelection = {cursor, selectionFormat};
+    this->Output->setExtraSelections(QList<QTextEdit::ExtraSelection>()
+                                     << extraSelection);
+
+    // make the whole error-block visible
+    this->Output->setTextCursor(cursor);
+
+    // remove the selection to see the extraSelection
+    cursor.setPosition(cursor.anchor());
+    this->Output->setTextCursor(cursor);
+    }
+}

+ 6 - 0
Source/QtDialog/CMakeSetupDialog.h

@@ -77,6 +77,11 @@ protected slots:
   bool doConfigureInternal();
   bool doGenerateInternal();
   void exitLoop(int);
+  void doOutputContextMenu(const QPoint &);
+  void doOutputFindDialog();
+  void doOutputFindNext(bool directionForward = true);
+  void doOutputFindPrev();
+  void doOutputErrorNext();
 
 protected:
 
@@ -106,6 +111,7 @@ protected:
   QTextCharFormat MessageFormat;
 
   QStringList AddVariableCompletions;
+  QStringList FindHistory;
 
   QEventLoop LocalLoop;
 

+ 4 - 1
Source/QtDialog/CMakeSetupDialog.ui

@@ -107,7 +107,10 @@
             </sizepolicy>
            </property>
            <property name="text">
-            <string>Search:</string>
+            <string>S&amp;earch:</string>
+           </property>
+           <property name="buddy">
+            <cstring>Search</cstring>
            </property>
           </widget>
          </item>

+ 1 - 1
Source/QtDialog/QCMakeCacheView.cxx

@@ -177,7 +177,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
 void QCMakeCacheView::setShowAdvanced(bool s)
 {
 #if QT_VERSION >= 040300
-  // new 4.3 api that needs to be called.  what about an older Qt?
+  // new 4.3 API that needs to be called.  what about an older Qt?
   this->SearchFilter->invalidate();
 #endif
 

+ 1 - 1
Source/cmAddDefinitionsCommand.h

@@ -63,7 +63,7 @@ public:
       "but it was originally intended to add preprocessor definitions.  "
       "Flags beginning in -D or /D that look like preprocessor definitions "
       "are automatically added to the COMPILE_DEFINITIONS property for "
-      "the current directory.  Definitions with non-trival values may be "
+      "the current directory.  Definitions with non-trivial values may be "
       "left in the set of flags instead of being converted for reasons of "
       "backwards compatibility.  See documentation of the directory, "
       "target, and source file COMPILE_DEFINITIONS properties for details "

+ 1 - 1
Source/cmAddSubDirectoryCommand.h

@@ -61,7 +61,7 @@ public:
       "  add_subdirectory(source_dir [binary_dir] \n"
       "                   [EXCLUDE_FROM_ALL])\n"
       "Add a subdirectory to the build. The source_dir specifies the "
-      "directory in which the source CmakeLists.txt and code files are "
+      "directory in which the source CMakeLists.txt and code files are "
       "located. If it is a relative "
       "path it will be evaluated with respect to the current "
       "directory (the typical usage), but it may also be an absolute path. "

+ 1 - 0
Source/cmBootstrapCommands.cxx

@@ -52,6 +52,7 @@
 #include "cmFindProgramCommand.cxx"
 #include "cmForEachCommand.cxx"
 #include "cmFunctionCommand.cxx"
+#include "cmGeneratorExpressionEvaluationFile.cxx"
 #include "cmGetCMakePropertyCommand.cxx"
 #include "cmGetDirectoryPropertyCommand.cxx"
 #include "cmGetFilenameComponentCommand.cxx"

+ 2 - 2
Source/cmBuildCommand.cxx

@@ -122,7 +122,7 @@ bool cmBuildCommand
   //
   std::string makecommand = this->Makefile->GetLocalGenerator()
     ->GetGlobalGenerator()->GenerateBuildCommand
-    (makeprogram, project_name, 0, target, configuration, true, false);
+    (makeprogram, project_name, 0, 0, target, configuration, true, false);
 
   this->Makefile->AddDefinition(variable, makecommand.c_str());
 
@@ -153,7 +153,7 @@ bool cmBuildCommand
 
   std::string makecommand = this->Makefile->GetLocalGenerator()
     ->GetGlobalGenerator()->GenerateBuildCommand
-    (makeprogram.c_str(), this->Makefile->GetProjectName(), 0,
+    (makeprogram.c_str(), this->Makefile->GetProjectName(), 0, 0,
      0, configType.c_str(), true, false);
 
   if(cacheValue)

+ 12 - 1
Source/cmCTest.cxx

@@ -294,6 +294,7 @@ cmCTest::cmCTest()
 {
   this->LabelSummary           = true;
   this->ParallelLevel          = 1;
+  this->ParallelLevelSetInCli  = false;
   this->SubmitIndex            = 0;
   this->Failover               = false;
   this->BatchJobs              = false;
@@ -1999,11 +2000,13 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
     i++;
     int plevel = atoi(args[i].c_str());
     this->SetParallelLevel(plevel);
+    this->ParallelLevelSetInCli = true;
     }
   else if(arg.find("-j") == 0)
     {
     int plevel = atoi(arg.substr(2).c_str());
     this->SetParallelLevel(plevel);
+    this->ParallelLevelSetInCli = true;
     }
 
   if(this->CheckArgument(arg, "--no-compress-output"))
@@ -2398,6 +2401,14 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
       }
     } // the close of the for argument loop
 
+  if (!this->ParallelLevelSetInCli)
+    {
+    if (const char *parallel = cmSystemTools::GetEnv("CTEST_PARALLEL_LEVEL"))
+      {
+      int plevel = atoi(parallel);
+      this->SetParallelLevel(plevel);
+      }
+    }
 
   // now what sould cmake do? if --build-and-test was specified then
   // we run the build and test handler and return
@@ -2413,7 +2424,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
 #endif
     if(retv != 0)
       {
-      cmCTestLog(this, DEBUG, "build and test failing returing: " << retv
+      cmCTestLog(this, DEBUG, "build and test failing returning: " << retv
                  << std::endl);
       }
     return retv;

+ 1 - 0
Source/cmCTest.h

@@ -485,6 +485,7 @@ private:
   int                     MaxTestNameWidth;
 
   int                     ParallelLevel;
+  bool                    ParallelLevelSetInCli;
 
   int                     CompatibilityMode;
 

+ 1 - 1
Source/cmCacheManager.cxx

@@ -491,7 +491,7 @@ bool cmCacheManager::SaveCache(const char* path)
        << "# The syntax for the file is as follows:\n"
        << "# KEY:TYPE=VALUE\n"
        << "# KEY is the name of a variable in the cache.\n"
-       << "# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT "
+       << "# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT "
        "TYPE!." << std::endl
        << "# VALUE is the current value for the KEY.\n\n";
 

+ 1 - 1
Source/cmCacheManager.h

@@ -82,7 +82,7 @@ public:
         {
         this->Find(key);
         }
-    }
+      }
   private:
     CacheEntry const& GetEntry() const { return this->Position->second; }
     CacheEntry& GetEntry() { return this->Position->second; }

+ 10 - 4
Source/cmComputeLinkInformation.cxx

@@ -882,7 +882,8 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
     }
 
   // Compute a regex to match link extensions.
-  std::string libext = this->CreateExtensionRegex(this->LinkExtensions);
+  std::string libext = this->CreateExtensionRegex(this->LinkExtensions,
+                                                  LinkUnknown);
 
   // Create regex to remove any library extension.
   std::string reg("(.*)");
@@ -916,7 +917,8 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
   if(!this->StaticLinkExtensions.empty())
     {
     std::string reg_static = reg;
-    reg_static += this->CreateExtensionRegex(this->StaticLinkExtensions);
+    reg_static += this->CreateExtensionRegex(this->StaticLinkExtensions,
+                                             LinkStatic);
 #ifdef CM_COMPUTE_LINK_INFO_DEBUG
   fprintf(stderr, "static regex [%s]\n", reg_static.c_str());
 #endif
@@ -928,7 +930,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
     {
     std::string reg_shared = reg;
     this->SharedRegexString =
-      this->CreateExtensionRegex(this->SharedLinkExtensions);
+      this->CreateExtensionRegex(this->SharedLinkExtensions, LinkShared);
     reg_shared += this->SharedRegexString;
 #ifdef CM_COMPUTE_LINK_INFO_DEBUG
   fprintf(stderr, "shared regex [%s]\n", reg_shared.c_str());
@@ -966,7 +968,7 @@ void cmComputeLinkInformation::AddLinkExtension(const char* e, LinkType type)
 //----------------------------------------------------------------------------
 std::string
 cmComputeLinkInformation
-::CreateExtensionRegex(std::vector<std::string> const& exts)
+::CreateExtensionRegex(std::vector<std::string> const& exts, LinkType type)
 {
   // Build a list of extension choices.
   std::string libext = "(";
@@ -995,6 +997,10 @@ cmComputeLinkInformation
     {
     libext += "(\\.[0-9]+\\.[0-9]+)?";
     }
+  else if(type == LinkShared)
+    {
+    libext += "(\\.[0-9]+)?";
+    }
 
   libext += "$";
   return libext;

+ 2 - 1
Source/cmComputeLinkInformation.h

@@ -134,7 +134,8 @@ private:
   bool OpenBSD;
   void AddLinkPrefix(const char* p);
   void AddLinkExtension(const char* e, LinkType type);
-  std::string CreateExtensionRegex(std::vector<std::string> const& exts);
+  std::string CreateExtensionRegex(std::vector<std::string> const& exts,
+                                   LinkType type);
   std::string NoCaseExpression(const char* str);
 
   // Handling of link items.

+ 1 - 1
Source/cmCoreTryCompile.cxx

@@ -111,7 +111,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
           ++i)
         {
         extraArgs++;
-        libsToLink += argv[i] + " ";
+        libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" ";
         cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str());
         if (!tgt)
           {

+ 1 - 1
Source/cmDocumentCompileDefinitions.h

@@ -23,7 +23,7 @@
   "in a (configured) header file.  Then report the limitation.  "       \
   "Known limitations include:\n"                                        \
   "  #          - broken almost everywhere\n"                           \
-  "  ;          - broken in VS IDE and Borland Makefiles\n"             \
+  "  ;          - broken in VS IDE 7.0 and Borland Makefiles\n"         \
   "  ,          - broken in VS IDE\n"                                   \
   "  %          - broken in some cases in NMake\n"                      \
   "  & |        - broken in some cases on MinGW\n"                      \

+ 11 - 1
Source/cmDocumentGeneratorExpressions.h

@@ -13,7 +13,7 @@
 #define cmDocumentGeneratorExpressions_h
 
 #define CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS                      \
-  "Generator expressions are evaluted during build system generation "  \
+  "Generator expressions are evaluated during build system generation " \
   "to produce information specific to each build configuration.  "      \
   "Valid expressions are:\n"                                            \
   "  $<0:...>                  = empty string (ignores \"...\")\n"      \
@@ -28,6 +28,8 @@
   "strings which contain a ',' for example.\n"                          \
   "  $<SEMICOLON>              = A literal ';'. Used to prevent "       \
   "list expansion on an argument with ';'.\n"                           \
+  "  $<JOIN:list,...>          = joins the list with the content of "   \
+  "\"...\"\n"                                                           \
   "  $<TARGET_NAME:...>        = Marks ... as being the name of a "     \
   "target.  This is required if exporting targets to multiple "         \
   "dependent export sets.  The '...' must be a literal name of a "      \
@@ -72,4 +74,12 @@
   "the target on which the generator expression is evaluated.\n"        \
   ""
 
+#define CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS                      \
+  "Language related expressions:\n"                                     \
+  "  $<LINK_LANGUAGE>          = The link language of the target "      \
+  "being generated.\n"                                                  \
+  "  $<LINK_LANGUAGE:lang>     = '1' if the link language of the "      \
+  "target being generated matches lang, else '0'.\n"                    \
+  ""
+
 #endif

+ 90 - 65
Source/cmDocumentVariables.cxx

@@ -10,7 +10,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
   cm->DefineProperty
     ("CMAKE_AR", cmProperty::VARIABLE,
      "Name of archiving tool for static libraries.",
-     "This specifies name of the program that creates archive "
+     "This specifies the name of the program that creates archive "
      "or static libraries.",false,
      "Variables that Provide Information");
 
@@ -129,9 +129,9 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      " needed to build the output of CMake.   If the "
      "generator selected was Visual Studio 6, the "
      "CMAKE_BUILD_TOOL will be set to msdev, for "
-     "Unix makefiles it will be set to make or gmake, "
+     "Unix Makefiles it will be set to make or gmake, "
      "and for Visual Studio 7 it set to devenv.  For "
-     "Nmake Makefiles the value is nmake. This can be "
+     "NMake Makefiles the value is nmake. This can be "
      "useful for adding special flags and commands based"
      " on the final build environment. ", false,
      "Variables that Provide Information");
@@ -152,7 +152,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
   cm->DefineProperty
     ("CMAKE_CACHE_MAJOR_VERSION", cmProperty::VARIABLE,
      "Major version of CMake used to create the CMakeCache.txt file",
-     "This is stores the major version of CMake used to "
+     "This stores the major version of CMake used to "
      "write a CMake cache file. It is only different when "
      "a different version of CMake is run on a previously "
      "created cache file.", false,
@@ -160,7 +160,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
   cm->DefineProperty
     ("CMAKE_CACHE_MINOR_VERSION", cmProperty::VARIABLE,
      "Minor version of CMake used to create the CMakeCache.txt file",
-     "This is stores the minor version of CMake used to "
+     "This stores the minor version of CMake used to "
      "write a CMake cache file. It is only different when "
      "a different version of CMake is run on a previously "
      "created cache file.", false,
@@ -169,7 +169,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
   cm->DefineProperty
     ("CMAKE_CACHE_PATCH_VERSION", cmProperty::VARIABLE,
      "Patch version of CMake used to create the CMakeCache.txt file",
-     "This is stores the patch version of CMake used to "
+     "This stores the patch version of CMake used to "
      "write a CMake cache file. It is only different when "
      "a different version of CMake is run on a previously "
      "created cache file.", false,
@@ -270,12 +270,13 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
   cm->DefineProperty
     ("CMAKE_LINK_LIBRARY_SUFFIX", cmProperty::VARIABLE,
      "The suffix for libraries that you link to.",
-     "The suffix to use for the end of a library, .lib on Windows.",false,
+     "The suffix to use for the end of a library filename, .lib on Windows."
+     ,false,
      "Variables that Provide Information");
   cm->DefineProperty
     ("CMAKE_EXECUTABLE_SUFFIX", cmProperty::VARIABLE,
      "The suffix for executables on this platform.",
-     "The suffix to use for the end of an executable if any, "
+     "The suffix to use for the end of an executable filename if any, "
      ".exe on Windows."
      "\n"
      "CMAKE_EXECUTABLE_SUFFIX_<LANG> overrides this for language <LANG>."
@@ -452,8 +453,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      ,false, "Variables that Provide Information");
   cm->DefineProperty
     ("CMAKE_IMPORT_LIBRARY_SUFFIX", cmProperty::VARIABLE,
-     "The suffix for import  libraries that you link to.",
-     "The suffix to use for the end of an import library if used "
+     "The suffix for import libraries that you link to.",
+     "The suffix to use for the end of an import library filename if used "
      "on this platform."
      "\n"
      "CMAKE_IMPORT_LIBRARY_SUFFIX_<LANG> overrides this for language <LANG>."
@@ -468,7 +469,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
   cm->DefineProperty
     ("CMAKE_SHARED_LIBRARY_SUFFIX", cmProperty::VARIABLE,
      "The suffix for shared libraries that you link to.",
-     "The suffix to use for the end of a shared library, .dll on Windows."
+     "The suffix to use for the end of a shared library filename, "
+     ".dll on Windows."
      "\n"
      "CMAKE_SHARED_LIBRARY_SUFFIX_<LANG> overrides this for language <LANG>."
      ,false, "Variables that Provide Information");
@@ -482,7 +484,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
   cm->DefineProperty
     ("CMAKE_SHARED_MODULE_SUFFIX", cmProperty::VARIABLE,
      "The suffix for shared libraries that you link to.",
-     "The suffix to use for the end of a loadable module on this platform"
+     "The suffix to use for the end of a loadable module filename "
+     "on this platform"
      "\n"
      "CMAKE_SHARED_MODULE_SUFFIX_<LANG> overrides this for language <LANG>."
      ,false, "Variables that Provide Information");
@@ -496,7 +499,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
   cm->DefineProperty
     ("CMAKE_STATIC_LIBRARY_SUFFIX", cmProperty::VARIABLE,
      "The suffix for static libraries that you link to.",
-     "The suffix to use for the end of a static library, .lib on Windows."
+     "The suffix to use for the end of a static library filename, "
+     ".lib on Windows."
      "\n"
      "CMAKE_STATIC_LIBRARY_SUFFIX_<LANG> overrides this for language <LANG>."
      ,false, "Variables that Provide Information");
@@ -577,26 +581,37 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
 
     cm->DefineProperty
     ("CMAKE_CONFIGURATION_TYPES",  cmProperty::VARIABLE,
-     "Specifies the available build types.",
-     "This specifies what build types will be available such as "
-     "Debug, Release, RelWithDebInfo etc. This has reasonable defaults "
-     "on most platforms. But can be extended to provide other "
-     "build types. See also CMAKE_BUILD_TYPE.",
-     false,
+     "Specifies the available build types on multi-config generators.",
+     "This specifies what build types (configurations) will be available "
+     "such as Debug, Release, RelWithDebInfo etc. "
+     "This has reasonable defaults on most platforms, "
+     "but can be extended to provide other build types. "
+     "See also CMAKE_BUILD_TYPE for details of managing configuration data, "
+     "and CMAKE_CFG_INTDIR."
+     ,false,
      "Variables That Change Behavior");
 
     cm->DefineProperty
     ("CMAKE_BUILD_TYPE",  cmProperty::VARIABLE,
-     "Specifies the build type for make based generators.",
-     "This specifies what build type will be built in this tree. "
-     " Possible values are empty, Debug, Release, RelWithDebInfo"
-     " and MinSizeRel. This variable is only supported for "
-     "make based generators. If this variable is supported, "
-     "then CMake will also provide initial values for the "
-     "variables with the name "
-     " CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL]."
-     " For example, if CMAKE_BUILD_TYPE is Debug, then "
-     "CMAKE_C_FLAGS_DEBUG will be added to the CMAKE_C_FLAGS.",false,
+     "Specifies the build type on single-configuration generators.",
+     "This statically specifies what build type (configuration) "
+     "will be built in this build tree. Possible values are "
+     "empty, Debug, Release, RelWithDebInfo and MinSizeRel. "
+     "This variable is only meaningful to single-configuration generators "
+     "(such as make and Ninja) i.e. "
+     "those which choose a single configuration "
+     "when CMake runs to generate a build tree as opposed to "
+     "multi-configuration generators which offer selection of the build "
+     "configuration within the generated build environment. "
+     "There are many per-config properties and variables "
+     "(usually following clean SOME_VAR_<CONFIG> order conventions), "
+     "such as CMAKE_C_FLAGS_<CONFIG>, specified as uppercase: "
+     "CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL]. "
+     "For example, in a build tree configured "
+     "to build type Debug, CMake will see to having "
+     "CMAKE_C_FLAGS_DEBUG settings get added to the CMAKE_C_FLAGS settings. "
+     "See also CMAKE_CONFIGURATION_TYPES."
+     ,false,
      "Variables That Change Behavior");
 
   cm->DefineProperty
@@ -616,7 +631,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
     ("CMAKE_INSTALL_PREFIX", cmProperty::VARIABLE,
      "Install directory used by install.",
      "If \"make install\" is invoked or INSTALL is built"
-     ", this directory is pre-pended onto all install "
+     ", this directory is prepended onto all install "
      "directories. This variable defaults to /usr/local"
      " on UNIX and c:/Program Files on Windows.\n"
      "On UNIX one can use the DESTDIR mechanism in order"
@@ -627,11 +642,11 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "It is usually invoked like this:\n"
      " make DESTDIR=/home/john install\n"
      "which will install the concerned software using the"
-     " installation prefix, e.g. \"/usr/local\" pre-pended with "
+     " installation prefix, e.g. \"/usr/local\" prepended with "
      "the DESTDIR value which finally gives \"/home/john/usr/local\".\n"
      "WARNING: DESTDIR may not be used on Windows because installation"
      " prefix usually contains a drive letter like in \"C:/Program Files\""
-     " which cannot be pre-pended with some other prefix."
+     " which cannot be prepended with some other prefix."
      ,false,
      "Variables That Change Behavior");
 
@@ -792,7 +807,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "This switch should be used during the initial CMake run. Otherwise if "
      "the package has already been found in a previous CMake run, the "
      "variables which have been stored in the cache will still be there. "
-     "In the case it is recommended to remove the cache variables for "
+     "In that case it is recommended to remove the cache variables for "
      "this package from the cache using the cache editor or cmake -U", false,
      "Variables That Change Behavior");
 
@@ -888,7 +903,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
       " an ABSOLUTE DESTINATION path.",
       "This variable is defined by CMake-generated cmake_install.cmake "
       "scripts."
-      " It can be used (read-only) by program or script that source those"
+      " It can be used (read-only) by programs or scripts that source those"
       " install scripts. This is used by some CPack generators (e.g. RPM).",
       false,
       "Variables That Change Behavior");
@@ -898,7 +913,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
       "Ask cmake_install.cmake script to warn each time a file with "
       "absolute INSTALL DESTINATION is encountered.",
       "This variable is used by CMake-generated cmake_install.cmake"
-      " scripts. If ones set this variable to ON while running the"
+      " scripts. If one sets this variable to ON while running the"
       " script, it may get warning messages from the script.", false,
       "Variables That Change Behavior");
 
@@ -909,7 +924,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
       "The fatal error is emitted before the installation of "
       "the offending file takes place."
       " This variable is used by CMake-generated cmake_install.cmake"
-      " scripts. If ones set this variable to ON while running the"
+      " scripts. If one sets this variable to ON while running the"
       " script, it may get fatal error messages from the script.",false,
       "Variables That Change Behavior");
 
@@ -940,7 +955,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "which CMake is targeting.   On systems that "
      "have the uname command, this variable is set "
      "to the output of uname -s.  Linux, Windows, "
-     " and Darwin for Mac OSX are the values found "
+     " and Darwin for Mac OS X are the values found "
      " on the big three operating systems."  ,false,
      "Variables That Describe the System");
   cm->DefineProperty
@@ -999,20 +1014,22 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
 
   cm->DefineProperty
     ("APPLE", cmProperty::VARIABLE,
-     "True if running on Mac OSX.",
-     "Set to true on Mac OSX.",false,
+     "True if running on Mac OS X.",
+     "Set to true on Mac OS X."
+     ,false,
      "Variables That Describe the System");
 
   cm->DefineProperty
     ("BORLAND", cmProperty::VARIABLE,
-     "True if the borland compiler is being used.",
+     "True if the Borland compiler is being used.",
      "This is set to true if the Borland compiler is being used.",false,
      "Variables That Describe the System");
 
   cm->DefineProperty
     ("CYGWIN", cmProperty::VARIABLE,
-     "True for cygwin.",
-     "Set to true when using CYGWIN.",false,
+     "True for Cygwin.",
+     "Set to true when using Cygwin."
+     ,false,
      "Variables That Describe the System");
 
   cm->DefineProperty
@@ -1110,8 +1127,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
 
   cm->DefineProperty
     ("CMAKE_HOST_APPLE", cmProperty::VARIABLE,
-     "True for Apple OSXoperating systems.",
-     "Set to true when the host system is Apple OSX.",
+     "True for Apple OS X operating systems.",
+     "Set to true when the host system is Apple OS X.",
      false,
      "Variables That Describe the System");
 
@@ -1125,7 +1142,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
   cm->DefineProperty
     ("CMAKE_HOST_WIN32", cmProperty::VARIABLE,
      "True on windows systems, including win64.",
-     "Set to true when the host system is Windows and on cygwin.",false,
+     "Set to true when the host system is Windows and on Cygwin."
+     ,false,
      "Variables That Describe the System");
 
   cm->DefineProperty
@@ -1198,7 +1216,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
 
   cm->DefineProperty
     ("CMAKE_INSTALL_NAME_DIR", cmProperty::VARIABLE,
-     "Mac OSX directory name for installed targets.",
+     "Mac OS X directory name for installed targets.",
      "CMAKE_INSTALL_NAME_DIR is used to initialize the "
      "INSTALL_NAME_DIR property on all targets. See that target "
      "property for more information.",
@@ -1252,7 +1270,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
 
   cm->DefineProperty
     ("CMAKE_PDB_OUTPUT_DIRECTORY", cmProperty::VARIABLE,
-     "Where to put all the MS debug symbol files.",
+     "Where to put all the MS debug symbol files from linker.",
      "This variable is used to initialize the "
      "PDB_OUTPUT_DIRECTORY property on all the targets. "
      "See that target property for additional information.",
@@ -1358,44 +1376,47 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
 
   cm->DefineProperty
     ("CMAKE_EXE_LINKER_FLAGS", cmProperty::VARIABLE,
-     "Linker flags used to create executables.",
-     "Flags used by the linker when creating an executable.",false,
+     "Linker flags to be used to create executables.",
+     "These flags will be used by the linker when creating an executable."
+     ,false,
      "Variables that Control the Build");
 
   cm->DefineProperty
-    ("CMAKE_EXE_LINKER_FLAGS_[CMAKE_BUILD_TYPE]", cmProperty::VARIABLE,
-     "Flag used when linking an executable.",
+    ("CMAKE_EXE_LINKER_FLAGS_<CONFIG>", cmProperty::VARIABLE,
+     "Flags to be used when linking an executable.",
      "Same as CMAKE_C_FLAGS_* but used by the linker "
      "when creating executables.",false,
      "Variables that Control the Build");
   cm->DefineProperty
     ("CMAKE_LIBRARY_PATH_FLAG", cmProperty::VARIABLE,
-     "The flag used to add a library search path to a compiler.",
-     "The flag used to specify a library directory to the compiler. "
+     "The flag to be used to add a library search path to a compiler.",
+     "The flag will be used to specify a library directory to the compiler. "
      "On most compilers this is \"-L\".",false,
      "Variables that Control the Build");
   cm->DefineProperty
     ("CMAKE_LINK_DEF_FILE_FLAG  ", cmProperty::VARIABLE,
-     "Linker flag used to specify a .def file for dll creation.",
-     "The flag used to add a .def file when creating "
-     "a dll on Windows, this is only defined on Windows.",false,
+     "Linker flag to be used to specify a .def file for dll creation.",
+     "The flag will be used to add a .def file when creating "
+     "a dll on Windows; this is only defined on Windows."
+     ,false,
      "Variables that Control the Build");
   cm->DefineProperty
     ("CMAKE_LINK_LIBRARY_FLAG", cmProperty::VARIABLE,
-     "Flag used to link a library into an executable.",
-     "The flag used to specify a library to link to an executable.  "
+     "Flag to be used to link a library into an executable.",
+     "The flag will be used to specify a library to link to an executable.  "
      "On most compilers this is \"-l\".",false,
      "Variables that Control the Build");
   cm->DefineProperty
     ("CMAKE_LINK_LIBRARY_FILE_FLAG", cmProperty::VARIABLE,
-     "Flag used to link a library specified by a path to its file.",
-     "The flag used before a library file path is given to the linker.  "
+     "Flag to be used to link a library specified by a path to its file.",
+     "The flag will be used before a library file path is given to the "
+     "linker.  "
      "This is needed only on very few platforms.", false,
      "Variables that Control the Build");
   cm->DefineProperty
     ("CMAKE_USE_RELATIVE_PATHS", cmProperty::VARIABLE,
      "Use relative paths (May not work!).",
-     "If this is set to TRUE, then the CMake will use "
+     "If this is set to TRUE, then CMake will use "
      "relative paths between the source and binary tree. "
      "This option does not work for more complicated "
      "projects, and relative paths are used when possible.  "
@@ -1591,7 +1612,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
     ("CMAKE_<LANG>_COMPILE_OBJECT", cmProperty::VARIABLE,
      "Rule variable to compile a single object file.",
      "This is a rule variable that tells CMake how to "
-     "compile a single object file for for the language <LANG>.",false,
+     "compile a single object file for the language <LANG>."
+     ,false,
      "Variables for Languages");
 
   cm->DefineProperty
@@ -1727,8 +1749,9 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
 
   cm->DefineProperty
     ("CMAKE_<LANG>_LINK_EXECUTABLE ", cmProperty::VARIABLE,
-     "Rule variable to link and executable.",
-     "Rule variable to link and executable for the given language.",false,
+     "Rule variable to link an executable.",
+     "Rule variable to link an executable for the given language."
+     ,false,
      "Variables for Languages");
 
   cm->DefineProperty
@@ -1742,7 +1765,9 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
     ("CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS", cmProperty::VARIABLE,
      "Extensions of source files for the given language.",
      "This is the list of extensions for a "
-     "given languages source files.",false,"Variables for Languages");
+     "given language's source files."
+     ,false,
+     "Variables for Languages");
 
   cm->DefineProperty(
     "CMAKE_<LANG>_COMPILER_LOADED", cmProperty::VARIABLE,

+ 2 - 2
Source/cmDocumentation.cxx

@@ -53,7 +53,7 @@ static const char *cmModulesDocumentationDescription[][3] =
   "This is the documentation for the modules and scripts coming with CMake. "
   "Using these modules you can check the computer system for "
   "installed software packages, features of the compiler and the "
-  "existance of headers to name just a few.", 0},
+  "existence of headers to name just a few.", 0},
   {0,0,0}
 };
 
@@ -67,7 +67,7 @@ static const char *cmCustomModulesDocumentationDescription[][3] =
   "This is the documentation for additional modules and scripts for CMake. "
   "Using these modules you can check the computer system for "
   "installed software packages, features of the compiler and the "
-  "existance of headers to name just a few.", 0},
+  "existence of headers to name just a few.", 0},
   {0,0,0}
 };
 

+ 2 - 2
Source/cmExportBuildFileGenerator.cxx

@@ -30,7 +30,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
         tei = this->Exports->begin();
       tei != this->Exports->end(); ++tei)
     {
-    expectedTargets += sep + this->Namespace + (*tei)->GetName();
+    expectedTargets += sep + this->Namespace + (*tei)->GetExportName();
     sep = " ";
     cmTarget* te = *tei;
     if(this->ExportedTargets.insert(te).second)
@@ -189,7 +189,7 @@ cmExportBuildFileGenerator::HandleMissingTarget(
   // Assume the target will be exported by another command.
   // Append it with the export namespace.
   link_libs += this->Namespace;
-  link_libs += dependee->GetName();
+  link_libs += dependee->GetExportName();
 }
 
 //----------------------------------------------------------------------------

+ 1 - 1
Source/cmExportCommand.cxx

@@ -210,7 +210,7 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args)
     else
       {
       cmOStringStream e;
-      e << "PACKAGE given unknown argumsnt: " << args[i];
+      e << "PACKAGE given unknown argument: " << args[i];
       this->SetError(e.str().c_str());
       return false;
       }

+ 7 - 5
Source/cmExportFileGenerator.cxx

@@ -376,7 +376,7 @@ void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget *target,
   if (!properties.empty())
     {
     std::string targetName = this->Namespace;
-    targetName += target->GetName();
+    targetName += target->GetExportName();
     os << "set_target_properties(" << targetName << " PROPERTIES\n";
     for(ImportPropertyMap::const_iterator pi = properties.begin();
         pi != properties.end(); ++pi)
@@ -407,7 +407,7 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
     }
   if(this->ExportedTargets.find(tgt) != this->ExportedTargets.end())
     {
-    input = this->Namespace + input;
+    input = this->Namespace + tgt->GetExportName();
     }
   else
     {
@@ -772,7 +772,8 @@ cmExportFileGenerator
 {
   // Construct the imported target name.
   std::string targetName = this->Namespace;
-  targetName += target->GetName();
+
+  targetName += target->GetExportName();
 
   // Create the imported target.
   os << "# Create imported target " << targetName << "\n";
@@ -835,7 +836,8 @@ cmExportFileGenerator
 {
   // Construct the imported target name.
   std::string targetName = this->Namespace;
-  targetName += target->GetName();
+
+  targetName += target->GetExportName();
 
   // Set the import properties.
   os << "# Import target \"" << targetName << "\" for configuration \""
@@ -954,7 +956,7 @@ cmExportFileGenerator
 {
   // Construct the imported target name.
   std::string targetName = this->Namespace;
-  targetName += target->GetName();
+  targetName += target->GetExportName();
 
   os << "list(APPEND _IMPORT_CHECK_TARGETS " << targetName << " )\n"
         "list(APPEND _IMPORT_CHECK_FILES_FOR_" << targetName << " ";

+ 4 - 3
Source/cmExportInstallFileGenerator.cxx

@@ -47,7 +47,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
         tei = this->IEGen->GetExportSet()->GetTargetExports()->begin();
       tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
     {
-    expectedTargets += sep + this->Namespace + (*tei)->Target->GetName();
+    expectedTargets += sep + this->Namespace + (*tei)->Target->GetExportName();
     sep = " ";
     cmTargetExport const* te = *tei;
     if(this->ExportedTargets.insert(te->Target).second)
@@ -395,13 +395,14 @@ cmExportInstallFileGenerator::HandleMissingTarget(
   std::string& link_libs, std::vector<std::string>& missingTargets,
   cmMakefile* mf, cmTarget* depender, cmTarget* dependee)
 {
-  std::string name = dependee->GetName();
+  const std::string name = dependee->GetName();
   std::vector<std::string> namespaces = this->FindNamespaces(mf, name);
   int targetOccurrences = (int)namespaces.size();
   if (targetOccurrences == 1)
     {
     std::string missingTarget = namespaces[0];
-    missingTarget += name;
+
+    missingTarget += dependee->GetExportName();
     link_libs += missingTarget;
     missingTargets.push_back(missingTarget);
     }

+ 16 - 2
Source/cmExtraEclipseCDT4Generator.cxx

@@ -39,6 +39,7 @@ cmExtraEclipseCDT4Generator
 
   this->SupportsVirtualFolders = true;
   this->GenerateLinkedResources = true;
+  this->SupportsGmakeErrorParser = true;
 }
 
 //----------------------------------------------------------------------------
@@ -50,7 +51,7 @@ void cmExtraEclipseCDT4Generator
   entry.Full =
     "Project files for Eclipse will be created in the top directory. "
     "In out of source builds, a linked resource to the top level source "
-    "directory will be created."
+    "directory will be created. "
     "Additionally a hierarchy of makefiles is generated into the "
     "build tree. The appropriate make program can build the project through "
     "the default make target. A \"make install\" target is also provided.";
@@ -77,6 +78,10 @@ void cmExtraEclipseCDT4Generator::Generate()
         {
         this->SupportsVirtualFolders = false;
         }
+      if (version < 3007) // 3.7 is Indigo
+        {
+        this->SupportsGmakeErrorParser = false;
+        }
       }
     }
 
@@ -403,8 +408,17 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
     {
     fout << "org.eclipse.cdt.core.ICCErrorParser;";
     }
+
+  if (this->SupportsGmakeErrorParser)
+    {
+    fout << "org.eclipse.cdt.core.GmakeErrorParser;";
+    }
+  else
+    {
+    fout << "org.eclipse.cdt.core.MakeErrorParser;";
+    }
+
   fout <<
-    "org.eclipse.cdt.core.MakeErrorParser;"
     "org.eclipse.cdt.core.GCCErrorParser;"
     "org.eclipse.cdt.core.GASErrorParser;"
     "org.eclipse.cdt.core.GLDErrorParser;"

+ 1 - 0
Source/cmExtraEclipseCDT4Generator.h

@@ -111,6 +111,7 @@ private:
   bool GenerateSourceProject;
   bool GenerateLinkedResources;
   bool SupportsVirtualFolders;
+  bool SupportsGmakeErrorParser;
 
 };
 

+ 1 - 1
Source/cmExtraSublimeTextGenerator.cxx

@@ -457,7 +457,7 @@ cmExtraSublimeTextGenerator::ComputeFlagsForObject(cmSourceFile* source,
     }
 
   // Add source file specific flags.
-  lg->AppendFlags(flags, target->GetProperty("COMPILE_FLAGS"));
+  lg->AppendFlags(flags, source->GetProperty("COMPILE_FLAGS"));
 
   // TODO: Handle Apple frameworks.
 

+ 80 - 2
Source/cmFileCommand.cxx

@@ -167,6 +167,10 @@ bool cmFileCommand
     {
     return this->HandleTimestampCommand(args);
     }
+  else if ( subCommand == "GENERATE" )
+    {
+    return this->HandleGenerateCommand(args);
+    }
 
   std::string e = "does not recognize sub-command "+subCommand;
   this->SetError(e.c_str());
@@ -1970,7 +1974,7 @@ bool cmFileInstaller
   else
     {
     cmOStringStream e;
-    e << "Option TYPE given uknown value \"" << stype << "\".";
+    e << "Option TYPE given unknown value \"" << stype << "\".";
     this->FileCommand->SetError(e.str().c_str());
     return false;
     }
@@ -1985,7 +1989,7 @@ bool cmFileInstaller::HandleInstallDestination()
   // allow for / to be a valid destination
   if ( destination.size() < 2 && destination != "/" )
     {
-    this->FileCommand->SetError("called with inapropriate arguments. "
+    this->FileCommand->SetError("called with inappropriate arguments. "
         "No DESTINATION provided or .");
     return false;
     }
@@ -3249,6 +3253,80 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
 #endif
 }
 
+//----------------------------------------------------------------------------
+void cmFileCommand::AddEvaluationFile(const std::string &inputName,
+                                      const std::string &outputExpr,
+                                      const std::string &condition,
+                                      bool inputIsContent
+                                     )
+{
+  cmListFileBacktrace lfbt;
+  this->Makefile->GetBacktrace(lfbt);
+
+  cmGeneratorExpression outputGe(lfbt);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> outputCge
+                                                = outputGe.Parse(outputExpr);
+
+  cmGeneratorExpression conditionGe(lfbt);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> conditionCge
+                                              = conditionGe.Parse(condition);
+
+  this->Makefile->GetLocalGenerator()
+                ->GetGlobalGenerator()->AddEvaluationFile(inputName,
+                                                          outputCge,
+                                                          this->Makefile,
+                                                          conditionCge,
+                                                          inputIsContent);
+}
+
+//----------------------------------------------------------------------------
+bool cmFileCommand::HandleGenerateCommand(
+  std::vector<std::string> const& args)
+{
+  if (args.size() < 5)
+    {
+    this->SetError("Incorrect arguments to GENERATE subcommand.");
+    return false;
+    }
+  if (args[1] != "OUTPUT")
+    {
+    this->SetError("Incorrect arguments to GENERATE subcommand.");
+    return false;
+    }
+  std::string condition;
+  if (args.size() > 5)
+    {
+    if (args[5] != "CONDITION")
+      {
+      this->SetError("Incorrect arguments to GENERATE subcommand.");
+      return false;
+      }
+    if (args.size() != 7)
+      {
+      this->SetError("Incorrect arguments to GENERATE subcommand.");
+      return false;
+      }
+    condition = args[6];
+    if (condition.empty())
+      {
+      this->SetError("CONDITION of sub-command GENERATE must not be empty if "
+        "specified.");
+      return false;
+      }
+    }
+  std::string output = args[2];
+  const bool inputIsContent = args[3] != "INPUT";
+  if (inputIsContent && args[3] != "CONTENT")
+    {
+    this->SetError("Incorrect arguments to GENERATE subcommand.");
+    return false;
+    }
+  std::string input = args[4];
+
+  this->AddEvaluationFile(input, output, condition, inputIsContent);
+  return true;
+}
+
 //----------------------------------------------------------------------------
 bool cmFileCommand::HandleTimestampCommand(
   std::vector<std::string> const& args)

+ 19 - 0
Source/cmFileCommand.h

@@ -88,6 +88,9 @@ public:
       "  file(UPLOAD filename url [INACTIVITY_TIMEOUT timeout]\n"
       "       [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS])\n"
       "  file(TIMESTAMP filename variable [<format string>] [UTC])\n"
+      "  file(GENERATE OUTPUT output_file\n"
+      "       <INPUT input_file|CONTENT input_content>\n"
+      "       CONDITION expression)\n"
       "WRITE will write a message into a file called 'filename'. It "
       "overwrites the file if it already exists, and creates the file "
       "if it does not exist. (If the file is a build input, use "
@@ -231,6 +234,15 @@ public:
       "it prints status messages, and NO_SOURCE_PERMISSIONS is default.  "
       "Installation scripts generated by the install() command use this "
       "signature (with some undocumented options for internal use)."
+      "\n"
+      "GENERATE will write an <output_file> with content from an "
+      "<input_file>, or from <input_content>.  The output is generated "
+      "conditionally based on the content of the <condition>.  The file is "
+      "written at CMake generate-time and the input may contain generator "
+      "expressions.  The <condition>, <output_file> and <input_file> may "
+      "also contain generator expressions.  The <condition> must evaluate to "
+      "either '0' or '1'.  The <output_file> must evaluate to a unique name "
+      "among all configurations and among all invocations of file(GENERATE)."
       // Undocumented INSTALL options:
       //  - RENAME <name>
       //  - OPTIONAL
@@ -269,6 +281,13 @@ protected:
   bool HandleUploadCommand(std::vector<std::string> const& args);
 
   bool HandleTimestampCommand(std::vector<std::string> const& args);
+  bool HandleGenerateCommand(std::vector<std::string> const& args);
+
+private:
+  void AddEvaluationFile(const std::string &inputName,
+                         const std::string &outputExpr,
+                         const std::string &condition,
+                         bool inputIsContent);
 };
 
 

+ 1 - 1
Source/cmFunctionCommand.cxx

@@ -267,7 +267,7 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf)
     std::vector<std::string> expandedArguments;
     mf.ExpandArguments(lff.Arguments, expandedArguments);
     // if the endfunction has arguments then make sure
-    // they match the ones in the openeing function command
+    // they match the ones in the opening function command
     if ((expandedArguments.empty() ||
          (expandedArguments[0] == this->Args[0])))
       {

+ 151 - 0
Source/cmGeneratorExpressionEvaluationFile.cxx

@@ -0,0 +1,151 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2013 Stephen Kelly <[email protected]>
+
+  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 "cmGeneratorExpressionEvaluationFile.h"
+
+#include "cmMakefile.h"
+
+#include <assert.h>
+
+//----------------------------------------------------------------------------
+cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
+        const std::string &input,
+        cmsys::auto_ptr<cmCompiledGeneratorExpression> outputFileExpr,
+        cmMakefile *makefile,
+        cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
+        bool inputIsContent)
+  : Input(input),
+    OutputFileExpr(outputFileExpr),
+    Makefile(makefile),
+    Condition(condition),
+    InputIsContent(inputIsContent)
+{
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorExpressionEvaluationFile::Generate(const char *config,
+              cmCompiledGeneratorExpression* inputExpression,
+              std::map<std::string, std::string> &outputFiles)
+{
+  std::string rawCondition = this->Condition->GetInput();
+  if (!rawCondition.empty())
+    {
+    std::string condResult = this->Condition->Evaluate(this->Makefile, config);
+    if (condResult == "0")
+      {
+      return;
+      }
+    if (condResult != "1")
+      {
+      cmOStringStream e;
+      e << "Evaluation file condition \"" << rawCondition << "\" did "
+          "not evaluate to valid content. Got \"" << condResult << "\".";
+      this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+      return;
+      }
+    }
+
+  const std::string outputFileName
+                    = this->OutputFileExpr->Evaluate(this->Makefile, config);
+  const std::string outputContent
+                          = inputExpression->Evaluate(this->Makefile, config);
+
+  std::map<std::string, std::string>::iterator it
+                                          = outputFiles.find(outputFileName);
+
+  if(it != outputFiles.end())
+    {
+    if (it->second == outputContent)
+      {
+      return;
+      }
+    cmOStringStream e;
+    e << "Evaluation file to be written multiple times for different "
+         "configurations with different content:\n  " << outputFileName;
+    this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+    return;
+    }
+
+  this->Files.push_back(outputFileName);
+  outputFiles[outputFileName] = outputContent;
+
+  std::ofstream fout(outputFileName.c_str());
+
+  if(!fout)
+    {
+    cmOStringStream e;
+    e << "Evaluation file \"" << outputFileName << "\" cannot be written.";
+    this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+    return;
+    }
+
+  fout << outputContent;
+
+  fout.close();
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorExpressionEvaluationFile::Generate()
+{
+  std::string inputContent;
+  if (this->InputIsContent)
+    {
+    inputContent = this->Input;
+    }
+  else
+    {
+    std::ifstream fin(this->Input.c_str());
+    if(!fin)
+      {
+      cmOStringStream e;
+      e << "Evaluation file \"" << this->Input << "\" cannot be read.";
+      this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+      return;
+      }
+
+    std::string line;
+    std::string sep;
+    while(cmSystemTools::GetLineFromStream(fin, line))
+      {
+      inputContent += sep + line;
+      sep = "\n";
+      }
+    inputContent += sep;
+    }
+
+  cmListFileBacktrace lfbt = this->OutputFileExpr->GetBacktrace();
+  cmGeneratorExpression contentGE(lfbt);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> inputExpression
+                                              = contentGE.Parse(inputContent);
+
+  std::map<std::string, std::string> outputFiles;
+
+  std::vector<std::string> allConfigs;
+  this->Makefile->GetConfigurations(allConfigs);
+
+  if (allConfigs.empty())
+    {
+    this->Generate(0, inputExpression.get(), outputFiles);
+    }
+  else
+    {
+    for(std::vector<std::string>::const_iterator li = allConfigs.begin();
+        li != allConfigs.end(); ++li)
+      {
+      this->Generate(li->c_str(), inputExpression.get(), outputFiles);
+      if(cmSystemTools::GetFatalErrorOccured())
+        {
+        return;
+        }
+      }
+    }
+}

+ 48 - 0
Source/cmGeneratorExpressionEvaluationFile.h

@@ -0,0 +1,48 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2013 Stephen Kelly <[email protected]>
+
+  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 cmGeneratorExpressionEvaluationFile_h
+#define cmGeneratorExpressionEvaluationFile_h
+
+#include "cmStandardIncludes.h"
+#include <cmsys/auto_ptr.hxx>
+
+#include "cmGeneratorExpression.h"
+
+//----------------------------------------------------------------------------
+class cmGeneratorExpressionEvaluationFile
+{
+public:
+  cmGeneratorExpressionEvaluationFile(const std::string &input,
+        cmsys::auto_ptr<cmCompiledGeneratorExpression> outputFileExpr,
+        cmMakefile *makefile,
+        cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
+        bool inputIsContent);
+
+  void Generate();
+
+  std::vector<std::string> GetFiles() const { return this->Files; }
+
+private:
+  void Generate(const char *config,
+              cmCompiledGeneratorExpression* inputExpression,
+              std::map<std::string, std::string> &outputFiles);
+
+private:
+  const std::string Input;
+  const cmsys::auto_ptr<cmCompiledGeneratorExpression> OutputFileExpr;
+  cmMakefile *Makefile;
+  const cmsys::auto_ptr<cmCompiledGeneratorExpression> Condition;
+  std::vector<std::string> Files;
+  const bool InputIsContent;
+};
+
+#endif

+ 250 - 92
Source/cmGeneratorExpressionEvaluator.cxx

@@ -45,13 +45,18 @@ void reportError(cmGeneratorExpressionContext *context,
 //----------------------------------------------------------------------------
 struct cmGeneratorExpressionNode
 {
+  enum {
+    DynamicParameters = 0,
+    OneOrMoreParameters = -1,
+    ZeroOrMoreParameters = -2
+  };
   virtual ~cmGeneratorExpressionNode() {}
 
   virtual bool GeneratesContent() const { return true; }
 
   virtual bool RequiresLiteralInput() const { return false; }
 
-  virtual bool AcceptsSingleArbitraryContentParameter() const
+  virtual bool AcceptsArbitraryContentParameter() const
     { return false; }
 
   virtual int NumExpectedParameters() const { return 1; }
@@ -70,7 +75,7 @@ static const struct ZeroNode : public cmGeneratorExpressionNode
 
   virtual bool GeneratesContent() const { return false; }
 
-  virtual bool AcceptsSingleArbitraryContentParameter() const { return true; }
+  virtual bool AcceptsArbitraryContentParameter() const { return true; }
 
   std::string Evaluate(const std::vector<std::string> &,
                        cmGeneratorExpressionContext *,
@@ -87,7 +92,7 @@ static const struct OneNode : public cmGeneratorExpressionNode
 {
   OneNode() {}
 
-  virtual bool AcceptsSingleArbitraryContentParameter() const { return true; }
+  virtual bool AcceptsArbitraryContentParameter() const { return true; }
 
   std::string Evaluate(const std::vector<std::string> &,
                        cmGeneratorExpressionContext *,
@@ -110,8 +115,7 @@ static const struct ZeroNode installInterfaceNode;
 static const struct OP ## Node : public cmGeneratorExpressionNode \
 { \
   OP ## Node () {} \
-/* We let -1 carry the meaning 'at least one' */ \
-  virtual int NumExpectedParameters() const { return -1; } \
+  virtual int NumExpectedParameters() const { return OneOrMoreParameters; } \
  \
   std::string Evaluate(const std::vector<std::string> &parameters, \
                        cmGeneratorExpressionContext *context, \
@@ -306,6 +310,88 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
   }
 } configurationTestNode;
 
+//----------------------------------------------------------------------------
+static const struct LinkLanguageNode : public cmGeneratorExpressionNode
+{
+  LinkLanguageNode() {}
+
+  virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; }
+
+  std::string Evaluate(const std::vector<std::string> &parameters,
+                       cmGeneratorExpressionContext *context,
+                       const GeneratorExpressionContent *content,
+                       cmGeneratorExpressionDAGChecker *) const
+  {
+    if (parameters.size() != 0 && parameters.size() != 1)
+      {
+      reportError(context, content->GetOriginalExpression(),
+          "$<LINK_LANGUAGE> expression requires one or two parameters");
+      return std::string();
+      }
+    cmTarget* target = context->HeadTarget;
+    if (!target)
+      {
+      reportError(context, content->GetOriginalExpression(),
+          "$<LINK_LANGUAGE> may only be used with targets.  It may not "
+          "be used with add_custom_command.");
+      }
+
+    const char *lang = target->GetLinkerLanguage(context->Config);
+    if (parameters.size() == 0)
+      {
+      return lang ? lang : "";
+      }
+    else
+      {
+      cmsys::RegularExpression langValidator;
+      langValidator.compile("^[A-Za-z0-9_]*$");
+      if (!langValidator.find(parameters.begin()->c_str()))
+        {
+        reportError(context, content->GetOriginalExpression(),
+                    "Expression syntax not recognized.");
+        return std::string();
+        }
+      if (!lang)
+        {
+        return parameters.front().empty() ? "1" : "0";
+        }
+
+      if (strcmp(parameters.begin()->c_str(), lang) == 0)
+        {
+        return "1";
+        }
+      return "0";
+      }
+  }
+} linkLanguageNode;
+
+static const struct JoinNode : public cmGeneratorExpressionNode
+{
+  JoinNode() {}
+
+  virtual int NumExpectedParameters() const { return 2; }
+
+  virtual bool AcceptsArbitraryContentParameter() const { return true; }
+
+  std::string Evaluate(const std::vector<std::string> &parameters,
+                       cmGeneratorExpressionContext *,
+                       const GeneratorExpressionContent *,
+                       cmGeneratorExpressionDAGChecker *) const
+  {
+    std::string result;
+
+    std::vector<std::string> list;
+    cmSystemTools::ExpandListArgument(parameters.front(), list);
+    std::string sep;
+    for(std::vector<std::string>::const_iterator li = list.begin();
+      li != list.end(); ++li)
+      {
+      result += sep + *li;
+      sep = parameters[1];
+      }
+    return result;
+  }
+} joinNode;
 
 //----------------------------------------------------------------------------
 static const char* targetPropertyTransitiveWhitelist[] = {
@@ -313,13 +399,66 @@ static const char* targetPropertyTransitiveWhitelist[] = {
   , "INTERFACE_COMPILE_DEFINITIONS"
 };
 
+std::string getLinkedTargetsContent(const std::vector<std::string> &libraries,
+                                  cmTarget *target,
+                                  cmGeneratorExpressionContext *context,
+                                  cmGeneratorExpressionDAGChecker *dagChecker,
+                                  const std::string &interfacePropertyName)
+{
+  cmGeneratorExpression ge(context->Backtrace);
+
+  std::string sep;
+  std::string depString;
+  for (std::vector<std::string>::const_iterator
+      it = libraries.begin();
+      it != libraries.end(); ++it)
+    {
+    if (*it == target->GetName())
+      {
+      // Broken code can have a target in its own link interface.
+      // Don't follow such link interface entries so as not to create a
+      // self-referencing loop.
+      continue;
+      }
+    if (context->Makefile->FindTargetToUse(it->c_str()))
+      {
+      depString +=
+        sep + "$<TARGET_PROPERTY:" + *it + "," + interfacePropertyName + ">";
+      sep = ";";
+      }
+    }
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(depString);
+  std::string linkedTargetsContent = cge->Evaluate(context->Makefile,
+                      context->Config,
+                      context->Quiet,
+                      context->HeadTarget,
+                      target,
+                      dagChecker);
+  if (cge->GetHadContextSensitiveCondition())
+    {
+    context->HadContextSensitiveCondition = true;
+    }
+  return linkedTargetsContent;
+}
+
+//----------------------------------------------------------------------------
+struct TransitiveWhitelistCompare
+{
+  explicit TransitiveWhitelistCompare(const std::string &needle)
+    : Needle(needle) {}
+  bool operator() (const char *item)
+  { return strcmp(item, this->Needle.c_str()) == 0; }
+private:
+  std::string Needle;
+};
+
 //----------------------------------------------------------------------------
 static const struct TargetPropertyNode : public cmGeneratorExpressionNode
 {
   TargetPropertyNode() {}
 
   // This node handles errors on parameter count itself.
-  virtual int NumExpectedParameters() const { return -1; }
+  virtual int NumExpectedParameters() const { return OneOrMoreParameters; }
 
   std::string Evaluate(const std::vector<std::string> &parameters,
                        cmGeneratorExpressionContext *context,
@@ -485,49 +624,36 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
       interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
       }
 
-    if (interfacePropertyName == "INTERFACE_INCLUDE_DIRECTORIES"
-        || interfacePropertyName == "INTERFACE_COMPILE_DEFINITIONS")
+    const char **transBegin = targetPropertyTransitiveWhitelist;
+    const char **transEnd = targetPropertyTransitiveWhitelist
+              + (sizeof(targetPropertyTransitiveWhitelist) /
+              sizeof(*targetPropertyTransitiveWhitelist));
+    if (std::find_if(transBegin, transEnd,
+              TransitiveWhitelistCompare(propertyName)) != transEnd)
       {
       const cmTarget::LinkInterface *iface = target->GetLinkInterface(
                                                     context->Config,
                                                     context->HeadTarget);
       if(iface)
         {
-        cmGeneratorExpression ge(context->Backtrace);
-
-        std::string sep;
-        std::string depString;
-        for (std::vector<std::string>::const_iterator
-            it = iface->Libraries.begin();
-            it != iface->Libraries.end(); ++it)
-          {
-          if (*it == target->GetName())
-            {
-            // Broken code can have a target in its own link interface.
-            // Don't follow such link interface entries so as not to create a
-            // self-referencing loop.
-            continue;
-            }
-          if (context->Makefile->FindTargetToUse(it->c_str()))
-            {
-            depString +=
-              sep + "$<TARGET_PROPERTY:" + *it + ","
-                                         + interfacePropertyName + ">";
-            sep = ";";
-            }
-          }
-        cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
-                                                      ge.Parse(depString);
-        linkedTargetsContent = cge->Evaluate(context->Makefile,
-                            context->Config,
-                            context->Quiet,
-                            context->HeadTarget,
-                            target,
-                            &dagChecker);
-        if (cge->GetHadContextSensitiveCondition())
-          {
-          context->HadContextSensitiveCondition = true;
-          }
+        linkedTargetsContent =
+                  getLinkedTargetsContent(iface->Libraries, target,
+                                          context, &dagChecker,
+                                          interfacePropertyName);
+        }
+      }
+    else if (std::find_if(transBegin, transEnd,
+              TransitiveWhitelistCompare(interfacePropertyName)) != transEnd)
+      {
+      const cmTarget::LinkImplementation *impl = target->GetLinkImplementation(
+                                                    context->Config,
+                                                    context->HeadTarget);
+      if(impl)
+        {
+        linkedTargetsContent =
+                  getLinkedTargetsContent(impl->Libraries, target,
+                                          context, &dagChecker,
+                                          interfacePropertyName);
         }
       }
 
@@ -600,7 +726,7 @@ static const struct TargetNameNode : public cmGeneratorExpressionNode
 
   virtual bool GeneratesContent() const { return true; }
 
-  virtual bool AcceptsSingleArbitraryContentParameter() const { return true; }
+  virtual bool AcceptsArbitraryContentParameter() const { return true; }
   virtual bool RequiresLiteralInput() const { return true; }
 
   std::string Evaluate(const std::vector<std::string> &parameters,
@@ -933,6 +1059,8 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
     return &configurationNode;
   else if (identifier == "CONFIG")
     return &configurationTestNode;
+  else if (identifier == "LINK_LANGUAGE")
+    return &linkLanguageNode;
   else if (identifier == "TARGET_FILE")
     return &targetFileNode;
   else if (identifier == "TARGET_LINKER_FILE")
@@ -973,6 +1101,8 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
     return &installInterfaceNode;
   else if (identifier == "INSTALL_PREFIX")
     return &installPrefixNode;
+  else if (identifier == "JOIN")
+    return &joinNode;
   return 0;
 
 }
@@ -992,6 +1122,57 @@ std::string GeneratorExpressionContent::GetOriginalExpression() const
   return std::string(this->StartContent, this->ContentLength);
 }
 
+//----------------------------------------------------------------------------
+std::string GeneratorExpressionContent::ProcessArbitraryContent(
+    const cmGeneratorExpressionNode *node,
+    const std::string &identifier,
+    cmGeneratorExpressionContext *context,
+    cmGeneratorExpressionDAGChecker *dagChecker,
+    std::vector<std::vector<cmGeneratorExpressionEvaluator*> >::const_iterator
+    pit) const
+{
+  std::string result;
+
+  const
+  std::vector<std::vector<cmGeneratorExpressionEvaluator*> >::const_iterator
+                                      pend = this->ParamChildren.end();
+  for ( ; pit != pend; ++pit)
+    {
+    std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it
+                                                            = pit->begin();
+    const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end
+                                                              = pit->end();
+    for ( ; it != end; ++it)
+      {
+      if (node->RequiresLiteralInput())
+        {
+        if ((*it)->GetType() != cmGeneratorExpressionEvaluator::Text)
+          {
+          reportError(context, this->GetOriginalExpression(),
+                "$<" + identifier + "> expression requires literal input.");
+          return std::string();
+          }
+        }
+      result += (*it)->Evaluate(context, dagChecker);
+      if (context->HadError)
+        {
+        return std::string();
+        }
+      }
+      if ((pit + 1) != pend)
+        {
+        result += ",";
+        }
+    }
+  if (node->RequiresLiteralInput())
+    {
+    std::vector<std::string> parameters;
+    parameters.push_back(result);
+    return node->Evaluate(parameters, context, this, dagChecker);
+    }
+  return result;
+}
+
 //----------------------------------------------------------------------------
 std::string GeneratorExpressionContent::Evaluate(
                             cmGeneratorExpressionContext *context,
@@ -1024,7 +1205,8 @@ std::string GeneratorExpressionContent::Evaluate(
 
   if (!node->GeneratesContent())
     {
-    if (node->AcceptsSingleArbitraryContentParameter())
+    if (node->NumExpectedParameters() == 1
+        && node->AcceptsArbitraryContentParameter())
       {
       if (this->ParamChildren.empty())
         {
@@ -1041,50 +1223,12 @@ std::string GeneratorExpressionContent::Evaluate(
     return std::string();
     }
 
-  if (node->AcceptsSingleArbitraryContentParameter())
+  if (node->NumExpectedParameters() == 1
+        && node->AcceptsArbitraryContentParameter())
     {
-    std::string result;
-    std::vector<std::vector<cmGeneratorExpressionEvaluator*> >::const_iterator
-                                        pit = this->ParamChildren.begin();
-    const
-    std::vector<std::vector<cmGeneratorExpressionEvaluator*> >::const_iterator
-                                        pend = this->ParamChildren.end();
-    for ( ; pit != pend; ++pit)
-      {
-      if (!result.empty())
-        {
-        result += ",";
-        }
-
-      std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it
-                                                              = pit->begin();
-      const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end
-                                                                = pit->end();
-      for ( ; it != end; ++it)
-        {
-        if (node->RequiresLiteralInput())
-          {
-          if ((*it)->GetType() != cmGeneratorExpressionEvaluator::Text)
-            {
-            reportError(context, this->GetOriginalExpression(),
-                  "$<" + identifier + "> expression requires literal input.");
-            return std::string();
-            }
-          }
-        result += (*it)->Evaluate(context, dagChecker);
-        if (context->HadError)
-          {
-          return std::string();
-          }
-        }
-      }
-    if (node->RequiresLiteralInput())
-      {
-      std::vector<std::string> parameters;
-      parameters.push_back(result);
-      return node->Evaluate(parameters, context, this, dagChecker);
-      }
-    return result;
+    return this->ProcessArbitraryContent(node, identifier, context,
+                                         dagChecker,
+                                         this->ParamChildren.begin());
     }
 
   std::vector<std::string> parameters;
@@ -1105,12 +1249,15 @@ std::string GeneratorExpressionContent::EvaluateParameters(
                                 cmGeneratorExpressionDAGChecker *dagChecker,
                                 std::vector<std::string> &parameters) const
 {
+  const int numExpected = node->NumExpectedParameters();
   {
   std::vector<std::vector<cmGeneratorExpressionEvaluator*> >::const_iterator
                                         pit = this->ParamChildren.begin();
   const
   std::vector<std::vector<cmGeneratorExpressionEvaluator*> >::const_iterator
                                         pend = this->ParamChildren.end();
+  const bool acceptsArbitraryContent
+                                  = node->AcceptsArbitraryContentParameter();
   for ( ; pit != pend; ++pit)
     {
     std::string parameter;
@@ -1127,11 +1274,22 @@ std::string GeneratorExpressionContent::EvaluateParameters(
         }
       }
     parameters.push_back(parameter);
+    if (acceptsArbitraryContent
+        && parameters.size() == (unsigned int)numExpected - 1)
+      {
+      assert(pit != pend);
+      std::string lastParam = this->ProcessArbitraryContent(node, identifier,
+                                                            context,
+                                                            dagChecker,
+                                                            pit + 1);
+      parameters.push_back(lastParam);
+      return std::string();
+      }
     }
   }
 
-  int numExpected = node->NumExpectedParameters();
-  if ((numExpected != -1 && (unsigned int)numExpected != parameters.size()))
+  if ((numExpected > cmGeneratorExpressionNode::DynamicParameters
+      && (unsigned int)numExpected != parameters.size()))
     {
     if (numExpected == 0)
       {
@@ -1156,7 +1314,8 @@ std::string GeneratorExpressionContent::EvaluateParameters(
     return std::string();
     }
 
-  if (numExpected == -1 && parameters.empty())
+  if (numExpected == cmGeneratorExpressionNode::OneOrMoreParameters
+      && parameters.empty())
     {
     reportError(context, this->GetOriginalExpression(), "$<" + identifier
                       + "> expression requires at least one parameter.");
@@ -1183,7 +1342,6 @@ GeneratorExpressionContent::~GeneratorExpressionContent()
   deleteAll(this->IdentifierChildren);
 
   typedef std::vector<cmGeneratorExpressionEvaluator*> EvaluatorVector;
-  typedef std::vector<cmGeneratorExpressionToken> TokenVector;
   std::vector<EvaluatorVector>::const_iterator pit =
                                                   this->ParamChildren.begin();
   const std::vector<EvaluatorVector>::const_iterator pend =

+ 8 - 0
Source/cmGeneratorExpressionEvaluator.h

@@ -129,6 +129,14 @@ private:
                                  cmGeneratorExpressionDAGChecker *dagChecker,
                                  std::vector<std::string> &parameters) const;
 
+  std::string ProcessArbitraryContent(
+    const cmGeneratorExpressionNode *node,
+    const std::string &identifier,
+    cmGeneratorExpressionContext *context,
+    cmGeneratorExpressionDAGChecker *dagChecker,
+    std::vector<std::vector<cmGeneratorExpressionEvaluator*> >::const_iterator
+    pit) const;
+
 private:
   std::vector<cmGeneratorExpressionEvaluator*> IdentifierChildren;
   std::vector<std::vector<cmGeneratorExpressionEvaluator*> > ParamChildren;

+ 12 - 0
Source/cmGeneratorTarget.cxx

@@ -98,6 +98,18 @@ void cmGeneratorTarget::ClassifySources()
       this->IDLSources.push_back(sf);
       if(isObjLib) { badObjLib.push_back(sf); }
       }
+    else if(ext == "resx")
+      {
+      // Build and save the name of the corresponding .h file
+      // This relationship will be used later when building the project files.
+      // Both names would have been auto generated from Visual Studio
+      // where the user supplied the file name and Visual Studio
+      // appended the suffix.
+      std::string resx = sf->GetFullPath();
+      std::string hFileName = resx.substr(0, resx.find_last_of(".")) + ".h";
+      this->ExpectedResxHeaders.insert(hFileName);
+      this->ResxSources.push_back(sf);
+      }
     else if(header.find(sf->GetFullPath().c_str()))
       {
       this->HeaderSources.push_back(sf);

+ 4 - 0
Source/cmGeneratorTarget.h

@@ -44,11 +44,15 @@ public:
   std::vector<cmSourceFile*> ObjectSources;
   std::vector<cmSourceFile*> ExternalObjects;
   std::vector<cmSourceFile*> IDLSources;
+  std::vector<cmSourceFile*> ResxSources;
+
   std::string ModuleDefinitionFile;
 
   std::map<cmSourceFile const*, std::string> Objects;
   std::set<cmSourceFile const*> ExplicitObjectName;
 
+  std::set<std::string> ExpectedResxHeaders;
+
   /** Full path with trailing slash to the top-level directory
       holding object files for this target.  Includes the build
       time config name placeholder if needed for the generator.  */

+ 1 - 1
Source/cmGetFilenameComponentCommand.cxx

@@ -58,7 +58,7 @@ bool cmGetFilenameComponentCommand
     }
   std::string storeArgs;
   std::string programArgs;
-  if (args[2] == "PATH")
+  if (args[2] == "DIRECTORY" || args[2] == "PATH")
     {
     result = cmSystemTools::GetFilenamePath(filename);
     }

Some files were not shown because too many files changed in this diff